Apache Geronimo > Discussion Forums  User List | Dev List | Wiki | Issue Tracker  

JCA and MDB

View: New views
6 Messages — Rating Filter:   Alert me  

JCA and MDB

by ardf69 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
I create a inbound JCA that connects to some JMS Queues (their name is defined in a DB accessed by hibernate classes). The deploy of the jca and the start/stop is ok. Here there is the ra.xml:

<?xml version="1.0" encoding="UTF-8"?>
<connector id="Connector_ID" version="1.5" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
        <description></description>
        <display-name>UBQ_JSR212_JCA_Queue</display-name>
  <vendor-name>Ubiquity s.r.l.</vendor-name>
  <eis-type>JMS</eis-type>
  <resourceadapter-version>1.0</resourceadapter-version>                                  
  <resourceadapter>
  <resourceadapter-class>it.ubiquity.sams.jms.DequeuerResourceAdapter</resourceadapter-class>
  <inbound-resourceadapter>
  <messageadapter>
  <messagelistener>
  <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
  <activationspec>
  <activationspec-class>it.ubiquity.sams.jms.DequeuerActivationSpec</activationspec-class>
  <required-config-property>
  <description>The queue prefix</description>
  <config-property-name>queuePrefix</config-property-name>
  </required-config-property>
  </activationspec>
  </messagelistener>
  </messageadapter>
  </inbound-resourceadapter>
  <security-permission>
  <description>Permissions allowed to the EIS Connector</description>
  <security-permission-spec/>
  </security-permission>
  </resourceadapter>
</connector>

and the geronimo-ra.xml:

<?xml version="1.0" encoding="UTF-8"?>
<connector
        xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
        xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
        xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
        xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
        xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
        xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
        xmlns:pers="http://java.sun.com/xml/ns/persistence"
        xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
        xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
        xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
>
        <dep:environment>
                <dep:moduleId>
                        <dep:groupId>sams.jca</dep:groupId>
                        <dep:artifactId>UBQ_JSR212_JCA_Queue</dep:artifactId>
                        <dep:version>1.0</dep:version>
                        <dep:type>car</dep:type>
                </dep:moduleId>
                <dep:dependencies/>
                <dep:hidden-classes/>
                <dep:non-overridable-classes/>
        </dep:environment>
        <resourceadapter>
                <resourceadapter-instance>
                        <resourceadapter-name>SAMSQueueManager</resourceadapter-name>
                        <name:workmanager>
                                <name:gbean-link>DefaultWorkManager</name:gbean-link>
                        </name:workmanager>
                </resourceadapter-instance>
        </resourceadapter>
</connector>

I created a mdb that connects to this jca and I included it in ear. Here there is the geronimo-application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<app:application
        xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
        xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
        xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
        application-name="UBQ_JSR212_EAR_Frontend"
>
        <sys:environment>
                <sys:moduleId>
                        <sys:groupId>sams.ear</sys:groupId>
                        <sys:artifactId>UBQ_JSR212_EAR_Middleware</sys:artifactId>
                        <sys:version>1.0</sys:version>
                        <sys:type>ear</sys:type>
                </sys:moduleId>
        </sys:environment>
</app:application>

the ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
        <display-name>UBQ_JSR212_EJB_Frontend</display-name>
        <enterprise-beans>
                <message-driven>
                        <ejb-name>FrontendMDB</ejb-name>
                        <ejb-class>it.ubiquity.sams.jms.FrontendBean</ejb-class>
                        <messaging-type>javax.jms.MessageListener</messaging-type>
                        <transaction-type>Container</transaction-type>
                        <activation-config>
                                <activation-config-property>
                                        <activation-config-property-name>queuePrefix</activation-config-property-name>
                                        <activation-config-property-value>f</activation-config-property-value>
                                </activation-config-property>
                        </activation-config>
                </message-driven>
        </enterprise-beans>
        <assembly-descriptor>
                <container-transaction>
                        <method>
                                <ejb-name>FrontendMDB</ejb-name>
                                <method-name>*</method-name>
                        </method>
                        <trans-attribute>NotSupported</trans-attribute>
                </container-transaction>
        </assembly-descriptor>
</ejb-jar>

and the openejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar
        xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
        xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
        xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
        xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
        xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
        version="1.0"
