[jboss-user] [Messaging, JMS & JBossMQ] - Re: java.lang.ClassCastException

vermanaveen do-not-reply at jboss.com
Fri May 4 02:10:04 EDT 2007


Based on the suggestions, I did all suggested changed. Now I am getting  javax.naming.NameNotFoundException: jms not bound

Infact, can you please suggest how do I create my own connection factory? I have my MDB

  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
  | 
  | <ejb-jar>
  | 	<enterprise-beans>
  | 		<message-driven>
  | 			<ejb-name>MQManager</ejb-name>
  | 			<ejb-class>com.ebw.ejb.mdb.MQManager</ejb-class>
  | 			<transaction-type>Container</transaction-type>
  | 			<message-selector>
  | 				<![CDATA[
  | 					Message_Redirector IS NULL AND Message_Type <> 'Data'
  | 				]]>
  | 			</message-selector>
  | 			<message-driven-destination>
  | 			<destination-type>javax.jms.Queue</destination-type>
  | 			</message-driven-destination>	 
  | 			<resource-ref>    		    <res-ref-name>jms/novaJMSConnectionFactory</res-ref-name>
  |       		<res-type>javax.jms.QueueConnectionFactory</res-type> 
  |         		<res-auth>Container</res-auth> 
  |       		</resource-ref>
  | 		
  | 			<security-identity>
  | 				<run-as>
  | 					<role-name>admin</role-name>
  | 				</run-as>
  | 			</security-identity>
  | 		</message-driven>
  | 	</enterprise-beans>
  | 	<assembly-descriptor>
  | 		<security-role>
  | 			<description>Administrator</description>
  | 			<role-name>admin</role-name>
  | 		</security-role>
  | 		<container-transaction>
  | 			<method>
  | 				<ejb-name>MQManager</ejb-name>
  | 				<method-name>*</method-name>
  | 			</method>
  | 			<trans-attribute>NotSupported</trans-attribute>
  | 		</container-transaction>
  | 	</assembly-descriptor>
  | 	<ejb-client-jar>novaEJBClient.jar</ejb-client-jar>
  | </ejb-jar>
  | 



Also find my jboss.xml


  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"
  |    "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
  | <!-- jboss xml used on for JBoss deployement-->
  | 
  | <jboss>
  | 	<enterprise-bean>
  | 		<message-driven>
  | 			<ejb-name>MQManager</ejb-name>
  | 				<!--
  | 				@Naveen: commented for the time being
  | 				<pool>
  | 					<instance-pool>15</instance-pool>
  | 				</pool>
  | 				-->
  | 				<destination-jndi-name>jms/novaRequestQueue</destination-jndi-name>
  | 				<resource-ref> 
  | 	       			<res-ref-name>jms/novaJMSConnectionFactory</res-ref-name>
  |         		 	<res-type>javax.jms.QueueConnectionFactory</res-type>
  |       				<jndi-name>QueueConnectionFactory</jndi-name> 
  |       			</resource-ref> 
  | 				
  | 		</message-driven>	
  | 	</enterprise-bean>
  | 
  | 	<security-role-assignment>
  | 		<role-name>admin</role-name>
  | 		<principal-name>server</principal-name>
  | 	</security-role-assignment>
  | </jboss>
  | 

My client code reads MQ.properties which are defined as below.

  | 
  | # Intial factory
  | java.naming.factory.initial org.jnp.interfaces.NamingContextFactory
  | 
  | # Provider URL
  | #java.naming.provider.url t3://192.168.2.227:7001
  | java.naming.provider.url jnp://localhost:1099
  | 
  | #java.naming.provider.url t3://novps1.nj.ssmb.com:7001
  | 
  | 
  | # Queue Connection Factory
  | queue.connection.factory jms/novaJMSConnectionFactory
  | #Based on suggestion; http://www.jboss.com/index.html?module=bb&op=viewtopic&t=107646
  | #queue.connection.factory ConnectionFactory
  | 
  | 
  | # Request Queue
  | request.queue.context.name jms/novaRequestQueue
  | #request.queue.context.name queue/B
  | 
  | 
  | # Response Queue
  | response.queue.context.name jms/novaResponseQueue
  | #response.queue.context.name queue/novaResponseQueue
  | 
  | #Strategy to pick one server out of the available list of servers. ['sequential', 'random'] 'sequential' is default. 
  | server.selection.strategy sequential
  | 
  | #Security principal
  | java.naming.security.principal client
  | 
  | # Security credentials (password)
  | java.naming.security.credentials client123
  | 
  | # Maximum chars allowed in a single message
  | max.chars.in.message 1500000
  | 
  | # Time in milliseconds, The listener must wait for the response.
  | response.wait.time 300000
  | 
  | # Time in milliseconds, for which the queue connection is maintain(should be more than 'response.wait.time').
  | queue.connection.lease.time 600000
  | 
  | # Time in minutes, The time after witch session will expire [default value is 24hrs].
  | session.expire.time 1440
  | 
  | # ON/OFF debug information on the system output stream. ['on', 'off']
  | mq.debug.state off
  | 
  | # Set the debug leval [0, 1, 2 or 3] use largest value for maximum debug information, zero to turn off.
  | debug.level 3
  | 
  | # Property file to store transaction information.
  | transaction.file Transaction.properties
  | 
  | # ON/OFF lazy loading of Entity beans. ['on', 'off']
  | lazy.mode off
  | 
  | # ON/OFF workflow rules. ['on', 'off']
  | workflow off
  | 
  | # Whether connection to excel is to be done.['on', 'off']
  | excel.integration on
  | 


I am getting frustrating. Please help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043069#4043069

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043069



More information about the jboss-user mailing list