• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8076
  • Last Modified:

how to send messages to a queue on a remote server

am requried to send messages to a queue on a remote server.

The server is JBOSS JMS.
I am using jboss4.0.2 and ;i have created messaging instance in my jboss server and inside jboss-messaging.sar is there;

i changed jms-ds.xml,jboss.xml and standardjboss.xml.

i am getting following exception;

jms-ds.xml
*********

<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">QueuehostJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
    <!-- Use HAJNDI to access JMS -->
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1099
    </attribute>
  </mbean>
      

   <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
          name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool">
      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
      <attribute name="PoolName">StdJMSPool</attribute>
      <attribute name="PoolFactoryClass">org.jboss.jms.asf.StdServerSessionPoolFactory</attribute>
   </mbean>

   <!-- JMS XA Resource adapter, use this to get transacted JMS in beans
  <tx-connection-factory>
    <jndi-name>JmsXA</jndi-name>
    <xa-transaction/>
    <rar-name>jms-ra.rar</rar-name>
    <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
    <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
    <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
    <max-pool-size>20</max-pool-size>
    <security-domain-and-application>JmsXARealm</security-domain-and-application>
  </tx-connection-factory>-->
   <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->

   <tx-connection-factory>
      <jndi-name>JmsXA</jndi-name>
      <xa-transaction/>
      <rar-name>jms-ra.rar</rar-name>
      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
      <max-pool-size>20</max-pool-size>
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
      <depends>jboss.messaging:service=ServerPeer</depends>
   </tx-connection-factory>

jboss.xml
*****
<message-driven>
      <ejb-name>TestMessageDrivenBean</ejb-name>
      <configuration-name>Standard Message Driven Bean</configuration-name>
      <destination-jndi-name>queue/testQueue</destination-jndi-name>
       <invoker-bindings>
            <invoker>      
               <invoker-proxy-binding-name>my-mdb-invoker</invoker-proxy-binding-name>
            </invoker>
        </invoker-bindings>
    </message-driven>
standardjboss.xml
***********

 <invoker-proxy-binding>
         <name>my-mdb-invoker</name>
         <invoker-mbean>does-not-matter</invoker-mbean>
         <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
         <proxy-factory-config>
            <JMSProviderAdapterJNDI>QueuehostJMSProvider</JMSProviderAdapterJNDI>
            <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
            <MinimumSize>1</MinimumSize>
            <MaximumSize>15</MaximumSize>
            <KeepAliveMillis>30000</KeepAliveMillis>
            <MaxMessages>1</MaxMessages>
            <MDBConfig>
               <ReconnectIntervalSec>10</ReconnectIntervalSec>
               <DLQConfig>
                  <DestinationQueue>queue/DLQ</DestinationQueue>
                  <MaxTimesRedelivered>10</MaxTimesRedelivered>
                  <TimeToLive>0</TimeToLive>
               </DLQConfig>
            </MDBConfig>
         </proxy-factory-config>
      </invoker-proxy-binding>

0
chaitu chaitu
Asked:
chaitu chaitu
  • 10
  • 10
1 Solution
 
girionisCommented:
> i am getting following exception;

What exception?
0
 
chaitu chaituAuthor Commented:
2006-11-30 23:13:43,783 ERROR [org.jboss.ejb.plugins.jms.DLQHandler] Initialization failed DLQHandler
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:151)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:238)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:165)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:597)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:922)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy159.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:418)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
chaitu chaituAuthor Commented:
http://www.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureAnMDBToTalkToARemoteQueue

if you from the above link it mentioned about server=queuehost;what is queuehost??

Since 3.2.4 there is an improved ProviderAdapterClass that lets you specify all JNDI properties.


  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=RemoteJMSProvider,server=queuehost">
    <attribute name="ProviderName">QueuehostJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
    <!-- Connect to JNDI on the host "queuehost" port 1099 -->
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jnp.interfaces
       java.naming.provider.url=queuehost:1099
    </attribute>
  </mbean>
0
 
girionisCommented:
From: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingJBossMQMigrationGuide

 JMS Client Exceptions

PROBLEM: When running a client connecting directly to JBoss Messaging services, the following exception is thrown:


javax.naming.CommunicationException Root exception is java.lang.ClassNotFoundException:
  org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)


SOLUTION: You need to add jboss-messaging-client.jar library in the classpath of any client application attempting to connect or lookup JBoss Messaging administered objects directly.
0
 
