You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "kurt.sys" <ku...@gmail.com> on 2012/11/24 16:45:53 UTC

tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Hey all,

I'm trying to get persistence to work in tomee, but I just seem to fail.
When I try to compile a very simple project (I'm using netbeans), I get the
following stacktrace:


Some lines from build-impl.xml:



I just don't seem to understand where the error comes from, since I'm pretty
sure there is a javax.persistence.spi.PersistenceUnitInfo class in
javaee-api-6.0.4-tomcat.jar, javax.persistence-2.0.3.jar and
ejb3-persistence.jar. So at first, I thought I had to many times the same
class (interface), so I removed javax.persistence and ejb3-persistence from
$TOMCAT/lib. Same result... I removed the hibernate-related jars as well,
since I don't expect to use hibernate and I wanted to remove possible
interference or something, and if I will use them, I always can add them.

Some project files (the ones I think that are important, the error doesn't
seem wicket-related, so I don't mind these classes, but it's just a very
basic test application I used to get cdi to work - which luckily did work
out after some time. The webapp is really nothing fancy, I'm not even using
the persistence class):

web.xml



context.xml

(I'm using cdi inside wicket framework, hence the resource)

persistence.xml


item.java


I tried to add eclipselink jars to my project lib and to /opt/tomcat/lib as
well. Both give the same compile error. Not adding the eclipslink jars
doesn't help either... I added them to the tomcat/tomee lib-directory:


beans.xml (needed this one for cdi)



Jars in /opt/tomcat/lib.


System setup:



Any help pointing me in the right direction? (On forums, it's pointed out
that the same class may be present in different jars in case of
NoClassDefFoundError, and/or that I should add the eclipslink jars in the
lib-directory of tomcat/tomee. I seem the have another issue, since it is at
compile-time and there is a ClassNotFoundException).

Thx, Kurt



--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
okay, well, my app is working well with eclipselink JAR in tomee/lib and
eclipselink specified as jpa provider in persistence.xml. :)


On Sun, Feb 24, 2013 at 10:52 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> tomee only brings openjpa but custom jpa providers can be in the webapp.
>
> the only constraint is to not bring back another time jpa api jar.
>
> *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/2/24 Howard W. Smith, Jr. <sm...@gmail.com>
>
> > 1. Okay. I opted out of the dynamic weaving option; sometime later, I may
> > try to configure static weaving.
> >
> > > there are multiple packages of eclipselinks and one without the api
> >
> > 2. hmm, don't really understand; prior to this attempt to do dynamic
> > weaving, my app has been running fine in TomEE 1.5.1+, and I always
> deploy
> > eclipselink  2.3.2 JAR in tomee/lib, and 'never' add it to webapp webinf
> > classes.  If you're saying that tomee is shipped with eclipselink
> already,
> > sorry, I didn't see it. I did recognize openejb-jpa-integration jar
> though.
> >
> >
> > On Sun, Feb 24, 2013 at 9:58 AM, Romain Manni-Bucau
> > <rm...@gmail.com>wrote:
> >
> > > IIRC eclipselink javaagent looks in AppClassLoader for its classes (so
> of
> > > course it fails)
> > >
> > > That said if eclipselink add a correct ClassFileTransformer (i think
> so)
> > > through its persistence unit openejb-javaagent (present by default)
> will
> > > add instrumentation at load time.
> > >
> > > So basically nothing particular to do excepting adding eclipselink to
> the
> > > webapp or tomee/lib.
> > >
> > > Last thing; jpa api is provided by tomee and shouldn't be add to the
> > webapp
> > > or twice to tomee/lib (there are multiple packages of eclipselinks and
> > one
> > > without the api)
> > >
> > > *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/2/24 smithh032772 <sm...@gmail.com>
> > >
> > > > Yes, i know, old topic, but when I searched google for the exception,
> > it
> > > > lead
> > > > me to this, so I thought...why not see if I can resolve this issue
> via
> > > what
> > > > is mentioned in this thread. :)
> > > >
> > > > Background: of course, my app is running really really well on TomEE
> > > > 1.5.2-snapshot (not the latest version), so today, I 'finally'
> decided
> > to
> > > > attempt to configure dynamic weaving. So, when I added the following
> to
> > > JVM
> > > > options/command-line:
> > > >
> > > >
> > -javaagent:D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> > > >
> > > > tomee was unable to start, and the following was in the stderr log:
> > > >
> > > > 2013-02-24 07:18:51 Commons Daemon procrun stderr initialized
> > > > java.lang.reflect.InvocationTargetException
> > > >         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)
> > > >         at
> > > > sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown
> > > > Source)
> > > >         at
> > > > sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown
> > > > Source)
> > > > Caused by: java.lang.NoClassDefFoundError:
> > > > javax/persistence/spi/PersistenceUnitInfo
> > > >         at java.lang.Class.forName0(Native Method)
> > > >         at java.lang.Class.forName(Unknown Source)
> > > >         at
> > > >
> > > >
> > >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:44)
> > > >         at
> > > >
> > > >
> > >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39)
> > > >         ... 6 more
> > > > Caused by: java.lang.ClassNotFoundException:
> > > > javax.persistence.spi.PersistenceUnitInfo
> > > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > > >         at java.security.AccessController.doPrivileged(Native Method)
> > > >         at java.net.URLClassLoader.findClass(Unknown Source)
> > > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > > >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > > >         ... 10 more
> > > > Exception in thread "main"
> > > >
> > > >
> > > > Please note the following:
> > > >
> > > > 1. eclipselink JAR  in tomee/lib:
> > > >
> > > > D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> > > >
> > > >
> > > > 2. tomee.xml contains the following:
> > > >
> > > > <Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
> > > >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> > > >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> > > >   UserName mcms
> > > >   Password mcms
> > > >   JtaManaged true
> > > >   jmxEnabled true
> > > >   InitialSize 10
> > > >   MaxActive 100
> > > >   MaxIdle 30
> > > >   MaxWait 10000
> > > >   minIdle 10
> > > >   suspectTimeout 60
> > > >   removeAbandoned true
> > > >   removeAbandonedTimeout 180
> > > >   timeBetweenEvictionRunsMillis 30000
> > > >   jdbcInterceptors=StatementCache(max=128)
> > > > </Resource>
> > > >
> > > > <Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
> > > >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> > > >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> > > >   UserName mcms
> > > >   Password mcms
> > > >   JtaManaged false
> > > >   jmxEnabled true
> > > >   InitialSize 10
> > > >   MaxActive 20
> > > >   MaxIdle 10
> > > >   MaxWait 10000
> > > >   removeAbandoned true
> > > >   removeAbandonedTimeout 18000
> > > > </Resource>
> > > >
> > > > 3. Romain, per what you mentioned in your email below, I 'can' remove
> > > > nonJTA, don't need it, but I think when I first started 'using'
> tomee,
> > I
> > > > think it was required for me to have jta and nonjta defined; i don't
> > > > remember...sorry.
> > > >
> > > > 4. i did recognize the following file in tomee/lib; if I have a
> > > > javax.persistance.jar file that was bundled with eclipselink (ZIP
> > > contains
> > > > eclipselink.jar and javax.persistance.jar, separately), should I
> remove
> > > the
> > > > following file from tomee/lib?
> > > >
> > > > openejb-jpa-integration-4.5.2-SNAPSHOT.jar
> > > >
> > > > it's not a necessity for me to do dynamic weaving, but i wanted to
> see
> > > how
> > > > it impacts my app (and performance, of course).
> > > >
> > > > please advise.
> > > >
> > > > thanks,
> > > > Howard
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4660999.html
> > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >
> > >
> >
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by Romain Manni-Bucau <rm...@gmail.com>.
tomee only brings openjpa but custom jpa providers can be in the webapp.

the only constraint is to not bring back another time jpa api jar.

*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/2/24 Howard W. Smith, Jr. <sm...@gmail.com>

> 1. Okay. I opted out of the dynamic weaving option; sometime later, I may
> try to configure static weaving.
>
> > there are multiple packages of eclipselinks and one without the api
>
> 2. hmm, don't really understand; prior to this attempt to do dynamic
> weaving, my app has been running fine in TomEE 1.5.1+, and I always deploy
> eclipselink  2.3.2 JAR in tomee/lib, and 'never' add it to webapp webinf
> classes.  If you're saying that tomee is shipped with eclipselink already,
> sorry, I didn't see it. I did recognize openejb-jpa-integration jar though.
>
>
> On Sun, Feb 24, 2013 at 9:58 AM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
> > IIRC eclipselink javaagent looks in AppClassLoader for its classes (so of
> > course it fails)
> >
> > That said if eclipselink add a correct ClassFileTransformer (i think so)
> > through its persistence unit openejb-javaagent (present by default) will
> > add instrumentation at load time.
> >
> > So basically nothing particular to do excepting adding eclipselink to the
> > webapp or tomee/lib.
> >
> > Last thing; jpa api is provided by tomee and shouldn't be add to the
> webapp
> > or twice to tomee/lib (there are multiple packages of eclipselinks and
> one
> > without the api)
> >
> > *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/2/24 smithh032772 <sm...@gmail.com>
> >
> > > Yes, i know, old topic, but when I searched google for the exception,
> it
> > > lead
> > > me to this, so I thought...why not see if I can resolve this issue via
> > what
> > > is mentioned in this thread. :)
> > >
> > > Background: of course, my app is running really really well on TomEE
> > > 1.5.2-snapshot (not the latest version), so today, I 'finally' decided
> to
> > > attempt to configure dynamic weaving. So, when I added the following to
> > JVM
> > > options/command-line:
> > >
> > >
> -javaagent:D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> > >
> > > tomee was unable to start, and the following was in the stderr log:
> > >
> > > 2013-02-24 07:18:51 Commons Daemon procrun stderr initialized
> > > java.lang.reflect.InvocationTargetException
> > >         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)
> > >         at
> > > sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown
> > > Source)
> > >         at
> > > sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown
> > > Source)
> > > Caused by: java.lang.NoClassDefFoundError:
> > > javax/persistence/spi/PersistenceUnitInfo
> > >         at java.lang.Class.forName0(Native Method)
> > >         at java.lang.Class.forName(Unknown Source)
> > >         at
> > >
> > >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:44)
> > >         at
> > >
> > >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39)
> > >         ... 6 more
> > > Caused by: java.lang.ClassNotFoundException:
> > > javax.persistence.spi.PersistenceUnitInfo
> > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > >         at java.security.AccessController.doPrivileged(Native Method)
> > >         at java.net.URLClassLoader.findClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         ... 10 more
> > > Exception in thread "main"
> > >
> > >
> > > Please note the following:
> > >
> > > 1. eclipselink JAR  in tomee/lib:
> > >
> > > D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> > >
> > >
> > > 2. tomee.xml contains the following:
> > >
> > > <Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
> > >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> > >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> > >   UserName mcms
> > >   Password mcms
> > >   JtaManaged true
> > >   jmxEnabled true
> > >   InitialSize 10
> > >   MaxActive 100
> > >   MaxIdle 30
> > >   MaxWait 10000
> > >   minIdle 10
> > >   suspectTimeout 60
> > >   removeAbandoned true
> > >   removeAbandonedTimeout 180
> > >   timeBetweenEvictionRunsMillis 30000
> > >   jdbcInterceptors=StatementCache(max=128)
> > > </Resource>
> > >
> > > <Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
> > >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> > >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> > >   UserName mcms
> > >   Password mcms
> > >   JtaManaged false
> > >   jmxEnabled true
> > >   InitialSize 10
> > >   MaxActive 20
> > >   MaxIdle 10
> > >   MaxWait 10000
> > >   removeAbandoned true
> > >   removeAbandonedTimeout 18000
> > > </Resource>
> > >
> > > 3. Romain, per what you mentioned in your email below, I 'can' remove
> > > nonJTA, don't need it, but I think when I first started 'using' tomee,
> I
> > > think it was required for me to have jta and nonjta defined; i don't
> > > remember...sorry.
> > >
> > > 4. i did recognize the following file in tomee/lib; if I have a
> > > javax.persistance.jar file that was bundled with eclipselink (ZIP
> > contains
> > > eclipselink.jar and javax.persistance.jar, separately), should I remove
> > the
> > > following file from tomee/lib?
> > >
> > > openejb-jpa-integration-4.5.2-SNAPSHOT.jar
> > >
> > > it's not a necessity for me to do dynamic weaving, but i wanted to see
> > how
> > > it impacts my app (and performance, of course).
> > >
> > > please advise.
> > >
> > > thanks,
> > > Howard
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4660999.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
1. Okay. I opted out of the dynamic weaving option; sometime later, I may
try to configure static weaving.

> there are multiple packages of eclipselinks and one without the api

2. hmm, don't really understand; prior to this attempt to do dynamic
weaving, my app has been running fine in TomEE 1.5.1+, and I always deploy
eclipselink  2.3.2 JAR in tomee/lib, and 'never' add it to webapp webinf
classes.  If you're saying that tomee is shipped with eclipselink already,
sorry, I didn't see it. I did recognize openejb-jpa-integration jar though.


On Sun, Feb 24, 2013 at 9:58 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> IIRC eclipselink javaagent looks in AppClassLoader for its classes (so of
> course it fails)
>
> That said if eclipselink add a correct ClassFileTransformer (i think so)
> through its persistence unit openejb-javaagent (present by default) will
> add instrumentation at load time.
>
> So basically nothing particular to do excepting adding eclipselink to the
> webapp or tomee/lib.
>
> Last thing; jpa api is provided by tomee and shouldn't be add to the webapp
> or twice to tomee/lib (there are multiple packages of eclipselinks and one
> without the api)
>
> *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/2/24 smithh032772 <sm...@gmail.com>
>
> > Yes, i know, old topic, but when I searched google for the exception, it
> > lead
> > me to this, so I thought...why not see if I can resolve this issue via
> what
> > is mentioned in this thread. :)
> >
> > Background: of course, my app is running really really well on TomEE
> > 1.5.2-snapshot (not the latest version), so today, I 'finally' decided to
> > attempt to configure dynamic weaving. So, when I added the following to
> JVM
> > options/command-line:
> >
> > -javaagent:D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> >
> > tomee was unable to start, and the following was in the stderr log:
> >
> > 2013-02-24 07:18:51 Commons Daemon procrun stderr initialized
> > java.lang.reflect.InvocationTargetException
> >         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)
> >         at
> > sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown
> > Source)
> >         at
> > sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown
> > Source)
> > Caused by: java.lang.NoClassDefFoundError:
> > javax/persistence/spi/PersistenceUnitInfo
> >         at java.lang.Class.forName0(Native Method)
> >         at java.lang.Class.forName(Unknown Source)
> >         at
> >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:44)
> >         at
> >
> >
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39)
> >         ... 6 more
> > Caused by: java.lang.ClassNotFoundException:
> > javax.persistence.spi.PersistenceUnitInfo
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >         ... 10 more
> > Exception in thread "main"
> >
> >
> > Please note the following:
> >
> > 1. eclipselink JAR  in tomee/lib:
> >
> > D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
> >
> >
> > 2. tomee.xml contains the following:
> >
> > <Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
> >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> >   UserName mcms
> >   Password mcms
> >   JtaManaged true
> >   jmxEnabled true
> >   InitialSize 10
> >   MaxActive 100
> >   MaxIdle 30
> >   MaxWait 10000
> >   minIdle 10
> >   suspectTimeout 60
> >   removeAbandoned true
> >   removeAbandonedTimeout 180
> >   timeBetweenEvictionRunsMillis 30000
> >   jdbcInterceptors=StatementCache(max=128)
> > </Resource>
> >
> > <Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
> >   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
> >   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
> >   UserName mcms
> >   Password mcms
> >   JtaManaged false
> >   jmxEnabled true
> >   InitialSize 10
> >   MaxActive 20
> >   MaxIdle 10
> >   MaxWait 10000
> >   removeAbandoned true
> >   removeAbandonedTimeout 18000
> > </Resource>
> >
> > 3. Romain, per what you mentioned in your email below, I 'can' remove
> > nonJTA, don't need it, but I think when I first started 'using' tomee, I
> > think it was required for me to have jta and nonjta defined; i don't
> > remember...sorry.
> >
> > 4. i did recognize the following file in tomee/lib; if I have a
> > javax.persistance.jar file that was bundled with eclipselink (ZIP
> contains
> > eclipselink.jar and javax.persistance.jar, separately), should I remove
> the
> > following file from tomee/lib?
> >
> > openejb-jpa-integration-4.5.2-SNAPSHOT.jar
> >
> > it's not a necessity for me to do dynamic weaving, but i wanted to see
> how
> > it impacts my app (and performance, of course).
> >
> > please advise.
> >
> > thanks,
> > Howard
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4660999.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by Romain Manni-Bucau <rm...@gmail.com>.
IIRC eclipselink javaagent looks in AppClassLoader for its classes (so of
course it fails)

