geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cumbers <rich.cumb...@gmail.com>
Subject Re: Geronimo with openjpa (and DataSource lookups)
Date Thu, 26 Nov 2009 22:07:58 GMT

Hi David,
Thanks for responding so quickly. If I follow you correctly I should have a
geronimo-web.xml that looks like the following:

<?xml version="1.0" encoding="UTF-8"?>
<web:web-app
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
			
xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
			 xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
			 xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
			 xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
			 xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
			 xmlns:pers="http://java.sun.com/xml/ns/persistence"
			 xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
			 xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
			 xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment>
        <dep:moduleId>
            <dep:groupId>MyWebApp</dep:groupId>
            <dep:artifactId>rest</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>car</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>console.dbpool</dep:groupId>
                <dep:artifactId>jdbc_db</dep:artifactId>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <web:context-root>/wmqfte</web:context-root>
</web:web-app>

This is what I am currently using (and have been for a while) and still no
success. If I alter the artifact name, I get a failure to deploy, so I know
these values are correct.

Cheers

Rich


djencks wrote:
> 
> The datasource module needs to be listed as a dependency of the war  
> module if they are deployed separately.  Single-valued component  
> search in geronimo follows the directed acyclic graph of dependencies  
> so you can deploy lots of datasources named "jdbc/db" in different  
> modules yet still get the one you want in your app by specifying the  
> module with the right one as a dependency.
> 
> thanks
> david jencks
> 
> On Nov 26, 2009, at 9:44 AM, cumbers wrote:
> 
>>
>> I am looking for someone to put me out of my geronimo/openpa misery.
>>
>> I have an application that I can deploy to Geronimo (2.1.1.3) that  
>> uses
>> openjpa where the properties inside the persistence.xml are explicitly
>> defined like so:
>>
>> <properties>
>>        <property name="openjpa.ConnectionDriverName"
>> value="oracle.jdbc.driver.OracleDriver"></property>
>>        <property name="openjpa.ConnectionURL"
>> value="jdbc:oracle:thin:@localhost:1521:DB"></property>
>>        <property name="openjpa.ConnectionUserName"
>> value="dbuser"></property>
>>        <property name="openjpa.ConnectionPassword"
>> value="passw0rd"></property>
>> </properties>
>>
>> However this app is going to be deployed by lots of users, and  
>> ideally I
>> would like to ship a war file, and direct users to create a JNDI  
>> object that
>> they define and then openjpa uses this.
>>
>> Simply defining the JNDI datasource connection within Geronimo, and  
>> using
>> the reference in the <jta-data-source>jdbc/db</jta-data-source> or
>> <non-jta-data-source>jdbc/db</non-jta-data-source> does not appear  
>> to work,
>> and I get the following error message when I try and create an
>> EntityManager:
>>
>> "<openjpa-1.2.1-r2180:4612 fatal user error>
>> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
>> DataSource class name must be specified in the ConnectionDriverName
>> property."
>>
>> After 3 days on google, I found this page:
>> http://cwiki.apache.org/GMOxDOC21/datasource-connectionfactory-mdb-and-jpa.html
>> which suggests that:
>>
>> "Although many other servers use jndi to define the meaning of the
>> jta-data-source and non-jta-data-source geronimo does not. These are  
>> not
>> jndi names in any way but must match the name specified in the  
>> connector
>> plan."
>>
>> OK so using the jndi object name directly does not seem to be  
>> supported.
>> However the name in the resourceadapter of the plan.xml IS "jdbc/db"  
>> and so
>> I think this should work. Here is the relevant snippet from my  
>> plan.xml as
>> created when I define a JDBC datasource using Geronimo.
>>
>>    <resourceadapter>
>>        <outbound-resourceadapter>
>>            <connection-definition>
>>
>> <connectionfactory-interface>javax.sql.DataSource</connectionfactory- 
>> interface>
>>                <connectiondefinition-instance>
>>                    <name>jdbc/db</name>
>>
>> I have run out of ideas on how I can make this work, and would be  
>> massively
>> appreciative if anyone can shed some light on why this is not  
>> working. If
>> you think you need more information please let me know!
>>
>> Cheers
>>
>> Rich
>> -- 
>> View this message in context:
>> http://old.nabble.com/Geronimo-with-openjpa-%28and-DataSource-lookups%29-tp26532836s134p26532836.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Geronimo-with-openjpa-%28and-DataSource-lookups%29-tp26532836s134p26535512.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message