>
        <sys:environment>
                <sys:moduleId>
                        <sys:groupId>sams.ejb</sys:groupId>
                        <sys:artifactId>UBQ_JSR212_EJB_Frontend</sys:artifactId>
                        <sys:version>1.0</sys:version>
                        <sys:type>jar</sys:type>
                </sys:moduleId>
                <sys:dependencies>
                        <sys:dependency>
                                <sys:groupId>sams.jca</sys:groupId>
                                <sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>
                                <sys:version>1.0</sys:version>
                                <sys:type>car</sys:type>
                        </sys:dependency>
                        <sys:dependency>
                                <sys:groupId>console.jms</sys:groupId>
                                <sys:artifactId>sams</sys:artifactId>
                                <sys:version>1.0</sys:version>
                        </sys:dependency>
                        <sys:dependency>
                                <sys:groupId>console.dbpool</sys:groupId>
                                <sys:artifactId>jdbc_sams</sys:artifactId>
                                <sys:version>1.0</sys:version>
                                <sys:type>rar</sys:type>
                        </sys:dependency>
                </sys:dependencies>
        </sys:environment>

        <enterprise-beans>
                <message-driven>
                        <ejb-name>FrontendMDB</ejb-name>
                        <naming:resource-adapter>
                                <naming:resource-link>SAMSQueueManager</naming:resource-link>
                        </naming:resource-adapter>
                </message-driven>
        </enterprise-beans>
</openejb-jar>

When I deploy the ear the app server (the jca is already deployed and running) give me a strange error:

Caused by: java.lang.IllegalStateException: Container does not exist: UBQ_JSR212_JCA_Queue.  Referenced by deployment: UBQ_JSR212_EJB_Frontend.jar/FrontendMDB
        at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:60)
        ... 28 more

where UBQ_JSR212_EJB_Frontend.jar is the name of the ejb jar in the ear.
Can someone help me?
Regards

Angelo

Re: JCA and MDB

by ardf69 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
I did some more checks and I found something really strange. I tried to read the file config.ser in the META-INF for the ear and I found:

<xml-fragment version="2.1" id="ejb-jar_ID" metadata-complete="true" xmlns:jav="http://java.sun.com/xml/ns/javaee">
  <jav:display-name>UBQ_JSR212_EJB_Frontend</jav:display-name>
  <jav:enterprise-beans>
    <jav:message-driven id="UBQ_JSR212_EJB_Frontend.jar/FrontendMDB">
      <jav:ejb-name>FrontendMDB</jav:ejb-name>
      <jav:ejb-class>it.ubiquity.sams.jms.FrontendBean</jav:ejb-class>
      <jav:messaging-type>javax.jms.MessageListener</jav:messaging-type>
      <jav:transaction-type>Container</jav:transaction-type>
      <jav:message-destination-type>javax.jms.Queue</jav:message-destination-type>
      <jav:activation-config>
        <jav:activation-config-property>
          <jav:activation-config-property-name>queuePrefix</jav:activation-config-property-name>
          <jav:activation-config-property-value>f</jav:activation-config-property-value>
        </jav:activation-config-property>
        <jav:activation-config-property>
          <jav:activation-config-property-name>destination</jav:activation-config-property-name>
          <jav:activation-config-property-value>UBQ_JSR212_EJB_Frontend.jar/FrontendMDB</jav:activation-config-property-value>
        </jav:activation-config-property>
        <jav:activation-config-property>
          <jav:activation-config-property-name>destinationType</jav:activation-config-property-name>
          <jav:activation-config-property-value>javax.jms.Queue</jav:activation-config-property-value>
        </jav:activation-config-property>
      </jav:activation-config>
    </jav:message-driven>
  </jav:enterprise-beans>
  <jav:assembly-descriptor>
    <jav:container-transaction>
      <jav:method>
        <jav:ejb-name>FrontendMDB</jav:ejb-name>
        <jav:method-name>*</jav:method-name>
      </jav:method>
      <jav:trans-attribute>NotSupported</jav:trans-attribute>
    </jav:container-transaction>
    <jav:exclude-list/>
  </jav:assembly-descriptor>
</xml-fragment>

but in the ejb-jar.xml I didn't set the tags message-destination-type and the activation-configs destination and destinationType. To me this seems to be a bug!!!!
Can you confirm this?

