Martin, I have a JiBX service running alright already. The only complications pop up when trying to use JPA.

Anthony, I believe your reply goes into the right direction, the proposed solutions still feels a little dirty, though. I'm writing a generator that takes user-defined data types and generates persistence services from those type descriptions (to provide simple crud operations for each data type). Thus, I want the deployment to be as simple as possible for the user, and deleting a jar that comes with Axis2 doesn't feel too good in this regard.

I might look into modifying a stock axis2.war for each generation, removing log4j, adding my services properly -- maybe with some classloading help from spring -- and putting it onto a dedicated path, so the user would just get a war that they need to deploy.

Thanks a lot for your replies!
  Leif


Did you take a look at JibxService Library.java and JibxServiceClient
LibraryStub.java (Service and ClientStub for JiBX respectively) from dennis
sosnoski?

Get the Library.java compiled and deployed as .aar source located at
%AXIS2_HOME%\modules\jibx\target\gen\test\src\com\sosnoski\ws\library \wsdl\L
ibrary.java

confirm by http://127.0.0.1:5555/axis2/services/library
*(change the host:port to your tomcat configuration)*

then Get LibraryStub.java client
%AXIS2_HOME%\modules\jibx\target\gen\test\src\com\sosnoski\ws\library \wsdl\L
ibraryStub.java

compiled and execute the client pointing EPR to
http://127.0.0.1:5555/axis2/services/library
change the host:port to your tomcat configuration

(I'll jump in for the hibernate configuration afterwards)

Martin-
----- Original Message -----
From: "Leif Singer" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, October 28, 2007 8:23 PM
Subject: Classloaders and JPA


Hello,

I'm trying to implement a simple Axis2 service using JPA. Its only
operation is supposed to take a model object (e.g., a "Person") as its
sole argument and persist it.

I understand that each AAR uses a seperate classloader. Also, I
believe I've read that the libraries I use (JPA, specifically) are
being loaded by a different classloader than my AAR.

The issue I'm having is this:
1. My service implementation can see my model classes and the
persistence.xml.
2. JPA cannot see the persistence.xml in my AAR, no matter where I
place it.
3. JPA cannot see my model classes in my AAR.

I solved this by putting the persistence.xml into Tomcat's axis2/WEB-
INF/classes/META-INF directory and putting my model classes into the
axis2/WEB-INF/classes directory, i.e., outside the AAR.

The trouble I have with this is that I want to have my AAR as self-
contained as possible. I could live with a seperate persistence.xml --
after all, it's configuration -- but would really like to have the
model classes packaged into the AAR and *still* have JPA see them.

Without a JEE container, is there a way to achieve this? What's
considered a good practice to solve this?

I use JiBX for un-/marhalling. I use Hibernate's JPA implementation. I
tried this running in the SimpleAxisServer and Apache Tomcat 5.0.28.

Thanks in advance
  Leif Singer


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to