That said if eclipselink add a correct ClassFileTransformer (i think so)
through its persistence unit openejb-javaagent (present by default) will
add instrumentation at load time.

So basically nothing particular to do excepting adding eclipselink to the
webapp or tomee/lib.

Last thing; jpa api is provided by tomee and shouldn't be add to the webapp
or twice to tomee/lib (there are multiple packages of eclipselinks and one
without the api)

*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/2/24 smithh032772 <sm...@gmail.com>

> Yes, i know, old topic, but when I searched google for the exception, it
> lead
> me to this, so I thought...why not see if I can resolve this issue via what
> is mentioned in this thread. :)
>
> Background: of course, my app is running really really well on TomEE
> 1.5.2-snapshot (not the latest version), so today, I 'finally' decided to
> attempt to configure dynamic weaving. So, when I added the following to JVM
> options/command-line:
>
> -javaagent:D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
>
> tomee was unable to start, and the following was in the stderr log:
>
> 2013-02-24 07:18:51 Commons Daemon procrun stderr initialized
> java.lang.reflect.InvocationTargetException
>         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)
>         at
> sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown
> Source)
>         at
> sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown
> Source)
> Caused by: java.lang.NoClassDefFoundError:
> javax/persistence/spi/PersistenceUnitInfo
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Unknown Source)
>         at
>
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:44)
>         at
>
> org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39)
>         ... 6 more
> Caused by: java.lang.ClassNotFoundException:
> javax.persistence.spi.PersistenceUnitInfo
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         ... 10 more
> Exception in thread "main"
>
>
> Please note the following:
>
> 1. eclipselink JAR  in tomee/lib:
>
> D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar
>
>
> 2. tomee.xml contains the following:
>
> <Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
>   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
>   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
>   UserName mcms
>   Password mcms
>   JtaManaged true
>   jmxEnabled true
>   InitialSize 10
>   MaxActive 100
>   MaxIdle 30
>   MaxWait 10000
>   minIdle 10
>   suspectTimeout 60
>   removeAbandoned true
>   removeAbandonedTimeout 180
>   timeBetweenEvictionRunsMillis 30000
>   jdbcInterceptors=StatementCache(max=128)
> </Resource>
>
> <Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
>   JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
>   JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
>   UserName mcms
>   Password mcms
>   JtaManaged false
>   jmxEnabled true
>   InitialSize 10
>   MaxActive 20
>   MaxIdle 10
>   MaxWait 10000
>   removeAbandoned true
>   removeAbandonedTimeout 18000
> </Resource>
>
> 3. Romain, per what you mentioned in your email below, I 'can' remove
> nonJTA, don't need it, but I think when I first started 'using' tomee, I
> think it was required for me to have jta and nonjta defined; i don't
> remember...sorry.
>
> 4. i did recognize the following file in tomee/lib; if I have a
> javax.persistance.jar file that was bundled with eclipselink (ZIP contains
> eclipselink.jar and javax.persistance.jar, separately), should I remove the
> following file from tomee/lib?
>
> openejb-jpa-integration-4.5.2-SNAPSHOT.jar
>
> it's not a necessity for me to do dynamic weaving, but i wanted to see how
> it impacts my app (and performance, of course).
>
> please advise.
>
> thanks,
> Howard
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4660999.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by smithh032772 <sm...@gmail.com>.
Yes, i know, old topic, but when I searched google for the exception, it lead
me to this, so I thought...why not see if I can resolve this issue via what
is mentioned in this thread. :)