Ciao Angelo

Re: JCA and MDB

by Donald Woods-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Which release and assembly (Tomcat vs. Jetty) of Geronimo are you using?


-Donald


ardf69 wrote:

> Hi all,
> I create a inbound JCA that connects to some JMS Queues (their name is
> defined in a DB accessed by hibernate classes). The deploy of the jca and
> the start/stop is ok. Here there is the ra.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector id="Connector_ID" version="1.5"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
> <description></description>
> <display-name>UBQ_JSR212_JCA_Queue</display-name>
>   <vendor-name>Ubiquity s.r.l.</vendor-name>
>   <eis-type>JMS</eis-type>
>   <resourceadapter-version>1.0</resourceadapter-version>                                  
>   <resourceadapter>
>  
> <resourceadapter-class>it.ubiquity.sams.jms.DequeuerResourceAdapter</resourceadapter-class>
>   <inbound-resourceadapter>
>   <messageadapter>
>   <messagelistener>
>  
> <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
>   <activationspec>
>  
> <activationspec-class>it.ubiquity.sams.jms.DequeuerActivationSpec</activationspec-class>
>   <required-config-property>
>   <description>The queue prefix</description>
>   <config-property-name>queuePrefix</config-property-name>
>   </required-config-property>
>   </activationspec>
>   </messagelistener>
>   </messageadapter>
>   </inbound-resourceadapter>
>   <security-permission>
>   <description>Permissions allowed to the EIS Connector</description>
>   <security-permission-spec/>
>   </security-permission>
>   </resourceadapter>
> </connector>
>
> and the geronimo-ra.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>
> xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
> xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:pers="http://java.sun.com/xml/ns/persistence"
> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
> <dep:environment>
> <dep:moduleId>
> <dep:groupId>sams.jca</dep:groupId>
> <dep:artifactId>UBQ_JSR212_JCA_Queue</dep:artifactId>
> <dep:version>1.0</dep:version>
> <dep:type>car</dep:type>
> </dep:moduleId>
> <dep:dependencies/>
> <dep:hidden-classes/>
> <dep:non-overridable-classes/>
> </dep:environment>
> <resourceadapter>
> <resourceadapter-instance>
> <resourceadapter-name>SAMSQueueManager</resourceadapter-name>
> <name:workmanager>
> <name:gbean-link>DefaultWorkManager</name:gbean-link>
> </name:workmanager>
> </resourceadapter-instance>
> </resourceadapter>
> </connector>
>
> I created a mdb that connects to this jca and I included it in ear. Here
> there is the geronimo-application.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <app:application
> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
> application-name="UBQ_JSR212_EAR_Frontend"
> <sys:environment>
> <sys:moduleId>
> <sys:groupId>sams.ear</sys:groupId>
> <sys:artifactId>UBQ_JSR212_EAR_Middleware</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>ear</sys:type>
> </sys:moduleId>
> </sys:environment>
> </app:application>
>
> the ejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar id="ejb-jar_ID" version="2.1"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
> <display-name>UBQ_JSR212_EJB_Frontend</display-name>
> <enterprise-beans>
> <message-driven>
> <ejb-name>FrontendMDB</ejb-name>
> <ejb-class>it.ubiquity.sams.jms.FrontendBean</ejb-class>
> <messaging-type>javax.jms.MessageListener</messaging-type>
> <transaction-type>Container</transaction-type>
> <activation-config>
> <activation-config-property>
>
> <activation-config-property-name>queuePrefix</activation-config-property-name>
> <activation-config-property-value>f</activation-config-property-value>
> </activation-config-property>
> </activation-config>
> </message-driven>
> </enterprise-beans>
> <assembly-descriptor>
> <container-transaction>
> <method>
> <ejb-name>FrontendMDB</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>NotSupported</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
> </ejb-jar>
>
> and the openejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <openejb-jar
> xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
> xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
> version="1.0"
> <sys:environment>
> <sys:moduleId>
> <sys:groupId>sams.ejb</sys:groupId>
> <sys:artifactId>UBQ_JSR212_EJB_Frontend</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>jar</sys:type>
> </sys:moduleId>
> <sys:dependencies>
> <sys:dependency>
> <sys:groupId>sams.jca</sys:groupId>
> <sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>car</sys:type>
> </sys:dependency>
> <sys:dependency>
> <sys:groupId>console.jms</sys:groupId>
> <sys:artifactId>sams</sys:artifactId>
> <sys:version>1.0</sys:version>
> </sys:dependency>
> <sys:dependency>
> <sys:groupId>console.dbpool</sys:groupId>
> <sys:artifactId>jdbc_sams</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>rar</sys:type>
> </sys:dependency>
> </sys:dependencies>
> </sys:environment>
>
> <enterprise-beans>
> <message-driven>
> <ejb-name>FrontendMDB</ejb-name>
> <naming:resource-adapter>
> <naming:resource-link>SAMSQueueManager</naming:resource-link>
> </naming:resource-adapter>
> </message-driven>
> </enterprise-beans>
> </openejb-jar>
>
> When I deploy the ear the app server (the jca is already deployed and
> running) give me a strange error:
>
> Caused by: java.lang.IllegalStateException: Container does not exist:
> UBQ_JSR212_JCA_Queue.  Referenced by deployment:
> UBQ_JSR212_EJB_Frontend.jar/FrontendMDB
> at
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:60)
> ... 28 more
>
> where UBQ_JSR212_EJB_Frontend.jar is the name of the ejb jar in the ear.
> Can someone help me?
> Regards
>
> Angelo

