geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: unknown or ambigous connectionFactory
Date Thu, 18 Aug 2005 21:19:43 GMT
	What do you see if you run:

java -jar bin/deployer.jar list-modules --started

	In particular, do you see the your data source module listed?  If 
not, you may need to run:

java -jar bin/deployer.jar start your-module-configId

	(you can also run the list-modules command without --started to 
see everything in the server whether started or not)

	You might also set the parentId in your geronimo-web.xml to be the 
configId of the data source module, which will force it to always load the 
data source before loading your web app.

	Also, in your code, your lookup should use 
java:comp/env/jdbc/MysqlDataSource  (in your e-mail below you left out the
jdbc/ part though you had it in the deployment descriptors)

Aaron

On Thu, 18 Aug 2005, I?igo wrote:
> Hello everybody:
>     I have deployed a MySQL pool connection in Geronimo, and now I am 
> trying to make some code to take some data from the database in an 
> application, but when I deploy the application I get this message:
> 
> C:\geronimo-1.0-M4>java -jar bin\deployer.jar --user system --password 
> manager deploy ..\EjemploBD\dist\EjemploBD.war
>     Error: Unable to distribute EjemploBD.war: Unknown or ambiguous  
> connection factory name query:
>     
> geronimo.server:J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAManaged
> ConnectionFactory,name=MysqlDataSource,*
>     match count: 0
> 
> I guess I have something wrong in some of the deployment descriptors. 
> Well, in geronimo-web I have added this:
> <naming:resource-ref>
>     <naming:ref-name>jdbc/DataSource</naming:ref-name>
>     <naming:resource-link>MysqlDataSource</naming:resource-link>
> </naming:resource-ref>
> 
> and in web.xml there is this:
> <resource-ref>
>     <res-ref-name>jdbc/DataSource</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>     <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
> 
> and last but not least, in the application the lookup is this:
> DataSource ds = (DataSource)ctx.lookup("java:comp/env/MysqlDataSource");
> 
> 
> 

Mime
View raw message