chaitu chaituAuthor Commented:
2006-12-01 15:49:37,773 WARN  [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected:
java.lang.NoSuchFieldError: dcl
      at org.jboss.aop.deployment.JBossClassPool.isUnloadedClassLoader(JBossClassPool.java:47)
      at org.jboss.aop.AspectManager.clearUnregisteredClassLoaders(AspectManager.java:620)
      at org.jboss.aop.AspectManager.getRegisteredCLs(AspectManager.java:600)
      at org.jboss.aop.AspectManager.registerClassLoader(AspectManager.java:679)
      at org.jboss.aop.AspectManager.findClassPool(AspectManager.java:668)
      at org.jboss.aop.annotation.PortableAnnotationElement.getClassFile(PortableAnnotationElement.java:253)
      at org.jboss.aop.annotation.PortableAnnotationElement.isAnyAnnotationPresent(PortableAnnotationElement.java:235)
      at org.jboss.aop.Advisor.hasAnnotation(Advisor.java:346)
      at org.jboss.aop.pointcut.Util.matchesClassExpr(Util.java:113)
      at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:153)
      at org.jboss.aop.pointcut.ast.ASTClass.jjtAccept(ASTClass.java:43)
      at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:73)
      at org.jboss.aop.pointcut.ast.ASTStart.jjtAccept(ASTStart.java:42)
      at org.jboss.aop.introduction.InterfaceIntroduction.matches(InterfaceIntroduction.java:233)
0
 
chaitu chaituAuthor Commented:
girionis,

i have read the document but i didnt understand what changs need to be done to my server;.
0
 
girionisCommented:
THis is what you need to do

Yes, just copying the jar into the lib directory won't work - JBoss Messaging uses different versions of aop and remoting to those used by JBoss AS 4.x - that's why we do a scoped deployment.

(All these hassles due to scoped deployments will disappear when JBoss 5 is out :) )

You need to either deploy the sar into your AS client machine - but this will give you a server too which you don't want in your case.

Alternatively you should be able to package the jboss client jar inside your ear file, and scope your ear.

I know you have tried this but had some problems with the structure - but I think it should work.

Try this and let me know if it works.
0
 
chaitu chaituAuthor Commented:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigMessagingJDBC2Persistence

i followed 2nd approach i.e Remote JBoss Messaging Instance.i followed all the things described above  and deployed the ear;no errors;

say i deployed ear in one system in that mdb.jar is there.see java.naming.provider.url;Is it ok??

in the server jms-ds.xml is like this;see
  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">QueuehostJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
    <!-- Use HAJNDI to access JMS -->
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1099
    </attribute>
  </mbean>


  in another system say B how jms client in system-B access mdb.jar deployed in  system A..

 how to look up remotely;
0
 
girionisCommented:
You have to get a reference to the remote object first by using the InitialContext. Then use this reference to send the messages you need. Have a look here for source code examples: http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch6.chapt.html
0
 
chaitu chaituAuthor Commented:
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">QueuehostJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
    <!-- Use HAJNDI to access JMS -->
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1099
    </attribute>
  </mbean>

  <tx-connection-factory>
      <jndi-name>JmsXA</jndi-name>
      <xa-transaction/>
      <rar-name>jms-ra.rar</rar-name>
      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
      <max-pool-size>20</max-pool-size>
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
      <depends>jboss.messaging:service=ServerPeer</depends>
   </tx-connection-factory>


jms-ds.xml in server.

          Properties p = new Properties();
                                          p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                                          p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
                                          p.put(Context.PROVIDER_URL, "localhost:1099"); // HA-JNDI port.
                                          InitialContext iniCtx = new InitialContext(p);

                                    QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)iniCtx.lookup("java:/JmsXA");
                                                out.println("queueConnectionFactory="+queueConnectionFactory);

2006-12-04 19:37:24,552 INFO  [STDOUT] javax.naming.NameNotFoundException: JmsXA not bound
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
2006-12-04 19:37:24,552 INFO  [STDOUT]       at javax.naming.InitialContext.lookup(InitialContext.java:351)
0
 
girionisCommented:
Hmm.. Try adding this line

<use-java-context>false</use-java-context>

after the <jndi-name>, so it should be something like

<jndi-name>JmsXA</jndi-name>
<use-java-context>false</use-java-context>
<xa-transaction/>
0
 
chaitu chaituAuthor Commented:
same error;


<tx-connection-factory>
      <jndi-name>JmsXA</jndi-name>
      <xa-transaction/>
      <rar-name>jms-ra.rar</rar-name>
      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
      <max-pool-size>20</max-pool-size>
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
      <depends>jboss.messaging:service=ServerPeer</depends>
   </tx-connection-factory>


jms-ds.xml in server.


this is client code
***************

          Properties p = new Properties();
                                   p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                                   p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
                                   p.put(Context.PROVIDER_URL, "localhost:1099"); // HA-JNDI port.
                                   InitialContext iniCtx = new InitialContext(p);
           QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)iniCtx.lookup("java:/JmsXA");
                                        out.println("queueConnectionFactory="+queueConnectionFactory);
0
 
