geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viet Hung Nguyen <vnguye...@uky.edu>
Subject Re: DataSource, JNDI and EJB module ...
Date Mon, 16 Jul 2007 18:10:38 GMT
DevIn wrote:
> Hi there,
>
> I actually work on a EJB3 module which must access à Connection Pool on a
> Geronimo 2 server.
> I've successfully created the data source (BigDB) in the geronimo console
> but my EJB
> Deployment is unsucessfull with the folowing error :
>
> 19:53:39,207 ERROR [DirectoryHotDeployer] Unable to deploy: Unable to
> resolve reference "NonJtaDataSourceWrapper" in gbean
> default/testEJB/11846084165
> 04/jar?EJBModule=default/testEJB/1184608416504/jar,J2EEApplication=null,PersistenceUnitModule=ejb.jar,j2eeType=PersistenceUnit,name=game
> to a gbean ma
> tching the pattern
> [?name=BigDB#org.apache.geronimo.connector.outbound.ConnectionFactorySource]due
> to: No matches for referencePatterns: [?name=BigDB# ....
>
> My persistence.xml is as below :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>     http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
> version="1.0">
> 	<persistence-unit name="game" transaction-type="RESOURCE_LOCAL">
> 	
> <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
	
> 			<!--  jta-data-source>BigDB</jta-data-source-->
> 			<non-jta-data-source>jdbc/BigDB</non-jta-data-source>
> 	</persistence-unit>
> </persistence>
>
>
> The problem seems to be in the JNDI name of the data source, so I've tried
> in a separated project to establish a simple connection with the JNDI
> provider of my geronimo server. My code is :
>
> Properties properties = new Properties();
>             properties.put("java.naming.factory.initial",
> "org.openejb.client.RemoteInitialContextFactory");
>             properties.put("java.naming.provider.url", "127.0.0.1:4201");
>            // properties.put("java.naming.security.principal", "myuser");
>            // properties.put("java.naming.security.credentials", "mypass");
>             Context ic = new InitialContext(properties);
>             System.out.println(ic.getNameInNamespace());
>             //Object obj = ic.lookup("jdbc/BigDB");
>
> and throws the exception :
>
> javax.naming.AuthenticationException: Cannot open object output stream to
> server: ; nested exception is: 
> 	java.net.SocketException: Software caused connection abort: socket write
> error
> 	at org.openejb.client.JNDIContext.authenticate(JNDIContext.java:196)
> 	at org.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:181)
> 	at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
> 	at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
> 	at javax.naming.InitialContext.init(Unknown Source)
> 	at javax.naming.InitialContext.<init>(Unknown Source)
> 	at com.big.util.Test.main(Test.java:24)
>
> The JNDI provider doen't seem to be OK ....
>
> Any help or idea will be welcome. 
>
> Thanks.
>   
Have you tried to use ic.lookup("java:comp/env/jdbc/BigDB");?

Also, for your persistence.xml, did you specify a dependency on that db 
pool that you made in Geornimo in the openejb-jar.xml?

I also think that you need both jta-data-source and non-jta-data-source.

Hope this helps,
Viet

Mime
View raw message