aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBOSS AND JMS HELP!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBOSS AND JMS HELP!!!" Watch "JBOSS AND JMS HELP!!!" New topic
Author

JBOSS AND JMS HELP!!!

sonyia nandan
Greenhorn

Joined: Feb 11, 2004
Posts: 14
Hi all,
I have implemented a JMS enabled program in J2EE already.I have to run the corresponding JMS program in JBOSS.I have a program in a file 'f'which accepts the QueueConnectionFactory,Queuename from a config directory in the same file 'f'.
I have no clue as to what changes i need to incorporate for JBOSS.I know that i add topic and queue via the J2EEadmin -addListFactory command,I was wondering if there is an equivalient command for JBOSS too..
Any help is appreciated
kalpeshS desai
Greenhorn

Joined: Jan 20, 2004
Posts: 6
HI,
Here is what you should try to set up a Queue/topic on Jboss
Add entries for queue/topic in "default/deploy/jms/jbossmq-destinations-service.xml" file.
for ex: Entry for setting up new queue "myQueue"
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=myQueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
Your client can use a preconfigured "ConnectionFactory" in Jboss.
If your JMS client and JMS server are in same JVM,then use ConnectionFactory located in the file,/server/default/deploy/jms/jvm-il-service.xml
Else use the one located in /server/default/deploy/jms/oil-service.xml
as
A sample client code to lookup Connection and Queue would be,
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context."jnp://localhost:1099");
InitialContext ctx = new InitialContext(p);
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("java:/ConnectionFactory");
QueueConnection qc = qcf.createQueueConnection();
Queue queue = (Queue) ctx.lookup("queue/myQueue");
......

Regards,
Kalpesh
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
Thanks Kalpesh,
I am also new to JMS with JBoss 3.2.1. I got the sample Topic publisher/subscriber working.
A small correction to the initialContext code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");
InitialContext iniCtx = new InitialContext(env);
sonyia nandan
Greenhorn

Joined: Feb 11, 2004
Posts: 14
Hi ,
Thank you kalpesh for your suggestion as such i havent run my JBOSS still coz i am getting some problem during startup.I dont know what the problem is.I have posted the error that it is giving in another topic.Hope someone can give me a solution to this coz i am stuk with this for 2 days
Sonyia
Meera K
Greenhorn

Joined: Apr 10, 2002
Posts: 4
Hi! guys
I have a problem in configuring the security for the destination queue which is the permanent queue. I have DBServerLogin configured for "jbossmq" in login-config.xml where unauthenticated identity is "guest"
I dont want to add this principal to my SecurityConfig for the queue. If I dont add the principal I get
javax.jms.JMSSecurityException: Connection not authorized to subscribe to destination: tryQueue
Any clue ?


SCJP2
Francois Beauregard
Greenhorn

Joined: Jul 30, 2004
Posts: 1
I have excatly the same problem, but with Topic created through the MBeans interface... The only thing I can think of that could affect this is the fact that I configured my application to use a JAAS source for authentication... It seem to want to pass everything through the security system now... Does it ring a bell to anyone out there ???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBOSS AND JMS HELP!!!