tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lb <open...@lbreuss.ch>
Subject Re: resource adapter configuration for Sun JMSJCA sun-jms-adapter
Date Tue, 23 Nov 2010 12:54:55 GMT

Hi Andy, thanks for your answer. I was fiddling around with further
configurations. The following is some of the closest I could get to.  With
another config variant (which I am not able to reproduce right away), it
went past the Connection Factory, but tried to instantiate an ActiveMQ
Queue/Topic (removing the lib just provoked a NoClassDefFound).

Are there any obvious configuration mistakes I could fix to get a few steps
further to a working solution?

I love to develop JEE apps, but configuring a JEE solution is far from being
straigt forward. Hope this will change over time. Also, I don't understand
why JCA and JMS don't play toghether (in my case JMSJCA and OpenMQ (4.4)).
Aren't they compliant to their respective API? *shrug* But I don't fully
grasp the complexity under the hood yet anyway.

I'll give a try to Glassfish v3 in embedded mode as well. In theory, should
integrate well with JMSJCA and OpenMQ, all Sun products...
regards, Leo


============================================================
=== stdout

DEBUG - Using default 'openejb.nobanner=true'
Apache OpenEJB 3.1.3    build: 20101015-05:42
http://openejb.apache.org/
INFO - openejb.home = C:\APPL\Tools\NetBeansProjects\TestOpenEJB
INFO - openejb.base = C:\APPL\Tools\NetBeansProjects\TestOpenEJB
DEBUG - Using default
'openejb.assembler=org.apache.openejb.assembler.classic.Assembler'
DEBUG - Instantiating assembler class
org.apache.openejb.assembler.classic.Assembler
DEBUG - Using default 'openejb.jndiname.failoncollision=true'
DEBUG - Using default
'openejb.configurator=org.apache.openejb.config.ConfigurationFactory'
DEBUG - Using default 'openejb.validation.skip=false'
DEBUG - Using default 'openejb.deploymentId.format={ejbName}'
DEBUG - Using default 'openejb.debuggable-vm-hackery=false'
DEBUG - Using default 'openejb.webservices.enabled=true'
DEBUG - Using default 'openejb.vendor.config=ALL'  Possible values are:
geronimo, glassfish, jboss, weblogic or NONE or ALL
DEBUG - Using default 'openejb.provider.default=org.apache.openejb.embedded'
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=MyJmsjcaResourceAdapter, type=Resource,
provider-id=JmsjcaResourceAdapter)
DEBUG - [ConnectionURL=mq://localhost:7676]
DEBUG - [UserName=info]
DEBUG - [Password=<hidden>]
INFO - Configuring Service(id=jms/tx/vaiqm, type=Resource,
provider-id=OpenMQConnectionFactory)
INFO - Configuring Service(id=jms/queErrAll_02, type=Resource,
provider-id=OpenMQQueue)
INFO - Configuring Service(id=jms/topRoutingRefresh, type=Resource,
provider-id=OpenMQTopic)
INFO - Configuring Service(id=sun-jms-adapter, type=Container,
provider-id=Default MDB Container)
DEBUG - [ResourceAdapter=MyJmsjcaResourceAdapter]
DEBUG - [MessageListenerInterface=javax.jms.MessageListener]
DEBUG -
[ActivationSpecClass=com.stc.jmsjca.unifiedjms.RAUnifiedActivationSpec]
DEBUG - Using default 'openejb.deployments.classpath=true'
DEBUG - Using default 'openejb.deployments.classpath.include='
DEBUG - Using default 'openejb.deployments.classpath.exclude=.*'
DEBUG - Using default
'openejb.deployments.classpath.require.descriptor=client'  Possible values
are: ejb, client or NONE or ALL
DEBUG - Using default
'openejb.deployments.classpath.filter.descriptors=false'
DEBUG - Using default 'openejb.deployments.classpath.filter.systemapps=true'
DEBUG - Inspecting classpath for applications: 0 urls.
INFO - Found EjbModule in classpath:
C:\APPL\Tools\NetBeansProjects\TestOpenEJB\build\jar
INFO - Found ConnectorModule in classpath:
C:\APPL\Tools\NetBeansProjects\NetbeansSharedLibraries\6.7\openejb-3.1.3\lib\sun-jms-adapter-with-service.jar
DEBUG - URLs after filtering: 094
...
DEBUG - Using default 'openejb.deployments.classpath.ear=true'
INFO - Beginning load: C:\APPL\Tools\NetBeansProjects\TestOpenEJB\build\jar
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums or NONE or ALL
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums or NONE or ALL
INFO - Beginning load:
C:\APPL\Tools\NetBeansProjects\NetbeansSharedLibraries\6.7\openejb-3.1.3\lib\sun-jms-adapter-with-service.jar
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums or NONE or ALL
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums or NONE or ALL
INFO - Configuring enterprise application: classpath.ear
DEBUG - Searching for inherited application exceptions (see OPENEJB-980) -
it doesn't care whether inherited is true/false
INFO - Auto-configuring a message driven bean
ch.lb.test.openejb.MyOpenEJBTestBean destination
ch.lb.test.openejb.MyOpenEJBTestBean to be destinationType javax.jms.Queue
INFO - Auto-linking resource-ref
'ch.lb.test.openejb.MyOpenEJBTestBean/myQMConnectionFactory' in bean
ch.lb.test.openejb.MyOpenEJBTestBean to Resource(id=jms/tx/vaiqm)
INFO - Auto-linking resource-env-ref
'ch.lb.test.openejb.MyOpenEJBTestBean/myQueue' in bean
ch.lb.test.openejb.MyOpenEJBTestBean to Resource(id=jms/queErrAll_02)
DEBUG - No existing resource found while attempting to Auto-link unmapped
resource-env-ref 'ch.lb.test.openejb.MyOpenEJBTestBean' of type
'javax.jms.Queue' for 'ch.lb.test.openejb.MyOpenEJBTestBean'.  Looked for
Resource(id=ch.lb.test.openejb.MyOpenEJBTestBean)
INFO - Configuring Service(id=ch.lb.test.openejb.MyOpenEJBTestBean,
type=Resource, provider-id=Default Queue)
DEBUG - [destination=ch.lb.test.openejb.MyOpenEJBTestBean]
INFO - Auto-creating a Resource with id
'ch.lb.test.openejb.MyOpenEJBTestBean' of type 'javax.jms.Queue for
'ch.lb.test.openejb.MyOpenEJBTestBean'.
INFO - Configuring Service(id=Default Stateless Container, type=Container,
provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean MyEJBBean:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Using 'openejb.descriptors.output=true'
INFO - Using 'openejb.descriptors.output=true'
INFO - Dumping Generated ejb-jar.xml to:
C:\DOCUME~1\vb819\LOCALS~1\Temp\ejb-jar-1069999983200656017jar.xml
INFO - Dumping Generated openejb-jar.xml to:
C:\DOCUME~1\vb819\LOCALS~1\Temp\openejb-jar-998228876795163731jar.xml
INFO - Configuring Service(id=sun-jms-adapter-with-service.jarRA,
type=Resource, provider-id=sun-jms-adapter-with-service.jarRA)
DEBUG - [TransformerMBeanName=]
DEBUG - [Options=]
DEBUG - [MBeanServerDomain=]
DEBUG - [Password=<hidden>]
DEBUG - [ConnectionURL=]
DEBUG - [UserName=]
DEBUG - [MBeanObjectName=]
INFO - Configuring
Service(id=sun-jms-adapter-with-service.jar-javax.jms.ConnectionFactory,
type=Resource,
provider-id=sun-jms-adapter-with-service.jar-javax.jms.ConnectionFactory)
DEBUG - [TransactionSupport=xa]
DEBUG - [ResourceAdapter=sun-jms-adapter-with-service.jarRA]
INFO - Configuring
Service(id=sun-jms-adapter-with-service.jar-javax.jms.QueueConnectionFactory,
type=Resource,
provider-id=sun-jms-adapter-with-service.jar-javax.jms.QueueConnectionFactory)
DEBUG - [TransactionSupport=xa]
DEBUG - [ProducerPooling=true]
DEBUG - [ResourceAdapter=sun-jms-adapter-with-service.jarRA]
INFO - Configuring
Service(id=sun-jms-adapter-with-service.jar-javax.jms.TopicConnectionFactory,
type=Resource,
provider-id=sun-jms-adapter-with-service.jar-javax.jms.TopicConnectionFactory)
DEBUG - [TransactionSupport=xa]
DEBUG - [ProducerPooling=true]
DEBUG - [ResourceAdapter=sun-jms-adapter-with-service.jarRA]
INFO - Configuring Service(id=sun-jms-adapter-with-service.jar,
type=Container, provider-id=Default MDB Container)
DEBUG -
[ActivationSpecClass=com.stc.jmsjca.unifiedjms.RAUnifiedActivationSpec]
DEBUG - [MessageListenerInterface=javax.jms.MessageListener]
DEBUG - [ResourceAdapter=sun-jms-adapter-with-service.jarRA]
INFO - Configuring
Service(id=sun-jms-adapter-with-service.jar-javax.jms.Queue, type=Resource,
provider-id=sun-jms-adapter-with-service.jar-javax.jms.Queue)
INFO - Configuring
Service(id=sun-jms-adapter-with-service.jar-javax.jms.Topic, type=Resource,
provider-id=sun-jms-adapter-with-service.jar-javax.jms.Topic)
INFO - Using 'openejb.validation.output.level=VERBOSE'
INFO - Enterprise application "classpath.ear" loaded.
DEBUG - Starting ResourceAdapter(id=MyJmsjcaResourceAdapter)
FATAL - OpenEJB has encountered a fatal error and cannot be started:
Assembler failed to build the container system.
org.apache.openejb.OpenEJBException: "Resource adapter defined with id {0}
is not an instance of ResourceAdapter, but is an instance of class
org.apache.openejb.core.ivm.naming.IvmContext
        at
org.apache.openejb.assembler.classic.Assembler.replaceResourceAdapterProperty(Assembler.java:1095)
        at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1106)
        at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:357)
        at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)


