geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WEIPING (BILL) LUO" <luow...@hotmail.com>
Subject RE: Persistence unit deploy error in 2.1 but works in 2.02
Date Mon, 31 Mar 2008 21:24:17 GMT

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.doDeploy(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.
>>
> 

Mime
View raw message