Background: of course, my app is running really really well on TomEE
1.5.2-snapshot (not the latest version), so today, I 'finally' decided to
attempt to configure dynamic weaving. So, when I added the following to JVM
options/command-line:

-javaagent:D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar

tomee was unable to start, and the following was in the stderr log:

2013-02-24 07:18:51 Commons Daemon procrun stderr initialized
java.lang.reflect.InvocationTargetException
	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)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown
Source)
	at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown
Source)
Caused by: java.lang.NoClassDefFoundError:
javax/persistence/spi/PersistenceUnitInfo
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at
org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:44)
	at
org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:39)
	... 6 more
Caused by: java.lang.ClassNotFoundException:
javax.persistence.spi.PersistenceUnitInfo
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 10 more
Exception in thread "main" 


Please note the following:

1. eclipselink JAR  in tomee/lib:

D:\apache-tomee-plus-1.5.2-SNAPSHOT\lib\eclipselink-2.3.2.jar


2. tomee.xml contains the following:

<Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
  JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
  JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
  UserName mcms
  Password mcms
  JtaManaged true
  jmxEnabled true
  InitialSize 10
  MaxActive 100
  MaxIdle 30
  MaxWait 10000
  minIdle 10
  suspectTimeout 60
  removeAbandoned true
  removeAbandonedTimeout 180
  timeBetweenEvictionRunsMillis 30000
  jdbcInterceptors=StatementCache(max=128)