Re: JCA and MDB

by ardf69 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

geronimo-tomcat6-javaee5-2.1.4 under windows

Ciao Angelo

Donald Woods-2 wrote:
Which release and assembly (Tomcat vs. Jetty) of Geronimo are you using?


-Donald


ardf69 wrote:
> Hi all,
> I create a inbound JCA that connects to some JMS Queues (their name is
> defined in a DB accessed by hibernate classes). The deploy of the jca and
> the start/stop is ok. Here there is the ra.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector id="Connector_ID" version="1.5"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
> <description></description>
> <display-name>UBQ_JSR212_JCA_Queue</display-name>
>   <vendor-name>Ubiquity s.r.l.</vendor-name>
>   <eis-type>JMS</eis-type>
>   <resourceadapter-version>1.0</resourceadapter-version>                                  
>   <resourceadapter>
>  
> <resourceadapter-class>it.ubiquity.sams.jms.DequeuerResourceAdapter</resourceadapter-class>
>   <inbound-resourceadapter>
>   <messageadapter>
>   <messagelistener>
>  
> <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
>   <activationspec>
>  
> <activationspec-class>it.ubiquity.sams.jms.DequeuerActivationSpec</activationspec-class>
>   <required-config-property>
>   <description>The queue prefix</description>
>   <config-property-name>queuePrefix</config-property-name>
>   </required-config-property>
>   </activationspec>
>   </messagelistener>
>   </messageadapter>
>   </inbound-resourceadapter>
>   <security-permission>
>   <description>Permissions allowed to the EIS Connector</description>
>   <security-permission-spec/>
>   </security-permission>
>   </resourceadapter>
> </connector>
>
> and the geronimo-ra.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>
> xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
> xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:pers="http://java.sun.com/xml/ns/persistence"
> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
> <dep:environment>
> <dep:moduleId>
> <dep:groupId>sams.jca</dep:groupId>
> <dep:artifactId>UBQ_JSR212_JCA_Queue</dep:artifactId>
> <dep:version>1.0</dep:version>
> <dep:type>car</dep:type>
> </dep:moduleId>
> <dep:dependencies/>
> <dep:hidden-classes/>
> <dep:non-overridable-classes/>
> </dep:environment>
> <resourceadapter>
> <resourceadapter-instance>
> <resourceadapter-name>SAMSQueueManager</resourceadapter-name>
> <name:workmanager>
> <name:gbean-link>DefaultWorkManager</name:gbean-link>
> </name:workmanager>
> </resourceadapter-instance>
> </resourceadapter>
> </connector>
>
> I created a mdb that connects to this jca and I included it in ear. Here
> there is the geronimo-application.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <app:application
> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
> application-name="UBQ_JSR212_EAR_Frontend"
> <sys:environment>
> <sys:moduleId>
> <sys:groupId>sams.ear</sys:groupId>
> <sys:artifactId>UBQ_JSR212_EAR_Middleware</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>ear</sys:type>
> </sys:moduleId>
> </sys:environment>
> </app:application>
>
> the ejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar id="ejb-jar_ID" version="2.1"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
> <display-name>UBQ_JSR212_EJB_Frontend</display-name>
> <enterprise-beans>
> <message-driven>
> <ejb-name>FrontendMDB</ejb-name>
> <ejb-class>it.ubiquity.sams.jms.FrontendBean</ejb-class>
> <messaging-type>javax.jms.MessageListener</messaging-type>
> <transaction-type>Container</transaction-type>
> <activation-config>
> <activation-config-property>
>
> <activation-config-property-name>queuePrefix</activation-config-property-name>
> <activation-config-property-value>f</activation-config-property-value>
> </activation-config-property>
> </activation-config>
> </message-driven>
> </enterprise-beans>
> <assembly-descriptor>
> <container-transaction>
> <method>
> <ejb-name>FrontendMDB</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>NotSupported</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
> </ejb-jar>
>
> and the openejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <openejb-jar
> xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
> xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
> version="1.0"
> <sys:environment>
> <sys:moduleId>
> <sys:groupId>sams.ejb</sys:groupId>
> <sys:artifactId>UBQ_JSR212_EJB_Frontend</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>jar</sys:type>
> </sys:moduleId>
> <sys:dependencies>
> <sys:dependency>
> <sys:groupId>sams.jca</sys:groupId>
> <sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>car</sys:type>
> </sys:dependency>
> <sys:dependency>
> <sys:groupId>console.jms</sys:groupId>
> <sys:artifactId>sams</sys:artifactId>
> <sys:version>1.0</sys:version>
> </sys:dependency>
> <sys:dependency>
> <sys:groupId>console.dbpool</sys:groupId>
> <sys:artifactId>jdbc_sams</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>rar</sys:type>
> </sys:dependency>
> </sys:dependencies>
> </sys:environment>
>
> <enterprise-beans>
> <message-driven>
> <ejb-name>FrontendMDB</ejb-name>
> <naming:resource-adapter>
> <naming:resource-link>SAMSQueueManager</naming:resource-link>
> </naming:resource-adapter>
> </message-driven>
> </enterprise-beans>
> </openejb-jar>
>
> When I deploy the ear the app server (the jca is already deployed and
> running) give me a strange error:
>
> Caused by: java.lang.IllegalStateException: Container does not exist:
> UBQ_JSR212_JCA_Queue.  Referenced by deployment:
> UBQ_JSR212_EJB_Frontend.jar/FrontendMDB
> at
> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:60)
> ... 28 more
>
> where UBQ_JSR212_EJB_Frontend.jar is the name of the ejb jar in the ear.
> Can someone help me?
> Regards
>
> Angelo

