This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JBoss/WildFly and the fly likes Creating dynamic queue in Java and Configuring it with JBoss 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Creating dynamic queue in Java and Configuring it with JBoss 6.0" Watch "Creating dynamic queue in Java and Configuring it with JBoss 6.0" New topic
Author

Creating dynamic queue in Java and Configuring it with JBoss 6.0

prasad phatak
Greenhorn

Joined: Sep 18, 2011
Posts: 5
Hi All,
Currently I am trying to migrate my application on JBoss 6.0 which was previously running on JBoss 4.0. After going through the code I found out that it creates dynamic queues with the code which is specific to JBoss 4.0 as posted below

RMIAdaptor server = (RMIAdaptor) jndiLookup("jmx/rmi/RMIAdaptor");
dm = new ObjectName("jboss.mq:service=DestinationManager");
server.invoke(dm, "createQueue",
new Object[] {subject,subject},
new String[] { String.class.getName(), String.class.getName()}
);

/*//Added By milind
server.invoke(dm, "createQueue", new Object[] { "ReplyChannel", "ReplyChannel"},
new String[] { String.class.getName(), String.class.getName() } );
//End here
*/

queue = (Queue) jndiLookup(subject);

After migration to JBoss 6.0 it gives following print trace on console....

Value of the Description:{javax.jms.JMSException: Failed to create session=Class = Manager Method = connectToJMS}
javax.naming.NameNotFoundException: outChannel not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.etp.dim.jms.JMSManager.jndiLookup(JMSManager.java:1473)

Can anyone please help me with this.
 
Consider Paul's rocket mass heater.
 
subject: Creating dynamic queue in Java and Configuring it with JBoss 6.0