You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by David Blevins <da...@visi.com> on 2010/01/04 22:47:25 UTC
Re: resource adapter config with openEJB
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
>
>
>
> On Wed, 2009-12-30 at 12:45 -0500, Jason Russo wrote:
>
>> To be more specific, when I install the adapter, I keep getting the
>> following error message in the log. Again, this is from openEjb
>> embedded in Tomcat 6.x (You may notice the references to Fiorano
>> JMS. I
>> am first trying to test with Fiorano, as that is our older JMS
>> provider,
>> but eventually we want to use this with Tibco). Any help would be
>> appreciated:
>>
>>
>> 2009-12-30 12:39:17,229 - INFO - Configuring
>> Service(id=genscape-generic-adapter-1.0-SNAPSHOTRA, type=Resource,
>> provider-id=genscape-generic-adapter-1.0-SNAPSHOTRA)
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [XATopicConnectionFactoryClassName
>> =fiorano.jms.runtime.pubsub.xa.FioranoXATopicConnectionFactoryProxy]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [QueueConnectionFactoryClassName
>> =fiorano.jms.runtime.ptp.FioranoQueueConnectionFactory]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [TopicConnectionFactoryClassName
>> =fiorano.jms.runtime.pubsub.FioranoTopicConnectionFactory]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [QueueClassName=fiorano.jms.runtime.ptp.FioranoQueue]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [ConnectionFactoryClassName
>> =fiorano.jms.runtime.common.FioranoConnectionFactoryProxy]
>> 2009-12-30 12:39:17,229 - DEBUG - [UserName=anonymous]
>> 2009-12-30 12:39:17,229 - DEBUG - [Password=<hidden>]
>> 2009-12-30 12:39:17,229 - DEBUG - [ProviderIntegrationMode=jndi]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [JndiProperties
>> =java.naming.factory.url.pkgs=fiorano.jms.runtime.naming
>> java
>> .naming
>> .factory
>> .initial=fiorano.jms.runtime.naming.FioranoInitialContextFactory
>> java.naming.provider.url=http://hades.genscape.com:1656
>> java.naming.provider.principal=anonymous
>> java.naming.provider.credentials=anonymous]
>> 2009-12-30 12:39:17,229 - DEBUG - [SupportsXA=false]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [XAConnectionFactoryClassName
>> =fiorano.jms.runtime.common.FioranoXAConnectionFactory]
>> 2009-12-30 12:39:17,229 - DEBUG -
>> [TopicClassName=fiorano.jms.runtime.pubsub.FioranoTopic]
>> 2009-12-30 12:39:17,230 - DEBUG -
>> [XAQueueConnectionFactoryClassName
>> =fiorano.jms.runtime.ptp.xa.FioranoXAQueueConnectionFactory]
>> 2009-12-30 12:39:17,231 - ERROR - FATAL ERROR: Unknown error in
>> Assembler. Please send the following stack trace and this message to
>> users@openejb.apache.org :
>> java.lang.NullPointerException
>> at
>> org
>> .apache
>> .openejb
>> .config.AppInfoBuilder.buildConnectorModules(AppInfoBuilder.java:346)
>> at
>> org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:
>> 106)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .configureApplication(ConfigurationFactory.java:604)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .configureApplication(ConfigurationFactory.java:488)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .getOpenEjbConfiguration(ConfigurationFactory.java:356)
>> at
>> org
>> .apache
>> .openejb
>> .assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:
>> 299)
>> at
>> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
>> 278)
>> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
>> at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
>> at
>> org
>> .apache.openejb.tomcat.catalina.TomcatLoader.init(TomcatLoader.java:
>> 123)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.apache.openejb.loader.Embedder.init(Embedder.java:75)
>> at
>> org.apache.openejb.tomcat.loader.TomcatHook.hook(TomcatHook.java:98)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org
>> .apache
>> .openejb.tomcat.loader.TomcatEmbedder.embed(TomcatEmbedder.java:77)
>> at
>> org
>> .apache
>> .openejb
>> .tomcat.loader.OpenEJBListener.lifecycleEvent(OpenEJBListener.java:
>> 53)
>> at
>> org
>> .apache
>> .catalina
>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> at
>> org
>> .apache.catalina.core.StandardServer.initialize(StandardServer.java:
>> 770)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
>>
>> 2009-12-30 12:39:17,232 - FATAL - OpenEJB has encountered a fatal
>> error
>> and cannot be started: Assembler failed to build the container
>> system.
>> org.apache.openejb.OpenEJBException: java.lang.NullPointerException:
>> null
>> at
>> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
>> 292)
>> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
>> at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
>> at
>> org
>> .apache.openejb.tomcat.catalina.TomcatLoader.init(TomcatLoader.java:
>> 123)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.apache.openejb.loader.Embedder.init(Embedder.java:75)
>> at
>> org.apache.openejb.tomcat.loader.TomcatHook.hook(TomcatHook.java:98)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org
>> .apache
>> .openejb.tomcat.loader.TomcatEmbedder.embed(TomcatEmbedder.java:77)
>> at
>> org
>> .apache
>> .openejb
>> .tomcat.loader.OpenEJBListener.lifecycleEvent(OpenEJBListener.java:
>> 53)
>> at
>> org
>> .apache
>> .catalina
>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>> at
>> org
>> .apache.catalina.core.StandardServer.initialize(StandardServer.java:
>> 770)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun
>> .reflect
>> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingMethodAccessorImpl
>> .invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
>> Caused by: java.lang.NullPointerException
>> at
>> org
>> .apache
>> .openejb
>> .config.AppInfoBuilder.buildConnectorModules(AppInfoBuilder.java:346)
>> at
>> org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:
>> 106)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .configureApplication(ConfigurationFactory.java:604)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .configureApplication(ConfigurationFactory.java:488)
>> at
>> org
>> .apache
>> .openejb
>> .config
>> .ConfigurationFactory
>> .getOpenEjbConfiguration(ConfigurationFactory.java:356)
>> at
>> org
>> .apache
>> .openejb
>> .assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:
>> 299)
>> at
>> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
>> 278)
>> ... 25 more
>>
>>
>>
>> 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 Wed, 2009-12-30 at 11:22 -0500, Jason Russo wrote:
>>
>>> Hello all,
>>>
>>> I am new to openEjb, and I am trying to use it to develop a proof of
>>> concept for my company. I want to use openEjb to build a message
>>> driven
>>> bean that can read messages from an external Tibco provider.
>>> Since we
>>> use the Tomcat 6.x platform for deploying applications, I have set
>>> up an
>>> environment with openEjb embedded into Tomcat to test this POC.
>>>
>>> I've been doing a lot of research over the past two weeks, and
>>> have read
>>> that openEjb is supposed to support installing a JCA resource
>>> adapter.
>>> Since Tibco does not provide me with an adapter of their own, I have
>>> looked into using Sun's generic adapter, but when I try to deploy
>>> it to
>>> openEjb, is will not install properly. Can I get some help on how
>>> to
>>> install and configure the genericRA into openEjb so it can read
>>> from an
>>> external provider?
>>>
>>> Many thanks.
>>>
>>>
>>>
>>> Jason Russo
>>>
>>> Application Developer
>>>
>>> Genscape– See the Energy
>>>
>>> 445 E. Market St, Suite 200
>>>
>>> Louisville, KY 40202
>>>
>>> Tel: 502-583-2091
>>>
>>> www.genscape.com
>>>
>>>
>>>
Re: resource adapter config with openEJB
Posted by David Blevins <da...@visi.com>.
On Jan 12, 2010, at 7:50 PM, Jason Russo wrote:
> I was hoping for better support.
Ditto. With Java EE 6 finally closed, I feel like I'll be months
before I see the light of day :)
> Nonetheless, I appreciate getting an
> answer one way or another.
>
> I might take a stab at this if I can find the time, and will check out
> the developer forums for any clues.
Best thing is to hit maybe hit me up on dev list or IRC if you think
you'll have time and I can load you up with some pointers to the right
code.
-David
Re: resource adapter config with openEJB
Posted by Jason Russo <jr...@genscape.com>.
Thanks David.
I was hoping for better support. Nonetheless, I appreciate getting an
answer one way or another.
I might take a stab at this if I can find the time, and will check out
the developer forums for any clues.
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 Tue, 2010-01-12 at 11:55 -0500, David Blevins wrote:
> 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
> >>>>
> >>>>
> >>>>
> >>
> >>
>
Re: resource adapter config with openEJB
Posted by David Blevins <da...@visi.com>.
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
>>>>
>>>>
>>>>
>>
>>
Re: resource adapter config with openEJB
Posted by Jason Russo <jr...@genscape.com>.
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.
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
> > >
> > >
> > >
>
>
Re: resource adapter config with openEJB
Posted by Jason Russo <jr...@genscape.com>.
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
> >
> >
> >