jms springsource weblogic

Hey everyone. I am trying to create a simple JMS springsource weblogic implementation that is a consumer of JMS messages from one source and uses weblogic for the queue.
Unfortunately I am getting the following error below, I have also included the springbean setup i'm using....



nitialization of bean failed; nested exception is org.springframework.beans.Conv
ersionNotSupportedException: Failed to convert property value of type 'weblogic.
jms.client.JMSConnectionFactory' to required type 'javax.jms.Destination' for pr
operty 'destination'; nested exception is java.lang.IllegalStateException: Canno
t convert value of type [weblogic.jms.client.JMSConnectionFactory] to required t
ype [javax.jms.Destination] for property 'destination': no matching editors or c
onversion strategy found.

Open in new window





<bean id="messageListener" class="com.mypackage.jms.JmsListener"/>


	
	

	<!-- and this is the message listener container -->
	<bean id="jmsContainer" class="org.springframework.jms.listener.SimpleMessageListenerContainer">
	    <property name="connectionFactory" ref="queueConnectionFactory"/>
	    <property name="destination" ref="jmsQueue"/>
	    <property name="messageListener" ref="messageListener" />
	</bean>
	
	<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
		<property name="environment">
			<props>
				<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
				<prop key="java.naming.provider.url">t3://localhost:7001</prop>
			</props>
		</property>
	</bean>

	<bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiTemplate">
			<ref bean="jndiTemplate" />
		</property>
		<property name="jndiName">
			<value>theJNDIname</value>
		</property>
	</bean>
	
	<bean id="jmsQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiTemplate">
			<ref bean="jndiTemplate" />
		</property>
		<property name="jndiName">
			<value>theJNDIname</value>
		</property>
	</bean>
	
	
	
	<bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver">
		<property name="jndiTemplate">
			<ref bean="jndiTemplate" />
		</property>
		<property name="cache">
		<value>true</value>
		</property>
	</bean>

Open in new window



ronyosiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
On lines 28 and 37, you are referring to the same JNDI resource "theJNDIname" for both the ConnectionFactory and the Destination.

I am not a WebLogic expert but by the looks of this link JMS Connection Factory Configuration you would need to use a JNDI name of possibly weblogic.jms.ConnectionFactory (or some other name that you would have manually configured. Also for the JNDI name for the queue, you would have configured that in WebLogic also, so you need to use the name that you set it up with there. (Note that there is information on the queue setup a little bit further down in the link above)

Actually, by looking again at that exception, "theJNDIname" may be a valid name for the ConnectionFactory, but there would be a different name that you would have to use for the destination.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sathish David Kumar NArchitectCommented:
ronyosiAuthor Commented:
Thank you very much :)
Turns out the Queue was not even set up in the weblogic "module", and there are two JNDI's to set up
1) Queue has a seperate JNDI as you said from the
2) connectionFactory

and both are needed.
ronyosiAuthor Commented:
btw do you know why upon sending a JMS message I would be getting thing?

javax.naming.NoInitialContextException: Cannot instantiate class: <kbd class=userinput>weblogic.jndi.WLInitialContextFactory</kbd> [Root exception is java.lang.ClassNotFoundException: <kbd class=userinput>weblogic.jndi.WLInitialContextFactory</kbd>]
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at SchemaValidation2.JMSMessageSend2.sendMessage(JMSMessageSend2.java:46)
	at SchemaValidation2.JMSMessageSend2.main(JMSMessageSend2.java:143)
Caused by: java.lang.ClassNotFoundException: <kbd class=userinput>weblogic.jndi.WLInitialContextFactory</kbd>
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
	... 5 more

Open in new window

mccarlIT Business Systems Analyst / Software DeveloperCommented:
Do you have the required weblogic JAR's in your classpath?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.