summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeston M. Price <wprice@apache.org>2012-04-17 21:38:29 +0000
committerWeston M. Price <wprice@apache.org>2012-04-17 21:38:29 +0000
commit5e09be7cc6ed2de1be4db0f8d345e0e4685ba801 (patch)
treeb72f5fda834a10c1b9da5e33f393884b46204adc
parent237152da04c827f44ece3c37e310b6e590c4cc91 (diff)
downloadqpid-python-5e09be7cc6ed2de1be4db0f8d345e0e4685ba801.tar.gz
QPID-3701
-Add support for Glassfish 3.1.1 AS -Add necessary configuration files for Glassfish support -Reworked JNDI naming conventions to be consistent across all supported app servers -Fixed NPE in QpidConnectionFactoryProxy -Added necessary documentation files for Glassfish support git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1327294 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/jca/example/README.txt65
-rw-r--r--qpid/java/jca/example/build-geronimo-properties.xml19
-rw-r--r--qpid/java/jca/example/build-glassfish-properties.xml135
-rw-r--r--qpid/java/jca/example/build-jboss-properties.xml4
-rw-r--r--qpid/java/jca/example/build.xml17
-rw-r--r--qpid/java/jca/example/conf/geronimo-application.xml2
-rw-r--r--qpid/java/jca/example/conf/geronimo-ra.xml18
-rw-r--r--qpid/java/jca/example/conf/glassfish-ejb-jar.xml70
-rw-r--r--qpid/java/jca/example/conf/glassfish-resources.xml74
-rw-r--r--qpid/java/jca/example/conf/glassfish-web.xml26
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java2
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java4
-rw-r--r--qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java4
-rw-r--r--qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java15
-rw-r--r--qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/GlassfishTransactionManagerLocator.java63
20 files changed, 485 insertions, 43 deletions
diff --git a/qpid/java/jca/example/README.txt b/qpid/java/jca/example/README.txt
index d94bbfa7e5..eccdf1377f 100644
--- a/qpid/java/jca/example/README.txt
+++ b/qpid/java/jca/example/README.txt
@@ -6,8 +6,8 @@ The Qpid JCA example provides a sample JEE application that demonstrates how to
configure, install and run applications using the Qpid JCA adapter for EE
connectivity and the Apache Qpid C++ Broker. This example code can be used as a
convenient starting point for your own development and deployment
-efforts. Currently the example is supported on JBoss EAP 5.x, JBoss 6.x and
-Apache Geronimo 2.x.
+efforts. Currently the example is supported on JBoss EAP 5.x, JBoss 6.x,
+Apache Geronimo 2.x and Glassfish 3.1.1.
Example Components
===================
@@ -42,11 +42,12 @@ they should be used. These concepts will be explained later in this document.
The deployment configuration for destinations, and ConnectionFactories varies by platform.
In JBossEAP, the configuration mechanism is a *-ds.xml file. Geronimo 2.2.x has the notion
-of a deployment plan in the form of a geronimo-ra.xml file.
+of a deployment plan in the form of a geronimo-ra.xml file. Similarly, Glassfish 3.1.1 uses
+the glassfish-resources.xml file.
-The Qpid JCA Example provides both a qpid-jca-ds.xml file as well as a geronimo-ra.xml deployment
-plan. Both mechanisms provide a reasonable set of defaults to allow you to deploy the Qpid JCA
-adapter in either environment and get up and running quickly.
+The Qpid JCA Example provides a sample qpid-jca-ds.xml, geronimo-ra.xml and glassfish-resources.xml file.
+Each file provides reasonable set of defaults to allow you to deploy the Qpid JCA
+adapter in the supported environments and get up and running quickly.
EJB 3.x
@@ -70,7 +71,7 @@ EE EAR archive
An EAR wrapper for the ejb and web components.
- An RMI client used to excercise the EJB 3.x component.
+An RMI client used to excercise the EJB 3.x component.
Sample *-ds.xml file
A sample *-ds.xml file is provided to create destinations and ManagedConnectionFactories
@@ -80,6 +81,10 @@ Sample geronimo-ra.xml
A sample geronimo-ra.xml file is provided to create destinations and ManagedConnectionFactories
in the Geronimo environment. This file is semantically equivalent to the JBoss *-ds.xml artifact.
+Sample glassfish-resources.xml
+ A sample glassfish-resources.xml file is provided to create JMS destinations and
+ ManagedConnectionFactories in the Glassfish environemnt.
+
A build.xml file
An ant build.xml file to configure, install and deploy the aforementioned components.
@@ -107,14 +112,11 @@ Quickstart
==========
After satifsying the above requirements you are ready to deploy and run the example application.
The steps to deploy and run in the supported application servers are largely the same, however,
-if you are targeting JBoss you will either need to modify the property in the example build.xml file
-
-
- <property name="target.platform" value="geronimo"/>
-
-to be jboss
+you need to specify the target platform environment to which you are attempting to deploy.
<property name="target.platform" value="jboss"/>
+ <property name="target.platform" value="geronimo"/>
+ <property name="target.platform" value="glassfish"/>
or set this property via the command line.
@@ -202,6 +204,16 @@ Geronimo
adapter is now deployed and ready for use in Geronimo.
+Glassfish
+ As previously mentioned, the Glassfish environment uses the glassfish-resources.xml file to configure AdminObjects and ManagedConnectionFactories.
+ A sample file is provided. To deploy the file simply execute:
+
+ ant deploy-rar
+
+ If building from the Qpid source tree, this will package and deploy the qpid-ra-<version>.rar file as well as configure the adapter. If you are
+ not building from source, the adapter will be configured correctly via the glassfish-resources.xml file.
+
+
Step 2 -- Deploy the application component(s).
As previously mentioned, the adapter comes with a variety of EE components for use in your respective application server. You can choose to deploy
@@ -246,6 +258,25 @@ This is the JNDI name of the SLSB component and it varies by application server.
You can set this property if you want to modify the message contents being routed through the system.
+JMS
+If you do not want to use EJB and prefer to test the Qpid JCA adapter using the standard JMS API's, simply set the following property
+
+ <property name="client.use.ejb" value="true"/> <!-- uses JNDI/JMS or JNDI/RMI -->
+
+as
+
+ <property name="client.use.ejb" value="false"/> <!-- uses JNDI/JMS or JNDI/RMI -->
+
+
+Request/Reply
+
+The EJB/JMS client simply sends a message to a destination and does not receive a response. The Qpid JCA examples includes a request-reply
+example to allow you to receive a response. The following command:
+
+ant run-reqresp
+
+will execute this example. A variety of configuration options for both the EJB/JMS and Request/Reply are provided. Please see the build.xml file for more details.
+
Web
The Qpid JCA Example comes with a web application. To access the web component, simply use a browser of your choice and navigate to
@@ -267,6 +298,14 @@ instead of posting to a queue, the web application will use the local interface
RMI client.
+Similar to the Request/Reply example, a Request/Reploy Servlet is provided as well. To access this servlet navigate to the above URL:
+
+
+http://<server-host-name>:<server-port>/qpid-jca-web/qpid-reqresp
+
+A reasonable set of defaults is provided which can be further tuned and configured to suit your development needs.
+
+
Summary
=======
While conceptually simple, the Qpid JCA example provides a majority of the component types and messaging patterns you are most likely to use your development efforts.
diff --git a/qpid/java/jca/example/build-geronimo-properties.xml b/qpid/java/jca/example/build-geronimo-properties.xml
index 7c5bd33cb0..02ecb53134 100644
--- a/qpid/java/jca/example/build-geronimo-properties.xml
+++ b/qpid/java/jca/example/build-geronimo-properties.xml
@@ -22,10 +22,19 @@
<property name="jndi.scheme" value="name"/>
- <!--
- <property name="qpid.xacf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAManagedConnectionFactory/QpidJMSXA"/>
- -->
<property name="qpid.xacf.jndi.name" value="QpidJMSXA"/>
+
+ <property name="jndi.prefix" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/"/>
+
+
+ <property name="qpid.hello.queue.jndi.name" value="HelloQueue"/>
+ <property name="qpid.goodbye.queue.jndi.name" value="GoodByeQueue"/>
+ <property name="qpid.hello.topic.jndi.name" value="HelloTopic"/>
+ <property name="qpid.goodbye.topic.jndi.name" value="GoodByeTopic"/>
+ <property name="qpid.request.queue.jndi.name" value="RequestQueue"/>
+ <property name="qpid.response.queue.jndi.name" value="ResponseQueue"/>
+
+ <!--
<property name="qpid.cf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/QpidConnectionFactory"/>
<property name="qpid.hello.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloQueue"/>
<property name="qpid.goodbye.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeQueue"/>
@@ -33,9 +42,11 @@
<property name="qpid.goodbye.topic.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeTopic"/>
<property name="qpid.request.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/RequestQueue"/>
<property name="qpid.response.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/ResponseQueue"/>
-
+ -->
<property name="qpid.ejb.jndi.name" value="name=&quot;QpidTestEJB&quot;"/>
<property name="qpid.ejb.name" value="QpidTestBeanRemote"/>
+ <property name="qpid.client.cf.jndi.name" value="${jndi.prefix}/QpidConnectionFactory"/>
+ <property name="qpid.client.dest.jndi.name" value="${jndi.prefix}/${qpid.hello.queue.jndi.name}"/>
<property name="jndi.context" value="org.openejb.client.RemoteInitialContextFactory"/>
<property name="server.host" value="ejbd://localhost:4201"/>
diff --git a/qpid/java/jca/example/build-glassfish-properties.xml b/qpid/java/jca/example/build-glassfish-properties.xml
new file mode 100644
index 0000000000..94c79be931
--- /dev/null
+++ b/qpid/java/jca/example/build-glassfish-properties.xml
@@ -0,0 +1,135 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+-->
+<project name="qpid-jca-example-glassfish-properties" basedir="." default="">
+
+ <property name="jndi.scheme" value="name"/>
+ <property name="jndi.prefix" value=""/>
+
+ <property name="qpid.xacf.jndi.name" value="QpidJMSXA"/>
+ <property name="qpid.hello.topic.jndi.name" value="HelloTopic"/>
+ <property name="qpid.goodbye.topic.jndi.name" value="GoodByeTopic"/>
+ <property name="qpid.hello.queue.jndi.name" value="HelloQueue"/>
+ <property name="qpid.goodbye.queue.jndi.name" value="GoodByeQueue"/>
+ <property name="qpid.request.queue.jndi.name" value="QpidRequestQueue"/>
+ <property name="qpid.response.queue.jndi.name" value="QpidResponseQueue"/>
+ <property name="qpid.ejb.jndi.name" value="mappedName=&quot;QpidTestEJB&quot;"/>
+ <property name="qpid.ejb.ref.name" value="QpidTestBean/local"/>
+ <property name="qpid.ejb.name" value="QpidTestBean#org.apache.qpid.jca.example.ejb.QpidTestRemote"/>
+ <property name="qpid.client.cf.jndi.name" value="QpidConnectionFactory"/>
+ <property name="qpid.client.dest.jndi.name" value="${qpid.hello.queue.jndi.name}"/>
+
+ <property name="jndi.context" value="com.sun.enterprise.naming.SerialInitContextFactory"/>
+ <property name="server.host" value="iiop://localhost:3700"/>
+ <property name="glassfish.home" value="${env.GLASSFISH_HOME}"/>
+ <property name="glassfish.domain" value="domain1"/>
+ <property name="glassfish.user" value=""/>
+ <property name="glassfish.password" value=""/>
+
+ <path id="compile.classpath">
+ <fileset dir="${glassfish.home}/glassfish/modules">
+ <include name="javax.ejb.jar"/>
+ <include name="javax.transaction.jar"/>
+ <include name="javax.jms.jar"/>
+ <include name="javax.resource.jar"/>
+ <include name="javax.servlet.jar"/>
+ </fileset>
+
+ <fileset dir="${glassfish.home}/glassfish/domains/${glassfish.domain}/lib/ext">
+ <include name="slf4j-api-*.jar"/>
+ </fileset>
+ </path>
+
+ <path id="run.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="qpid-ra-*.jar"/>
+ <include name="qpid-client-*.jar"/>
+ <include name="qpid-common-*.jar"/>
+ </fileset>
+
+ <fileset dir="${glassfish.home}/glassfish/lib/">
+ <include name="gf-client.jar"/>
+ </fileset>
+
+ <fileset dir="${glassfish.home}/glassfish/modules">
+ <include name="javax.ejb.jar"/>
+ <include name="javax.transaction.jar"/>
+ <include name="javax.jms.jar"/>
+ <include name="javax.resource.jar"/>
+ <include name="javax.servlet.jar"/>
+ </fileset>
+ <fileset dir="${glassfish.home}/glassfish/domains/${glassfish.domain}/lib/ext">
+ <include name="slf4j-api-*.jar"/>
+ </fileset>
+ </path>
+
+ <filterset id="extra.filterset">
+ <filter token="rar.ver" value="${qpid.ver}"/>
+ </filterset>
+
+ <macrodef name="glassfish">
+ <attribute name="user" default="${glassfish.user}"/>
+ <attribute name="password" default="${glassfish.password}"/>
+ <attribute name="action" default="list-applications"/>
+ <attribute name="module"/>
+ <attribute name="plan" default=""/>
+ <sequential>
+ <exec executable="${glassfish.home}/bin/asadmin">
+ <arg line="@{action} @{module} @{plan}"/>
+ </exec>
+ </sequential>
+ </macrodef>
+
+ <target name="package-rar" depends="compile">
+ <jar destfile="${build.dir}/${rar.name}"/>
+ </target>
+
+ <target name="deploy-rar" depends="package-rar" description="Deploy the RAR file.">
+ <glassfish action="deploy" module="${qpid.jca.dir}/${rar.name}"/>
+ <glassfish action="add-resources" module="${gen.dir}/glassfish-resources.xml"/>
+ </target>
+
+
+ <target name="undeploy-resources">
+ <glassfish action="delete-admin-object" module="${qpid.hello.topic.jndi.name}"/>
+ <glassfish action="delete-admin-object" module="${qpid.goodbye.topic.jndi.name}"/>
+ <glassfish action="delete-admin-object" module="${qpid.hello.queue.jndi.name}"/>
+ <glassfish action="delete-admin-object" module="${qpid.goodbye.queue.jndi.name}"/>
+ <glassfish action="delete-admin-object" module="${qpid.request.queue.jndi.name}"/>
+ <glassfish action="delete-admin-object" module="${qpid.response.queue.jndi.name}"/>
+ <glassfish action="delete-connector-connection-pool" module="--cascade true QpidJMSXAPool"/>
+ <glassfish action="delete-connector-connection-pool" module="--cascade true QpidJMSPool"/>
+ <glassfish action="delete-resource-adapter-config" module="QpidResourceAdapter"/>
+ </target>
+
+ <target name="undeploy-rar" description="Deploy the RAR file.">
+ <glassfish action="undeploy" module="--cascade true qpid-ra-${qpid.ver}"/>
+ </target>
+
+ <target name="deploy-ear" description="Deploy the EAR file." depends="package-ear">
+ <glassfish action="deploy" module="${build.dir}/${ear.name}"/>
+ </target>
+
+ <target name="undeploy-ear" description="Undeploy the EAR file.">
+ <glassfish action="undeploy" module="qpid-jcaex"/>
+ </target>
+</project>
+
+
diff --git a/qpid/java/jca/example/build-jboss-properties.xml b/qpid/java/jca/example/build-jboss-properties.xml
index ce0cec2b35..fd38274630 100644
--- a/qpid/java/jca/example/build-jboss-properties.xml
+++ b/qpid/java/jca/example/build-jboss-properties.xml
@@ -21,6 +21,7 @@
<project name="qpid-jca-example-jboss-properties" basedir="." default="">
<property name="jndi.scheme" value="mappedName"/>
+ <property name="jndi.prefix" value=""/>
<property name="qpid.xacf.jndi.name" value="java:QpidJMSXA"/>
<property name="qpid.cf.jndi.name" value="QpidConnectionFactory"/>
@@ -29,9 +30,12 @@
<property name="qpid.hello.queue.jndi.name" value="HelloQueue"/>
<property name="qpid.goodbye.queue.jndi.name" value="GoodByeQueue"/>
<property name="qpid.request.queue.jndi.name" value="QpidRequestQueue"/>
+ <property name="qpid.response.queue.jndi.name" value="QpidResponseQueue"/>
<property name="qpid.ejb.jndi.name" value="mappedName=&quot;QpidTestEJB&quot;"/>
<property name="qpid.ejb.ref.name" value="QpidTestBean/local"/>
<property name="qpid.ejb.name" value="qpid-jcaex/QpidTestBean/remote"/>
+ <property name="qpid.client.cf.jndi.name" value="${jndi.prefix}/QpidConnectionFactory"/>
+ <property name="qpid.client.dest.jndi.name" value="${jndi.prefix}/${qpid.hello.queue.jndi.name}"/>
<property name="jndi.context" value="org.jnp.interfaces.NamingContextFactory"/>
<property name="server.host" value="jnp://localhost:1099"/>
diff --git a/qpid/java/jca/example/build.xml b/qpid/java/jca/example/build.xml
index ab70ee45fc..60b7f7a0d1 100644
--- a/qpid/java/jca/example/build.xml
+++ b/qpid/java/jca/example/build.xml
@@ -27,7 +27,7 @@
<property name="qpid.dest_syntax" value="ADDR"/>
<!-- Properties controlling running sample standalone client -->
- <property name="client.use.ejb" value="true"/> <!-- uses JNDI/JMS or JNDI/RMI -->
+ <property name="client.use.ejb" value="false"/> <!-- uses JNDI/JMS or JNDI/RMI -->
<property name="client.message" value="Hello Qpid World"/>
<property name="client.message.count" value="1"/>
<property name="client.use.topic" value="false"/> <!-- Use topic/queue -->
@@ -72,7 +72,6 @@
<filter token="rar.name" value="${rar.name}"/>
<filter token="ejb.name" value="${ejb.name}"/>
<filter token="war.name" value="${war.name}"/>
-
<filter token="broker.url" value="${broker.url}"/>
<filter token="qpid.hello.topic.dest.address" value="${qpid.hello.topic.dest.address}"/>
@@ -92,12 +91,14 @@
<filter token="rar.name" value="${rar.name}"/>
<filter token="broker.url" value="${broker.url}"/>
<filter token="jndi.scheme" value="${jndi.scheme}"/>
+ <filter token="jndi.prefix" value="${jndi.prefix}"/>
<filter token="qpid.xacf.jndi.name" value="${qpid.xacf.jndi.name}"/>
<filter token="qpid.hello.topic.jndi.name" value="${qpid.hello.topic.jndi.name}"/>
<filter token="qpid.goodbye.topic.jndi.name" value="${qpid.goodbye.topic.jndi.name}"/>
<filter token="qpid.hello.queue.jndi.name" value="${qpid.hello.queue.jndi.name}"/>
<filter token="qpid.goodbye.queue.jndi.name" value="${qpid.goodbye.queue.jndi.name}"/>
<filter token="qpid.request.queue.jndi.name" value="${qpid.request.queue.jndi.name}"/>
+ <filter token="qpid.response.queue.jndi.name" value="${qpid.response.queue.jndi.name}"/>
<filter token="qpid.ejb.jndi.name" value="${qpid.ejb.jndi.name}"/>
</filterset>
</copy>
@@ -112,6 +113,9 @@
<classes dir="${build.classes.dir}">
<include name="org/apache/qpid/jca/example/web/**"/>
</classes>
+ <metainf dir="${gen.dir}">
+ <include name="glassfish-web.xml"/>
+ </metainf>
</war>
</target>
@@ -120,6 +124,7 @@
<include name="org/apache/qpid/jca/example/ejb/**/*.class"/>
<metainf dir="${gen.dir}">
<include name="jboss.xml"/>
+ <include name="glassfish-ejb-jar.xml"/>
</metainf>
</jar>
</target>
@@ -143,9 +148,9 @@
<sysproperty key="java.naming.factory.initial" value="${jndi.context}"/>
<sysproperty key="java.naming.provider.url" value="${server.host}"/>
<sysproperty key="qpid.ejb.name" value="${qpid.ejb.name}"/>
- <sysproperty key="qpid.cf.name" value="${qpid.cf.jndi.name}"/>
+ <sysproperty key="qpid.cf.name" value="${qpid.client.cf.jndi.name}"/>
+ <sysproperty key="qpid.dest.name" value="${qpid.client.dest.jndi.name}"/>
<sysproperty key="qpid.dest_syntax" value="${qpid.dest_syntax}"/>
- <sysproperty key="qpid.dest.name" value="${qpid.hello.queue.jndi.name}"/>
<sysproperty key="log4j.configuration" value="file://${conf.dir}/log4j.properties"/>
<sysproperty key="qpid.message" value="${client.message}"/>
@@ -167,8 +172,8 @@
<sysproperty key="qpid.message" value="Hello, World"/>
<sysproperty key="message.count" value="1"/>
<sysproperty key="thread.count" value="5"/>
- <sysproperty key="qpid.cf.name" value="${qpid.cf.jndi.name}"/>
- <sysproperty key="qpid.dest.name" value="${qpid.responder.queue.jndi.name}"/>
+ <sysproperty key="qpid.cf.name" value="${qpid.client.cf.jndi.name}"/>
+ <sysproperty key="qpid.dest.name" value="${qpid.client.dest.jndi.name}"/>
<sysproperty key="log4j.configuration" value="file://${conf.dir}/log4j.properties"/>
<sysproperty key="qpid.dest_syntax" value="${qpid.dest_syntax}"/>
</java>
diff --git a/qpid/java/jca/example/conf/geronimo-application.xml b/qpid/java/jca/example/conf/geronimo-application.xml
index a855e0fae8..384f6b2e75 100644
--- a/qpid/java/jca/example/conf/geronimo-application.xml
+++ b/qpid/java/jca/example/conf/geronimo-application.xml
@@ -21,7 +21,7 @@
-->
<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
- xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+ xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
application-name="QpidJCAExampleApplication">
<sys:environment>
diff --git a/qpid/java/jca/example/conf/geronimo-ra.xml b/qpid/java/jca/example/conf/geronimo-ra.xml
index 926c73baf1..a7511f647f 100644
--- a/qpid/java/jca/example/conf/geronimo-ra.xml
+++ b/qpid/java/jca/example/conf/geronimo-ra.xml
@@ -74,7 +74,7 @@
<adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>HelloTopic</message-destination-name>
+ <message-destination-name>HelloTopic</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.hello.topic.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
@@ -82,23 +82,25 @@
<adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>GoodByeTopic</message-destination-name>
+ <message-destination-name>GoodByeTopic</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.goodbye.topic.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
+ <!--
<adminobject>
<adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>HelloGoodByeTopic</message-destination-name>
+ <message-destination-name>jms/HelloGoodByeTopic</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.hellogoodbye.topic.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
+ -->
<adminobject>
<adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>HelloQueue</message-destination-name>
+ <message-destination-name>HelloQueue</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.hello.queue.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
@@ -106,7 +108,7 @@
<adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>GoodByeQueue</message-destination-name>
+ <message-destination-name>GoodByeQueue</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.goodbye.queue.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
@@ -114,7 +116,7 @@
<adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>RequestQueue</message-destination-name>
+ <message-destination-name>RequestQueue</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.request.queue.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
@@ -122,7 +124,7 @@
<adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
<adminobject-instance>
- <message-destination-name>ResponseQueue</message-destination-name>
+ <message-destination-name>ResponseQueue</message-destination-name>
<config-property-setting name="DestinationAddress">@qpid.response.queue.dest.address@</config-property-setting>
</adminobject-instance>
</adminobject>
@@ -130,7 +132,7 @@
<adminobject-interface>javax.jms.ConnectionFactory</adminobject-interface>
<adminobject-class>org.apache.qpid.ra.admin.QpidConnectionFactoryProxy</adminobject-class>
<adminobject-instance>
- <message-destination-name>QpidConnectionFactory</message-destination-name>
+ <message-destination-name>QpidConnectionFactory</message-destination-name>
<config-property-setting name="ConnectionURL">@broker.url@</config-property-setting>
</adminobject-instance>
</adminobject>
diff --git a/qpid/java/jca/example/conf/glassfish-ejb-jar.xml b/qpid/java/jca/example/conf/glassfish-ejb-jar.xml
new file mode 100644
index 0000000000..e3ea140472
--- /dev/null
+++ b/qpid/java/jca/example/conf/glassfish-ejb-jar.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 EJB 3.1//EN" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
+<glassfish-ejb-jar>
+ <enterprise-beans>
+ <ejb>
+ <ejb-name>QpidHelloListenerBean</ejb-name>
+ <jndi-name>HelloQueue</jndi-name>
+ <mdb-resource-adapter>
+ <resource-adapter-mid>qpid-ra-@rar.ver@</resource-adapter-mid>
+ </mdb-resource-adapter>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ <ejb>
+ <ejb-name>QpidGoodByeListenerBean</ejb-name>
+ <jndi-name>GoodByeQueue</jndi-name>
+ <mdb-resource-adapter>
+ <resource-adapter-mid>qpid-ra-@rar.ver@</resource-adapter-mid>
+ </mdb-resource-adapter>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ <ejb>
+ <ejb-name>QpidHelloSubscriberBean</ejb-name>
+ <jndi-name>HelloTopic</jndi-name>
+ <mdb-resource-adapter>
+ <resource-adapter-mid>qpid-ra-@rar.ver@</resource-adapter-mid>
+ </mdb-resource-adapter>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ <ejb>
+ <ejb-name>QpidGoodByeSubscriberBean</ejb-name>
+ <jndi-name>GoodByeTopic</jndi-name>
+ <mdb-resource-adapter>
+ <resource-adapter-mid>qpid-ra-@rar.ver@</resource-adapter-mid>
+ </mdb-resource-adapter>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ <ejb>
+ <ejb-name>QpidJMSResponderBean</ejb-name>
+ <jndi-name>QpidResponderQueue</jndi-name>
+ <mdb-resource-adapter>
+ <resource-adapter-mid>qpid-ra-@rar.ver@</resource-adapter-mid>
+ </mdb-resource-adapter>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ <ejb>
+ <ejb-name>QpidTestBean</ejb-name>
+ <jndi-name>QpidTestBean</jndi-name>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ </ejb>
+ </enterprise-beans>
+</glassfish-ejb-jar>
+
diff --git a/qpid/java/jca/example/conf/glassfish-resources.xml b/qpid/java/jca/example/conf/glassfish-resources.xml
new file mode 100644
index 0000000000..9eab4302d5
--- /dev/null
+++ b/qpid/java/jca/example/conf/glassfish-resources.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
+<resources>
+
+
+ <resource-adapter-config name="QpidResourceAdapter" resource-adapter-name="qpid-ra-@rar.ver@" thread-pool-ids="thread-pool-1">
+ <property name="TransactionManagerLocatorClass" value="org.apache.qpid.ra.tm.GlassfishTransactionManagerLocator"/>
+ <property name="TransactionManagerLocatorMethod" value="getTm"/>
+ </resource-adapter-config>
+
+ <!--XAConnectionFactory-->
+ <connector-connection-pool
+ name="QpidJMSXAPool"
+ resource-adapter-name="qpid-ra-@rar.ver@"
+ connection-definition-name="org.apache.qpid.ra.QpidRAConnectionFactory"
+ transaction-support="XATransaction"
+ ping="true">
+ <property name="connectionURL" value="@broker.url@"/>
+ <property name="SessionDefaultType" value="javax.jms.Queue"/>
+ </connector-connection-pool>
+
+ <connector-resource jndi-name="QpidJMSXA" pool-name="QpidJMSXAPool"/>
+
+ <!--LocalTransaction ConnectionFactory
+ <connector-connection-pool
+ name="QpidJMSPool"
+ resource-adapter-name="qpid-ra-@rar.ver@"
+ connection-definition-name="org.apache.qpid.ra.QpidRAConnectionFactory"
+ transaction-support="LocalTransaction"
+ ping="true">
+ <property name="connectionURL" value="@broker.url@"/>
+ <property name="SessionDefaultType" value="javax.jms.Queue"/>
+ <property name="UseLocalTx" value="true"/>
+ </connector-connection-pool>
+
+
+ <connector-resource jndi-name="QpidJMS" pool-name="QpidJMSPool"/>
+
+ -->
+ <!--Destinations-->
+ <admin-object-resource jndi-name="HelloQueue" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidQueue" class-name="org.apache.qpid.ra.admin.QpidQueueImpl">
+ <property name="DestinationAddress" value="@qpid.hello.queue.dest.address@"/>
+ </admin-object-resource>
+
+ <admin-object-resource jndi-name="GoodByeQueue" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidQueue" class-name="org.apache.qpid.ra.admin.QpidQueueImpl">
+ <property name="DestinationAddress" value="@qpid.goodbye.queue.dest.address@"/>
+ </admin-object-resource>
+
+ <admin-object-resource jndi-name="HelloTopic" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidTopic" class-name="org.apache.qpid.ra.admin.QpidTopicImpl">
+ <property name="DestinationAddress" value="@qpid.hello.topic.dest.address@"/>
+ </admin-object-resource>
+
+ <admin-object-resource jndi-name="GoodByeTopic" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidTopic" class-name="org.apache.qpid.ra.admin.QpidTopicImpl">
+ <property name="DestinationAddress" value="@qpid.goodbye.topic.dest.address@"/>
+ </admin-object-resource>
+
+ <!--
+ <admin-object-resource jndi-name="HelloGoodByeTopic" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidTopic" class-name="org.apache.qpid.ra.admin.QpidTopicImpl">
+ <property name="DestinationAddress" value="@qpid.hellogoodbye.topic.dest.address@"/>
+ </admin-object-resource>
+ -->
+ <admin-object-resource jndi-name="QpidRequestQueue" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidQueue" class-name="org.apache.qpid.ra.admin.QpidQueueImpl">
+ <property name="DestinationAddress" value="@qpid.request.queue.dest.address@"/>
+ </admin-object-resource>
+
+ <admin-object-resource jndi-name="QpidResponseQueue" res-adapter="qpid-ra-@rar.ver@" res-type="org.apache.qpid.ra.admin.QpidQueue" class-name="org.apache.qpid.ra.admin.QpidQueueImpl">
+ <property name="DestinationAddress" value="@qpid.response.queue.dest.address@"/>
+ </admin-object-resource>
+
+ <admin-object-resource jndi-name="QpidConnectionFactory" res-adapter="qpid-ra-@rar.ver@" res-type="javax.jms.ConnectionFactory" class-name="org.apache.qpid.ra.admin.QpidConnectionFactoryProxy">
+ <property name="ConnectionURL" value="@broker.url@"/>
+ </admin-object-resource>
+
+</resources>
diff --git a/qpid/java/jca/example/conf/glassfish-web.xml b/qpid/java/jca/example/conf/glassfish-web.xml
new file mode 100644
index 0000000000..950ee73d51
--- /dev/null
+++ b/qpid/java/jca/example/conf/glassfish-web.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
+<glassfish-web-app>
+
+ <context-root>qpid-jca-web</context-root>
+
+ <ejb-ref>
+ <ejb-ref-name>QpidTestBean</ejb-ref-name>
+ <jndi-name>QpidTestBean</jndi-name>
+ </ejb-ref>
+
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <jndi-name>QpidJMSXA</jndi-name>
+ </resource-ref>
+ <resource-env-ref>
+ <res-env-ref-name>HelloQueue</res-env-ref-name>
+ <jndi-name>HelloQueue</jndi-name>
+ </resource-env-ref>
+ <resource-ref>
+ <res-ref-name>HelloTopic</res-ref-name>
+ <jndi-name>HelloTopic</jndi-name>
+ </resource-ref>
+
+
+</glassfish-web-app>
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java
index 734df1c0f3..fd5b3efff0 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java
@@ -42,7 +42,7 @@ public class QpidRequestResponseClient implements MessageListener, Runnable
private static final Logger _log = LoggerFactory.getLogger(QpidRequestResponseClient.class);
private static final String DEFAULT_CF_JNDI = "QpidConnectionFactory";
- private static final String DEFAULT_DESTINATION_JNDI = "QpidResponderQueue";
+ private static final String DEFAULT_DESTINATION_JNDI = "QpidRequestQueue";
private static final String DEFAULT_MESSAGE = "Hello, World!";
private static final int DEFAULT_MESSAGE_COUNT = 1;
private static final int DEFAULT_THREAD_COUNT = 1;
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java
index 9cf220de2a..bdb722a87b 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
- @ActivationConfigProperty(propertyName = "destination", propertyValue = "@qpid.goodbye.queue.jndi.name@"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.goodbye.queue.jndi.name@"),
@ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"),
@ActivationConfigProperty(propertyName = "useLocalTx", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
index 2e43898ed7..f2e4d6aaa5 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
- @ActivationConfigProperty(propertyName = "destination", propertyValue = "@qpid.goodbye.topic.jndi.name@"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.goodbye.topic.jndi.name@"),
@ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"),
@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NotDurable"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
index 7cb7095ff4..42a9ab6f60 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
- @ActivationConfigProperty(propertyName = "destination", propertyValue = "@qpid.hello.queue.jndi.name@"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.hello.queue.jndi.name@"),
@ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
})
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
index 768cf25c3c..882c85fa18 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
- @ActivationConfigProperty(propertyName = "destination", propertyValue = "@qpid.hello.topic.jndi.name@"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.hello.topic.jndi.name@"),
@ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"),
@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NotDurable"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
index d4562511d0..6e99d4fe7f 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
- @ActivationConfigProperty(propertyName = "destination", propertyValue = "@qpid.request.queue.jndi.name@"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.request.queue.jndi.name@"),
@ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
})
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
index 014b459699..a5f4770257 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
@@ -43,10 +43,10 @@ public class QpidTestBean implements QpidTestRemote, QpidTestLocal
@Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
private ConnectionFactory _connectionFactory;
- @Resource(@jndi.scheme@="HelloQueue")
+ @Resource(@jndi.scheme@="@qpid.hello.queue.jndi.name@")
private Destination _queue;
- @Resource(@jndi.scheme@="HelloTopic")
+ @Resource(@jndi.scheme@="@qpid.hello.topic.jndi.name@")
private Destination _topic;
@Override
diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java
index 195a54242f..d069a0c943 100644
--- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java
+++ b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java
@@ -59,10 +59,10 @@ public class QpidRequestResponseServlet extends HttpServlet
@Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
private ConnectionFactory _connectionFactory;
- @Resource(@jndi.scheme@="QpidRequestQueue")
+ @Resource(@jndi.scheme@="@qpid.request.queue.jndi.name@")
private Destination _queue;
- @Resource(@jndi.scheme@="QpidResponseQueue")
+ @Resource(@jndi.scheme@="@qpid.response.queue.jndi.name@")
private Destination _responseQueue;
diff --git a/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java b/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java
index 41242fefae..7f2bee079f 100644
--- a/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java
+++ b/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java
@@ -137,7 +137,20 @@ public class QpidConnectionFactoryProxy implements Externalizable, Referenceable
*/
public Connection createConnection() throws JMSException
{
- return _delegate.createConnection();
+ try
+ {
+ if(_delegate == null)
+ {
+ getReference();
+ }
+
+ return _delegate.createConnection();
+ }
+ catch(Exception e)
+ {
+ throw new JMSException(e.getMessage());
+ }
+
}
/**
diff --git a/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/GlassfishTransactionManagerLocator.java b/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/GlassfishTransactionManagerLocator.java
new file mode 100644
index 0000000000..cff53d2710
--- /dev/null
+++ b/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/GlassfishTransactionManagerLocator.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.ra.tm;
+
+
+import javax.naming.InitialContext;
+import javax.transaction.TransactionManager;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class GlassfishTransactionManagerLocator
+{
+ private static final Logger _log = LoggerFactory.getLogger(GlassfishTransactionManagerLocator.class);
+
+ private static final String TM_JNDI_NAME = "java:appserver/TransactionManager";
+
+ public TransactionManager getTm() throws Exception
+ {
+ InitialContext ctx = null;
+ TransactionManager tm = null;
+
+ try
+ {
+ ctx = new InitialContext();
+ tm = (TransactionManager)ctx.lookup(TM_JNDI_NAME);
+ }
+ catch(Exception e)
+ {
+ _log.error("Error attempting to location TM " + e.getMessage());
+ }
+ finally
+ {
+ try
+ {
+ if(ctx != null)
+ {
+ ctx.close();
+ }
+ }
+ catch(Exception ignore){}
+ }
+
+ return tm;
+ }
+}