============================================================
=== openejb.xml

<?xml version="1.0" encoding="UTF-8"?>
<openejb>

<!-- see http://openejb.apache.org/3.0/containers-and-resources.html -->
<!-- see http://activemq.apache.org/activation-spec-properties.html -->
<!-- see http://openejb.apache.org/3.0/jms-resources-and-mdb-container.html
-->
    <!-- Note: a resource-adapter-mid is a Container in OpenEJB -->

<!-- Working config. Don't touch!  -->
    <Container id="sun-jms-adapter" ctype="MESSAGE">
        ResourceAdapter = MyJmsjcaResourceAdapter
        MessageListenerInterface=javax.jms.MessageListener
       
ActivationSpecClass=com.stc.jmsjca.unifiedjms.RAUnifiedActivationSpec
    </Container>

    <Resource id="MyJmsjcaResourceAdapter"
            type="ResourceAdapter" 
            provider="com.stc.jmsjca.unifiedjms#JmsjcaResourceAdapter"
            jar="sun-jms-adapter-with-service.jar">
        ConnectionURL = mq://localhost:7676
        UserName info
        Password none
    </Resource>

    <!-- http://openejb.apache.org/3.0/jms-resources-and-mdb-container.html
    // http://activemq.apache.org/connection-factory-properties.html
    //   Why does the first page mention a property ResourceAdapter but the
