• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

JBOSS AND JMS HELP!!!

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic