I did the test you suggested. Having the lib in both tomcats common/lib and the war web-inf/lib, gave the following result from the servlet.
url = jar:file:/C:/java/servers/apache-tomcat-6.0.20/shared/lib/eclipselink1.1.2.jar!/org/eclipse/persistence/transaction/JTATransactionController.class url = jar:file:/C:/java/servers/apache-tomcat-6.0.20/webapps/CondicaoPagamentoViewController-war/WEB-INF/lib/eclipselink1.1.2.jar!/org/eclipse/persistence/transaction/JTATransactionController.class I also did the other test, to see if it works having the library only in the web-inf/lib classpath. I got the following error: Caused by: java.lang.NoClassDefFoundError: org/eclipse/persistence/transaction/JTATransactionController So I guess in order for the EJBS to "see" these objects, eclipselink jar should be in the tomcat common/lib folder. Thanks for your help, and If I can assist you in any way please let me know. Thanks again David. Regards, John David Blevins wrote: > > > On Aug 17, 2009, at 1:16 PM, John Augusto Charnet wrote: > >> >> Ok, my mistake. I had eclipselink jar in two classpath locations. >> One was the >> war's web-inf\lib and the other was tomcats common lib. >> After removing from web-inf\lib, it worked in versions 1.0.1, 1.1.1, >> 1.1.2 >> >> Sorry for the newbie mistake ... > > No problem at all. I wonder if we can do something clever and check > for NoClassDefFoundError and take the liberty to do a big of > diagnostics. > > If you have a bit of time you can spare, recreate the problem with the > libs and add this to a servlet init: > > ClassLoader loader = this.getClass().getClassLoader(); > Enumeration<URL> urlsEnum = loader.getResources("org/eclipse/ > persistence/transaction/JTATransactionController.class"); > for (URL url : Collections.list(urlsEnum)) { > System.out.println("url = " + url.toExternalForm()); > } > > If you see two URLs, then we can definitely cook up an error message > that suggests the person remove one of the libraries as a possible > solution. > > Also, I'm curious if you had any success with removing the duplicate > libraries from Tomcat's common lib and leaving it only in web-inf/ > lib. If it only works the one way, that's definitely something we can > document. > > -David > > >> >> David Blevins wrote: >>> >>> >>> On Aug 17, 2009, at 11:51 AM, John Augusto Charnet wrote: >>> >>>> >>>> The manifest.mf file from the eclipselink jar has the following: >>>> Manifest-Version: 1.0 >>>> Ant-Version: Apache Ant 1.7.0 >>>> Created-By: 2.4 (IBM Corporation) >>>> Specification-Title: Eclipse Persistence Services >>>> Specification-Vendor: Eclipse.org - EclipseLink >>>> Specification-Version: 1.1.1 >>>> Implementation-Title: org.eclipse.persistence >>>> Implementation-Vendor: Eclipse.org - EclipseLink >>>> Implementation-Version: 1.1.1.v20090430-r4097 >>>> Release-Designation: EclipseLink Daily Build >>>> Premain-Class: >>>> org.eclipse.persistence.internal.jpa.deployment.JavaSEC >>>> MPInitializerAgent >>>> >>>> I've tried with version 1.0.1, and I did not get this error. I think >>>> they >>>> did change something in their API. >>>> Do have plans to support this new version ? >>> >>> I tried version 1.1.2.v20090612-r4475 in our jpa-eclipselink example >>> and all worked fine there. So it seems our subclass of the >>> EclipseLink JTATransactionController still works. Or it works in >>> 1.0.1 and 1.1.2, it may be broken in 1.1.1 for some reason. >>> >>> Give 1.1.2 a try on your end and I'll give 1.1.1 a try on my end. >>> >>> >>> -David >>> >>> >>>> >>>> Thanks again. >>>> >>>> Sincerely, >>>> John >>>> >>>> >>>> David Blevins wrote: >>>>> >>>>> If you can let me know the exact EclipseLink version you are using, >>>>> I'll give it a try. They may have updated their >>>>> JTATransactionController API in some way that is incompatible with >>>>> previous versions. >>>>> >>>>> -David >>>>> >>>>> On Aug 17, 2009, at 7:24 AM, John Augusto Charnet wrote: >>>>> >>>>>> >>>>>> Hi David. >>>>>> Thanks for the response. >>>>>> I was able to pack my app as a war, and deploy to tomcat with >>>>>> openEJB. My >>>>>> application uses eclipselink as the persistence provider. And now >>>>>> I'm having >>>>>> trouble with openEJB JTATransactionController. Here is the >>>>>> exception: >>>>>> >>>>>> Internal Exception: java.lang.NoSuchMethodException: >>>>>> org >>>>>> .apache >>>>>> .openejb >>>>>> .eclipselink >>>>>> .JTATransactionController >>>>>> .<init>(org.eclipse.persistence.sessions.DatabaseSession) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .openejb >>>>>> .assembler.classic.Assembler.createApplication(Assembler.java:658) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .openejb >>>>>> .assembler.classic.Assembler.createApplication(Assembler.java:442) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .openejb >>>>>> .tomcat >>>>>> .catalina.TomcatWebAppBuilder.start(TomcatWebAppBuilder.java: >>>>>> 249) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .openejb >>>>>> .tomcat >>>>>> .catalina >>>>>> .GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java: >>>>>> 58) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina >>>>>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java: >>>>>> 119) >>>>>> at >>>>>> org >>>>>> .apache.catalina.core.StandardContext.start(StandardContext.java: >>>>>> 4339) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina.core.ContainerBase.addChildInternal(ContainerBase.java: >>>>>> 791) >>>>>> at >>>>>> org >>>>>> .apache.catalina.core.ContainerBase.addChild(ContainerBase.java: >>>>>> 771) >>>>>> at >>>>>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java: >>>>>> 526) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina.startup.HostConfig.deployDirectory(HostConfig.java: >>>>>> 987) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina.startup.HostConfig.deployDirectories(HostConfig.java: >>>>>> 909) >>>>>> at >>>>>> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java: >>>>>> 495) >>>>>> at org.apache.catalina.startup.HostConfig.start(HostConfig.java: >>>>>> 1206) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina.startup.HostConfig.lifecycleEvent(HostConfig.java: >>>>>> 314) >>>>>> at >>>>>> org >>>>>> .apache >>>>>> .catalina >>>>>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java: >>>>>> 119) >>>>>> at >>>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java: >>>>>> 1053) >>>>>> at org.apache.catalina.core.StandardHost.start(StandardHost.java: >>>>>> 722) >>>>>> at >>>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java: >>>>>> 1045) >>>>>> at >>>>>> org.apache.catalina.core.StandardEngine.start(StandardEngine.java: >>>>>> 443) >>>>>> at >>>>>> org >>>>>> .apache.catalina.core.StandardService.start(StandardService.java: >>>>>> 516) >>>>>> at >>>>>> org.apache.catalina.core.StandardServer.start(StandardServer.java: >>>>>> 710) >>>>>> at org.apache.catalina.startup.Catalina.start(Catalina.java:583) >>>>>> 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.catalina.startup.Bootstrap.start(Bootstrap.java: >>>>>> 288) >>>>>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) >>>>>> >>>>>> >>>>>> I'm using Eclipselink 1.1.1 and my persistence.xml looks like >>>>>> this: >>>>>> <?xml version="1.0" encoding="windows-1252" ?> >>>>>> <persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence >>>>>> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" >>>>>> version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"> >>>>>> <persistence-unit name="NvsPU"> >>>>>> <provider>org.eclipse.persistence.jpa.PersistenceProvider</ >>>>>> provider> >>>>>> <jta-data-source>java:/jdbc/SfwBaseDS</jta-data-source> >>>>>> >>>>>> <non-jta-data-source>java:/jdbc/SfwBaseDSUnmanaged</non-jta-data- >>>>>> source> >>>>>> <properties> >>>>>> <property name="eclipselink.target-database" >>>>>> value="org.eclipse.persistence.platform.database.HSQLPlatform"/> >>>>>> <property name="eclipselink.ddl-generation" value="create- >>>>>> tables"/> >>>>>> <property name="eclipselink.ddl-generation.output-mode" >>>>>> value="sql-script"/> >>>>>> </properties> >>>>>> </persistence-unit> >>>>>> </persistence> >>>>>> >>>>>> Any ideas what's going wrong ? >>>>>> >>>>>> Thanks again. >>>>>> >>>>>> John >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> David Blevins wrote: >>>>>>> >>>>>>> Hi John, >>>>>>> >>>>>>> This definitely seems like a bug. Looks like the code that scans >>>>>>> the >>>>>>> webapp for ejbs in relation to the Collapsed EAR support is being >>>>>>> too >>>>>>> strict with the WEB-INF/lib directory. Going to have to take a >>>>>>> closer >>>>>>> look on a proper fix. >>>>>>> >>>>>>> On a note in general, if your ear is a single-webapp ear then you >>>>>>> could easily restructure it to be a Collapsed EAR. Basically you >>>>>>> take >>>>>>> all the libraries from the ear and place them into your WEB-INF/ >>>>>>> lib >>>>>>> directory and just deploy it as a war. The EJB 3.1 "ejbs in .war >>>>>>> files" support part of Java EE 6 is based on this concept, so >>>>>>> other >>>>>>> vendors will be supporting it at some point -- i.e. it will be >>>>>>> portable in the future. >>>>>>> >>>>>>> Will look into that bug regardless, but definitely let me know if >>>>>>> you >>>>>>> take another approach so we can prioritize accordingly; have a >>>>>>> few >>>>>>> red- >>>>>>> hot ones on the fire at the moment. >>>>>>> >>>>>>> -David >>>>>>> >>>>>>> On Aug 11, 2009, at 9:45 AM, John Augusto Charnet wrote: >>>>>>> >>>>>>>> >>>>>>>> Hello. >>>>>>>> I'm new to OpenEJB. I'm trying to deploy an EAR, that works on >>>>>>>> glassfish, >>>>>>>> jboss, weblogic, to a Tomcat environment with OpenEJB configured >>>>>>>> in >>>>>>>> tomcat. >>>>>>>> I know OpenEJB is working, because I've tested some oonline >>>>>>>> examples. >>>>>>>> >>>>>>>> When I start my tomcat, I keep getting the following error: >>>>>>>> -------------------- >>>>>>>> 2009-08-11 11:10:57,906 - ERROR - Unable to load EAR: >>>>>>>> C:\java\servers\apache-tomcat-6.0.20\webapps\NvsDeployEAR.ear >>>>>>>> org.apache.openejb.OpenEJBException: Unable to determine the >>>>>>>> module >>>>>>>> type of >>>>>>>> CondicaoPagamentoViewController.war/WEB-INF/lib/trinidad- >>>>>>>> api-1.2.11.jar: >>>>>>>> Exception: Unknown module type: >>>>>>>> url=file:/C:/java/servers/apache-tomcat-6.0.20/webapps/ >>>>>>>> NvsDeployEAR.ear/CondicaoPagamentoViewController.war/WEB-INF/ >>>>>>>> lib/ >>>>>>>> trinidad-api-1.2.11.jar: >>>>>>>> Unknown module type: >>>>>>>> url=file:/C:/java/servers/apache-tomcat-6.0.20/webapps/ >>>>>>>> NvsDeployEAR.ear/CondicaoPagamentoViewController.war/WEB-INF/ >>>>>>>> lib/ >>>>>>>> trinidad-api-1.2.11.jar >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb >>>>>>>> .config.DeploymentLoader.createAppModule(DeploymentLoader.java: >>>>>>>> 268) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb.config.DeploymentLoader.load(DeploymentLoader.java: >>>>>>>> 130) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb >>>>>>>> .tomcat >>>>>>>> .catalina >>>>>>>> .TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java: >>>>>>>> 467) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb >>>>>>>> .tomcat >>>>>>>> .catalina >>>>>>>> .GlobalListenerSupport >>>>>>>> .lifecycleEvent(GlobalListenerSupport.java: >>>>>>>> 74) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .catalina >>>>>>>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java: >>>>>>>> 119) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .catalina >>>>>>>> .core.ContainerBase.backgroundProcess(ContainerBase.java: >>>>>>>> 1337) >>>>>>>> at >>>>>>>> org.apache.catalina.core.ContainerBase >>>>>>>> $ >>>>>>>> ContainerBackgroundProcessor.processChildren(ContainerBase.java: >>>>>>>> 1601) >>>>>>>> at >>>>>>>> org.apache.catalina.core.ContainerBase >>>>>>>> $ >>>>>>>> ContainerBackgroundProcessor.processChildren(ContainerBase.java: >>>>>>>> 1610) >>>>>>>> at >>>>>>>> org.apache.catalina.core.ContainerBase >>>>>>>> $ContainerBackgroundProcessor.run(ContainerBase.java:1590) >>>>>>>> at java.lang.Thread.run(Thread.java:619) >>>>>>>> Caused by: org.apache.openejb.config.UnknownModuleTypeException: >>>>>>>> Unknown >>>>>>>> module type: >>>>>>>> url=file:/C:/java/servers/apache-tomcat-6.0.20/webapps/ >>>>>>>> NvsDeployEAR.ear/CondicaoPagamentoViewController.war/WEB-INF/ >>>>>>>> lib/ >>>>>>>> trinidad-api-1.2.11.jar >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb >>>>>>>> .config >>>>>>>> .DeploymentLoader.discoverModuleType(DeploymentLoader.java: >>>>>>>> 1176) >>>>>>>> at >>>>>>>> org >>>>>>>> .apache >>>>>>>> .openejb >>>>>>>> .config.DeploymentLoader.createAppModule(DeploymentLoader.java: >>>>>>>> 255) >>>>>>>> ... 9 more >>>>>>>> -------------------- >>>>>>>> >>>>>>>> any idea why this is happening ? >>>>>>>> Really appreciate some help!. >>>>>>>> >>>>>>>> Thanks a lot. >>>>>>>> >>>>>>>> Sincerely, >>>>>>>> >>>>>>>> John >>>>>>>> -- >>>>>>>> View this message in context: >>>>>>>> http://www.nabble.com/rg.apache.openejb.OpenEJBException%3A-Unable-to-determine-the-module-type-of-tp24921373p24921373.html >>>>>>>> Sent from the OpenEJB User mailing list archive at Nabble.com. >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> http://www.nabble.com/rg.apache.openejb.OpenEJBException%3A-Unable-to-determine-the-module-type-of-tp24921373p25007682.html >>>>>> Sent from the OpenEJB User mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/rg.apache.openejb.OpenEJBException%3A-Unable-to-determine-the-module-type-of-tp24921373p25012165.html >>>> Sent from the OpenEJB User mailing list archive at Nabble.com. >>>> >>>> >>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/rg.apache.openejb.OpenEJBException%3A-Unable-to-determine-the-module-type-of-tp24921373p25013439.html >> Sent from the OpenEJB User mailing list archive at Nabble.com. >> >> > > > -- View this message in context: http://www.nabble.com/rg.apache.openejb.OpenEJBException%3A-Unable-to-determine-the-module-type-of-tp24921373p25044743.html Sent from the OpenEJB User mailing list archive at Nabble.com.