Results 1 to 3 of 3
  1. #1
    ishakteyran is offline Member
    Join Date
    Dec 2007
    Posts
    11
    Rep Power
    0

    Default JPA application noclassdeffound error

    hello to all,

    i am developing my first JPA application on RAD 7.5.5 windows vista business, and using websphere application server 7.0 .

    using RAD , i created a JPA application and i created my entities and entity managers as well successfully, then for trying to actually manipulate my data, i created a Deneme.java which has the code
    Java Code:
    package source;
    
    import entities.controller.*;
    import entities.*;
    
    import javax.persistence.*;
    
    public class Deneme {
    	
    
    	public static void main(String[] args) {
    		
    		EntityManager em = Persistence.createEntityManagerFactory("Dene").createEntityManager();
    		System.out.print("success");
    
    	}
    
    }
    and i made the application run as java application but it gave the following error :

    ------------------------------------------

    Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.collections.set.MapBackedSet
    at org.apache.openjpa.lib.util.concurrent.ConcurrentR eferenceHashSet.<init>(ConcurrentReferenceHashSet. java:68)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.ne wBrokerSet(AbstractBrokerFactory.java:486)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.<i nit>(AbstractBrokerFactory.java:148)
    at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.< init>(JDBCBrokerFactory.java:87)
    at com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCBroker Factory.<init>(WsJpaJDBCBrokerFactory.java:77)
    at com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCBroker Factory.newInstance(WsJpaJDBCBrokerFactory.java:12 2)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at org.apache.openjpa.kernel.Bootstrap.invokeFactory( Bootstrap.java:124)
    at org.apache.openjpa.kernel.Bootstrap.newBrokerFacto ry(Bootstrap.java:62)
    at org.apache.openjpa.persistence.PersistenceProvider Impl.getBrokerFactory(PersistenceProviderImpl.java :102)
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide rImpl.java:81)
    at com.ibm.websphere.persistence.PersistenceProviderI mpl.createEntityManagerFactory(PersistenceProvider Impl.java:71)
    at com.ibm.websphere.persistence.PersistenceProviderI mpl.createEntityManagerFactory(PersistenceProvider Impl.java:41)
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide rImpl.java:109)
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide rImpl.java:53)
    at javax.persistence.Persistence.createFactory(Persis tence.java:172)
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:112)
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:66)
    at source.Deneme.main(Deneme.java:20)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.set.MapBackedSet
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:421)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 43)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:346)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 09)
    ... 22 more
    --------------------------------------------------

    using the first line of the exception i made asearch on google and i found the suggestion on this forum post and copied commons collectins, beanutils, digester, logging and openjpa latest zip file to the build path of my application.

    and i made the aplication run. but still i get the very same error :(

    if it will make any help here is also the persistence.xml contents
    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.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_1_0.xsd">
    	<persistence-unit name="Dene">
    		<jta-data-source>jdbc/DeneJPA</jta-data-source>
    		<class>entities.Child</class>
    		<class>entities.Parent</class>
    		<properties>
    			<property name="openjpa.jdbc.Schema" value="Schema"/>
    		</properties>
    	</persistence-unit>
    </persistence>
    can anyone please suggest me how to come over of this problem ?

    thank you

  2. #2
    ishakteyran is offline Member
    Join Date
    Dec 2007
    Posts
    11
    Rep Power
    0

    Default

    well, i think it is a stupidity of RAD, instead of zip files (because it allows me to add zip files as library jars) , i showed the actual jar files and it accepted, but now there is this error :

    108 Dene INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2-SNAPSHOT
    Exception in thread "P=23519:O=0:CT" java.lang.NoClassDefFoundError: com.ibm.ffdc.Manager
    at com.ibm.ws.naming.util.RasUtil.logException(RasUti l.java:164)
    at com.ibm.ws.naming.util.RasUtil.logException(RasUti l.java:72)
    at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java :363)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitia lContextInternal(WsnInitCtxFactory.java:422)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnIn itCtx.java:123)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull (WsnInitCtx.java:798)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCt x.java:164)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCt x.java:179)
    at javax.naming.InitialContext.lookup(InitialContext. java:455)
    at org.apache.openjpa.lib.conf.Configurations.lookup( Configurations.java:619)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.l ookupConnectionFactory(OpenJPAConfigurationImpl.ja va:960)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.g etConnectionFactory(OpenJPAConfigurationImpl.java: 946)
    at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl .createConnectionFactory(JDBCConfigurationImpl.jav a:782)
    at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl .getDBDictionaryInstance(JDBCConfigurationImpl.jav a:561)
    at org.apache.openjpa.jdbc.meta.MappingRepository.end Configuration(MappingRepository.java:1265)
    at org.apache.openjpa.lib.conf.Configurations.configu reInstance(Configurations.java:505)
    at org.apache.openjpa.lib.conf.Configurations.configu reInstance(Configurations.java:430)
    at org.apache.openjpa.lib.conf.PluginValue.instantiat e(PluginValue.java:103)
    at org.apache.openjpa.conf.MetaDataRepositoryValue.in stantiate(MetaDataRepositoryValue.java:68)
    at org.apache.openjpa.lib.conf.ObjectValue.instantiat e(ObjectValue.java:83)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.n ewMetaDataRepositoryInstance(OpenJPAConfigurationI mpl.java:863)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.g etMetaDataRepositoryInstance(OpenJPAConfigurationI mpl.java:854)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.ma keReadOnly(AbstractBrokerFactory.java:638)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.ne wBroker(AbstractBrokerFactory.java:183)
    at org.apache.openjpa.kernel.DelegatingBrokerFactory. newBroker(DelegatingBrokerFactory.java:142)
    at org.apache.openjpa.persistence.EntityManagerFactor yImpl.createEntityManager(EntityManagerFactoryImpl .java:192)
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.cr eateEntityManager(EntityManagerFactoryImpl.java:42 )
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.cr eateEntityManager(EntityManagerFactoryImpl.java:27 )
    at source.Deneme.main(Deneme.java:13)
    Caused by: java.lang.ClassNotFoundException: com.ibm.ffdc.Manager
    at java.lang.ClassNotFoundException.<init>(ClassNotFo undException.java:77)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:383)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 43)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:346)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 09)
    ... 29 more
    anyone who knows how to solve these is welcomed, or where is the jar file that is missing ..

    thank you.

  3. #3
    ishakteyran is offline Member
    Join Date
    Dec 2007
    Posts
    11
    Rep Power
    0

    Default

    well, here is the solution to the problem in the previous thread ,

    and the next error i receive is

    97 Dene INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2-SNAPSHOT
    Mar 11, 2010 2:38:21 AM null null
    WARNING: WSVR0072W
    Mar 11, 2010 2:38:21 AM null null
    WARNING: WSVR0072W
    Mar 11, 2010 2:38:22 AM null null
    WARNING: WSVR0072W
    Mar 11, 2010 2:38:22 AM null null
    WARNING: WSVR0072W
    Mar 11, 2010 2:38:22 AM null null
    INFO: Client code attempting to load security configuration
    Exception in thread "P=900815:O=0:CT" <openjpa-1.2.2-SNAPSHOT-r422266:821449 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
    at org.apache.openjpa.jdbc.schema.DataSourceFactory.n ewDataSource(DataSourceFactory.java:74)
    at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl .createConnectionFactory(JDBCConfigurationImpl.jav a:784)
    at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl .getDBDictionaryInstance(JDBCConfigurationImpl.jav a:561)
    at org.apache.openjpa.jdbc.meta.MappingRepository.end Configuration(MappingRepository.java:1265)
    at org.apache.openjpa.lib.conf.Configurations.configu reInstance(Configurations.java:505)
    at org.apache.openjpa.lib.conf.Configurations.configu reInstance(Configurations.java:430)
    at org.apache.openjpa.lib.conf.PluginValue.instantiat e(PluginValue.java:103)
    at org.apache.openjpa.conf.MetaDataRepositoryValue.in stantiate(MetaDataRepositoryValue.java:68)
    at org.apache.openjpa.lib.conf.ObjectValue.instantiat e(ObjectValue.java:83)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.n ewMetaDataRepositoryInstance(OpenJPAConfigurationI mpl.java:863)
    at org.apache.openjpa.conf.OpenJPAConfigurationImpl.g etMetaDataRepositoryInstance(OpenJPAConfigurationI mpl.java:854)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.ma keReadOnly(AbstractBrokerFactory.java:638)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.ne wBroker(AbstractBrokerFactory.java:183)
    at org.apache.openjpa.kernel.DelegatingBrokerFactory. newBroker(DelegatingBrokerFactory.java:142)
    at org.apache.openjpa.persistence.EntityManagerFactor yImpl.createEntityManager(EntityManagerFactoryImpl .java:192)
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.cr eateEntityManager(EntityManagerFactoryImpl.java:42 )
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.cr eateEntityManager(EntityManagerFactoryImpl.java:27 )
    at source.Deneme.main(Deneme.java:15)
    i dont have any idea about this problem. and now i will begin to ask to google about this, anyone who has experienced this before please reply

    thank you all.

Similar Threads

  1. JPA application noclassdeffound error
    By ishakteyran in forum New To Java
    Replies: 2
    Last Post: 03-12-2010, 07:31 PM
  2. JPA application noclassdeffound error
    By ishakteyran in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-11-2010, 12:34 AM
  3. Replies: 1
    Last Post: 07-22-2009, 11:00 PM
  4. java.lang.NoClassDefFound --Any way to handle this
    By sunny_sykes in forum Advanced Java
    Replies: 1
    Last Post: 03-30-2009, 08:29 AM
  5. Application error
    By saso1310 in forum CLDC and MIDP
    Replies: 1
    Last Post: 10-16-2008, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •