geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: jndi properties for datasource
Date Wed, 21 Aug 2013 05:27:15 GMT
Hi,

This is all correct but I'm not sure it answers the original question.  Geronimo datasources/database
pools are designed to only be accessed in the same VM as they are deployed in.  You cannot
look up a database pool deployed in geronimo from another VM no matter how you configure the
remote jndi.  One reason for this is that we don't have a distributed transaction manager
and certainly couldn't come up with a correctly configured transaction manager in the remote
vm through a jndi lookup.

If you really want a "standalone" application to be able to use a geronimo datasource consider
deploying the app in the app client container and deploying the datasource there.

thanks
david jencks

On Aug 20, 2013, at 8:42 PM, Zhi Xie <daxiezhi@gmail.com> wrote:

> You can create a datasource by a deployment plan. For example,
> 
> Deployment Plan:
> <?xml version="1.0" encoding="UTF-8"?>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>     <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
>         <dep:moduleId>
>             <dep:groupId>console.dbpool</dep:groupId>
>             <dep:artifactId>Test</dep:artifactId>
>             <dep:version>1.0</dep:version>
>             <dep:type>car</dep:type>
>         </dep:moduleId>
>         <dep:dependencies>
>             <dep:dependency>
>                 <dep:groupId>mysql</dep:groupId>
>                 <dep:artifactId>mysql-connector-java</dep:artifactId>
>                 <dep:version>3.1.14</dep:version>
>                 <dep:type>jar</dep:type>
>             </dep:dependency>
>         </dep:dependencies>
>     </dep:environment>
>     <resourceadapter>
>         <outbound-resourceadapter>
>             <connection-definition>
>                 <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
>                 <connectiondefinition-instance>
>                     <name>Test</name>
>                     <config-property-setting name="DatabaseName">TestDB</config-property-setting>
>                     <config-property-setting name="UserName">admin</config-property-setting>
>                     <config-property-setting name="Password">admin</config-property-setting>
>                     <connectionmanager>
>                         <local-transaction/>
>                         <single-pool>
>                             <max-size>10</max-size>
>                             <min-size>0</min-size>
>                             <match-one/>
>                         </single-pool>
>                     </connectionmanager>
>                 </connectiondefinition-instance>
>             </connection-definition>
>         </outbound-resourceadapter>
>     </resourceadapter>
> </connector>
> 
> Deploy Command:
> To deploy a database pool from the command line using this plan,copy and paste it to
a file (say, plan-file.xml) and save it. Then run a command like:
> cd GERONIMO_HOME
> java -jar bin/deployer.jar deploy plan-file.xml \
>         \repository\org\tranql\tranql-connector-mysql-local\1.6\tranql-connector-mysql-local-1.6.rar
> Add to EAR:
> Instead of deploying as a top-level database pool, you can deploy this pool as part of
an EAR. To add a database pool to an EAR using this plan:
> Copy and paste the plan to a file
> Save the plan file to the top level of your EAR
> Copy the RAR file from GERONIMO_HOME/\repository\org\tranql\tranql-connector-mysql-local\1.6\tranql-connector-mysql-local-1.6.rar
to the top level of your EAR
> Create a META-INF/geronimo-application.xml file in your EAR that has a module entry like
this (substituting the correct RAR file name and plan file name)
> <application
>    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1">
>   <environment>
>     <moduleId>
>       <artifactId>MyApplication</artifactId>
>     </moduleId>
>   </environment>
>   <module>
>     <connector>rar-file-name.rar</connector>
>     <alt-dd>plan-file-name.xml</alt-dd>
>   </module>
> </application>
> 
> You can click "Show Plan" button to refer it when you create database pool.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 2013/8/19 kiranreddykasa <kirankumarrk@fss.co.in>
> Hi
> 
> I have created a datasource in geronimo server.
> I'm able to connect it via admin console.
> 
> Can anyone let me  know how to connect to this datasource by external
> standalone application via jndi.
> 
> Specifically i'm not sure about these following values :
> 
> java.naming.factory.initial=TO_BE_CHANGED_BY_USER
> java.naming.factory.object=TO_BE_CHANGED_BY_USER
> java.naming.factory.state=TO_BE_CHANGED_BY_USER
> java.naming.factory.control=TO_BE_CHANGED_BY_USER
> java.naming.factory.url.pkgs=TO_BE_CHANGED_BY_USER
> java.naming.provider.url=TO_BE_CHANGED_BY_USER
> java.naming.dns.url=TO_BE_CHANGED_BY_USER
> 
> And also which jar should be included for this to work ??
> 
> 
> 
> --
> View this message in context: http://apache-geronimo.328035.n3.nabble.com/jndi-properties-for-datasource-tp3987125.html
> Sent from the Users mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> Best Regards
> Gary


Mime
View raw message