</Resource>

<Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
  JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
  JdbcUrl jdbc:derby:D:/javadb/mcms;create=true
  UserName mcms
  Password mcms
  JtaManaged false
  jmxEnabled true
  InitialSize 10
  MaxActive 20
  MaxIdle 10
  MaxWait 10000
  removeAbandoned true
  removeAbandonedTimeout 18000
</Resource>

3. Romain, per what you mentioned in your email below, I 'can' remove
nonJTA, don't need it, but I think when I first started 'using' tomee, I
think it was required for me to have jta and nonjta defined; i don't
remember...sorry.

4. i did recognize the following file in tomee/lib; if I have a
javax.persistance.jar file that was bundled with eclipselink (ZIP contains
eclipselink.jar and javax.persistance.jar, separately), should I remove the
following file from tomee/lib?

openejb-jpa-integration-4.5.2-SNAPSHOT.jar

it's not a necessity for me to do dynamic weaving, but i wanted to see how
it impacts my app (and performance, of course).

please advise.

thanks,
Howard




--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4660999.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException [SOLVED]

Posted by "kurt.sys" <ku...@gmail.com>.
Placing it in $TOMCAT/webapps and starting tomee. Nothing fancy. I now
have some issues with injection of PersistenceContext, but that's for
another thread, if I can't figure out what I'm doing wrong...
Thx, Kurt

2012/11/24 smithh032772 [via OpenEJB]
<ml...@n4.nabble.com>:
> How did you deploy the war file?
> On Nov 24, 2012 3:35 PM, "kurt.sys" <[hidden email]> wrote:
>
>> Yeah, the basic problem was placement of configuration files, but I'm fine
>> now :). I just needed:
>>
>>
>> After contex.xml was in place etc, it worked almost. I just had to do some
>> small adjustments, not related to the previous problem... It took a few
>> minutes to find out where to put 'find.xml' (sql queries) as well, and my
>> postgresql column names had to be lowercase (not double quoted). I might
>> move beans.xml to META-INF, although it works now as well.
>>
>> Thanks again,
>> Kurt
>>
>>
>>
>> --
>> View this message in context:
>>
>> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658886.html
>
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658887.html
> To unsubscribe from tomee + eclipselink =>
> NoClassDefFoundError/ClassNotFoundException, click here.
> NAML




--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658888.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException [SOLVED]

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
How did you deploy the war file?
On Nov 24, 2012 3:35 PM, "kurt.sys" <ku...@gmail.com> wrote:

> Yeah, the basic problem was placement of configuration files, but I'm fine
> now :). I just needed:
>
>
> After contex.xml was in place etc, it worked almost. I just had to do some
> small adjustments, not related to the previous problem... It took a few
> minutes to find out where to put 'find.xml' (sql queries) as well, and my
> postgresql column names had to be lowercase (not double quoted). I might
> move beans.xml to META-INF, although it works now as well.
>
> Thanks again,
> Kurt
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658886.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException [SOLVED]

Posted by "kurt.sys" <ku...@gmail.com>.
Yeah, the basic problem was placement of configuration files, but I'm fine
now :). I just needed:


After contex.xml was in place etc, it worked almost. I just had to do some
small adjustments, not related to the previous problem... It took a few
minutes to find out where to put 'find.xml' (sql queries) as well, and my
postgresql column names had to be lowercase (not double quoted). I might
move beans.xml to META-INF, although it works now as well.

Thanks again, 
Kurt



--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658886.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException [SOLVED]

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Kurt, I was advised to place beans.xml in META-INF instead of WEB-INF for
CDI app, and I still think you should generate your war and place in
webapps folder while TomEE is not running and restart TomEE and see what
the result is.