Re: JCA and MDB

by Donald Woods-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you also paste your datasource and jms plans, specifically the ones
for -


<sys:groupId>sams.jca</sys:groupId>
<sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>

<sys:groupId>console.jms</sys:groupId>
<sys:artifactId>sams</sys:artifactId>

<sys:groupId>console.dbpool</sys:groupId>
<sys:artifactId>jdbc_sams</sys:artifactId>


-Donald


ardf69 wrote:

> geronimo-tomcat6-javaee5-2.1.4 under windows
>
> Ciao Angelo
>
>
> Donald Woods-2 wrote:
>> Which release and assembly (Tomcat vs. Jetty) of Geronimo are you using?
>>
>>
>> -Donald
>>
>>
>> ardf69 wrote:
>>> Hi all,
>>> I create a inbound JCA that connects to some JMS Queues (their name is
>>> defined in a DB accessed by hibernate classes). The deploy of the jca and
>>> the start/stop is ok. Here there is the ra.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <connector id="Connector_ID" version="1.5"
>>> xmlns="http://java.sun.com/xml/ns/j2ee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
>>> <description></description>
>>> <display-name>UBQ_JSR212_JCA_Queue</display-name>
>>>   <vendor-name>Ubiquity s.r.l.</vendor-name>
>>>   <eis-type>JMS</eis-type>
>>>   <resourceadapter-version>1.0</resourceadapter-version>                                  
>>>   <resourceadapter>
>>>  
>>> <resourceadapter-class>it.ubiquity.sams.jms.DequeuerResourceAdapter</resourceadapter-class>
>>>   <inbound-resourceadapter>
>>>   <messageadapter>
>>>   <messagelistener>
>>>  
>>> <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
>>>   <activationspec>
>>>  
>>> <activationspec-class>it.ubiquity.sams.jms.DequeuerActivationSpec</activationspec-class>
>>>   <required-config-property>
>>>   <description>The queue prefix</description>
>>>   <config-property-name>queuePrefix</config-property-name>
>>>   </required-config-property>
>>>   </activationspec>
>>>   </messagelistener>
>>>   </messageadapter>
>>>   </inbound-resourceadapter>
>>>   <security-permission>
>>>   <description>Permissions allowed to the EIS Connector</description>
>>>   <security-permission-spec/>
>>>   </security-permission>
>>>   </resourceadapter>
>>> </connector>
>>>
>>> and the geronimo-ra.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <connector
>>> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
>>> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>>>
>>> xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
>>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
>>> xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
>>> xmlns:pers="http://java.sun.com/xml/ns/persistence"
>>> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
>>> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
>>> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
>>> <dep:environment>
>>> <dep:moduleId>
>>> <dep:groupId>sams.jca</dep:groupId>
>>> <dep:artifactId>UBQ_JSR212_JCA_Queue</dep:artifactId>
>>> <dep:version>1.0</dep:version>
>>> <dep:type>car</dep:type>
>>> </dep:moduleId>
>>> <dep:dependencies/>
>>> <dep:hidden-classes/>
>>> <dep:non-overridable-classes/>
>>> </dep:environment>
>>> <resourceadapter>
>>> <resourceadapter-instance>
>>> <resourceadapter-name>SAMSQueueManager</resourceadapter-name>
>>> <name:workmanager>
>>> <name:gbean-link>DefaultWorkManager</name:gbean-link>
>>> </name:workmanager>
>>> </resourceadapter-instance>
>>> </resourceadapter>
>>> </connector>
>>>
>>> I created a mdb that connects to this jca and I included it in ear. Here
>>> there is the geronimo-application.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <app:application
>>> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>>> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
>>> application-name="UBQ_JSR212_EAR_Frontend"
>>> <sys:environment>
>>> <sys:moduleId>
>>> <sys:groupId>sams.ear</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_EAR_Middleware</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>ear</sys:type>
>>> </sys:moduleId>
>>> </sys:environment>
>>> </app:application>
>>>
>>> the ejb-jar.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <ejb-jar id="ejb-jar_ID" version="2.1"
>>> xmlns="http://java.sun.com/xml/ns/j2ee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
>>> <display-name>UBQ_JSR212_EJB_Frontend</display-name>
>>> <enterprise-beans>
>>> <message-driven>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <ejb-class>it.ubiquity.sams.jms.FrontendBean</ejb-class>
>>> <messaging-type>javax.jms.MessageListener</messaging-type>
>>> <transaction-type>Container</transaction-type>
>>> <activation-config>
>>> <activation-config-property>
>>>
>>> <activation-config-property-name>queuePrefix</activation-config-property-name>
>>>
>>> <activation-config-property-value>f</activation-config-property-value>
>>> </activation-config-property>
>>> </activation-config>
>>> </message-driven>
>>> </enterprise-beans>
>>> <assembly-descriptor>
>>> <container-transaction>
>>> <method>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <method-name>*</method-name>
>>> </method>
>>> <trans-attribute>NotSupported</trans-attribute>
>>> </container-transaction>
>>> </assembly-descriptor>
>>> </ejb-jar>
>>>
>>> and the openejb-jar.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <openejb-jar
>>> xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
>>> xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
>>> xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
>>> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
>>> version="1.0"
>>> <sys:environment>
>>> <sys:moduleId>
>>> <sys:groupId>sams.ejb</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_EJB_Frontend</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>jar</sys:type>
>>> </sys:moduleId>
>>> <sys:dependencies>
>>> <sys:dependency>
>>> <sys:groupId>sams.jca</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>car</sys:type>
>>> </sys:dependency>
>>> <sys:dependency>
>>> <sys:groupId>console.jms</sys:groupId>
>>> <sys:artifactId>sams</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> </sys:dependency>
>>> <sys:dependency>
>>> <sys:groupId>console.dbpool</sys:groupId>
>>> <sys:artifactId>jdbc_sams</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>rar</sys:type>
>>> </sys:dependency>
>>> </sys:dependencies>
>>> </sys:environment>
>>>
>>> <enterprise-beans>
>>> <message-driven>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <naming:resource-adapter>
>>> <naming:resource-link>SAMSQueueManager</naming:resource-link>
>>> </naming:resource-adapter>
>>> </message-driven>
>>> </enterprise-beans>
>>> </openejb-jar>
>>>
>>> When I deploy the ear the app server (the jca is already deployed and
>>> running) give me a strange error:
>>>
>>> Caused by: java.lang.IllegalStateException: Container does not exist:
>>> UBQ_JSR212_JCA_Queue.  Referenced by deployment:
>>> UBQ_JSR212_EJB_Frontend.jar/FrontendMDB
>>> at
>>> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:60)
>>> ... 28 more
>>>
>>> where UBQ_JSR212_EJB_Frontend.jar is the name of the ejb jar in the ear.
>>> Can someone help me?
>>> Regards
>>>
>>> Angelo
>>
>

