In our EJB 3.0 application, we have a random event java.lang.NoClassDefFoundError.
It just happens locally in the IDE.
Setup:
OS: Windows 7 32 Bit Java JDK: 1.6.0_24 (32 Bit)β IDE: IntelliJ 11.1β App-Server: JBoss 5.1.0 EAP EAR-Building with βmaven-ear-plugin"β WAR-Building with Maven β<packaging>war</packaging>"β EJB-Building with Maven β<packaging>ejb</packaging>" und βmaven-ejb-βplugin"β
EAR is as follows:
xxx.ear β |___ META-INF β | |___ application.xml (Information about EAR, EJB und WEB-Modul βconfigured)β β |β β |___ xxxEJB.jarβ β | |β β | |___ META-INF β | | |___ persistance.xml (JPA 1.0 configuration)β β | | |___ jboss.xml (JBoss-Config)β β | | |___ ejb-jar.xml (EJB 3.0 definition)β β | |β β | |___ country/yyy/xxx/.. (our own compiled classes) β | |___ report/.. (JasperReport-Tamplates) β | |___ quickfix/.. (QuickFixJ-configuration) β | |___ all dependent libraries for our EJB 3.0 project, (74-jar-files) β | β β |___ xxxWAR.warβ β |β β |___ META-INF β |___ WEB-INF β |β β |___ libβ β | |___ all dependent libraries for the Servlet-βproject, (2-jar-files) β |___ classesβ β | |___ country/yyy/xxx/.. (our own compiled classes) β |___ web.xml (Servlet-configuration)β
Stacktrace is as follows:
The JVM starts with the option: -verbose: class to see all the actions for loading classes.
--- SNIP JBoss-Log ---β β[Loaded country.yyy.xxx.service.issue.util.IssueUtil from file:/C:/Workarea/Projects/xxx-βtrunk/xxx/target/classes/]β β[Loaded org.joda.time.DateTimeZone from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.Chronology from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.chrono.BaseChronology from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.DateTimeZone$1 from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.tz.NameProvider from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.JodaTimePermission from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.tz.Provider from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.tz.FixedDateTimeZone from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β β[Loaded org.joda.time.tz.ZoneInfoProvider from jar:file:/C:/Workarea/Projects/xxx-trunk/xxx-βear/target/xxx.ear!/xxxEJB.jar]β ERROR - javax.ejb.EJBTransactionRolledbackException: Unexpected Error java.lang.NoClassDefFoundError: org/joda/time/tz/DefaultNameProvider at org.joda.time.DateTimeZone.getDefaultNameProvider(DateTimeZone.java:545)β at org.joda.time.DateTimeZone.setNameProvider0(DateTimeZone.java:515)β at org.joda.time.DateTimeZone.<clinit>(DateTimeZone.java:116)β at βcountry.yyy.xxx.service.issue.util.InitialFixingDateTimeUtil.getHedgingTimestampsForIssue(InitialFixingDateTimeUtil.java:83)β at βcountry.yyy.xxx.service.issue.util.InitialFixingDateTimeUtil.getFirstHedgingTimestampForIssue(InitialFixingDateTimeUtil.java:43)β at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)β at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)β at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)β at java.lang.reflect.Method.invoke(Unknown Source)β β--- SNAP JBoss-Log ---β
The file "org / joda / time / tz / DefaultNameProvider" is definitely located in the jar file: file: file: / C: / Workarea / Projects / xxx-trunk / xxx- ear / target / xxx.ear! /XxxEJB.jar
Suggestions:
We have a feeling that Quartz has something to do with it. Therefore, when something was planned, from EJB 3.0 Remote-Stateless-Service. Sometimes an error occurs.
Quartz-Scheduler is initially created in the context of the Servlet-Context, but basically it works fine.
Has anyone had the same problem?
JBoss deployment is done through the IntelliJ JBoss plugin:
Maybe the problem is related to the deployment mechanism used? we are deploying an application with the IntelliJ JBoss plugin, so JBoss says:
09:39:21,614 INFO [MainDeployer] deploy, url=file:/C:/Workarea/Projects/xxx-trunk/xxx-ear/target/xxx.ear 09:39:33,613 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@2726974 {vfszip:/C:/Workarea/Projects/xxx-trunk/xxx-ear/target/xxx.ear/xxxEJB.jar/}