I started this morning with the Andreas' solution as it is easiest to 
implement.  I got farther.  The web service finds the persistence file and 
starts mapping the classes.
Now I am getting the following exception, which amuses me somehow:

"java.lang.ClassNotFoundException: Class Not found : long"

I thought 'long' was baked into Java.  If I manually change the generated model 
pojos to use Long instead of long, it seems to work a little better (until 
Persistence.createEntityManagerFactory advances to a pojo I haven't 
hand-edited...)  Obviously I don't want to hand edit these files, but doing so 
yielded good information.  I seem to be missing a critical jar from my 
classpath if "long" isn't recognized.  That it uses "long" is a bit of a 
mystery as other similar columns are Long. The DDL is the same except the Long 
columns are primary keys.  So I need to encourage hbm2java to generate Long 
instead of long, or tell hibernate that "long" types are built-in. Oddly, 
Persistence.createEntityManagerFactory  works if I run locally (ie not as a web 
service.)

Regarding Robert's comment, I have no "need" for a session to isolated to 
axis2, but that's going to be the effect.  The user will lob a text file at my 
web service, and my web service will make some response.  That's the entire 
activity.  Usage volume will be medium-low.  I may add more end-points, but I 
don't know that I'll be adding any more aar files.

----- Original Message -----
From: robert lazarski <[email protected]>
Date: Wednesday, September 30, 2009 9:55
Subject: Re: hibernate and axis2
To: [email protected]

> On Wed, Sep 30, 2009 at 9:53 AM, Andreas Veithen
> <[email protected]> wrote:
> >> 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.
> >
> > It should be enough to add the following parameter to the service:
> >
> > <parameter name="ServiceTCCL" 
> locked="false">composite</parameter>>
> >
> > Andreas
> >
> 
> Right. With only one end user aar and without the OP showing a 
> need to
> have a hibernate session isolated to axis2, however, its probably
> overkill. Its possible to do spring and/or hibernate per aar, I just
> think it rarely makes sense. Just my 2 brazilian centavos :-) .
> 
> - R
>

Reply via email to