And I think TomEE requires context.xml in your meta-inf folder, netbeans
did that for me automatically. :-)
 On Nov 24, 2012 2:16 PM, "kurt.sys" <ku...@gmail.com> wrote:

> Hey,
> I'm one step further, (I think). I suddenly realised I might have to
> include
> the META-INF directory, something I not always do when I'm writing small
> apps for testing. Doing this gives other errors now, still related to
> persistence, but I hope I can solve myself. Thanks a lot.
> Kurt
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658884.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException [SOLVED]

Posted by "kurt.sys" <ku...@gmail.com>.
Hey,
I'm one step further, (I think). I suddenly realised I might have to include
the META-INF directory, something I not always do when I'm writing small
apps for testing. Doing this gives other errors now, still related to
persistence, but I hope I can solve myself. Thanks a lot.
Kurt



--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658884.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

the classnotfound is probably because you had too many times the same api
deployed (maybe it doesnt find always the same)

why non jta datasource is needed when the persistence unit is jta is
because some provider use it to optimize some queries. If you dont define
it explicitely the nonjta will be deduce from the jta

*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*




2012/11/24 kurt.sys <ku...@gmail.com>

> Hey hey,
>
> I started all over, and so far, I can compile without any troubles - I have
> no idea what's different, but so far, so good. I still can't deploy:
>
>
>
> I don't really get it, but I'll try to get things right. Anyway, since
> asm.jar was already in the directory, I didn't add that one. Since I'm not
> using el, I didn't add el-related jars either. I have eclipselink-2.3.2.jar
> and javax.persistence-2.0.3.
>
> For deployment, I copy the WEB-INF-directory into the
> $TOMCAT/webapp/test-directory. The NoClassDefFoundError is similar to what
> I
> had with cdi. However, I could solve it with the whole cdi-thing, but I
> just
> can't find the problem (so far) with the so far with the
> PersistenceProvider. I suppose I have to look for 'doubles', although I'm
> not sure.
>
> What I (also) don't understand is why you have 4 resources defined in
> tomee.xml. Is one not enough? Since the transaction-type is declared 'jta',
> only a jta-data-source is needed, I suppose? And you seem to use two
> different drivers/databases as well? Anyway, I configered also four
> datasources (just to mimic what you did), but probably I can remove three
> of
> them :).
>
>
>
> Thanks, Kurt
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658873.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by "kurt.sys" <ku...@gmail.com>.
Hey hey,

I started all over, and so far, I can compile without any troubles - I have
no idea what's different, but so far, so good. I still can't deploy:



I don't really get it, but I'll try to get things right. Anyway, since
asm.jar was already in the directory, I didn't add that one. Since I'm not
using el, I didn't add el-related jars either. I have eclipselink-2.3.2.jar
and javax.persistence-2.0.3.

For deployment, I copy the WEB-INF-directory into the
$TOMCAT/webapp/test-directory. The NoClassDefFoundError is similar to what I
had with cdi. However, I could solve it with the whole cdi-thing, but I just
can't find the problem (so far) with the so far with the
PersistenceProvider. I suppose I have to look for 'doubles', although I'm
not sure.

What I (also) don't understand is why you have 4 resources defined in
tomee.xml. Is one not enough? Since the transaction-type is declared 'jta',
only a jta-data-source is needed, I suppose? And you seem to use two
different drivers/databases as well? Anyway, I configered also four
datasources (just to mimic what you did), but probably I can remove three of
them :).



Thanks, Kurt



--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870p4658873.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee + eclipselink => NoClassDefFoundError/ClassNotFoundException

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Kurt,

I recently migrated my web app from Glassfish 3.1.2.2 JSF managed beans to
CDI managed beans on TomEE 1.5+ SNAPSHOT. Like you, I experienced those
exceptions, had to search google plenty of times for those classes not
found in my class path.

Anyway, what is working well for me today is the following:

*persistence.xml*

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
             xmlns="http://java.sun.com/xml/ns/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_2_0.xsd">
  <persistence-unit name="mcmsPU" transaction-type="JTA">

<!--<provider>org.batoo.jpa.core.BatooPersistenceProvider</provider>-->
      <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
      <jta-data-source>jdbc/mcmsJta</jta-data-source>
      <non-jta-data-source>jdbc/mcmsNonJta</non-jta-data-source>
      <exclude-unlisted-classes>false</exclude-unlisted-classes>
      <properties/>
  </persistence-unit>
