aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Problem with creating JMS Application with Queues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem with creating JMS Application with Queues" Watch "Problem with creating JMS Application with Queues" New topic
Author

Problem with creating JMS Application with Queues

Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Hello,

I am trying to use Sun App Server 8.1 to deploy and run a variant of the Java Tutorial 1.4 A J2EE application with session bean that uses JMS p. 1260
chapter 34. I used a queue instead, borrowing queues from the example in chapter 28, "A Message Driven Bean Example".

Shown below is the JMS code and exerps of my Server LOG. I also deployed the example using queues from chapter 28 and it doesn't work either. Any ideas?

Thank you so much, Any insight would be greatly appreciated.

Ken

JMS Code: (method name is confusing)
public void publishNews(transaction trans) {
Session session = null;
MessageProducer publisher = null;
//TextMessage message = null;
ObjectMessage message = null;

String messageType = null;

try {
transaction transaction = trans;
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
publisher = session.createProducer(destination);
//message = session.createObjectMessage(transaction)
// throws JMSException;
//Integer theint = new Integer(10);
message = session.createObjectMessage(transaction);// throws JMSException;
//message = session.createTextMessage();
publisher.send(message);

} catch (Throwable t1) {
// JMSException could be thrown
logger.severe("AgencyBean.publishNews: " + "Exception: " +
t1.toString());
sc.setRollbackOnly();
} finally {
if (session != null) {
try {
session.close();
} catch (JMSException e) {
}
}
}
}
THIS IS HOW I CREATED THE RESOURCES:
To create the connection factory, perform the following steps:
1. In the tree component, expand the Java Message Service node.
2. Select the Connection Factories node.
3. On the JMS Connection Factories page, click New. The Create JMS Connection
Factory page appears.

4. In the JNDI Name field, type jms/QueueConnectionFactory.
5. Choose javax.jms.QueueConnectionFactory from the Type combo
box.
6. Select the Enabled checkbox.
7. Click OK.

**********************************************************************
Note: THE PHYSICAL DESTINATION WAS NOT UNDER WHERE IT SAID THAT IT WAS
AND THIS SEEMED TO WORK FOR SOME OTHERS WITHOUT CREATTING THE PHYSICAL DEST.
***********************************************************************
To create the physical destination, perform the following steps:
1. In the tree component, select the Physical Destinations node.
2. On the Physical Destinations page, click New. The Create Physical Destination
page appears.
3. In the Physical Destination Name field, type PhysicalQueue.
4. Choose queue from the Type combo box.
5. Click OK.
To create the destination resource and link it to the physical destination, perform
the following steps:
1. In the tree component, expand Destination Resources.
2. On the JMS Destination Resources page, click New. The Create JMS Destination
Resource page appears.
3. In the JNDI Name field, type jms/Queue.
4. Choose javax.jms.Queue from the Type combo box.
5. Select the Enabled checkbox.
6. Under Additional Properties, click Add.
7. Type Name in the Name field.
8. Type PhysicalQueue in the Value field.
9. Click OK.

Server Logs:

