On Tue, Sep 29, 2009 at 6:34 PM, ANTHONY ENNIS <[email protected]> wrote:
> I'm at wit's end.  Now the situation is that I can connect to the database
> using my persistence.xml settings when I run from my IDE (intellij.)
> Previously, I was using a properties file.  So that is a small amount of
> progress.
>
<snip>
> aar file:
> --- lib
> --- --- antlr-2.7.6.jar
> --- --- asm-2.2.jar
> --- --- asm-attrs-2.2.jar
> --- --- bsh-2.0b1.jar
> --- --- c3p0-0.9.1.jar
> --- --- cglib-nodep-2.2.jar
> --- --- commons-collections-3.1.jar
> --- --- commons-logging-1.0.4.jar
> --- --- dom4j-1.6.1.jar
> --- --- ehcache-1.2.3.jar
> --- --- ejb3-persistence.jar
> --- --- freemarker.jar
> --- --- hibernate-annotations.jar
> --- --- hibernate-commons-annotations.jar
> --- --- hibernate-core.jar
> --- --- hibernate-entitymanager.jar
> --- --- hibernate-tools.jar
> --- --- hibernate3.jar

I suggest you don't put all these jar's in the aar, put them in
WEB-INF/lib . hibernate uses the TCCL and that won't work directly in
an aar without some extra effort.

...

> --- --- this-is-my-jar.jar
> --- --- --- com
> --- --- --- mycompany
> --- --- --- --- mypackage
> --- --- --- --- --- *.class
> --- --- --- META-INF
> --- --- --- --- persistence.xml
> --- META-INF
> --- --- services.xml
>

All this can be loaded in your WEB-INF/classes and WEB-INF/lib as
well. I'd try getting your db stuff to work in a war , then try to get
your Service Class to access it - its much easier that way. The only
thing really required in an aar is your services.xml .

> Here's the first few lines of the exception I get in every case:
>
> javax.persistence.PersistenceException: No Persistence provider for
> EntityManager named Snapshot
>         at

As I said I wouldn't try loading this in your aar without a good
reason due to classloader issues.

- R

Reply via email to