</persistence>


context.xml -- no need to specify a JDBC resource in this file

*tomee.xml* (in tomee /conf folder)

<Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
  JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
  JdbcUrl jdbc:derby:C:/javadb/databases/mcmsdev;create=true
  UserName mcms
  Password mcms
  JtaManaged true
  InitialSize 10
  MaxActive 100
  MaxIdle 30
  MaxWait 10000
</Resource>

<Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource">
  JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
  JdbcUrl jdbc:derby:C:/javadb/databases/mcmsdev;create=true
  UserName mcms
  Password mcms
  JtaManaged false
  InitialSize 10
  MaxActive 100
  MaxIdle 30
  MaxWait 10000
</Resource>

<Resource id="My DataSource" type="DataSource">
  JdbcDriver org.hsqldb.jdbcDriver
  JdbcUrl jdbc:hsqldb:file:data/hsqldb/hsqldb
  UserName sa
  Password
  JtaManaged true
</Resource>


<Resource id="My Unmanaged DataSource" type="DataSource">
  JdbcDriver org.hsqldb.jdbcDriver
  JdbcUrl jdbc:hsqldb:file:data/hsqldb/hsqldb
  UserName sa
  Password
  JtaManaged false
</Resource>

Also, I did (or recommend) the following:

   1. Download/unzip TomEE Plus 1.5.1 SNAPSHOT (latest version, which
   should/may be 2012.11.24) to C:\; I always delete existing folder before
   doing this
   2. I copy the following JARs to tomee /lib folder: asm-3.3.1, derby.jar,
   eclipselink.2.4.1, el-api-2.2, el-impl-2.2, javax-persistence_2.0.4,
   juel-2.2.5
   3. After upgrading to new version/release of TomEE, I start TomEE at
   this point via NetBeans, stop tomEE via NetBeans, clean-and-build WAR file
   via NetBeans, and then I copy WAR file from NetBeans dist folder to tomee
   /webapps folder
   4. This usually guarantees an exception-free server log

I'm not saying that all will work for you, but as I am a new TomEE/CDI
user/developer, this works for me. :)

Howard


On Sat, Nov 24, 2012 at 10:45 AM, kurt.sys <ku...@gmail.com> wrote:

> Hey all,
>
> I'm trying to get persistence to work in tomee, but I just seem to fail.
> When I try to compile a very simple project (I'm using netbeans), I get the
> following stacktrace:
>
>
> Some lines from build-impl.xml:
>
>
>
> I just don't seem to understand where the error comes from, since I'm
> pretty
> sure there is a javax.persistence.spi.PersistenceUnitInfo class in
> javaee-api-6.0.4-tomcat.jar, javax.persistence-2.0.3.jar and
> ejb3-persistence.jar. So at first, I thought I had to many times the same
> class (interface), so I removed javax.persistence and ejb3-persistence from
> $TOMCAT/lib. Same result... I removed the hibernate-related jars as well,
> since I don't expect to use hibernate and I wanted to remove possible
> interference or something, and if I will use them, I always can add them.
>
> Some project files (the ones I think that are important, the error doesn't
> seem wicket-related, so I don't mind these classes, but it's just a very
> basic test application I used to get cdi to work - which luckily did work
> out after some time. The webapp is really nothing fancy, I'm not even using
> the persistence class):
>
> web.xml
>
>
>
> context.xml
>
> (I'm using cdi inside wicket framework, hence the resource)
>
> persistence.xml
>
>
> item.java
>
>
> I tried to add eclipselink jars to my project lib and to /opt/tomcat/lib as
> well. Both give the same compile error. Not adding the eclipslink jars
> doesn't help either... I added them to the tomcat/tomee lib-directory:
>
>
> beans.xml (needed this one for cdi)
>
>
>
> Jars in /opt/tomcat/lib.
>
>
> System setup:
>
>
>
> Any help pointing me in the right direction? (On forums, it's pointed out
> that the same class may be present in different jars in case of
> NoClassDefFoundError, and/or that I should add the eclipslink jars in the
> lib-directory of tomcat/tomee. I seem the have another issue, since it is
> at
> compile-time and there is a ClassNotFoundException).
>
> Thx, Kurt
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-eclipselink-NoClassDefFoundError-ClassNotFoundException-tp4658870.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>