Re: aar and hibernate
On Sat, Sep 26, 2009 at 2:11 AM, ANTHONY ENNIS wrote: > I have a web service that performs a simple database lookup. Unfortunately, > Persistence.createEntityManagerFactory('xyzzy') fails in all cases. > > My aar looks like: > /com >(class files in package format eg com/this/that/x.class) > /META-INF > services.xml > /lib > numerous jars > > I don't know where to put the persistence.xml file. I have tried putting > it everywhere. I keep getting the following error: > > try this as well. create a jar file containing your clases and the persistence.xml file eg a jar containing. persistence.xml com/this/that and put under lib folder eg /lib other.jars your.jar thanks, Amila. > javax.persistence.PersistenceException: No Persistence provider for > EntityManager named xyzzy > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56) > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34) > at > com.papajohns.snapshot.webservice.SurveySubmissionWebService.getSurvey(SurveySubmissionWebService.java:63) > > (etc) > > Or does that error mean something else? > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
RE: aar and hibernate
check your ant or maven scripts to find out which container you're deploying to tomcat is a webapp container and axis as a war(WebApplicationArchive) will deploy there with minimal configuration..on the other hand if you have EJBs, persistence or timed services you're going to need Appserver such as Glassfish..in which case you'll need to use Glassfish admin interface to deploy your axis2 war Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: tony.en...@insightbb.com > To: axis-user@ws.apache.org > Subject: Re: aar and hibernate > Date: Fri, 25 Sep 2009 19:12:51 -0400 > > > > On Sep 25, 2009, at 6:30 PM, robert lazarski wrote: > > > On Fri, Sep 25, 2009 at 7:17 PM, Tony Ennis > > wrote: > >> I'm at home now, so no checking for me. Thank God. > >> > >> Am I sure? As sure as I can be. Previously the aar had "com" at > >> the root. > >> I moved the entire com tree to WEB-INF/classes/... as per your > >> suggestion. > >> I ASSume WEB-INF should be at the root of the aar... > >> > >> Using the latest and greatest Axis2 and Jetspeed. > >> > > > > When you say " I ASSume WEB-INF should be at the root of the aar" , > > that doesn't seem right. The aar goes in your WEB-INF/services , and > > the format of the aar should be just: > > > > ./myExample.aar > > ./META-INF > > ./META-INF/MANIFEST.MF > > ./META-INF/services.xml > > > > I have no idea about Axis2 compatability with Jetspeed - I'd try > > tomcat 6 first to see if that's the issue. > > > > - R > > > I'm just talking about the structure of the aar file. > > If I understand the documentation correctly, the aar file should have > a META-INF folder inside, at the root. There should be a services.xml > file in the META-INF folder. Also at the root is a lib folder. > Finally, I had my classes at the root under 'com.' > > All that was working fine before I tried getting a database connection. > > I deploy the aar file to axis2/WEB-INF/services and didn't change any > other files. Everything the webapp needs is in the aar file. > > Jetspeed uses tomcat under the hood I believe. > > > _ Bing™ brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1
Re: aar and hibernate
On Sep 25, 2009, at 6:30 PM, robert lazarski wrote: On Fri, Sep 25, 2009 at 7:17 PM, Tony Ennis wrote: I'm at home now, so no checking for me. Thank God. Am I sure? As sure as I can be. Previously the aar had "com" at the root. I moved the entire com tree to WEB-INF/classes/... as per your suggestion. I ASSume WEB-INF should be at the root of the aar... Using the latest and greatest Axis2 and Jetspeed. When you say " I ASSume WEB-INF should be at the root of the aar" , that doesn't seem right. The aar goes in your WEB-INF/services , and the format of the aar should be just: ./myExample.aar ./META-INF ./META-INF/MANIFEST.MF ./META-INF/services.xml I have no idea about Axis2 compatability with Jetspeed - I'd try tomcat 6 first to see if that's the issue. - R I'm just talking about the structure of the aar file. If I understand the documentation correctly, the aar file should have a META-INF folder inside, at the root. There should be a services.xml file in the META-INF folder. Also at the root is a lib folder. Finally, I had my classes at the root under 'com.' All that was working fine before I tried getting a database connection. I deploy the aar file to axis2/WEB-INF/services and didn't change any other files. Everything the webapp needs is in the aar file. Jetspeed uses tomcat under the hood I believe.
Re: aar and hibernate
On Fri, Sep 25, 2009 at 7:17 PM, Tony Ennis wrote: > I'm at home now, so no checking for me. Thank God. > > Am I sure? As sure as I can be. Previously the aar had "com" at the root. > I moved the entire com tree to WEB-INF/classes/... as per your suggestion. > I ASSume WEB-INF should be at the root of the aar... > > Using the latest and greatest Axis2 and Jetspeed. > When you say " I ASSume WEB-INF should be at the root of the aar" , that doesn't seem right. The aar goes in your WEB-INF/services , and the format of the aar should be just: ./myExample.aar ./META-INF ./META-INF/MANIFEST.MF ./META-INF/services.xml I have no idea about Axis2 compatability with Jetspeed - I'd try tomcat 6 first to see if that's the issue. - R
Re: aar and hibernate
I'm at home now, so no checking for me. Thank God. Am I sure? As sure as I can be. Previously the aar had "com" at the root. I moved the entire com tree to WEB-INF/classes/... as per your suggestion. I ASSume WEB-INF should be at the root of the aar... Using the latest and greatest Axis2 and Jetspeed. On Sep 25, 2009, at 6:08 PM, robert lazarski wrote: On Fri, Sep 25, 2009 at 6:30 PM, ANTHONY ENNIS > wrote: I moved my classes under WEB-INF/classes and the application no longer deploys. I get org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of The following error occurred during schema generation: java.lang.ClassNotFoundException: Class Not found : com.company.snapshot.webservice.MyWebService Are you 100% sure that class "com.company.snapshot.webservice.MyWebService" is under WEB-INF/classes ? Try logging this in your class to make sure - make it static and reference it if need be so that its loaded and logs: this.getClass().getProtectionDomain().getCodeSource().getLocation()); You could try putting _only_ your MyWebService class in the aar, though that shouldn't be needed. What version of axis2 and servlet container are you using ? - R
Re: aar and hibernate
On Fri, Sep 25, 2009 at 6:30 PM, ANTHONY ENNIS wrote: > I moved my classes under WEB-INF/classes and the application no longer > deploys. I get > > org.apache.axis2.deployment.DeploymentException: Processing Operations > Modules with an error of The following error occurred during schema > generation: java.lang.ClassNotFoundException: Class Not found : > com.company.snapshot.webservice.MyWebService > Are you 100% sure that class "com.company.snapshot.webservice.MyWebService" is under WEB-INF/classes ? Try logging this in your class to make sure - make it static and reference it if need be so that its loaded and logs: this.getClass().getProtectionDomain().getCodeSource().getLocation()); You could try putting _only_ your MyWebService class in the aar, though that shouldn't be needed. What version of axis2 and servlet container are you using ? - R
Re: aar and hibernate
I moved my classes under WEB-INF/classes and the application no longer deploys. I get org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of The following error occurred during schema generation: java.lang.ClassNotFoundException: Class Not found : com.company.snapshot.webservice.MyWebService - Original Message - From: robert lazarski Date: Friday, September 25, 2009 17:07 Subject: Re: aar and hibernate To: axis-user@ws.apache.org > On Fri, Sep 25, 2009 at 5:41 PM, ANTHONY ENNIS > wrote: > > I have a web service that performs a simple database lookup. > Unfortunately,> Persistence.createEntityManagerFactory('xyzzy') > fails in all cases. > > > > My aar looks like: > > /com > > (class files in package format eg com/this/that/x.class) > > /META-INF > > services.xml > > /lib > > numerous jars > > > > I don't know where to put the persistence.xml file. I have > tried putting it > > everywhere. I keep getting the following error: > > > > javax.persistence.PersistenceException: No Persistence > provider for > > EntityManager named xyzzy > > at > > > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)> > at > > > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)> > at > > > com.papajohns.snapshot.webservice.SurveySubmissionWebService.getSurvey(SurveySubmissionWebService.java:63)> > > (etc) > > > > Or does that error mean something else? > > > > The only thing really required in your aar is a services.xml . Put > your classes under WEB-INF/classes and you should have no problems. > Hibernate uses the TCCL (Thread context classloader) so you > can't load > hibernate there without some tricks - for example what the spring > support docs show for hibernate. > > - R >
Re: aar and hibernate
On Fri, Sep 25, 2009 at 5:41 PM, ANTHONY ENNIS wrote: > I have a web service that performs a simple database lookup. Unfortunately, > Persistence.createEntityManagerFactory('xyzzy') fails in all cases. > > My aar looks like: > /com > (class files in package format eg com/this/that/x.class) > /META-INF > services.xml > /lib > numerous jars > > I don't know where to put the persistence.xml file. I have tried putting it > everywhere. I keep getting the following error: > > javax.persistence.PersistenceException: No Persistence provider for > EntityManager named xyzzy > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56) > at > javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34) > at > com.papajohns.snapshot.webservice.SurveySubmissionWebService.getSurvey(SurveySubmissionWebService.java:63) > > (etc) > > Or does that error mean something else? > The only thing really required in your aar is a services.xml . Put your classes under WEB-INF/classes and you should have no problems. Hibernate uses the TCCL (Thread context classloader) so you can't load hibernate there without some tricks - for example what the spring support docs show for hibernate. - R