Hi,
The issue seems to be linked to the JNDI lookup.
I think that the issue is due to a limitation of JBoss about on which
context the name is bound.
In JBoss, a JNDI name is bound on the local context by default:
java:comp/env) and you need to make the JNDI lookup on this context.
In your case, as you're remote from JBoss, you need to use the global
context.
So you need to map the JNDI local name to the JNDI global name.
To do it in JBoss, you have to add a naming alias (for example in
deploy/properties-service.xml):
<mbean code="org.jboss.naming.NamingAlias"
name="jboss.mq:service=..."">
<attribute name="FromName">java:comp/env/ConnectionFactory</attribute>
<attribute name="ToName">ConnectionFactory</attribute>
</mbean>
Could you try this ?
Thanks
Regards
JB
fraespre wrote:
Hi,
I'm using an alternate JMS provider (not ActiveMQ) with ServiceMix 4. The
jms provider is jBossMessaging 2.0.0BETA4, this provider works with Hermes
and java client whithout problems.
I'm using Spring's JEE JNDI lookup to create the Connection Factory.
I'm getting an error when I start the JBI service assembly that contains
the JMS service unit.
jBossMessaging configuration jbm-jms.xml
<connection-factory name="ConnectionFactory">
<connector-ref connector-name="netty"/>
<entries>
<entry name="cosimaFactory"/>
<entry name="java:/cosimaFactory"/>
</entries>
</connection-factory>
<queue name="cosimaJira">
<entry name="/CosimaJira"/>
</queue>
JMS SU xbean.xml
<jms:endpoint service="cosi:jmsCosimaJira" endpoint="jmsCosimaJira"
targetService="cosi:router"
role="consumer"
destinationStyle="queue"
jmsProviderDestinationName="CosimaJira"
connectionFactory="#connFactory"/>
<bean id="jbossJndiTemplate"
class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop
key="java.naming.factory.initial">org.jboss.naming.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="connFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jbossJndiTemplate" />
</property>
<property name="jndiName">
<value>cosimaFactory</value>
</property>
<property name="resourceRef" value="true"/>
</bean>
The result is:
Cannot resolve reference to bean 'connFactory' while setting bean property
'connectionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'connFactory'. Invocation of init method failed; nested exception
is javax.naming.NameNotFoundException: cosimaFactory
Note, I've also tried:
<value>/cosimaFactory</value>
and
<value>java:/cosimaFactory</value>
with the same result.
With this other JMS SU xbean.xml
<jms:endpoint service="cosi:jmsCosimaJira" endpoint="jmsCosimaJira"
targetService="cosi:router"
role="consumer"
destinationStyle="queue"
jndiDestinationName="CosimaJira"
jndiConnectionFactoryName="cosimaFactory"
initialContextFactory="org.jboss.naming.NamingContextFactory"
jndiProviderURL="jnp://localhost:1099"
defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
The result is:
Caused by: javax.jbi.management.DeploymentException: <component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-jms</component-name>
<component-task-result-details>
<task-result-details>
<task-id>init</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg><msg-loc-info><loc-token/><loc-message>Unable to init
service unit</loc-message></msg-loc-info></task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token />
<loc-message>null</loc-message>
<stack-trace><![CDATA[java.lang.NullPointerException
In my opinion the problem is the servicemix can´t find the jndi service
jboss.
Any suggestions, ideas or alternative?
Thanks,
javier