Oá,
estou usando :
jboss-4.2.2.GA
jre1.5.0_16
e na hora que vai inicializar a aplicação web pois estou testando uma aplicação ejb e gerei
ear contendo war do web e jar do ejb…pelo log a parte ejb foi sem erro mas war deu esse erro ???
--web.xml
<display-name>TestApplicationWeb</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>TestServlet</display-name>
<servlet-name>TestServlet</servlet-name>
<servlet-class>lesson.servlets.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
</web-app>
----servlet
public class TestServlet extends HttpServlet implements javax.servlet.Servlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public TestServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
InitialContext ctx = new InitialContext();
HelloWorld hello = (HelloWorld) ctx.lookup("TestApplication/HelloWorldBean/remote");
System.out.println(hello.getMessage());
} catch (NamingException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doPost(request, response);
}
}
----Descriptor
<display-name>
TestApplication</display-name>
<module>
<web>
<web-uri>TestApplicationWeb.war</web-uri>
<context-root>TestApplicationWeb</context-root>
</web>
</module>
<module>
<ejb>TestApplicationEJB.jar</ejb>
</module>
</application>
----ejb
@Stateless
@Remote(HelloWorld.class)
public class HelloWorldBean implements HelloWorld {
public String getMessage() {
// TODO Auto-generated method stub
return "Olá,,,Paulo";
}
}
-----
public interface HelloWorld {
public String getMessage();
}
2009-03-10 11:17:28,441 INFO [org.apache.catalina.loader.WebappClassLoader] validateJarFile(C:\Arquivos de programas\jboss-4.2.2.GA\server\default\.\tmp\deploy\tmp46237TestApplication.ear-contents\TestApplicationWeb-exp.war\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2009-03-10 11:17:30,065 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TestApplicationWeb]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.IncompatibleClassChangeError
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:774)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.sun.faces.config.WebConfiguration.processJndiEntries(WebConfiguration.java:441)
at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:86)
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:139)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:228)
at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)