Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 63319 invoked from network); 1 Apr 2008 13:32:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Apr 2008 13:32:55 -0000 Received: (qmail 74817 invoked by uid 500); 1 Apr 2008 13:32:48 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 74795 invoked by uid 500); 1 Apr 2008 13:32:48 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 74784 invoked by uid 99); 1 Apr 2008 13:32:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 06:32:48 -0700 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 13:31:57 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Jggb2-00025F-W1 for user@geronimo.apache.org; Tue, 01 Apr 2008 06:32:16 -0700 Message-ID: <16418427.post@talk.nabble.com> Date: Tue, 1 Apr 2008 06:32:16 -0700 (PDT) From: luoluo To: user@geronimo.apache.org Subject: Re: Persistence unit deploy error in 2.1 but works in 2.02 In-Reply-To: <7D4CEA75-A4DC-4E48-9D54-0F63261E99E2@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: luowp88@hotmail.com References: <16396504.post@talk.nabble.com> <5B6A1E91-853A-4C20-9715-A90251BB4CA3@yahoo.com> <7D4CEA75-A4DC-4E48-9D54-0F63261E99E2@yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org The data source is created by wizard. The dependency is created in Geronimo plan. Here is the plan: geronimo-web.xml inpulse8 CMWS 1.0.0 war console.dbpool inpulse8_cmws org.hibernate /CMWS jdbc/cmwsDS inpulse8_cmws in web.xml, the data source is declared: jdbc/cmwsDS javax.sql.DataSource Container Shareable Now I changed the persistence.xml to: org.hibernate.ejb.HibernatePersistence inpulse8_cmws inpulse8_cmws It could be deployed, but the entity manager can not be initialized because of exceptions: WARNING: Found unrecognized persistence provider "org.hibernate.ejb.HibernatePersistence" in place of OpenJPA provider. This provider's properties will not be used. javax.persistence.PersistenceException: Provider error. Provider: org.hibernate.ejb.HibernatePersistence at javax.persistence.Persistence.createFactory(Persistence.java:176) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66) at com.ek3.inpulse.cmws.persistence.JpaUtil.(JpaUtil.java:39) at com.ek3.inpulse.cmws.domain.sessionproxy.SessionInvocationHandler.invoke(SessionInvocationHandler.java:37) at $Proxy74.listConfigedClients(Unknown Source) at com.ek3.inpulse.cmws.serviceinterface.ProcessConfigurationServiceImpl.listConfigedClients(ProcessConfigurationServiceImpl.java:459) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:107) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:77) at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:100) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:63) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) at org.apache.geronimo.cxf.GeronimoDestination.invoke(GeronimoDestination.java:115) at org.apache.geronimo.cxf.CXFWebServiceContainer.processPOST(CXFWebServiceContainer.java:107) at org.apache.geronimo.cxf.CXFWebServiceContainer.invoke(CXFWebServiceContainer.java:83) at org.apache.geronimo.webservices.WebServiceContainerInvoker.service(WebServiceContainerInvoker.java:84) at org.apache.geronimo.webservices.POJOWebServiceServlet.service(POJOWebServiceServlet.java:79) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56) at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:396) at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ContentManagementWorkflow] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createFactory(Persistence.java:172) ... 40 more Caused by: org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) ... 42 more Caused by: javax.naming.NameNotFoundException: inpulse8_cmws at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:169) at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:603) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) I think because hibernate is not loaded into container (I packaged it into my war file). It can not find the data_source without JNDI entry. Is there any way to embedded hibernate into Geronimo? I use some of hibernate specific annotations to extend standard JPA so hibernate is required here. Thanks, Bill djencks wrote: > > This is progress :-) > > I assume your datasource plan has something like: > > > inpulse_cmws > > In this case you need to do two things: > > - in persistence.xml, include > inpulse_cmws > > - in the geronimo plan for your web app, include a dependency on the > module defining the datasource. > > I think that you already have the second set up since that would be > needed for the jndi lookup to work in g 2.0.2 > > If this doesn't help please include more of your plans. > > thanks > david jencks > > > On Mar 31, 2008, at 2:24 PM, WEIPING (BILL) LUO wrote: > >> >> Thanks! >> >> I am not sure which name should I use. So I tried use the db-pool >> name and jdbc/cmwsDS. Geronimo can not deploy it and throw out >> Unable to resolve reference "JtaDataSourceWrapper" >> in gbean inpulse8/ContentManagementWorkflow/1.0.0/war? >> J2EEApplication=null,PersistenceUnitModule=WEB-INF/ >> classes/,WebModule=inpulse8/ContentManagementWorkflow/1.0.0/ >> war,j2eeType=PersistenceUnit,name=ContentManagementWorkflow >> to a gbean matching the pattern [?name=java:/ >> inpulse_cmws#org.apache.geronimo.naming.ResourceSource] >> due to: No matches for referencePatterns: [?name=java:/ >> inpulse_cmws#org.apache.geronimo.naming.ResourceSource] >> org.apache.geronimo.common.DeploymentException: Unable to resolve >> reference "JtaDataSourceWrapper" >> in gbean inpulse8/ContentManagementWorkflow/1.0.0/war? >> J2EEApplication=null,PersistenceUnitModule=WEB-INF/ >> classes/,WebModule=inpulse8/ContentManagementWorkflow/1.0.0/ >> war,j2eeType=PersistenceUnit,name=ContentManagementWorkflow >> to a gbean matching the pattern [?name=java:/ >> inpulse_cmws#org.apache.geronimo.naming.ResourceSource] >> due to: No matches for referencePatterns: [?name=java:/ >> inpulse_cmws#org.apache.geronimo.naming.ResourceSource] >> at >> org.apache.geronimo.deployment.DeploymentContext.getConfigurationData( >> DeploymentContext.java:516) >> at org.apache.geronimo.deployment.Deployer.install(Deployer.java:319) >> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256) >> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke >> (NativeMethodAccessorImpl.java:39) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke >> (DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke >> (ReflectionMethodInvoker.java:34) >> at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke >> (GBeanOperation.java:124) >> at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke >> (GBeanInstance.java:867) >> at org.apache.geronimo.kernel.basic.BasicKernel.invoke >> (BasicKernel.java:239) >> at >> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDe >> ploy(AbstractDeployCommand.java:116) >> at >> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run >> (DistributeCommand.java:61) >> at java.lang.Thread.run(Thread.java:619) >> >> So is there any document to discuss about how to set it without JNDI? >> >> >> Regards, >> >> Bill >> ---------------------------------------- >>> From: david_jencks@yahoo.com >>> Subject: Re: Persistence unit deploy error in 2.1 but works in 2.02 >>> Date: Mon, 31 Mar 2008 13:37:58 -0700 >>> To: user@geronimo.apache.org >>> >>> It's generally considered more polite to continue the original thread >>> you start, answering requests for more information, rather than to >>> appear to ignore responses and start new threads on the same topic. >>> In this case I realize you may be having problems with your mail >>> provider. >>> On Mar 31, 2008, at 1:25 PM, luoluo wrote: >>> >>>> >>>> Hi, >>>> >>>> I have an application using JPA with hibernate. I changed the >>>> persistence >>>> provider to hibernate and trying to using db-pools. It works >>>> perfectly fine >>>> in Geronimo 2.02. But when I tried to deploy it to Geronimo 2.1. It >>>> throw >>>> out an exception with can not find JNDI entry for the data source >>>> when >>>> Geronimo try to start the application. >>>> >>>> in persistence.xml, I use below to refer the data source: >>>> >>>> >>>> org.hibernate.ejb.HibernatePersistence >>>> >>>> > value="class" /> >>>> >>>> > value="java:/comp/env/jdbc/CmwsDS" /> >>>> ... >>>> >>>> The data source is created and defined in web.xml too. >>>> >>>> I found the different between 2.0.2 and 2.1. In 2.0.2, the entity >>>> manager >>>> was initialized when first time db-access. At that time, the data >>>> source is >>>> already be registered in JNDI as /comp/env/jdbc/...DS. >>>> >>>> In 2.1, Geronimo try to initialize the entity manager when starting >>>> the >>>> application. The sequence is wrong. It tried to find the data >>>> source before >>>> the reference in Web.xml been registered. So the JNDI entry not find >>>> exception was thrown out. >>>> >>>> Is that a bug of Geronimo 2.1? Is there any way to work around this >>>> issue in >>>> 2.1? >>> >>> I recommend you use the jpa standard way of specifying datasources >>> for jpa (using the jta-datasource and non-jta-datasource elements) >>> rather than this hibernate specific way using a hibernate specific >>> property. Since in geronimo the jpa standard way does not rely on >>> jndi, you will not have this problem. >>> >>> Can you provide a stack trace of the problem you are seeing? That >>> would help figure out what is causing the earlier initialization. >>> >>> thanks >>> david jencks >>> >>>> >>>> Thanks! >>>> >>>> Bill >>>> >>>> -- >>>> View this message in context: http://www.nabble.com/Persistence- >>>> unit-deploy-error-in-2.1-but-works-in-2.02- >>>> tp16396504s134p16396504.html >>>> Sent from the Apache Geronimo - Users mailing list archive at >>>> Nabble.com. >>>> >>> > > > -- View this message in context: http://www.nabble.com/Persistence-unit-deploy-error-in-2.1-but-works-in-2.02-tp16396504s134p16418427.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.