girionisCommented:
Did you add the line in your jms-ds.xml file as I told you? I cannot see it.
0
 
chaitu chaituAuthor Commented:
YES i did;its not there but i tried.

when i do this i got connection factory;

 QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:/XAConnectionFactory");
   System.out.println("queueFactory="+queueFactory);

but when i do this QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:/JmsXA"); //i am getting exception;

***************************
finally client code like this;

  Properties env = new Properties();
   env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
   env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
   env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
 
   Context remoteCtx = new InitialContext(env);
   Queue queue = (Queue)remoteCtx.lookup("queue/empQueue");
   System.out.println("queuequeuequeue="+queue);
   QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:/XAConnectionFactory");
   System.out.println("queueFactory="+queueFactory);

**********************

see my log file

2006-12-04 20:11:52,175 INFO  [org.jboss.resource.deployment.RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/messaging/deploy/jboss-ha-xa-jdbc.rar
2006-12-04 20:11:52,393 INFO  [org.jboss.resource.deployment.RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/messaging/deploy/jboss-local-jdbc.rar
2006-12-04 20:11:52,642 INFO  [org.jboss.resource.deployment.RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/messaging/deploy/jboss-xa-jdbc.rar
2006-12-04 20:11:52,892 INFO  [org.jboss.resource.deployment.RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/messaging/deploy/jms-ra.rar
2006-12-04 20:11:53,141 INFO  [org.jboss.resource.deployment.RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/messaging/deploy/mail-ra.rar
2006-12-04 20:11:54,900 INFO  [org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS to JNDI name 'java:DefaultDS'
2006-12-04 20:11:55,616 WARN  [org.jboss.messaging.core.plugin.JDBCPersistenceManager]

JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently READ_UNCOMMITTED.
                         Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
                         Using an isolation level more strict than READ_COMMITTED may lead to deadlock.

2006-12-04 20:11:56,845 INFO  [org.jboss.jms.server.ServerPeer] JBoss Messaging 1.0.1.GA server [server.0] started
2006-12-04 20:11:58,636 INFO  [org.jboss.jms.server.connectionfactory.ConnectionFactory] Connector socket://192.168.75.112:4457 has leasing enabled, lease period 20000 milliseconds
2006-12-04 20:11:58,636 INFO  [org.jboss.jms.server.connectionfactory.ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] deployed
2006-12-04 20:11:58,760 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,807 INFO  [org.jboss.jms.server.destination.Topic] Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,807 INFO  [org.jboss.jms.server.destination.Topic] Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,807 INFO  [org.jboss.jms.server.destination.Topic] Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,822 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,822 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/empQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,869 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,869 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,869 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,885 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,900 INFO  [org.jboss.jms.server.destination.Queue] Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:58,916 INFO  [org.jboss.jms.server.destination.Topic] Topic[/topic/openTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-04 20:11:59,072 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA to JNDI name 'JmsXA'
2006-12-04 20:12:00,255 INFO  [org.jboss.web.tomcat.tc5.TomcatDeployer] deploy, ctxPath=/ex, warUrl=file:/C:/jboss-4.0.2/server/messaging/deploy/webapps/ex.war/
2006-12-04 20:12:00,457 INFO  [org.apache.catalina.startup.ContextConfig] Missing application web.xml, using defaults only StandardEngine[jboss.web].StandardHost[localhost].StandardContext[/ex]
2006-12-04 20:12:01,702 INFO  [org.jboss.deployment.EARDeployer] Init J2EE application: file:/C:/jboss-4.0.2/server/messaging/deploy/emp.ear
0
 
girionisCommented:
> but when i do this QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:/JmsXA"); //i am getting exception;

Try this

QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("JmsXA");
0
 
chaitu chaituAuthor Commented:
I also tried but queueFactory  is coming as null;


i have major doubt is

  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider,server=queuehost">
    <attribute name="ProviderName">QueuehostJMSProvider</attribute>
    <attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
    <!-- Use HAJNDI to access JMS -->
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1099
    </attribute>
  </mbean>

 to lookup remotely at client side i set below properties . so what is the use of properties setting above in JMSProvider(QueuehostJMSProvider)?what is the meaning of server queuehost

         Properties env = new Properties();
   env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
   env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
   env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
0
 
girionisCommented:
> I also tried but queueFactory  is coming as null;

At least we have made progress, now it does not throw an exception, it just comes null which probably means that the lookup returns null.

> to lookup remotely at client side i set below properties

If you want to look remotely something you should chaneg this line

env.put(Context.PROVIDER_URL, "jnp://localhost:1099");

and instead of "localhost" have the remote host name or IP address.
0
 
chaitu chaituAuthor Commented:
i posted new post in jboss forums;

check this


http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991242#3991242
0
 
girionisCommented:
:)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 10
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now