openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: NoClassDefFoundError: org/apache/commons/lang/StringUtils
Date Wed, 23 Sep 2009 13:19:39 GMT
How are you launching your application? Are you sure that commons-lang is on
your classpath?

-Rick

On Tue, Sep 22, 2009 at 8:45 AM, Xie, Bruce <bruce.xie@cgi.com> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message