openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xie, Bruce" <bruce....@cgi.com>
Subject NoClassDefFoundError: org/apache/commons/lang/StringUtils
Date Tue, 22 Sep 2009 13:45:01 GMT
Hi,

 

I am trying to create a test base class to test my persistence and  run
as out-of-container. When I run it I got following exception:

 

Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
org/apache/commons/lang/StringUtils

          at
org.apache.openjpa.persistence.PersistenceProductDerivation.load(Persist
enceProductDerivation.java:156)

          at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManag
erFactory(PersistenceProviderImpl.java:77)

          at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManag
erFactory(PersistenceProviderImpl.java:109)

          at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManag
erFactory(PersistenceProviderImpl.java:53)

          at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.jav
a:83)

          at JPATestBase.createEntityManager(JPATestBase.java:53)

          at JPATestBase.<init>(JPATestBase.java:16)

          at JPATestBase.main(JPATestBase.java:11)

 

Below is my code:

 

  private EntityManagerFactory emf;

 

  public EntityManager createEntityManager() {

 

    if(emf == null) {

      emf = Persistence.createEntityManagerFactory(persistenceUnitName,
null);

    }

    return emf.createEntityManager();

  }

 

 

 

The commons-lang-2.4.jar is already included in the classpath. Does
anybody know how to fix it?

 

 

 

Thanks,

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message