second one
    //   does not list it? It also does not work with (sun-jms-adapter and)
OpenMQ. -->
    <Resource id="jms/tx/vaiqm"
            provider="com.stc.jmsjca.unifiedjms#OpenMQConnectionFactory"
            type="javax.jms.ConnectionFactory">
        # Discrepancy:
        # http://openejb.apache.org/3.0/jms-resources-and-mdb-container.html
        # http://activemq.apache.org/connection-factory-properties.html
        #    Why does the first page mention a property ResourceAdapter for
the 
        #    ConnectionFactory but the second one does not list it? 
        #    OpenEJB also warns with (sun-jms-adapter RA and) OpenMQ.
        #ResourceAdapter = MyJmsjcaResourceAdapter
    </Resource>
<!-- END of Working config. Don't touch!  -->

   <Resource id="jms/queErrAll_02"
provider="com.stc.jmsjca.unifiedjms#OpenMQQueue"
            type="javax.jms.Queue">
        #destination=queErrAll_02
        # provider="com.stc.jmsjca.unifiedjms#OpenMQQueue"
    </Resource>

    <Resource id="jms/topRoutingRefresh"
provider="com.stc.jmsjca.unifiedjms#OpenMQTopic"
            type="javax.jms.Topic">
        #destination=topRoutingRefresh
    </Resource>
 <!--  -->

</openejb>


============================================================
=== service-jar.xml
===   META-INF\com.stc.jmsjca.unifiedjms/service-jar.xml, in repackaged
sun-jms-adapter.rar now named sun-jms-adapter-with-service.jar

<?xml version="1.0" encoding="UTF-8"?>
<ServiceJar>
  <ServiceProvider
          id="JmsjcaResourceAdapter"
          service="Resource"
          types="RAUnifiedResourceAdapter,
com.stc.jmsjca.unifiedjms.RAUnifiedResourceAdapter,
javax.resource.spi.ResourceAdapter, ResourceAdapter"
          class-name="com.stc.jmsjca.unifiedjms.RAUnifiedResourceAdapter">
## types: What are allowed types?
# types="ResourceAdapter, javax.resource.spi.ResourceAdapter,
RAUnifiedResourceAdapter"  ## ???
# class-name="com.stc.jmsjca.unifiedjms.RAUnifiedResourceAdapter"          
# from ra.xml

        # Properties copied from ra.xml
        ConnectionURL
        UserName
        Password
        MBeanObjectName
        MBeanServerDomain
        Options
        TransformerMBeanName
  </ServiceProvider>

 <!-- configure for OpenMQ JMS Provider -->
  <ServiceProvider
          id="OpenMQConnectionFactory"
          service="Resource"
          types="javax.jms.ConnectionFactory,
javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory,
QueueConnectionFactory, TopicConnectionFactory"
          class-name="com.sun.messaging.XAConnectionFactory">

    ResourceAdapter
    # ResourceAdapter JmsjcaResourceAdapter
  </ServiceProvider>

  <ServiceProvider
          id="OpenMQQueue"
          service="Resource"
          types="javax.jms.Queue, Queue"
          class-name="com.sun.messaging.Queue">
  </ServiceProvider>

  <ServiceProvider
          id="OpenMQTopic"
          service="Resource"
          types="javax.jms.Topic, Topic"
          class-name="com.sun.messaging.Topic">
  </ServiceProvider>

</ServiceJar>
 

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Outbound-resource-injection-in-an-ejb-tp1013402p3055360.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message