Re: JCA and MDB

by ardf69 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can find geronimo-ra.xml for UBQ_JSR212_JCA_Queue in the first post, while console.jms/sams is a standard definition of a QueueConnecctionFactory via web console and console.dbpool/jdbc_sams is a standard definition of a DataSource via web console. I don't know how to extact the last two from geronimo.

Ciao Angelo

Donald Woods-2 wrote:
Can you also paste your datasource and jms plans, specifically the ones
for -


<sys:groupId>sams.jca</sys:groupId>
<sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>

<sys:groupId>console.jms</sys:groupId>
<sys:artifactId>sams</sys:artifactId>

<sys:groupId>console.dbpool</sys:groupId>
<sys:artifactId>jdbc_sams</sys:artifactId>


-Donald


ardf69 wrote:
> geronimo-tomcat6-javaee5-2.1.4 under windows
>
> Ciao Angelo
>
>
> Donald Woods-2 wrote:
>> Which release and assembly (Tomcat vs. Jetty) of Geronimo are you using?
>>
>>
>> -Donald
>>
>>
>> ardf69 wrote:
>>> Hi all,
>>> I create a inbound JCA that connects to some JMS Queues (their name is
>>> defined in a DB accessed by hibernate classes). The deploy of the jca and
>>> the start/stop is ok. Here there is the ra.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <connector id="Connector_ID" version="1.5"
>>> xmlns="http://java.sun.com/xml/ns/j2ee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
>>> <description></description>
>>> <display-name>UBQ_JSR212_JCA_Queue</display-name>
>>>   <vendor-name>Ubiquity s.r.l.</vendor-name>
>>>   <eis-type>JMS</eis-type>
>>>   <resourceadapter-version>1.0</resourceadapter-version>                                  
>>>   <resourceadapter>
>>>  
>>> <resourceadapter-class>it.ubiquity.sams.jms.DequeuerResourceAdapter</resourceadapter-class>
>>>   <inbound-resourceadapter>
>>>   <messageadapter>
>>>   <messagelistener>
>>>  
>>> <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
>>>   <activationspec>
>>>  
>>> <activationspec-class>it.ubiquity.sams.jms.DequeuerActivationSpec</activationspec-class>
>>>   <required-config-property>
>>>   <description>The queue prefix</description>
>>>   <config-property-name>queuePrefix</config-property-name>
>>>   </required-config-property>
>>>   </activationspec>
>>>   </messagelistener>
>>>   </messageadapter>
>>>   </inbound-resourceadapter>
>>>   <security-permission>
>>>   <description>Permissions allowed to the EIS Connector</description>
>>>   <security-permission-spec/>
>>>   </security-permission>
>>>   </resourceadapter>
>>> </connector>
>>>
>>> and the geronimo-ra.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <connector
>>> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
>>> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>>>
>>> xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
>>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
>>> xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
>>> xmlns:pers="http://java.sun.com/xml/ns/persistence"
>>> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
>>> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
>>> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
>>> <dep:environment>
>>> <dep:moduleId>
>>> <dep:groupId>sams.jca</dep:groupId>
>>> <dep:artifactId>UBQ_JSR212_JCA_Queue</dep:artifactId>
>>> <dep:version>1.0</dep:version>
>>> <dep:type>car</dep:type>
>>> </dep:moduleId>
>>> <dep:dependencies/>
>>> <dep:hidden-classes/>
>>> <dep:non-overridable-classes/>
>>> </dep:environment>
>>> <resourceadapter>
>>> <resourceadapter-instance>
>>> <resourceadapter-name>SAMSQueueManager</resourceadapter-name>
>>> <name:workmanager>
>>> <name:gbean-link>DefaultWorkManager</name:gbean-link>
>>> </name:workmanager>
>>> </resourceadapter-instance>
>>> </resourceadapter>
>>> </connector>
>>>
>>> I created a mdb that connects to this jca and I included it in ear. Here
>>> there is the geronimo-application.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <app:application
>>> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
>>> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
>>> application-name="UBQ_JSR212_EAR_Frontend"
>>> <sys:environment>
>>> <sys:moduleId>
>>> <sys:groupId>sams.ear</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_EAR_Middleware</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>ear</sys:type>
>>> </sys:moduleId>
>>> </sys:environment>
>>> </app:application>
>>>
>>> the ejb-jar.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <ejb-jar id="ejb-jar_ID" version="2.1"
>>> xmlns="http://java.sun.com/xml/ns/j2ee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
>>> <display-name>UBQ_JSR212_EJB_Frontend</display-name>
>>> <enterprise-beans>
>>> <message-driven>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <ejb-class>it.ubiquity.sams.jms.FrontendBean</ejb-class>
>>> <messaging-type>javax.jms.MessageListener</messaging-type>
>>> <transaction-type>Container</transaction-type>
>>> <activation-config>
>>> <activation-config-property>
>>>
>>> <activation-config-property-name>queuePrefix</activation-config-property-name>
>>>
>>> <activation-config-property-value>f</activation-config-property-value>
>>> </activation-config-property>
>>> </activation-config>
>>> </message-driven>
>>> </enterprise-beans>
>>> <assembly-descriptor>
>>> <container-transaction>
>>> <method>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <method-name>*</method-name>
>>> </method>
>>> <trans-attribute>NotSupported</trans-attribute>
>>> </container-transaction>
>>> </assembly-descriptor>
>>> </ejb-jar>
>>>
>>> and the openejb-jar.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <openejb-jar
>>> xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
>>> xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
>>> xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
>>> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
>>> xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
>>> version="1.0"
>>> <sys:environment>
>>> <sys:moduleId>
>>> <sys:groupId>sams.ejb</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_EJB_Frontend</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>jar</sys:type>
>>> </sys:moduleId>
>>> <sys:dependencies>
>>> <sys:dependency>
>>> <sys:groupId>sams.jca</sys:groupId>
>>> <sys:artifactId>UBQ_JSR212_JCA_Queue</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>car</sys:type>
>>> </sys:dependency>
>>> <sys:dependency>
>>> <sys:groupId>console.jms</sys:groupId>
>>> <sys:artifactId>sams</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> </sys:dependency>
>>> <sys:dependency>
>>> <sys:groupId>console.dbpool</sys:groupId>
>>> <sys:artifactId>jdbc_sams</sys:artifactId>
>>> <sys:version>1.0</sys:version>
>>> <sys:type>rar</sys:type>
>>> </sys:dependency>
>>> </sys:dependencies>
>>> </sys:environment>
>>>
>>> <enterprise-beans>
>>> <message-driven>
>>> <ejb-name>FrontendMDB</ejb-name>
>>> <naming:resource-adapter>
>>> <naming:resource-link>SAMSQueueManager</naming:resource-link>
>>> </naming:resource-adapter>
>>> </message-driven>
>>> </enterprise-beans>
>>> </openejb-jar>
>>>
>>> When I deploy the ear the app server (the jca is already deployed and
>>> running) give me a strange error:
>>>
>>> Caused by: java.lang.IllegalStateException: Container does not exist:
>>> UBQ_JSR212_JCA_Queue.  Referenced by deployment:
>>> UBQ_JSR212_EJB_Frontend.jar/FrontendMDB
>>> at
>>> org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:60)
>>> ... 28 more
>>>
>>> where UBQ_JSR212_EJB_Frontend.jar is the name of the ejb jar in the ear.
>>> Can someone help me?
>>> Regards
>>>
>>> Angelo
>>
>