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

    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 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();
    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 wBrokerSet(
    at org.apache.openjpa.kernel.AbstractBrokerFactory.<i nit>(
    at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.< init>(
    at Factory.<init>(
    at Factory.newInstance( 2)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at org.apache.openjpa.kernel.Bootstrap.invokeFactory(
    at org.apache.openjpa.kernel.Bootstrap.newBrokerFacto ry(
    at org.apache.openjpa.persistence.PersistenceProvider Impl.getBrokerFactory( :102)
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide
    at mpl.createEntityManagerFactory(PersistenceProvider
    at mpl.createEntityManagerFactory(PersistenceProvider
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide
    at org.apache.openjpa.persistence.PersistenceProvider Impl.createEntityManagerFactory(PersistenceProvide
    at javax.persistence.Persistence.createFactory(Persis
    at javax.persistence.Persistence.createEntityManagerF actory(
    at javax.persistence.Persistence.createEntityManagerF actory(
    at source.Deneme.main(
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.set.MapBackedSet
    at ava:421)
    at java.lang.ClassLoader.loadClass( 43)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche
    at java.lang.ClassLoader.loadClass( 09)
    ... 22 more

    using the first line of the exception i made asearch on google and i found the suggestion on [this forum post | ]JavaWorld Forums: Digester hanging on new Digester() ?! 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="" xmlns:xsi="" xsi:schemaLocation="">
    	<persistence-unit name="Dene">
    			<property name="openjpa.jdbc.Schema" value="Schema"/>
    can anyone please suggest me how to come over of this problem ?

    thank you

  2. #2
    FON is offline Senior Member
    Join Date
    Dec 2009
    Belgrade, Serbia
    Rep Power


    Can you create new class and make instance of
    org.apache.commons.collections.set.MapBackedSet ?

    I guess you took
    and place it on your build path with no problems

    If that it OK than it looks like there is some bootstrap problem with openjpa.

    Maybe you could try to find some help about resources for your projects here:

    IBM WebSphere Developer Technical Journal: Leveraging OpenJPA with WebSphere Application Server V6.1

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

    Default solution and track to this post

    hello to all,

    sorry for my late reply, but i was working on this kind of errors all the past days even nights, and i asked the same question on IBM developerworks forum too, and now the only problem remains to be jpa enhancer, for those who want to catch up with what happened with this error and thereafter, here is the link for the thread in developerworks forum.

    if you have any suggestion about jpa enhancer mentioned there, you can either reply here or there, i will also share the result on both forums.

Similar Threads

  1. Error, trying to deploy a web application
    By aspmedeiros in forum NetBeans
    Replies: 2
    Last Post: 03-23-2012, 09:29 AM
  2. JPA application noclassdeffound error
    By ishakteyran in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-11-2010, 01:34 AM
  3. Replies: 1
    Last Post: 07-23-2009, 12:00 AM
  4. java.lang.NoClassDefFound --Any way to handle this
    By sunny_sykes in forum Advanced Java
    Replies: 1
    Last Post: 03-30-2009, 09:29 AM
  5. Application error
    By saso1310 in forum CLDC and MIDP
    Replies: 1
    Last Post: 10-16-2008, 08: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