aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Writing to a JMS Queue via Timer Method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Writing to a JMS Queue via Timer Method." Watch "Writing to a JMS Queue via Timer Method." New topic
Author

Writing to a JMS Queue via Timer Method.

Annie McCall
Greenhorn

Joined: Apr 17, 2003
Posts: 21
Hi,
My server is BEA WebLogic Server 8.1.
I currently inherited a JMS app where it uses an Asyncronous Message bean.
The logic in this bean is very simple. It has an OnMessage method which looks at the input message. This input message is just a textmessage, depending on it's value it will implement different processes.
For example:


I have a listener which gets kicked off when the server starts.
This listener kicks off a method (let's say around every 10 minutes) that attempts to write to the JMS queue.

Now is where the problem occurs.

Here is the logic that attempts to send a text message to the queue.





The exception occurs on this line:

queueSender = queueSession.createSender(queue);

I get this error:





I think I am getting this because the process is being kicked off on the server rather than from an user.

Does anyone know how to do this?

I tried using an anonymous producer but doing this:




But then I got an invalid destination error.


Has anyone attempted to this before ( Write to a JMS queue from a method which was set off with a timer)?

Any help would be greatly appreciated,

[ February 06, 2008: Message edited by: Annie McCall ]
[ February 06, 2008: Message edited by: Annie McCall ]

Annie McCall<br />SCJP 1.4<br />SCWCD
Annie McCall
Greenhorn

Joined: Apr 17, 2003
Posts: 21
Hi All,

I do have an answer to my JMS Security Exception. I will post the
solution for any JMS newbies like myself.

It was not an application code fix but rather a change in the security
configuration of my JMS queue on my Weblogic Server.

Since there was no "real" user, the user context is "guest". All I
needed to do was add an 'acl entry' for guest in the send action of my
JMS queue.

An 'acl entry' is really adding a row in a table in the realm database.

For example:
<CODE>
insert into weblogic.realm_acl_entries values ('realm_domain','guest', 'JMS QUEUE NAME','send', null);</CODE>

Hope this information helps someone who may encounter the same problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing to a JMS Queue via Timer Method.
 
Similar Threads
A simple JNDI question....
New To JMS
Message Driven Beans
MDB
can I integrate JMS with Servlets???