[#|2005-10-15T00:08:30.626-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise
.resource.resourceadapter|
_ThreadID=10;|JMS Service Connection URL is :mq://krubin:7676/,|#]

[#|2005-10-15T00:08:30.907-0400|WARNING|sun-appserver-pe8.1_02|
javax.enterprise.resource.resourceadapter|
_ThreadID=10;|RAR8000 : The method setReconnectEnabled is not present in the class :
com.sun.messaging.jms.ra.ActivationSpec|#]

[#|2005-10-15T00:08:30.907-0400|WARNING|sun-appserver-pe8.1_02|
javax.enterprise.resource.resourceadapter
|_ThreadID=10;|RAR7097: No setter method present for the property ReconnectEnabled in the class
com.sun.messaging.jms.ra.ActivationSpec|#]
...
[#|2005-10-15T00:08:32.790-0400|WARNING|sun-appserver-pe8.1_02
|javax.enterprise.resource.resourceadapter
|_ThreadID=10;|RAR8000 : The method setAddressListIterations is not present in the class
: com.sun.messaging.jms.ra.ActivationSpec|#]

[#|2005-10-15T00:08:32.790-0400|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter
|_ThreadID=10;|RAR7097: No setter method present for the property AddressListIterations in the class
com.sun.messaging.jms.ra.ActivationSpec|#]

[#|2005-10-15T00:08:32.960-0400|WARNING|sun-appserver-pe8.1_02
|javax.enterprise.system.stream.err
|_ThreadID=10;|MQRA-endpointActivation:Error:creatMessageConsumer failed:aborting|#]

[#|2005-10-15T00:08:33.020-0400|WARNING|sun-appserver-pe8.1_02
|javax.enterprise.system.stream.err|_ThreadID=10;|
javax.resource.NotSupportedException: MQRA-endpointActivation:Error:creatMessageConsumer failed:aborting
at com.sun.messaging.jms.ra.ResourceAdapter.endpointActivation(ResourceAdapter.java:288)
...
Caused by: javax.resource.NotSupportedException: MQRA:EC:Error creating Non-Durable Message Consumer:
[C4073]: A JMS destination limit was reached. Too many Subscribers/Receivers for
Queue : PhysicalQueue user=guest, broker=krubin:7676(1069)
at com.sun.messaging.jms.ra.EndpointConsumer.createNonDurableMessageConsumer
(EndpointConsumer.java:639)
...
Caused by: javax.jms.ResourceAllocationException: [C4073]: A JMS destination limit was reached.
Too many Subscribers/Receivers for Queue : PhysicalQueue user=guest, broker=krubin:7676(1069)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.addInterest(ProtocolHandler
.java:1850)
...
[#|2005-10-15T00:08:33.020-0400|SEVERE|sun-appserver-pe8.1_02|
javax.enterprise.system.container.ejb.mdb|_ThreadID=10;|MDB00017: [SimpleMessageBean]:
Exception in creating message-driven bean container: [java.lang.Exception]|#]

[#|2005-10-15T00:08:33.020-0400|SEVERE|sun-appserver-pe8.1_02|
javax.enterprise.system.container.ejb.mdb|_ThreadID=10;
|java.lang.Exception
at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup
(ConnectorMessageBeanClient.java:230)
...
Caused by: javax.resource.NotSupportedException: MQRA-endpointActivation:Error:creatMessageConsumer failed:aborting
at com.sun.messaging.jms.ra.ResourceAdapter.endpointActivation
(ResourceAdapter.java:288)
at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup
(ConnectorMessageBeanClient.java:221)
... 10 more
Caused by: javax.resource.NotSupportedException: MQRA:EC:Error creating Non-Durable Message Consumer:
[C4073]: A JMS destination limit was reached. Too many Subscribers/Receivers for Queue : PhysicalQueue user=guest,
broker=krubin:7676(1069)
at com.sun.messaging.jms.ra.EndpointConsumer.createNonDurableMessageConsumer
(EndpointConsumer.java:639)
at com.sun.messaging.jms.ra.EndpointConsumer.createMessageConsumer
(EndpointConsumer.java:272)
at com.sun.messaging.jms.ra.ResourceAdapter.endpointActivation
(ResourceAdapter.java:283)
... 11 more
Caused by: javax.jms.ResourceAllocationException: [C4073]: A JMS destination limit was reached.
Too many Subscribers/Receivers for Queue : PhysicalQueue user=guest, broker=krubin:7676(1069)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.addInterest
(ProtocolHandler.java:1850)
at com.sun.messaging.jmq.jmsclient.WriteChannel.addInterest
(WriteChannel.java:57)
...
[#|2005-10-15T00:08:33.020-0400|SEVERE|sun-appserver-pe8.1_02|
javax.enterprise.system.container.ejb|_ThreadID=10;|EJB5090: Exception in creating EJB container [java.lang.Exception]|#]

[#|2005-10-15T00:08:33.020-0400|SEVERE|sun-appserver-pe8.1_02|
javax.enterprise.system.container.ejb|_ThreadID=10;|appId=SimpleMessageApp moduleName=ejb-jar-ic_jar ejbName=SimpleMessageBean|#]

[#|2005-10-15T00:08:33.030-0400|SEVERE|sun-appserver-pe8.1_02|
javax.enterprise.system.core.classloading|_ThreadID=10;|LDR5004: UnExpected error occured while creating ejb container
java.lang.Exception
at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup
(ConnectorMessageBeanClient.java:230)
...
[#|2005-10-15T00:10:18.321-0400|WARNING|sun-appserver-pe8.1_02|
javax.enterprise.system.stream.err|_ThreadID=11;|
MQRA:MC:Constr:Exception on cnxn creation-[C4060]: Login failed: user=j2ee, broker=krubin:7676(1069)|#]

[#|2005-10-15T00:10:18.321-0400|WARNING|sun-appserver-pe8.1_02|
javax.enterprise.system.stream.err|_ThreadID=11;|
com.sun.messaging.jms.JMSSecurityException: [C4060]: Login failed: user=j2ee, broker=krubin:7676(1069)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.authenticate
(ProtocolHandler.java:824)

[#|2005-10-15T00:10:18.331-0400|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_
ThreadID=11;|RAR5117 : Failed to obtain/create connection. Reason : MQRA:MC:Constr:Exception on cnxn creation-[C4060]: Login failed: user=j2ee, broker=krubin:7676(1069)|#]

[#|2005-10-15T00:10:18.331-0400|SEVERE|sun-appserver-pe8.1_02|AgencyBean|_ThreadID=11;|AgencyBean.ejbCreate:Exception: com.sun.messaging.jms.JMSException: MQRA:CFA:allocation failure:createConnection:Error in allocating a connection. Cause: MQRA:MC:Constr:Exception on cnxn creation-[C4060]: Login failed: user=j2ee, broker=krubin:7676(1069)|#]

[#|2005-10-15T00:10:18.431-0400|SEVERE|sun-appserver-pe8.1_02|AgencyBean|_ThreadID=11;|AgencyBean.publishNews: Exception: java.lang.NullPointerException|#]

[#|2005-10-15T00:10:18.441-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=11;|In AgencyBean.ejbRemove()|#]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with creating JMS Application with Queues