geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bongosdude <bongosd...@gmail.com>
Subject Re: Jetty/Tomcat plugin build failed with persistence.xml
Date Mon, 19 Jan 2009 21:57:31 GMT

David,

I put it the file persistence.xml in
${EJB_PROJECT_HOME}/src/resources/META-INF/

Should I put it under tomcat/jetty tomcat?

-B


djencks wrote:
> 
> 
> On Jan 18, 2009, at 6:23 PM, bongosdude wrote:
> 
>>
>> David,
>>
>> my database name is my_users. and I have two dbpool defined to point  
>> to the
>> same database my_users. One is XA and other is non XA.
> 
> thats fine.
> 
> I forgot to mention in my post on the other thread that you need to be  
> sure to use the correct tranql msql xa wrapper in your maven project.   
> Note that it shows up in two places in your pom.xml -- as a dependency  
> and as the module being deployed in the car-maven-plugin.
> 
> You still haven't said where you put your persistence.xml but it looks  
> from an earlier post that deployment is still not able to find it.
> 
> thanks
> david jencks
> 
>>
>>
>> Thanks
>>
>>
>> bongosdude wrote:
>>>
>>>
>>> David,
>>>
>>> Here is my connector definition in my datasource plan.xml
>>>
>>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 
>>> ">
>>>    <resourceadapter>
>>>        <outbound-resourceadapter>
>>>            <connection-definition>
>>>
>>> <connectionfactory-interface>javax.sql.DataSource</ 
>>> connectionfactory-interface>
>>>                <connectiondefinition-instance>
>>>                    <name>my_users</name>
>>>                    <config-property-setting
>>> name="DatabaseName">my_users</config-property-setting>
>>>                    <connectionmanager>
>>>                        <xa-transaction>
>>>                            <transaction-caching/>
>>>                        </xa-transaction>
>>>                        <single-pool>
>>>                            <max-size>10</max-size>
>>>                            <min-size>0</min-size>
>>>                            <select-one-assume-match/>
>>>                        </single-pool>
>>>                    </connectionmanager>
>>>                </connectiondefinition-instance>
>>>                <connectiondefinition-instance>
>>>                    <name>my_users_notx</name>
>>>                    <config-property-setting
>>> name="DatabaseName">my_users</config-property-setting>
>>>                    <connectionmanager>
>>>                        <no-transaction/>
>>>                        <single-pool>
>>>                            <max-size>10</max-size>
>>>                            <min-size>0</min-size>
>>>                            <select-one-assume-match/>
>>>                        </single-pool>
>>>                    </connectionmanager>
>>>                </connectiondefinition-instance>
>>>            </connection-definition>
>>>        </outbound-resourceadapter>
>>>    </resourceadapter>
>>> </connector>
>>>
>>> I have configured two database pool name: my_users and  
>>> my_users_no_tx (the
>>> database driver is mysql. one is XA and other is NONXA). I am now
>>> encountering the following:
>>>
>>> [ERROR] BUILD ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] You are requesting xa transaction support for a connector that
>>> supports only local transactions: named: my_users
>>>
>>> What is wrong with my plan.xml
>>>
>>>
>>>
>>>
>>> bongosdude wrote:
>>>>
>>>>
>>>>
>>>> David,
>>>>
>>>> I figured out part of my problems by looking at Bank/Caculator  
>>>> samples.
>>>> Bank tomcat/jetty plugins depend on the sample sample-datasource
>>>> (sample-datasource.car). So it gave me how to create plan.xml for my
>>>> datasource connector.  The build was now successful but with  
>>>> exception as
>>>> below:
>>>>
>>>> Can you show me how can I build gbean for my persistence unit that I
>>>> defined in persistence.xml. I could not find out how it can be  
>>>> done with
>>>> the sample bank/calculator.
>>>>
>>>> INFO] Started deployer:
>>>> org.apache.geronimo.configs/persistence-jpa10-deployer/2.1.2/car
>>>> org.apache.geronimo.common.DeploymentException: Could not resolve
>>>> reference at deploy time for query
>>>> ?name=persistence/ 
>>>> CallingCardUsersUnit 
>>>> #org.apache.geronimo.persistence.PersistenceUnitGBean.
>>>> No GBeans found.
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .persistence 
>>>> .builder 
>>>> .PersistenceContextRefBuilder 
>>>> .checkForGBean(PersistenceContextRefBuilder.java:205)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .persistence 
>>>> .builder 
>>>> .PersistenceContextRefBuilder 
>>>> .buildNaming(PersistenceContextRefBuilder.java:119)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .j2ee 
>>>> .deployment 
>>>> .NamingBuilderCollection.buildNaming(NamingBuilderCollection.java: 
>>>> 53)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .openejb 
>>>> .deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java: 
>>>> 321)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .openejb 
>>>> .deployment 
>>>> .EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:286)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .openejb 
>>>> .deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
>>>> 	at
>>>> org 
>>>> .apache 
>>>> .geronimo 
>>>> .j2ee 
>>>> .deployment 
>>>> .EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>>>> 	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java: 
>>>> 254)
>>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>
>>>>
>>>>
>>>>
>>>> djencks wrote:
>>>>>
>>>>> Where exactly is the persistence.xml in your ear?
>>>>>
>>>>> BTW if you use auto-create tables or openjpa "sequences" you almost
>>>>> certainly need a non-jta-datasource as well, and it should really  
>>>>> not
>>>>> have transactions enabled.
>>>>>
>>>>> thanks
>>>>> david jencks
>>>>>
>>>>> On Jan 18, 2009, at 2:52 PM, bongosdude wrote:
>>>>>
>>>>>>
>>>>>> in my EJB module, I have created a persistence.xml as below:
>>>>>> <persistence-unit name="CallingCardUsersUnit"	transaction- 
>>>>>> type="JTA">
>>>>>> 		<description>CallingCardUserJPA</description>
>>>>>> 	
>>>>>> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</
>>>>>> provider>
>>>>>> 		<jta-data-source>callingcard_users</jta-data-source>
>>>>>> 		<class>com.mycom.services.svc.model.entity.users.User</class>
>>>>>> 		<class>com.mycom.services.xvc.model.entity.users.UserRole</

