tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: resource adapter config with openEJB
Date Tue, 12 Jan 2010 16:55:10 GMT

On Jan 6, 2010, at 12:48 AM, Jason Russo wrote:

> Well, I think I finally figured out how to make this work, at least  
> when
> packaging everything in an EAR file.  The bad part, however, is that I
> had to hardcode all my ActivationConfig properties in the message  
> bean.
>
> Can anyone tell me if there is anywhere else I can define these
> properties so I don't have to hardcode them in my MDB?  I'd prefer to
> define them in the container (perhaps some properties file on the
> container), or next best thing would be to include them in a property
> file in my resource adapter.  Thanks.

An alternative is the ejb-jar.xml, which does allow the activation  
config properties to be set.

We don't have an alternate way to override those properties other than  
the spec defined way (annotation or ejb-jar.xml) but certainly it'd be  
a great feature to have.  Right, the container config would be a great  
place to do that.  That might not be that hard if you wanted to take a  
swing at it.

If you're interested, hit the dev list for pointers.

-David


>
>
>
> Jason Russo
>
> Application Developer
>
> Genscape– See the Energy
>
> 445 E. Market St, Suite 200
>
> Louisville, KY 40202
>
> Tel: 502-583-2091
>
> www.genscape.com
>
>
>
> On Mon, 2010-01-04 at 17:53 -0500, Jason Russo wrote:
>
>> Thanks for responding David.
>>
>> I've tried to package the adapter in an ear, as well as install the  
>> rar
>> and ejb separately.  In either case, I can see messages in the logs
>> indicating that the adapter and ejb installed, but for some reason,  
>> my
>> MDB cannot seem to access the adapter.  It appears that openEjb is  
>> auto
>> creating a container that uses the default ActiveMQ adapter instead  
>> of
>> the one I deploy.
>>
>> This is my openejb-jar.xml:
>>
>> <openejb-jar  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>>   xmlns='http://www.openejb.org/openejb-jar/1.1'
>>
>> xsi:schemaLocation='http://www.openejb.org/openejb-jar/1.1 /home/ 
>> jrusso/Projects/openEjb/container/openejb-core/src/main/resources/ 
>> schema/openejb-jar.xsd'>
>>    <ejb-deployment ejb-name="TestFioranoMDB">
>>        <resource-link res-ref-name="genscape-generic-adapter"
>> res-id="genscape-generic-adapter"/>
>>    </ejb-deployment>
>> </openejb-jar>
>>
>>
>> My resource adapter file is named genscape-generic-adapter.rar.   
>> I'm not
>> sure what the res-ref-name & res-id I need to provide should be, but
>> this is what openejb reports in the log when i install the adapter:
>>
>> 2010-01-04 17:38:36,496 - INFO  - Configuring
>> Service(id=genscape-generic-adapterRA, type=Resource,
>> provider-id=genscape-generic-adapterRA)
>> 2010-01-04 17:38:36,499 - INFO  - Configuring
>> Service(id=genscape-generic-adapter, type=Container, provider- 
>> id=Default
>> MDB Container)
>>
>>
>> However, when I install my MDB, I see the following in the logs,  
>> which
>> suggests that it is using the default ActiveMQ adapter instead of the
>> one I am trying to reference:
>>
>> 2010-01-04 17:38:36,504 - DEBUG - Beginning
>> load: /home/jrusso/bin/apache-tomcat-6.0.20/apps/TestMDB.jar
>> 2010-01-04 17:38:36,505 - DEBUG - Using default
>> 'openejb.tempclassloader.skip=none'  Possible values are: none,
>> annotations, enums or NONE or ALL
>> 2010-01-04 17:38:36,505 - DEBUG - Using default
>> 'openejb.tempclassloader.skip=none'  Possible values are: none,
>> annotations, enums or NONE or ALL
>> 2010-01-04 17:38:36,508 - DEBUG - Destroying classLoader
>> URLClassLoader@711090443
>> 2010-01-04 17:38:36,508 - INFO  - Configuring enterprise
>> application: /home/jrusso/bin/apache-tomcat-6.0.20/apps/TestMDB.jar
>> 2010-01-04 17:38:36,551 - DEBUG - Searching for inherited application
>> exceptions (see OPENEJB-980) - it doesn't care whether inherited is
>> true/false
>> 2010-01-04 17:38:36,565 - INFO  - Auto-assigning deployment-id for  
>> ejb
>> TestFioranoMDB: EjbDeployment(deployment-id=TestFioranoMDB)
>> 2010-01-04 17:38:36,795 - INFO  - Configuring Service(id=Default MDB
>> Container, type=Container, provider-id=Default MDB Container)
>> 2010-01-04 17:38:36,795 - INFO  - Auto-creating a container for bean
>> TestFioranoMDB: Container(type=MESSAGE, id=Default MDB Container)
>> 2010-01-04 17:38:36,796 - DEBUG - No existing resource found while
>> attempting to Auto-link unmapped resource-ref 'Default JMS Resource
>> Adapter' of type 'null' for 'TestFioranoMDB'.  Looked for
>> Resource(id=Default JMS Resource Adapter) and Resource(id=Default JMS
>> Resource Adapter)
>> 2010-01-04 17:38:36,796 - INFO  - Configuring Service(id=Default JMS
>> Resource Adapter, type=Resource, provider-id=Default JMS Resource
>> Adapter)
>> 2010-01-04 17:38:36,797 - DEBUG - No existing resource found while
>> attempting to Auto-link unmapped resource-ref 'Default Unmanaged JDBC
>> Database' of type 'null' for 'TestFioranoMDB'.  Looked for
>> Resource(id=Default Unmanaged JDBC Database) and Resource(id=Default
>> Unmanaged JDBC Database)
>> 2010-01-04 17:38:36,798 - INFO  - Configuring Service(id=Default
>> Unmanaged JDBC Database, type=Resource, provider-id=Default Unmanaged
>> JDBC Database)
>> 2010-01-04 17:38:36,798 - DEBUG - Using default
>> 'openejb.descriptors.output=false'
>> 2010-01-04 17:38:36,798 - DEBUG - Using default
>> 'openejb.descriptors.output=false'
>> 2010-01-04 17:38:36,800 - DEBUG - Using default
>> 'openejb.validation.output.level=medium'.  Possible values are:  
>> terse,
>> medium, verbose
>> 2010-01-04 17:38:36,800 - INFO  - Enterprise application
>> "/home/jrusso/bin/apache-tomcat-6.0.20/apps/TestMDB.jar" loaded.
>>
>> Any ideas?
>>
>>
>>
>> Jason Russo
>>
>> Application Developer
>>
>> Genscape– See the Energy
>>
>> 445 E. Market St, Suite 200
>>
>> Louisville, KY 40202
>>
>> Tel: 502-583-2091
>>
>> www.genscape.com
>>
>>
>>
>> On Mon, 2010-01-04 at 16:47 -0500, David Blevins wrote:
>>
>>> On Dec 30, 2009, at 8:25 PM, Jason Russo wrote:
>>>
>>>> Well, I feel a bit dumb, but I think I figured out the problem
>>>> here.  It
>>>> seems that the ra.xml within the generic adapter rar package has  
>>>> a tag
>>>> within the <outbound-resourceadapter/> tag as such:
>>>>
>>>>           <transaction-support>
>>>>               XATransaction
>>>>           </transaction-support>
>>>>
>>>> Notice the whitespace.  It appears that openEjb chokes with the  
>>>> below
>>>> error when reading this tag because of the whitespace in between  
>>>> the
>>>> tag
>>>> ends.  When I remove the carriage returns and other whitespace,  
>>>> like
>>>> so:
>>>>
>>>>           <transaction-support>XATransaction</transaction-support>
>>>>
>>>> The adapter deploys fine.  So I had to rebuild the genericra.rar
>>>> with a
>>>> modified ra.xml to correct this tag.  What I don't understand is  
>>>> that
>>>> there are many other tags in the ra.xml that have the same kind
>>>> whitespace within them, but openEjb does not have a problem with  
>>>> those
>>>> tags.  I'm going to suggest that this is a bug.
>>>
>>> Definitely seems so.  Might be something we can just have trimmed
>>> right that JAXB tree.  Seem to recall there is some easy way to ask
>>> jaxb to trim text input.
>>>
>>>> So now that I have been able to deploy the generic adapter, I  
>>>> seem to
>>>> have this problem with getting my MDB to use this adapter.  It  
>>>> appears
>>>> that instead of using this adapter, my MDB is using the 'Default  
>>>> JMS
>>>> Resource Adapter'.  Can anyone tell me how to link to the reference
>>>> for
>>>> my own adapter?  Is this something I would set up in the
>>>> openejb-jar.xml?
>>>
>>> Are you packaging your rar inside the app or deploying it  
>>> separately?
>>> We can get it to work either way, just the "automatic" way is when  
>>> the
>>> rar is in an ear with the MDB.
>>>
>>> -David
>>>
>>>
>>>>
>>>>
>>>>
>>>> Jason Russo
>>>>
>>>> Application Developer
>>>>
>>>> Genscape– See the Energy
>>>>
>>>> 445 E. Market St, Suite 200
>>>>
>>>> Louisville, KY 40202
>>>>
>>>> Tel: 502-583-2091
>>>>
>>>> www.genscape.com
>>>>
>>>>
>>>>
>>
>>


Mime
View raw message