openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: NoClassDefFoundError: org/apache/commons/lang/StringUtils
Date Thu, 24 Sep 2009 15:29:50 GMT
Are you including all of the jars in the /lib directory that are 
provided in the apache-openjpa-1.2.1-binary.zip distribution?

     commons-collections-3.2.jar
     commons-lang-2.1.jar
     commons-pool-1.3.jar
     derby-10.2.2.0.jar
     geronimo-jpa_3.0_spec-1.0.jar
     geronimo-jta_1.1_spec-1.1.jar
     serp-1.13.1.jar


-Donald


Xie, Bruce wrote:
> 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
View raw message