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: deploy a client application
Date Wed, 31 Aug 2005 16:30:43 GMT
The immediate cause of the problem is that either you should look up :
> DataSource ds = (DataSource)ctx.lookup("java:comp/env/MySQL");

or your resource-ref in application-client.xml should look like:
>    <resource-ref>
>        <res-ref-name>jdbc/DataSource</res-ref-name>
>        <res-type>javax.sql.DataSource</res-type>
>        <res-auth>Container</res-auth>
>    </resource-ref>

After that, since you don't show your entire plan I don't know what 
else you have or are missing.  However, you need to include an 
"resource" element in the deployment plan that includes the entire 
connector plan for the datasource.  If the connection-factory-name 
elements is jdbc/DataSource (or MySQL, depending on your choice above), 
you won't need a resource-ref element in the client plan.

thanks
david jencks



On Aug 31, 2005, at 7:32 AM, Iñigo wrote:

> Well, I made some progress. Now Geronimo deploys the module, and when 
> running the application with java -jar bin\client.jar I get this 
> error:
> javax.naming.NameNotFoundException jdbc/DataSource
>
> However, in the deployment plan this is what I have:
>    <resource-ref>
>        <ref-name>jdbc/DataSource</ref-name>
>        <target-name>MySQL</target-name>
>    </resource-ref>
> And in the application-client.xml:
>    <resource-ref>
>        <res-ref-name>MySQL</res-ref-name>
>        <res-type>javax.sql.DataSource</res-type>
>        <res-auth>Container</res-auth>
>    </resource-ref>
>
> And in the application:
>            InitialContext ctx = new InitialContext();
>            DataSource ds = 
> (DataSource)ctx.lookup("java:comp/env/jdbc/DataSource");
>
> I should lookup a different jndi name?
>
> Jeremy Boynes escribió:
>
>> Main-Class: com.example.Main
>>
>> How it gets in there depends on how your build creates the appclient 
>> jar file - e.g. with ant you can specify manifest="${file}" on the 
>> jar task.
>>
>> -- 
>> Jeremy
>>
>>
>
>


Mime
View raw message