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: "Could not auto-map to resource" problem when using EJB annotations only
Date Tue, 05 May 2009 18:16:25 GMT

On May 5, 2009, at 12:42 AM, fmeili wrote:

>
>
>
> Rex Wang-2 wrote:
>>
>> Hi Frank, sorry for the confusing, it can not be added to the
>> application.xml, but should be added to the web.xml / ejb-jar.xml...
>>
>> here is an example in attachment.
>>
>> HTH
>>
>> rex.
>>
>
> Hi Rex,
>
> thanks for your answer. But this, I think, is the problem. My EAR  
> consits
> out of 40 EJB's and 25 WAR's and all are using the @Resource  
> injection for
> the database. Til now I don't have descriptors for the EJB's (no
> "ejb-jar.xml") - I thought they are no longer neccessary in JEE5.  
> And the
> deployment descriptors of the WAR's ("web.xml") only contains the
> servlet-mappings. (This EAR file can successfully deployed in JBoss  
> and in
> GlassFish without modifications.)
>
> To be able to deploy this in Geronimo do I really need to add 40 new
> "openejb-jar.xml", 40 new "ejb-jar.xml" and 25 new "geronimo- 
> web.xml" files
> - and also change 25 "web.xml" files to place the <resource-ref>  
> tag? Is
> there no way to just use injection without specifying it in all  
> descriptors?
> Maybe there is a way to define a jdbc resource globally in Geronimo  
> to use
> in with injection?

I think you should be able to avoid geronimo plans for each module.

You need to

1. make sure that the name specified in the annotations or dd resource- 
ref is the same as the datasource name you specify when you deploy the  
connection pool.
2. make the connection pool "visible" to your application by adding  
its id as a dependency to the geronimo plan for your application.

This should be enough to make the auto-map work.

hope this helps
david jencks


>
>
> Thanks,
> Frank
> -- 
> View this message in context: http://www.nabble.com/%22Could-not-auto-map-to-resource%22-problem-when-using-EJB-annotations-only-tp23316686s134p23382575.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message