Hi Ajay, Ok, looks like QueueConnectionFactory is set up in JNDI directly under root (i.e. not under java:comp/env). Have you tried java:QueueConnectionFactory as value of property JNDIName.
In any case if that does not work either, I would think that there is some problem with the QueueConnectionFactory and its ability to create connection objects with links to queue/MyQueue. Can you please verify whether the QueueConnectionFactory does return valid connection handles that can write to the JBoss Queue using a simple JAVA mainline class. Cheers, Ashwin... Ajaykumar wrote: > > Hi Ashwin, > > Thank you for your reply. I did the following as per your recommendations. > > Jms SU xbean.xml > > <beans xmlns:jms="http://servicemix.apache.org/jms/1.0" > xmlns:tut="http://intra.agfanet" > xmlns:amq="http://activemq.org/config/1.0"> > <jms:endpoint service="tut:jms" > endpoint="myQueue" > role="provider" > destinationStyle="queue" > jmsProviderDestinationName="queue/myQueue" > connectionFactory="#connectionFactory"/> > > <bean id="jbossJndiTemplate" > class="org.springframework.jndi.JndiTemplate"> > <property name="environment"> > <props> > <prop key="java.naming.factory.initial"> > org.jnp.interfaces.NamingContextFactory > </prop> > <prop key="java.naming.provider.url"> > jnp://localhost:1099 > </prop> > <prop key="java.naming.factory.url.pkgs"> > org.jboss.naming:org.jnp.interfaces > </prop> > </props> > </property> > </bean> > <bean id="connectionFactory" > class="org.springframework.jndi.JndiObjectFactoryBean"> > <property name="jndiTemplate"> > <ref bean="jbossJndiTemplate" /> > </property> > <property name="jndiName"> > <value>QueueConnectionFactory</value> > </property> > <property name="resourceRef" value="true"/> > </bean> > </beans> > > But when I use mvn install for creating SA, Iam getting this exceptions. > > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'org.apache.servicemix.jms.JmsEndpoint' defined in URL > [file:/D:/SampleJMSExample1/tutorial-jms-su/src/main/resources/xbean.xml]: > Cannot resolve reference to bean 'connectionFactory' while setting bean > property 'connectionFactory'; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'connectionFactory' defined in URL > [file:/D:/SampleJMSExample1/tutorial-jms-su/src/main/resources/xbean.xml]: > Invocation of init method failed; > nested exception is javax.naming.NameNotFoundException: comp not bound > > I checked the jmx-console of jboss. There I could find under jboss.jms, > there is a JNDIName->QueueConnectionFactory. > > I dont know what might be the problem. But when I run the jboss, I have > this information. > > [ConnectionFactoryBindingService] Bound ConnectionManager > 'jboss.jca:service=DataSourceBinding,name=HSQL_DefaultDS' to JNDI name > 'java:HSQL_DefaultDS' > [ConnectionFactoryBindingService] Bound ConnectionManager > 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name > 'java:JmsXA' > [ConnectionFactoryBindingService] Bound ConnectionManager > 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name > 'java:DefaultDS > > So, I request to give some hints what might be the problem. All I want is > to create a Jboss JMS queue using Spring beans. > > Thanking you. > > Best Regards, > Ajay > > > > Ashwin Karpe wrote: >> >> Hi Ajay, >> >> It seems that the JNDI Name you are using is set to >> QueueConnectionFactory. I wonder whether this has been created in JBOSS >> as java:comp/env/QueueConnectionFactory. Note that the setter will >> automatically append java:comp/env only if resourceRef is set to "true". >> >> If so then the lookup will fail... >> >> Can you please verify whether this is the case. Note that the reason this >> may be working in your ActiveMQ connectionfactory is that there is no >> JNDI related activity. >> >> Cheers, >> >> Ashwin... >> >> >> Ajaykumar wrote: >>> >>> Hi, >>> >>> Iam having problem using EIP example. I have the following SU's >>> configuration. >>> >>> File SU xbean.xml >>> >>> <beans xmlns:file="http://servicemix.apache.org/file/1.0" >>> xmlns:tut="http://intra.agfanet"> >>> <!-- add the poller endpoint here --> >>> <file:poller service="tut:file" endpoint="poller" >>> file="file:C:/BPEFileReader" targetService="tut:wiretap"> >>> <property name="filter"> >>> <bean >>> class="org.apache.commons.io.filefilter.WildcardFilter"> >>> <constructor-arg value="sample.xml" /> >>> </bean> >>> </property> >>> </file:poller> >>> <!-- add the sender endpoint here --> >>> <file:sender service="tut:file" endpoint="sender" >>> directory="file:C:/BPEFileWriter" /> >>> </beans> >>> >>> JMS SU xbean.xml >>> >>> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0" >>> xmlns:tut="http://intra.agfanet" >>> xmlns:amq="http://activemq.org/config/1.0"> >>> <jms:endpoint service="tut:jms" >>> endpoint="myQueue" >>> role="provider" >>> destinationStyle="queue" >>> jmsProviderDestinationName="queue/myQueue" >>> connectionFactory="#connectionFactory"/> >>> <bean id="jbossJndiTemplate" >>> class="org.springframework.jndi.JndiTemplate"> >>> <property name="environment"> >>> <props> >>> <prop key="java.naming.factory.initial"> >>> org.jnp.interfaces.NamingContextFactory >>> </prop> >>> <prop key="java.naming.provider.url"> >>> jnp://localhost:1099 >>> </prop> >>> <prop key="java.naming.factory.url.pkgs"> >>> org.jboss.naming:org.jnp.interfaces >>> </prop> >>> </props> >>> </property> >>> </bean> >>> >>> <bean id="connectionFactory" >>> class="org.springframework.jndi.JndiObjectFactoryBean"> >>> <property name="jndiTemplate"> >>> <ref bean="jbossJndiTemplate" /> >>> </property> >>> <property name="jndiName"> >>> <value>QueueConnectionFactory</value> >>> </property> >>> </bean> >>> </beans> >>> >>> EIP SU xbean.xml >>> >>> <beans xmlns:eip="http://servicemix.apache.org/eip/1.0" >>> xmlns:tut="http://intra.agfanet"> >>> >>> <eip:wire-tap service="tut:wiretap" endpoint="endpoint"> >>> <eip:target> >>> <eip:exchange-target service="tut:jms" /> >>> </eip:target> >>> <eip:inListener> >>> <eip:exchange-target service="tut:file" endpoint="sender" /> >>> </eip:inListener> >>> </eip:wire-tap> >>> </beans> >>> >>> When I use mvn install I dont get any problems. But when I deploy the SA >>> on servicemix running on jetty, I have to following exceptions. >>> >>> ERROR - JmsComponent - Error processing exchange >>> InOnly[ >>> id: ID:172.25.35.156-11e876aa483-7:100 >>> status: Active >>> role: provider >>> service: {http://intra.agfanet}jms >>> endpoint: myQueue >>> java.lang.NullPointerException >>> at >>> org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:83) >>> at >>> org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:107) >>> WARN - FileComponent - Message in file >>> C:\BPEFileReader\sample.xml could not be handled successfully: null >>> java.lang.NullPointerException >>> >>> Iam newbie for servicemix. Could some one please help me. >>> >>> Thanking you. >>> >>> Best Regards, >>> Ajay >>> >> >> > > ----- --- Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence Progress Software Corporation 14 Oak Park Drive Bedford, MA 01730 --- +1-972-304-9084 (Office) +1-972-971-1700 (Mobile) ---- Blog: http://opensourceknowledge.blogspot.com/ -- View this message in context: http://www.nabble.com/Problems-with-EIP-when-using-Jboss-JMS-queue-tp21215924p21230408.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