>>>>>> class>
>>>>>> 		<properties>
>>>>>> 			<property name="openjpa.log" value="SQL=TRACE" />
>>>>>> 		</properties>
>>>>>> 	</persistence-unit>
>>>>>> </persistence>
>>>>>>
>>>>>> When I build my project using maven2 (i.e. mvn clean install), all
>>>>>> build
>>>>>> succeeded except when it builds jetty/tomcat plugin with the  
>>>>>> following
>>>>>> error:
>>>>>>
>>>>>> How can I setup jetty/tomcat plugin plan.xml with a persistence 

>>>>>> unit
>>>>>> that I
>>>>>> defined in persistence.xml?
>>>>>>
>>>>>> Please help.
>>>>>>
>>>>>> -B
>>>>>>
>>>>>> org.apache.geronimo.common.DeploymentException: Could not resolve
>>>>>> reference
>>>>>> at deploy time for query
>>>>>> ?name=persistence/
>>>>>> CallingCardUsersUnit
>>>>>> #org.apache.geronimo.persistence.PersistenceUnitGBean.
>>>>>> No GBeans found.
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .persistence
>>>>>> .builder
>>>>>> .PersistenceContextRefBuilder
>>>>>> .checkForGBean(PersistenceContextRefBuilder.java:205)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .persistence
>>>>>> .builder
>>>>>> .PersistenceContextRefBuilder
>>>>>> .buildNaming(PersistenceContextRefBuilder.java:119)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .j2ee
>>>>>> .deployment
>>>>>> .NamingBuilderCollection 
>>>>>> .buildNaming(NamingBuilderCollection.java:53)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .openejb
>>>>>> .deployment 
>>>>>> .EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:321)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .openejb
>>>>>> .deployment 
>>>>>> .EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:
>>>>>> 286)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .openejb 
>>>>>> .deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:
>>>>>> 764)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .j2ee
>>>>>> .deployment
>>>>>> .EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>>>>>> 	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:

>>>>>> 254)
>>>>>> 	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:585)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo
>>>>>> .gbean
>>>>>> .runtime 
>>>>>> .ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:
>>>>>> 34)
>>>>>> 	at
>>>>>> org
>>>>>> .apache
>>>>>> .geronimo 
>>>>>> .gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>>>>>>
>>>>>>
>>>>>> -----
>>>>>> B Amigo:super:
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Jetty-Tomcat-plugin-build-failed-with-persistence.xml-tp21534279s134p21534279.html
>>>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>>>> Nabble.com.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> -----
>> B Amigo:super:
>> -- 
>> View this message in context:
>> http://www.nabble.com/Jetty-Tomcat-plugin-build-failed-with-persistence.xml-tp21534279s134p21535950.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 


-----
B Amigo:super:
-- 
View this message in context: http://www.nabble.com/Jetty-Tomcat-plugin-build-failed-with-persistence.xml-tp21534279s134p21552479.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message