hi
do you care packaging your app (mvn project on github?)?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/5/23 pierrepinon <[email protected]>

> Hi everybody,
>
> I'm experiencing a problem when I add a webModule in addition of a Rest
> webModule (Apache CXF - JAX-RS) in my ear on Tomee Plus 1.5.2 (Tested on
> SNAPSHOT 1.5.3 and 1.6.0)
>
> Goal :
> - Have Rest webModule plus an other webModule in my ear
>
> Description :
>
> I have ear which contains an ejb, a simple rest service and a web
> application
>
> Problem :
>
> When my ear has two webModules with at least one is a REST WS, Tomee throws
> errors and the WS is not working. See the output below :
>
> -------------------------
> GRAVE: error invoking
> org.apache.openejb.observer.ObserverManager$Observer@1cacd5d4
> java.lang.reflect.InvocationTargetException
>         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:597)
>         at
>
> org.apache.openejb.observer.ObserverManager$Observer.invoke(ObserverManager.java:145)
>         at
>
> org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:69)
>         at
> org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:107)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1486)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:110)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.openejb.server.rest.OpenEJBRestRuntimeException:
> can't
> find context
>         at
>
> org.apache.openejb.server.rest.EJBRestServiceInfo.<init>(EJBRestServiceInfo.java:27)
>         at
>
> org.apache.openejb.server.rest.RESTService.getRestEjbs(RESTService.java:390)
>         at
>
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:105)
>         at
>
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)
>         ... 20 more
> -------------------------
>
> I have created simple project to reproduce problem. (src :
> https://github.com/xesnet/test/tree/master/bugtomee)
> In this example, I have two webModule which contains Rest WS but the
> problem
> is the same when I have webModule of Rest WS + standard webModule
>
> Example Project structure :
>
> +--- pom.xml
> |
> +--- ear
> |    +--- pom.xml
> |
> +--- ejb
> |    +--- pom.xml
> |    +--- src/main/java/fr/xesnet/test/projectTest/EjbTest.java
> |
> +--- rest
> |    +--- pom.xml
> |    +--- src/main
> |         +--- java/fr/xesnet/test/projectTest/Rest/TestRest.java
> |         +--- webapp/WEB-INF/web.xml
> |
> +--- rest2
>      +--- pom.xml
>      +--- src/main
>           +--- java/fr/xesnet/test/projectTest/Rest2/TestRest2.java
>           +--- webapp/WEB-INF/web.xml
>
> * EjbTest.java :
> -------------------------
> [...]
> @Stateless
> public class EjbTest {
>
>   public String getTest() {
>     return "SUCCESS";
>   }
> }
> -------------------------
>
> * TestRest.java :
> -------------------------
> [...]
> @Path("/test")
> @Stateless
> public class TestRest {
>         @EJB
>         private EjbTest ejbTest;
>
>         @GET
>         @Produces(MediaType.TEXT_PLAIN)
>         @Path("/version")
>         public String version() {
>                 return ejbTest.getTest();
>         }
> }
> -------------------------
>
> * TestRest2.java :
> -------------------------
> [...]
> @Path("/test2")
> @Stateless
> public class TestRest2 {
>         @EJB
>         private EjbTest ejbTest;
>
>         @GET
>         @Produces(MediaType.TEXT_PLAIN)
>         @Path("/version2")
>         public String version() {
>                 return ejbTest.getTest();
>         }
> }
> -------------------------
>
> * web.xml (Rest) :
> -------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns="http://java.sun.com/xml/ns/javaee";
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
> id="WebApp_ID" version="3.0">
> <display-name>rest</display-name>
> </web-app>
> -------------------------
>
> * web.xml (Rest2) :
> -------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns="http://java.sun.com/xml/ns/javaee";
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
> id="WebApp_ID" version="3.0">
> <display-name>rest2</display-name>
> </web-app>
> -------------------------
>
> When I deploy, I have theses errors on catalina.out :
>
> -------------------------
> GRAVE: Error merging Java EE JNDI entries in to war /projectTest-rest:
> Exception: Error building bean 'TestRest2'.  Exception: class
> org.apache.openejb.OpenEJBException: Error while loading bean class
> fr.xesnet.test.projectTest.Rest2.TestRest2 for bean TestRest2. Received
> message: Cannot locate the class fr.xesnet.test.projectTest.Rest2.TestRest2
> from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest2-1.0-SNAPSHOT]:
> Error while loading bean class fr.xesnet.test.projectTest.Rest2.TestRest2
> for bean TestRest2. Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest2.TestRest2 from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest2-1.0-SNAPSHOT]
> org.apache.openejb.OpenEJBException: Error building bean 'TestRest2'.
> Exception: class org.apache.openejb.OpenEJBException: Error while loading
> bean class fr.xesnet.test.projectTest.Rest2.TestRest2 for bean TestRest2.
> Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest2.TestRest2 from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest2-1.0-SNAPSHOT]:
> Error while loading bean class fr.xesnet.test.projectTest.Rest2.TestRest2
> for bean TestRest2. Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest2.TestRest2 from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest2-1.0-SNAPSHOT]
>         at
>
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:80)
>         at
> org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:857)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1241)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1033)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.openejb.OpenEJBException: Error while loading bean
> class fr.xesnet.test.projectTest.Rest2.TestRest2 for bean TestRest2.
> Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest2.TestRest2 from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest2-1.0-SNAPSHOT]
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:426)
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:403)
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:79)
>         at
>
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:65)
>         ... 15 more
> -------------------------
>
> and
>
> -------------------------
> GRAVE: Error merging Java EE JNDI entries in to war /projectTest-rest2:
> Exception: Error building bean 'TestRest'.  Exception: class
> org.apache.openejb.OpenEJBException: Error while loading bean class
> fr.xesnet.test.projectTest.Rest.TestRest for bean TestRest. Received
> message: Cannot locate the class fr.xesnet.test.projectTest.Rest.TestRest
> from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest-1.0-SNAPSHOT]:
> Error while loading bean class fr.xesnet.test.projectTest.Rest.TestRest for
> bean TestRest. Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest.TestRest from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest-1.0-SNAPSHOT]
> org.apache.openejb.OpenEJBException: Error building bean 'TestRest'.
> Exception: class org.apache.openejb.OpenEJBException: Error while loading
> bean class fr.xesnet.test.projectTest.Rest.TestRest for bean TestRest.
> Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest.TestRest from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest-1.0-SNAPSHOT]:
> Error while loading bean class fr.xesnet.test.projectTest.Rest.TestRest for
> bean TestRest. Received message: Cannot locate the class
> fr.xesnet.test.projectTest.Rest.TestRest from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest-1.0-SNAPSHOT]
>         at
>
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:80)
>         at
> org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:857)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1241)
>         at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1033)
>         at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124)
>         at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>         at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>         at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.openejb.OpenEJBException: Error while loading bean
> class fr.xesnet.test.projectTest.Rest.TestRest for bean TestRest. Received
> message: Cannot locate the class fr.xesnet.test.projectTest.Rest.TestRest
> from the codebase
>
> [/home/pp/Desktop/apache-tomee-plus-1.5.2/apps/projectTest-ear-1.0-SNAPSHOT/projectTest-rest-1.0-SNAPSHOT]
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:426)
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:403)
>         at
>
> org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:79)
>         at
>
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:65)
>         ... 15 more
> -------------------------
>
> Any suggestion ?
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Error-merging-Java-EE-JNDI-entries-in-to-war-tp4663181.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to