You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by ivanrc <ir...@indra.es> on 2007/11/06 10:08:49 UTC
Configure and Deploy JMS Resources in Geronimo 2.0.2
Hello,
I´m trying to configure and deploy JMS Resources in Geronimo 2.0.2. I´ve
got the connector xml file below that is for geronimo 1.1
I want to know what I have to change in this file and how to deploy it,
because i trying to use...
deploy.bat deploy my-JMS-resources-plan.xml
repository/activemq/rars/activemq.rar
... and It in this version doesn´t work.
Thanks.
my-JMS-resources-plan.xml:
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
configId="SampleJMSResources" parentId="geronimo/activemq/1.0/car">
<resourceadapter>
<resourceadapter-instance>
<resourceadapter-name>SampleJMSResources</resourceadapter-name>
<config-property-setting
name="ServerUrl">tcp://localhost:61616</config-property-setting>
<workmanager>
<gbean-link>DefaultWorkManager</gbean-link>
</workmanager>
</resourceadapter-instance>
<!-- defines a ConnectionFactory -->
<outbound-resourceadapter>
<connection-definition>
<connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
<connectiondefinition-instance>
<name>SampleConnectionFactory</name>
<implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
<implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
<connectionmanager>
<xa-transaction>
<transaction-caching />
</xa-transaction>
<single-pool>
<max-size>10</max-size>
<min-size>0</min-size>
<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
<idle-timeout-minutes>0</idle-timeout-minutes>
<match-one />
</single-pool>
</connectionmanager>
<global-jndi-name>jms/SampleConectionFactory</global-jndi-name>
</connectiondefinition-instance>
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
<!-- defines a Topic -->
<adminobject>
<adminobject-interface>javax.jms.Topic</adminobject-interface>
<adminobject-class>org.codehaus.activemq.message.ActiveMQTopic</adminobject-class>
<adminobject-instance>
<message-destination-name>SampleTopic</message-destination-name>
<config-property-setting
name="PhysicalName">SampleTopic</config-property-setting>
</adminobject-instance>
</adminobject>
<!-- defines a Queue -->
<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
<adminobject-instance>
<message-destination-name>SampleQueue</message-destination-name>
<config-property-setting
name="PhysicalName">SampleQueue</config-property-setting>
</adminobject-instance>
</adminobject>
</connector>
--
View this message in context: http://www.nabble.com/Configure-and-Deploy-JMS-Resources-in-Geronimo-2.0.2-tf4756866s134.html#a13603013
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 11/6/07, ivanrc <ir...@indra.es> wrote:
> and my jndi.parameters are...
>
> java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
> java.naming.provider.url=tcp://localhost:61616
> topic.MyTopic=jms/CustomerServiceTopic
>
> but always obtain javax.naming.NamingException: Cannot lookup
Use the remote client sample as a reference:
package pl.jaceklaskowski.ticketservice;
import java.util.Properties;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
public class TicketServiceClient {
private final static int NUMBER_OF_MESSAGES = 1;
public static void main(String[] args) throws Exception {
Properties env = new Properties();
env.put(Context.PROVIDER_URL, "tcp://localhost:61616");
env.put("connectionFactoryNames", "TicketConnectionFactory");
env.put("queue.TicketQueue", "TicketQueue");
Context jndiContext = new InitialContext(env);
QueueConnectionFactory factory = (QueueConnectionFactory)
jndiContext.lookup("TicketConnectionFactory");
Queue queue = (Queue) jndiContext.lookup("TicketQueue");
QueueConnection connection = factory.createQueueConnection();
QueueSession session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(queue);
for (int i = 0; i < NUMBER_OF_MESSAGES; i++) {
System.out.println("Wysylana wiadomosc nr #" + i);
TextMessage txtMsg = session.createTextMessage();
txtMsg.setText("Wiadomosc od Jacka o numerze #" + i);
producer.send(txtMsg);
}
session.close();
connection.close();
}
}
Change the managed object names appropriately.
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by ivanrc <ir...@indra.es>.
yes I tried It. I´ve created a ConnectionGroup
(CustomerServiceConnectionGroup
(console.jms/CustomerServiceConnectionGroup/1.0/rar) with a
ConnectionFactory (named IHCIConnectionFactory) and topic (named
CustomerServiceTopic) but I can not obtain ConectionFactory. I tried use
this...
TopicConnectionFactory factory =
(javax.jms.TopicConnectionFactory)ctx.lookup("IHCIConnectionFactory");
and this
TopicConnectionFactory factory =
(javax.jms.TopicConnectionFactory)ctx.lookup("jms/IHCIConnectionFactory");
and my jndi.parameters are...
java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
java.naming.provider.url=tcp://localhost:61616
topic.MyTopic=jms/CustomerServiceTopic
but always obtain javax.naming.NamingException: Cannot lookup
Other thing, is that I don´t know how to modify a ConnectionGroup after
created it.
could you help me?
Vamsavardhana Reddy-2 wrote:
>
> Have you tried using the JMS Resources portlet in the Admin Console?
>
> ++Vamsi
>
> On 11/6/07, ivanrc <ir...@indra.es> wrote:
>>
>>
>> Hello,
>>
>> I´m trying to configure and deploy JMS Resources in Geronimo 2.0.2. I´ve
>> got the connector xml file below that is for geronimo 1.1
>>
>> I want to know what I have to change in this file and how to deploy it,
>> because i trying to use...
>>
>> deploy.bat deploy my-JMS-resources-plan.xml
>> repository/activemq/rars/activemq.rar
>>
>> ... and It in this version doesn´t work.
>>
>> Thanks.
>>
>>
>> my-JMS-resources-plan.xml:
>>
>>
>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
>> configId="SampleJMSResources" parentId="geronimo/activemq/1.0/car">
>> <resourceadapter>
>> <resourceadapter-instance>
>>
>>
>> <resourceadapter-name>SampleJMSResources</resourceadapter-name>
>> <config-property-setting
>> name="ServerUrl">tcp://localhost:61616</config-property-setting>
>> <workmanager>
>>
>>
>> <gbean-link>DefaultWorkManager</gbean-link>
>> </workmanager>
>> </resourceadapter-instance>
>> <!-- defines a ConnectionFactory -->
>> <outbound-resourceadapter>
>> <connection-definition>
>>
>> <connectionfactory-interface>javax.jms.ConnectionFactory
>> </connectionfactory-interface>
>> <connectiondefinition-instance>
>>
>>
>> <name>SampleConnectionFactory</name>
>>
>> <implemented-interface>javax.jms.QueueConnectionFactory
>> </implemented-interface>
>>
>> <implemented-interface>javax.jms.TopicConnectionFactory
>> </implemented-interface>
>> <connectionmanager>
>> <xa-transaction>
>>
>> <transaction-caching
>> />
>> </xa-transaction>
>> <single-pool>
>>
>>
>> <max-size>10</max-size>
>>
>>
>> <min-size>0</min-size>
>>
>>
>> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
>>
>>
>> <idle-timeout-minutes>0</idle-timeout-minutes>
>> <match-one />
>> </single-pool>
>> </connectionmanager>
>>
>>
>> <global-jndi-name>jms/SampleConectionFactory</global-jndi-name>
>> </connectiondefinition-instance>
>> </connection-definition>
>> </outbound-resourceadapter>
>> </resourceadapter>
>> <!-- defines a Topic -->
>> <adminobject>
>> <adminobject-interface>javax.jms.Topic
>> </adminobject-interface>
>>
>> <adminobject-class>org.codehaus.activemq.message.ActiveMQTopic
>> </adminobject-class>
>> <adminobject-instance>
>>
>>
>> <message-destination-name>SampleTopic</message-destination-name>
>> <config-property-setting
>> name="PhysicalName">SampleTopic</config-property-setting>
>> </adminobject-instance>
>> </adminobject>
>> <!-- defines a Queue -->
>> <adminobject>
>> <adminobject-interface>javax.jms.Queue
>> </adminobject-interface>
>>
>> <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue
>> </adminobject-class>
>> <adminobject-instance>
>>
>>
>> <message-destination-name>SampleQueue</message-destination-name>
>> <config-property-setting
>> name="PhysicalName">SampleQueue</config-property-setting>
>> </adminobject-instance>
>> </adminobject>
>> </connector>
>> --
>> View this message in context:
>> http://www.nabble.com/Configure-and-Deploy-JMS-Resources-in-Geronimo-2.0.2-tf4756866s134.html#a13603013
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Configure-and-Deploy-JMS-Resources-in-Geronimo-2.0.2-tf4756866s134.html#a13603301
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 11/6/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> Have you tried using the JMS Resources portlet in the Admin Console?
Admin Console is broken on Jetty due to java.io.IOException: FULL head
(http://issues.apache.org/jira/browse/GERONIMO-3523). It might work
fine on Tomcat, though (I didn't try it out myself).
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Have you tried using the JMS Resources portlet in the Admin Console?
++Vamsi
On 11/6/07, ivanrc <ir...@indra.es> wrote:
>
>
> Hello,
>
> I´m trying to configure and deploy JMS Resources in Geronimo 2.0.2. I´ve
> got the connector xml file below that is for geronimo 1.1
>
> I want to know what I have to change in this file and how to deploy it,
> because i trying to use...
>
> deploy.bat deploy my-JMS-resources-plan.xml
> repository/activemq/rars/activemq.rar
>
> ... and It in this version doesn´t work.
>
> Thanks.
>
>
> my-JMS-resources-plan.xml:
>
>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
> configId="SampleJMSResources" parentId="geronimo/activemq/1.0/car">
> <resourceadapter>
> <resourceadapter-instance>
>
> <resourceadapter-name>SampleJMSResources</resourceadapter-name>
> <config-property-setting
> name="ServerUrl">tcp://localhost:61616</config-property-setting>
> <workmanager>
>
> <gbean-link>DefaultWorkManager</gbean-link>
> </workmanager>
> </resourceadapter-instance>
> <!-- defines a ConnectionFactory -->
> <outbound-resourceadapter>
> <connection-definition>
>
> <connectionfactory-interface>javax.jms.ConnectionFactory
> </connectionfactory-interface>
> <connectiondefinition-instance>
>
> <name>SampleConnectionFactory</name>
>
> <implemented-interface>javax.jms.QueueConnectionFactory
> </implemented-interface>
>
> <implemented-interface>javax.jms.TopicConnectionFactory
> </implemented-interface>
> <connectionmanager>
> <xa-transaction>
> <transaction-caching
> />
> </xa-transaction>
> <single-pool>
>
> <max-size>10</max-size>
>
> <min-size>0</min-size>
>
> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
>
> <idle-timeout-minutes>0</idle-timeout-minutes>
> <match-one />
> </single-pool>
> </connectionmanager>
>
> <global-jndi-name>jms/SampleConectionFactory</global-jndi-name>
> </connectiondefinition-instance>
> </connection-definition>
> </outbound-resourceadapter>
> </resourceadapter>
> <!-- defines a Topic -->
> <adminobject>
> <adminobject-interface>javax.jms.Topic
> </adminobject-interface>
>
> <adminobject-class>org.codehaus.activemq.message.ActiveMQTopic
> </adminobject-class>
> <adminobject-instance>
>
> <message-destination-name>SampleTopic</message-destination-name>
> <config-property-setting
> name="PhysicalName">SampleTopic</config-property-setting>
> </adminobject-instance>
> </adminobject>
> <!-- defines a Queue -->
> <adminobject>
> <adminobject-interface>javax.jms.Queue
> </adminobject-interface>
>
> <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue
> </adminobject-class>
> <adminobject-instance>
>
> <message-destination-name>SampleQueue</message-destination-name>
> <config-property-setting
> name="PhysicalName">SampleQueue</config-property-setting>
> </adminobject-instance>
> </adminobject>
> </connector>
> --
> View this message in context:
> http://www.nabble.com/Configure-and-Deploy-JMS-Resources-in-Geronimo-2.0.2-tf4756866s134.html#a13603013
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by ivanrc <ir...@indra.es>.
Jacek Laskowski wrote:
>
> On 11/6/07, ivanrc <ir...@indra.es> wrote:
>
>> I´m trying to configure and deploy JMS Resources in Geronimo 2.0.2. I´ve
>> got the connector xml file below that is for geronimo 1.1
>>
>> I want to know what I have to change in this file and how to deploy it,
>> because i trying to use...
>>
>> deploy.bat deploy my-JMS-resources-plan.xml
>> repository/activemq/rars/activemq.rar
>>
>> ... and It in this version doesn´t work.
>
> Hi,
>
> my-JMS-resources-plan.xml:
>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
> <dep:environment
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
> <dep:dependencies>
> <dep:dependency>
> <dep:groupId>org.apache.geronimo.configs</dep:groupId>
> <dep:artifactId>activemq-broker</dep:artifactId>
> <dep:type>car</dep:type>
> </dep:dependency>
> </dep:dependencies>
> </dep:environment>
> <resourceadapter>
> <resourceadapter-instance>
> <resourceadapter-name>SampleJMSResources</resourceadapter-name>
> <workmanager xmlns="http://geronimo.apache.org/xml/ns/naming-1.2">
> <gbean-link>DefaultWorkManager</gbean-link>
> </workmanager>
> </resourceadapter-instance>
> <outbound-resourceadapter>
> <connection-definition>
>
> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
> <connectiondefinition-instance>
> <name>SampleConnectionFactory</name>
>
> <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
>
> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
> <connectionmanager>
> <xa-transaction>
> <transaction-caching />
> </xa-transaction>
> <single-pool>
> <max-size>10</max-size>
> <min-size>0</min-size>
>
> <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
> <idle-timeout-minutes>0</idle-timeout-minutes>
> <match-one />
> </single-pool>
> </connectionmanager>
> </connectiondefinition-instance>
> </connection-definition>
> </outbound-resourceadapter>
> </resourceadapter>
> <adminobject>
> <adminobject-interface>javax.jms.Topic</adminobject-interface>
>
> <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
> <adminobject-instance>
> <message-destination-name>SampleTopic</message-destination-name>
> <config-property-setting
> name="PhysicalName">SampleTopic</config-property-setting>
> </adminobject-instance>
> </adminobject>
> <adminobject>
> <adminobject-interface>javax.jms.Queue</adminobject-interface>
>
> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
> <adminobject-instance>
> <message-destination-name>SampleQueue</message-destination-name>
> <config-property-setting
> name="PhysicalName">SampleQueue</config-property-setting>
> </adminobject-instance>
> </adminobject>
> </connector>
>
> The command to deploy the file is as follows:
>
> jlaskowski@dev /cygdrive/c/geronimo-jetty6-jee5-2.0.2
> $ ./bin/deploy.sh --user system --password manager deploy
> my-JMS-resources-plan.xml
> repository/org/apache/geronimo/modules/geronimo-activemq-ra/2.0.2/geronimo-activemq-ra-2.0.2.rar
> Using GERONIMO_BASE: c:\geronimo-jetty6-jee5-2.0.2
> Using GERONIMO_HOME: c:\geronimo-jetty6-jee5-2.0.2
> Using GERONIMO_TMPDIR: c:\geronimo-jetty6-jee5-2.0.2\var\temp
> Using JRE_HOME: c:\apps\java5\jre
> Deployed default/geronimo-activemq-ra-2.0.2.rar/1194341150421/rar
>
> and you can see the managed objects deployed to Geronimo in the web
> console:
>
> http://localhost:8080/console/portal/services/services_jms
>
> SampleJMSResources
> (default/geronimo-activemq-ra-2.0.2.rar/1194341150421/rar)
> Type Name Deployed As State Actions
> Connection Factory SampleConnectionFactory Server-wide running
> Queue SampleQueue Server-wide running
> Topic SampleTopic Server-wide running
>
> These managed objects are server-wide so all applications can use it.
> If you want to "bind" these managed objects to your application, place
> the xml file within geronimo-application.xml of your application.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>
>
it works! thanks :)
--
View this message in context: http://www.nabble.com/Configure-and-Deploy-JMS-Resources-in-Geronimo-2.0.2-tf4756866s134.html#a13604890
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Configure and Deploy JMS Resources in Geronimo 2.0.2
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 11/6/07, ivanrc <ir...@indra.es> wrote:
> I´m trying to configure and deploy JMS Resources in Geronimo 2.0.2. I´ve
> got the connector xml file below that is for geronimo 1.1
>
> I want to know what I have to change in this file and how to deploy it,
> because i trying to use...
>
> deploy.bat deploy my-JMS-resources-plan.xml
> repository/activemq/rars/activemq.rar
>
> ... and It in this version doesn´t work.
Hi,
my-JMS-resources-plan.xml:
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
<dep:dependencies>
<dep:dependency>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>activemq-broker</dep:artifactId>
<dep:type>car</dep:type>
</dep:dependency>
</dep:dependencies>
</dep:environment>
<resourceadapter>
<resourceadapter-instance>
<resourceadapter-name>SampleJMSResources</resourceadapter-name>
<workmanager xmlns="http://geronimo.apache.org/xml/ns/naming-1.2">
<gbean-link>DefaultWorkManager</gbean-link>
</workmanager>
</resourceadapter-instance>
<outbound-resourceadapter>
<connection-definition>
<connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
<connectiondefinition-instance>
<name>SampleConnectionFactory</name>
<implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
<implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
<connectionmanager>
<xa-transaction>
<transaction-caching />
</xa-transaction>
<single-pool>
<max-size>10</max-size>
<min-size>0</min-size>
<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
<idle-timeout-minutes>0</idle-timeout-minutes>
<match-one />
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
<adminobject>
<adminobject-interface>javax.jms.Topic</adminobject-interface>
<adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
<adminobject-instance>
<message-destination-name>SampleTopic</message-destination-name>
<config-property-setting
name="PhysicalName">SampleTopic</config-property-setting>
</adminobject-instance>
</adminobject>
<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
<adminobject-instance>
<message-destination-name>SampleQueue</message-destination-name>
<config-property-setting
name="PhysicalName">SampleQueue</config-property-setting>
</adminobject-instance>
</adminobject>
</connector>
The command to deploy the file is as follows:
jlaskowski@dev /cygdrive/c/geronimo-jetty6-jee5-2.0.2
$ ./bin/deploy.sh --user system --password manager deploy
my-JMS-resources-plan.xml
repository/org/apache/geronimo/modules/geronimo-activemq-ra/2.0.2/geronimo-activemq-ra-2.0.2.rar
Using GERONIMO_BASE: c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_HOME: c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_TMPDIR: c:\geronimo-jetty6-jee5-2.0.2\var\temp
Using JRE_HOME: c:\apps\java5\jre
Deployed default/geronimo-activemq-ra-2.0.2.rar/1194341150421/rar
and you can see the managed objects deployed to Geronimo in the web console:
http://localhost:8080/console/portal/services/services_jms
SampleJMSResources (default/geronimo-activemq-ra-2.0.2.rar/1194341150421/rar)
Type Name Deployed As State Actions
Connection Factory SampleConnectionFactory Server-wide running
Queue SampleQueue Server-wide running
Topic SampleTopic Server-wide running
These managed objects are server-wide so all applications can use it.
If you want to "bind" these managed objects to your application, place
the xml file within geronimo-application.xml of your application.
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl