You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by johper <ka...@hotmail.com> on 2006/09/01 09:36:52 UTC

Re: JNDI and JBossMQ

this is snippet from my standalone java-application connectig to jboss using
remote jndi name "ConnectionFactory" :
      QueueConnection cnn = null;QueueSender sender = null;
      QueueSession session = null; InitialContext ctx = new
InitialContext();
      Queue queue = (Queue) ctx.lookup("queue/myinput");
      QueueConnectionFactory factory = (QueueConnectionFactory)
ctx.lookup("ConnectionFactory");
      cnn = factory.createQueueConnection();
      session = cnn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
      TextMessage msg = session.createTextMessage("HelloJBoss");
      sender = session.createSender(queue);
      sender.send(msg);
"ConnectionFactory" is the remote name for getting a factory from JBoss, but
if you sit in the same VM you should be able to solve lookup with local jndi
name "java:/JmsXA" ? Is JNDI-tree in Jboss accessible for ServiceMix running
inside JBoss with SM-SAR strategy?
If you can explain all steps and components involved for getting this to
work, would be great.
The component "servicemix-jms" with xbean notation seems to have it all
(jndiXX properties etc etc), but as far as I understand (newbe:-) you also
need something from "servicemix-lwcontainer" ?

Funny thing to note is that my ActiveMQ with component "servicemix-jms"
works very well, when comsuner/provider is in JBoss I have no luck.

By the way I dont know where to put the flags use mentioned? Tried this in
my pom.xml (no luck):
    <build>
        <plugins>
            <plugin>
<generateJbiDescriptor>false</generateJbiDescriptor>
<useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>jbi-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
=======================================

gnodet wrote:
> 
> You can set the <generateJbiDescriptor>false</generateJbiDescriptor>
> parameter on the jbi-maven-plugin to disable SU jbi.xml generation.
> 
> You can also disable the SU analyze by setting the
> <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
> configuration element.
> 
> Also, the error comes from a maybe invalid jndiName.
> It seems it should be a uri and have a protocol and can
> not just be "ConnectionFactory".
> 
> On 8/31/06, johper <ka...@hotmail.com> wrote:
>>
>>
>> After adding Maven artifact id's for jboss stuff I am getting this:
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to generate jbi.xml
>>
>> Embedded error: Unable to generate service unit descriptor!
>> no protocol: and
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
>> generate
>> jbi.x
>> ml
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:559)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
>> fecycle(DefaultLifecycleExecutor.java:475)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:454)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:306)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:273)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:140)
>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>         at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>
>>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to
>> generate jb
>> i.xml
>>         at
>> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> ojo.execute(GenerateServiceUnitDescriptorMojo.java:126)
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> nManager.java:412)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:534)
>>         ... 16 more
>> Caused by: org.apache.servicemix.maven.plugin.jbi.JbiPluginException:
>> Unable
>> to
>> generate service unit descriptor!
>>         at
>> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:217)
>>         at
>> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> ojo.execute(GenerateServiceUnitDescriptorMojo.java:124)
>>         ... 18 more
>> Caused by: org.springframework.beans.factory.BeanCreationException: Error
>> creati
>> ng bean with name 'bootstrapContext': FactoryBean threw exception on
>> object
>> crea
>> tion; nested exception is
>> org.springframework.beans.factory.BeanCreationExceptio
>> n: Error creating bean with name 'managedJmsFactory' defined in URL
>> [file:/D:/se
>> rvicemix-build/trunk/apache-servicemix/target/samples/bridge-
>> 3.0-incubating-SNAP
>> SHOT/bridge-jms-su/src/main/resources/xbean.xml]: Invocation of init
>> method
>> fail
>> ed; nested exception is javax.naming.CommunicationException [Root
>> exception
>> is j
>> ava.rmi.ServerException: RemoteException occurred in server thread;
>> nested
>> excep
>> tion is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> nested
>> excep
>> tion is:
>>         java.net.MalformedURLException: no protocol: and]
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> ctFromFactoryBean(AbstractBeanFactory.java:919)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> ctForBeanInstance(AbstractBeanFactory.java:883)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> (AbstractBeanFactory.java:199)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> (AbstractBeanFactory.java:153)
>>         at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> preInstantiateSingletons(DefaultListableBeanFactory.java:250)
>>         at
>> org.springframework.context.support.AbstractApplicationContext.refres
>> h(AbstractApplicationContext.java:337)
>>         at
>> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>> >(FileSystemXmlApplicationContext.java:149)
>>         at
>> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>> >(FileSystemXmlApplicationContext.java:48)
>>         at
>> org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.i
>> nit(AbstractXBeanServiceUnitAnalyzer.java:79)
>>         at
>> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:204)
>>         ... 19 more
>> Caused by: org.springframework.beans.factory.BeanCreationException: Error
>> creati
>> ng bean with name 'managedJmsFactory' defined in URL
>> [file:/D:/servicemix-build/
>> trunk/apache-servicemix/target/samples/bridge-3.0-incubating-SNAPSHOT
>> /bridge-jms
>> -su/src/main/resources/xbean.xml]: Invocation of init method failed;
>> nested
>> exce
>> ption is javax.naming.CommunicationException [Root exception is
>> java.rmi.ServerE
>> xception: RemoteException occurred in server thread; nested exception is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> nested
>> excep
>> tion is:
>>         java.net.MalformedURLException: no protocol: and]
>>         at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:878)
>>         at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> Factory.createBean(AbstractAutowireCapableBeanFactory.java:396)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
>> ject(AbstractBeanFactory.java:240)
>>         at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
>> y.getSingleton(DefaultSingletonBeanRegistry.java:132)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> (AbstractBeanFactory.java:237)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> (AbstractBeanFactory.java:153)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getType
>> (AbstractBeanFactory.java:377)
>>         at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> isBeanTypeMatch(DefaultListableBeanFactory.java:228)
>>         at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> getBeanNamesForType(DefaultListableBeanFactory.java:141)
>>         at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> getBeansOfType(DefaultListableBeanFactory.java:194)
>>         at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> getBeansOfType(DefaultListableBeanFactory.java:188)
>>         at
>> org.springframework.context.support.AbstractApplicationContext.getBea
>> nsOfType(AbstractApplicationContext.java:661)
>>         at
>> org.jencks.factory.WorkManagerFactoryBean.getTransactionContextManage
>> r(WorkManagerFactoryBean.java:92)
>>         at
>> org.jencks.factory.WorkManagerFactoryBean.createWorkManager(WorkManag
>> erFactoryBean.java:196)
>>         at
>> org.jencks.factory.WorkManagerFactoryBean.getWorkManager(WorkManagerF
>> actoryBean.java:84)
>>         at
>> org.jencks.factory.BootstrapContextFactoryBean.getWorkManager(Bootstr
>> apContextFactoryBean.java:79)
>>         at
>> org.jencks.factory.BootstrapContextFactoryBean.getObject(BootstrapCon
>> textFactoryBean.java:53)
>>         at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> ctFromFactoryBean(AbstractBeanFactory.java:916)
>>         ... 28 more
>> Caused by: javax.naming.CommunicationException [Root exception is
>> java.rmi.Serve
>> rException: RemoteException occurred in server thread; nested exception
>> is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> nested
>> excep
>> tion is:
>>         java.net.MalformedURLException: no protocol: and]
>>         at
>> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
>>         at
>> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
>>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
>>         at
>> org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java
>> :124)
>>         at
>> org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
>>         at
>> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
>>         at
>> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:147)
>>         at
>> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport
>> .java:86)
>>         at
>> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.j
>> ava:101)
>>         at
>> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(Jnd
>> iObjectFactoryBean.java:164)
>>         at
>> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(Jnd
>> iObjectFactoryBean.java:151)
>>         at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:908)
>>         at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:875)
>>         ... 45 more
>> Caused by: java.rmi.ServerException: RemoteException occurred in server
>> thread;
>> nested exception is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> nested
>> excep
>> tion is:
>>         java.net.MalformedURLException: no protocol: and
>>         at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
>>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>>         at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>> 66)
>>         at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>> .java:707)
>>         at java.lang.Thread.run(Thread.java:595)
>>         at
>> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
>> RemoteCall.java:247)
>>         at
>> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
>> 223)
>>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
>>         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
>>         at
>> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
>>         ... 57 more
>> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments;
>> nested ex
>> ception is:
>>         java.net.MalformedURLException: no protocol: and
>>         at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
>>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>>         at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>> 66)
>>         at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>> .java:707)
>>         at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.net.MalformedURLException: no protocol: and
>>         at java.net.URL.<init>(URL.java:567)
>>         at java.net.URL.<init>(URL.java:464)
>>         at java.net.URL.<init>(URL.java:413)
>>         at
>> sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
>>         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
>>         at
>> java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
>>         at
>> org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.ja
>> va:91)
>>         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java
>> :247)
>>         at
>> sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
>> a:197)
>>         at
>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:154
>> 3)
>>         at
>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465)
>>         at
>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
>> 698)
>>         at
>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
>>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
>> :349)
>>         at javax.naming.CompoundName.readObject(CompoundName.java:554)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946
>> )
>>         at
>> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1818)
>>
>>         at
>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
>> 718)
>>         at
>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
>>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
>> :349)
>>         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
>>         at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
>>         ... 6 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 1 minute 29 seconds
>> ===============================================
>> This is my new xbean.xml file (temporarily lifted out my actual enpoint
>> due
>> to error in factory creation):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>>        xmlns:b="http://servicemix.apache.org/samples/bridge"
>>        xmlns:c="http://servicemix.apache.org/samples/final"
>>        xmlns:h="http://servicemix.apache.org/samples/hammer">
>>
>>         <bean id="bootstrapContext"
>>                 class="org.jencks.factory.BootstrapContextFactoryBean">
>>                 <property name="threadPoolSize" value="25" />
>>         </bean>
>>         <bean id="jbossMQResourceAdapter"
>>                 class="org.jboss.resource.adapter.jms.JmsResourceAdapter"
>>                 singleton="true">
>>              <property name="serverUrl" value="tcp://localhost:1099" />
>>         </bean>
>>         <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="managedJmsFactory"
>> class="org.springframework.jndi.JndiObjectFactoryBean">
>>            <property name="jndiTemplate"><ref
>> bean="jbossJndiTemplate"/></property>
>>            <property
>> name="jndiName"><value>ConnectionFactory</value></property>
>>         </bean>
>> </beans>
>>
>> ===============================================
>>
>> Martin Landua wrote:
>> >
>> > We've been pretty successful with the following configuration (see
>> below).
>> > Please note that you might need the latest snapshot.
>> >
>> >                                               <jms:endpoints>
>> >                                                       <jms:endpoint
>> service="foo:jmsSender"
>> >
>> endpoint="endpoint" role="provider" destinationStyle="queue"
>> >
>> processorName="jca" jndiDestinationName="queue/testQueue"
>> >
>> jndiConnectionFactoryName="java:/JmsXA" />
>> >                                               </jms:endpoints>
>> >
>> > and here is the consumer:
>> >
>> >                                                       <jms:endpoint
>> service="foo:inputReceiver"
>> >
>> targetService="foo:rdbmsSender" endpoint="endpoint"
>> >
>> role="consumer" processorName="jca"
>> >
>> bootstrapContext="#bootstrapContext"
>> >
>> resourceAdapter="#jbossMQResourceAdapter"
>> >
>> connectionFactory="#managedJmsFactory"
>> >
>> defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>> >
>> synchronous="true">
>> >
>> <jms:activationSpec>
>> >
>> <bean
>> >
>> class="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec">
>> >
>> <property name="destination"
>> >
>> value="queue/testQueue" />
>> >
>> <property name="destinationType"
>> >
>> value="javax.jms.Queue" />
>> >
>> </bean>
>> >
>> </jms:activationSpec>
>> >                                                       </jms:endpoint>
>> >
>> > for which you will need the following references in your xbean file:
>> >
>> >       <bean id="bootstrapContext"
>> >               class="org.jencks.factory.BootstrapContextFactoryBean">
>> >               <property name="threadPoolSize" value="25" />
>> >       </bean>
>> >
>> >       <bean id="jbossMQResourceAdapter"
>> >               class="org.jboss.resource.adapter.jms.JmsResourceAdapter"
>> >               singleton="true">
>> >       </bean>
>> >
>> >       <bean id="managedJmsFactory"
>> >               class="org.springframework.jndi.JndiObjectFactoryBean">
>> >               <property name="jndiName">
>> >                       <value>java:/JmsXA</value>
>> >               </property>
>> >       </bean>
>> >
>> > Be sure to use the Connection Factory java:/JmsXA since this is the
>> one,
>> > which supports XA transactions if required.
>> >
>> > Best regards
>> > Martin
>> >
>> >
>> >
>> > johper wrote:
>> >>
>> >> Using SM in JBoss with newly built SAR, everythins workd/deploys fine
>> as
>> >> long as ActiveMQ is the provider.
>> >> Now I would like to use JBoss-MQ from "within" SM. Changed my
>> >> JMS-endpoints from using local ActiveMQ factories to JNDI lookups for
>> >> resources in JBoss. But SM does not like my JMS-endpoints?
>> >> When SM runs inside JBoss is JBoss JNDI tree accessible from my
>> >> service-assemblies? JBossMQ factory has remote and local JNDI names,
>> >> should I try the local one instead, since   both SM/JBoss runs in same
>> >> VM?
>> >>
>> >> This is what I am trying to do in my xbean file:
>> >>
>> >>   <jms:endpoint service="b:jms" endpoint="jms"
>> >>              role="provider"
>> >>              soap="true"
>> >>                 destinationStyle="queue"
>> >>
>> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>> >>                 jndiProviderURL="localhost"
>> >>                 jndiDestinationName="queue/myoutput"
>> >>                 jndiConnectionFactoryName="ConnectionFactory" />
>> >>
>> >>   <jms:endpoint service="b:finalconsumer" endpoint="finalconsumer"
>> >>              targetService="c:final"
>> >>              role="consumer"
>> >>              soap="true"
>> >>              soapVersion="1.1"
>> >>              destinationStyle="queue"
>> >>
>> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>> >>                 jndiProviderURL="localhost"
>> >>              jndiDestinationName="queue/myinput"
>> >>              jndiConnectionFactoryName="ConnectionFactory"
>> >>              defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
>> >>
>> >> In between there is an MDB in JBoss acting as the bridge..
>> >>
>> >> TIA
>> >> Johan
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6077054
>> Sent from the ServiceMix - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> 
> 

-- 
View this message in context: http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6094096
Sent from the ServiceMix - User forum at Nabble.com.


Re: JNDI and JBossMQ

Posted by johper <ka...@hotmail.com>.
That was the trick!! Now it works, really great, thanks a lot !!!
/Johan

gnodet wrote:
> 
> Try the following:
> 
>    <plugin>
>                 <groupId>org.apache.servicemix.tooling</groupId>
>                 <artifactId>jbi-maven-plugin</artifactId>
>                 <extensions>true</extensions>
>                <configuration>
>                      
> <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
>                </configuration>
>    </plugin>
> 
> On 9/1/06, johper <ka...@hotmail.com> wrote:
>>
>>
>>
>> By the way I dont know where to put the flags use mentioned? Tried this
>> in
>> my pom.xml (no luck):
>>     <build>
>>         <plugins>
>>             <plugin>
>> <generateJbiDescriptor>false</generateJbiDescriptor>
>> <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
>>                 <groupId>org.apache.servicemix.tooling</groupId>
>>                 <artifactId>jbi-maven-plugin</artifactId>
>>                 <extensions>true</extensions>
>>             </plugin>
>>         </plugins>
>>     </build>
>> =======================================
>>
>> gnodet wrote:
>> >
>> > You can set the <generateJbiDescriptor>false</generateJbiDescriptor>
>> > parameter on the jbi-maven-plugin to disable SU jbi.xml generation.
>> >
>> > You can also disable the SU analyze by setting the
>> > <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
>> > configuration element.
>> >
>> > Also, the error comes from a maybe invalid jndiName.
>> > It seems it should be a uri and have a protocol and can
>> > not just be "ConnectionFactory".
>> >
>> > On 8/31/06, johper <ka...@hotmail.com> wrote:
>> >>
>> >>
>> >> After adding Maven artifact id's for jboss stuff I am getting this:
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [ERROR] BUILD ERROR
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Failed to generate jbi.xml
>> >>
>> >> Embedded error: Unable to generate service unit descriptor!
>> >> no protocol: and
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Trace
>> >> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
>> >> generate
>> >> jbi.x
>> >> ml
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> >> ultLifecycleExecutor.java:559)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
>> >> fecycle(DefaultLifecycleExecutor.java:475)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> >> ltLifecycleExecutor.java:454)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> >> dleFailures(DefaultLifecycleExecutor.java:306)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> >> ts(DefaultLifecycleExecutor.java:273)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> >> fecycleExecutor.java:140)
>> >>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
>> :322)
>> >>         at
>> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>> >>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
>> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>         at
>> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> >> java:39)
>> >>         at
>> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> >> sorImpl.java:25)
>> >>         at java.lang.reflect.Method.invoke(Method.java:585)
>> >>         at
>> >> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> >>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> >>         at
>> >> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> >>
>> >>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> >> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to
>> >> generate jb
>> >> i.xml
>> >>         at
>> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> >> ojo.execute(GenerateServiceUnitDescriptorMojo.java:126)
>> >>         at
>> >> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> >> nManager.java:412)
>> >>         at
>> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> >> ultLifecycleExecutor.java:534)
>> >>         ... 16 more
>> >> Caused by: org.apache.servicemix.maven.plugin.jbi.JbiPluginException:
>> >> Unable
>> >> to
>> >> generate service unit descriptor!
>> >>         at
>> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> >> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:217)
>> >>         at
>> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> >> ojo.execute(GenerateServiceUnitDescriptorMojo.java:124)
>> >>         ... 18 more
>> >> Caused by: org.springframework.beans.factory.BeanCreationException:
>> Error
>> >> creati
>> >> ng bean with name 'bootstrapContext': FactoryBean threw exception on
>> >> object
>> >> crea
>> >> tion; nested exception is
>> >> org.springframework.beans.factory.BeanCreationExceptio
>> >> n: Error creating bean with name 'managedJmsFactory' defined in URL
>> >> [file:/D:/se
>> >> rvicemix-build/trunk/apache-servicemix/target/samples/bridge-
>> >> 3.0-incubating-SNAP
>> >> SHOT/bridge-jms-su/src/main/resources/xbean.xml]: Invocation of init
>> >> method
>> >> fail
>> >> ed; nested exception is javax.naming.CommunicationException [Root
>> >> exception
>> >> is j
>> >> ava.rmi.ServerException: RemoteException occurred in server thread;
>> >> nested
>> >> excep
>> >> tion is:
>> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> >> nested
>> >> excep
>> >> tion is:
>> >>         java.net.MalformedURLException: no protocol: and]
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> >> ctFromFactoryBean(AbstractBeanFactory.java:919)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> >> ctForBeanInstance(AbstractBeanFactory.java:883)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> >> (AbstractBeanFactory.java:199)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> >> (AbstractBeanFactory.java:153)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> >> preInstantiateSingletons(DefaultListableBeanFactory.java:250)
>> >>         at
>> >> org.springframework.context.support.AbstractApplicationContext.refres
>> >> h(AbstractApplicationContext.java:337)
>> >>         at
>> >> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>> >> >(FileSystemXmlApplicationContext.java:149)
>> >>         at
>> >> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
>> >> >(FileSystemXmlApplicationContext.java:48)
>> >>         at
>> >> org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.i
>> >> nit(AbstractXBeanServiceUnitAnalyzer.java:79)
>> >>         at
>> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
>> >> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:204)
>> >>         ... 19 more
>> >> Caused by: org.springframework.beans.factory.BeanCreationException:
>> Error
>> >> creati
>> >> ng bean with name 'managedJmsFactory' defined in URL
>> >> [file:/D:/servicemix-build/
>> >> trunk/apache-servicemix/target/samples/bridge-3.0-incubating-SNAPSHOT
>> >> /bridge-jms
>> >> -su/src/main/resources/xbean.xml]: Invocation of init method failed;
>> >> nested
>> >> exce
>> >> ption is javax.naming.CommunicationException [Root exception is
>> >> java.rmi.ServerE
>> >> xception: RemoteException occurred in server thread; nested exception
>> is:
>> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> >> nested
>> >> excep
>> >> tion is:
>> >>         java.net.MalformedURLException: no protocol: and]
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> >> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:878)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> >> Factory.createBean(AbstractAutowireCapableBeanFactory.java:396)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
>> >> ject(AbstractBeanFactory.java:240)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
>> >> y.getSingleton(DefaultSingletonBeanRegistry.java:132)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> >> (AbstractBeanFactory.java:237)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
>> >> (AbstractBeanFactory.java:153)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getType
>> >> (AbstractBeanFactory.java:377)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> >> isBeanTypeMatch(DefaultListableBeanFactory.java:228)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> >> getBeanNamesForType(DefaultListableBeanFactory.java:141)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> >> getBeansOfType(DefaultListableBeanFactory.java:194)
>> >>         at
>> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>> >> getBeansOfType(DefaultListableBeanFactory.java:188)
>> >>         at
>> >> org.springframework.context.support.AbstractApplicationContext.getBea
>> >> nsOfType(AbstractApplicationContext.java:661)
>> >>         at
>> >> org.jencks.factory.WorkManagerFactoryBean.getTransactionContextManage
>> >> r(WorkManagerFactoryBean.java:92)
>> >>         at
>> >> org.jencks.factory.WorkManagerFactoryBean.createWorkManager(WorkManag
>> >> erFactoryBean.java:196)
>> >>         at
>> >> org.jencks.factory.WorkManagerFactoryBean.getWorkManager(WorkManagerF
>> >> actoryBean.java:84)
>> >>         at
>> >> org.jencks.factory.BootstrapContextFactoryBean.getWorkManager(Bootstr
>> >> apContextFactoryBean.java:79)
>> >>         at
>> >> org.jencks.factory.BootstrapContextFactoryBean.getObject(BootstrapCon
>> >> textFactoryBean.java:53)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
>> >> ctFromFactoryBean(AbstractBeanFactory.java:916)
>> >>         ... 28 more
>> >> Caused by: javax.naming.CommunicationException [Root exception is
>> >> java.rmi.Serve
>> >> rException: RemoteException occurred in server thread; nested
>> exception
>> >> is:
>> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> >> nested
>> >> excep
>> >> tion is:
>> >>         java.net.MalformedURLException: no protocol: and]
>> >>         at
>> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
>> >>         at
>> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
>> >>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
>> >>         at
>> >> org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java
>> >> :124)
>> >>         at
>> >> org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
>> >>         at
>> >> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
>> >>         at
>> >> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:147)
>> >>         at
>> >> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport
>> >> .java:86)
>> >>         at
>> >> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.j
>> >> ava:101)
>> >>         at
>> >> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(Jnd
>> >> iObjectFactoryBean.java:164)
>> >>         at
>> >> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(Jnd
>> >> iObjectFactoryBean.java:151)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> >> Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:908)
>> >>         at
>> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
>> >> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:875)
>> >>         ... 45 more
>> >> Caused by: java.rmi.ServerException: RemoteException occurred in
>> server
>> >> thread;
>> >> nested exception is:
>> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
>> >> nested
>> >> excep
>> >> tion is:
>> >>         java.net.MalformedURLException: no protocol: and
>> >>         at
>> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
>> >>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>> >>         at java.security.AccessController.doPrivileged(Native Method)
>> >>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>> >>         at
>> >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>> >> 66)
>> >>         at
>> >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>> >> .java:707)
>> >>         at java.lang.Thread.run(Thread.java:595)
>> >>         at
>> >> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
>> >> RemoteCall.java:247)
>> >>         at
>> >> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
>> >> 223)
>> >>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
>> >>         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
>> >>         at
>> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
>> >>         ... 57 more
>> >> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments;
>> >> nested ex
>> >> ception is:
>> >>         java.net.MalformedURLException: no protocol: and
>> >>         at
>> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
>> >>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
>> >>         at java.security.AccessController.doPrivileged(Native Method)
>> >>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>> >>         at
>> >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
>> >> 66)
>> >>         at
>> >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
>> >> .java:707)
>> >>         at java.lang.Thread.run(Thread.java:595)
>> >> Caused by: java.net.MalformedURLException: no protocol: and
>> >>         at java.net.URL.<init>(URL.java:567)
>> >>         at java.net.URL.<init>(URL.java:464)
>> >>         at java.net.URL.<init>(URL.java:413)
>> >>         at
>> >> sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
>> >>         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java
>> :147)
>> >>         at
>> >> java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
>> >>         at
>> >> org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.ja
>> >> va:91)
>> >>         at
>> java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java
>> >> :247)
>> >>         at
>> >> sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
>> >> a:197)
>> >>         at
>> >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:154
>> >> 3)
>> >>         at
>> >> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465)
>> >>         at
>> >> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
>> >> 698)
>> >>         at
>> >> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
>> >>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
>> >> :349)
>> >>         at javax.naming.CompoundName.readObject(CompoundName.java:554)
>> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >>         at
>> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> >> java:39)
>> >>         at
>> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> >> sorImpl.java:25)
>> >>         at java.lang.reflect.Method.invoke(Method.java:585)
>> >>         at
>> >> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946
>> >> )
>> >>         at
>> >> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1818)
>> >>
>> >>         at
>> >> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
>> >> 718)
>> >>         at
>> >> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
>> >>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
>> >> :349)
>> >>         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java
>> :290)
>> >>         at
>> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
>> >>         ... 6 more
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Total time: 1 minute 29 seconds
>> >> ===============================================
>> >> This is my new xbean.xml file (temporarily lifted out my actual
>> enpoint
>> >> due
>> >> to error in factory creation):
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>> >>        xmlns:b="http://servicemix.apache.org/samples/bridge"
>> >>        xmlns:c="http://servicemix.apache.org/samples/final"
>> >>        xmlns:h="http://servicemix.apache.org/samples/hammer">
>> >>
>> >>         <bean id="bootstrapContext"
>> >>                
>> class="org.jencks.factory.BootstrapContextFactoryBean">
>> >>                 <property name="threadPoolSize" value="25" />
>> >>         </bean>
>> >>         <bean id="jbossMQResourceAdapter"
>> >>                 class="
>> org.jboss.resource.adapter.jms.JmsResourceAdapter"
>> >>                 singleton="true">
>> >>              <property name="serverUrl" value="tcp://localhost:1099"
>> />
>> >>         </bean>
>> >>         <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="managedJmsFactory"
>> >> class="org.springframework.jndi.JndiObjectFactoryBean">
>> >>            <property name="jndiTemplate"><ref
>> >> bean="jbossJndiTemplate"/></property>
>> >>            <property
>> >> name="jndiName"><value>ConnectionFactory</value></property>
>> >>         </bean>
>> >> </beans>
>> >>
>> >> ===============================================
>> >>
>> >> Martin Landua wrote:
>> >> >
>> >> > We've been pretty successful with the following configuration (see
>> >> below).
>> >> > Please note that you might need the latest snapshot.
>> >> >
>> >> >                                               <jms:endpoints>
>> >> >                                                       <jms:endpoint
>> >> service="foo:jmsSender"
>> >> >
>> >> endpoint="endpoint" role="provider" destinationStyle="queue"
>> >> >
>> >> processorName="jca" jndiDestinationName="queue/testQueue"
>> >> >
>> >> jndiConnectionFactoryName="java:/JmsXA" />
>> >> >                                               </jms:endpoints>
>> >> >
>> >> > and here is the consumer:
>> >> >
>> >> >                                                       <jms:endpoint
>> >> service="foo:inputReceiver"
>> >> >
>> >> targetService="foo:rdbmsSender" endpoint="endpoint"
>> >> >
>> >> role="consumer" processorName="jca"
>> >> >
>> >> bootstrapContext="#bootstrapContext"
>> >> >
>> >> resourceAdapter="#jbossMQResourceAdapter"
>> >> >
>> >> connectionFactory="#managedJmsFactory"
>> >> >
>> >> defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>> >> >
>> >> synchronous="true">
>> >> >
>> >> <jms:activationSpec>
>> >> >
>> >> <bean
>> >> >
>> >> class="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec">
>> >> >
>> >> <property name="destination"
>> >> >
>> >> value="queue/testQueue" />
>> >> >
>> >> <property name="destinationType"
>> >> >
>> >> value="javax.jms.Queue" />
>> >> >
>> >> </bean>
>> >> >
>> >> </jms:activationSpec>
>> >> >                                                      
>> </jms:endpoint>
>> >> >
>> >> > for which you will need the following references in your xbean file:
>> >> >
>> >> >       <bean id="bootstrapContext"
>> >> >              
>> class="org.jencks.factory.BootstrapContextFactoryBean">
>> >> >               <property name="threadPoolSize" value="25" />
>> >> >       </bean>
>> >> >
>> >> >       <bean id="jbossMQResourceAdapter"
>> >> >               class="
>> org.jboss.resource.adapter.jms.JmsResourceAdapter"
>> >> >               singleton="true">
>> >> >       </bean>
>> >> >
>> >> >       <bean id="managedJmsFactory"
>> >> >              
>> class="org.springframework.jndi.JndiObjectFactoryBean">
>> >> >               <property name="jndiName">
>> >> >                       <value>java:/JmsXA</value>
>> >> >               </property>
>> >> >       </bean>
>> >> >
>> >> > Be sure to use the Connection Factory java:/JmsXA since this is the
>> >> one,
>> >> > which supports XA transactions if required.
>> >> >
>> >> > Best regards
>> >> > Martin
>> >> >
>> >> >
>> >> >
>> >> > johper wrote:
>> >> >>
>> >> >> Using SM in JBoss with newly built SAR, everythins workd/deploys
>> fine
>> >> as
>> >> >> long as ActiveMQ is the provider.
>> >> >> Now I would like to use JBoss-MQ from "within" SM. Changed my
>> >> >> JMS-endpoints from using local ActiveMQ factories to JNDI lookups
>> for
>> >> >> resources in JBoss. But SM does not like my JMS-endpoints?
>> >> >> When SM runs inside JBoss is JBoss JNDI tree accessible from my
>> >> >> service-assemblies? JBossMQ factory has remote and local JNDI
>> names,
>> >> >> should I try the local one instead, since   both SM/JBoss runs in
>> same
>> >> >> VM?
>> >> >>
>> >> >> This is what I am trying to do in my xbean file:
>> >> >>
>> >> >>   <jms:endpoint service="b:jms" endpoint="jms"
>> >> >>              role="provider"
>> >> >>              soap="true"
>> >> >>                 destinationStyle="queue"
>> >> >>
>> >> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>> >> >>                 jndiProviderURL="localhost"
>> >> >>                 jndiDestinationName="queue/myoutput"
>> >> >>                 jndiConnectionFactoryName="ConnectionFactory" />
>> >> >>
>> >> >>   <jms:endpoint service="b:finalconsumer" endpoint="finalconsumer"
>> >> >>              targetService="c:final"
>> >> >>              role="consumer"
>> >> >>              soap="true"
>> >> >>              soapVersion="1.1"
>> >> >>              destinationStyle="queue"
>> >> >>
>> >> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>> >> >>                 jndiProviderURL="localhost"
>> >> >>              jndiDestinationName="queue/myinput"
>> >> >>              jndiConnectionFactoryName="ConnectionFactory"
>> >> >>              defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
>> >> >>
>> >> >> In between there is an MDB in JBoss acting as the bridge..
>> >> >>
>> >> >> TIA
>> >> >> Johan
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6077054
>> >> Sent from the ServiceMix - User forum at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6094096
>> Sent from the ServiceMix - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> 
> 

-- 
View this message in context: http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6096018
Sent from the ServiceMix - User forum at Nabble.com.


Re: JNDI and JBossMQ

Posted by Guillaume Nodet <gn...@gmail.com>.
Try the following:

   <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>jbi-maven-plugin</artifactId>
                <extensions>true</extensions>
               <configuration>
                      <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
               </configuration>
   </plugin>

On 9/1/06, johper <ka...@hotmail.com> wrote:
>
>
>
> By the way I dont know where to put the flags use mentioned? Tried this in
> my pom.xml (no luck):
>     <build>
>         <plugins>
>             <plugin>
> <generateJbiDescriptor>false</generateJbiDescriptor>
> <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
>                 <groupId>org.apache.servicemix.tooling</groupId>
>                 <artifactId>jbi-maven-plugin</artifactId>
>                 <extensions>true</extensions>
>             </plugin>
>         </plugins>
>     </build>
> =======================================
>
> gnodet wrote:
> >
> > You can set the <generateJbiDescriptor>false</generateJbiDescriptor>
> > parameter on the jbi-maven-plugin to disable SU jbi.xml generation.
> >
> > You can also disable the SU analyze by setting the
> > <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
> > configuration element.
> >
> > Also, the error comes from a maybe invalid jndiName.
> > It seems it should be a uri and have a protocol and can
> > not just be "ConnectionFactory".
> >
> > On 8/31/06, johper <ka...@hotmail.com> wrote:
> >>
> >>
> >> After adding Maven artifact id's for jboss stuff I am getting this:
> >> [INFO]
> >>
> ------------------------------------------------------------------------
> >> [ERROR] BUILD ERROR
> >> [INFO]
> >>
> ------------------------------------------------------------------------
> >> [INFO] Failed to generate jbi.xml
> >>
> >> Embedded error: Unable to generate service unit descriptor!
> >> no protocol: and
> >> [INFO]
> >>
> ------------------------------------------------------------------------
> >> [INFO] Trace
> >> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
> >> generate
> >> jbi.x
> >> ml
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> >> ultLifecycleExecutor.java:559)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> >> fecycle(DefaultLifecycleExecutor.java:475)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> >> ltLifecycleExecutor.java:454)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> >> dleFailures(DefaultLifecycleExecutor.java:306)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> >> ts(DefaultLifecycleExecutor.java:273)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> >> fecycleExecutor.java:140)
> >>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
> :322)
> >>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> >>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> >> java:39)
> >>         at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> >> sorImpl.java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> >>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> >>         at
> >> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> >>
> >>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> >> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to
> >> generate jb
> >> i.xml
> >>         at
> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> >> ojo.execute(GenerateServiceUnitDescriptorMojo.java:126)
> >>         at
> >> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> >> nManager.java:412)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> >> ultLifecycleExecutor.java:534)
> >>         ... 16 more
> >> Caused by: org.apache.servicemix.maven.plugin.jbi.JbiPluginException:
> >> Unable
> >> to
> >> generate service unit descriptor!
> >>         at
> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> >> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:217)
> >>         at
> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> >> ojo.execute(GenerateServiceUnitDescriptorMojo.java:124)
> >>         ... 18 more
> >> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error
> >> creati
> >> ng bean with name 'bootstrapContext': FactoryBean threw exception on
> >> object
> >> crea
> >> tion; nested exception is
> >> org.springframework.beans.factory.BeanCreationExceptio
> >> n: Error creating bean with name 'managedJmsFactory' defined in URL
> >> [file:/D:/se
> >> rvicemix-build/trunk/apache-servicemix/target/samples/bridge-
> >> 3.0-incubating-SNAP
> >> SHOT/bridge-jms-su/src/main/resources/xbean.xml]: Invocation of init
> >> method
> >> fail
> >> ed; nested exception is javax.naming.CommunicationException [Root
> >> exception
> >> is j
> >> ava.rmi.ServerException: RemoteException occurred in server thread;
> >> nested
> >> excep
> >> tion is:
> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
> >> nested
> >> excep
> >> tion is:
> >>         java.net.MalformedURLException: no protocol: and]
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
> >> ctFromFactoryBean(AbstractBeanFactory.java:919)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
> >> ctForBeanInstance(AbstractBeanFactory.java:883)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (AbstractBeanFactory.java:199)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (AbstractBeanFactory.java:153)
> >>         at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> preInstantiateSingletons(DefaultListableBeanFactory.java:250)
> >>         at
> >> org.springframework.context.support.AbstractApplicationContext.refres
> >> h(AbstractApplicationContext.java:337)
> >>         at
> >> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >> >(FileSystemXmlApplicationContext.java:149)
> >>         at
> >> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init
> >> >(FileSystemXmlApplicationContext.java:48)
> >>         at
> >> org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.i
> >> nit(AbstractXBeanServiceUnitAnalyzer.java:79)
> >>         at
> >> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> >> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:204)
> >>         ... 19 more
> >> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error
> >> creati
> >> ng bean with name 'managedJmsFactory' defined in URL
> >> [file:/D:/servicemix-build/
> >> trunk/apache-servicemix/target/samples/bridge-3.0-incubating-SNAPSHOT
> >> /bridge-jms
> >> -su/src/main/resources/xbean.xml]: Invocation of init method failed;
> >> nested
> >> exce
> >> ption is javax.naming.CommunicationException [Root exception is
> >> java.rmi.ServerE
> >> xception: RemoteException occurred in server thread; nested exception
> is:
> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
> >> nested
> >> excep
> >> tion is:
> >>         java.net.MalformedURLException: no protocol: and]
> >>         at
> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:878)
> >>         at
> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> Factory.createBean(AbstractAutowireCapableBeanFactory.java:396)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
> >> ject(AbstractBeanFactory.java:240)
> >>         at
> >> org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
> >> y.getSingleton(DefaultSingletonBeanRegistry.java:132)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (AbstractBeanFactory.java:237)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (AbstractBeanFactory.java:153)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getType
> >> (AbstractBeanFactory.java:377)
> >>         at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> isBeanTypeMatch(DefaultListableBeanFactory.java:228)
> >>         at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> getBeanNamesForType(DefaultListableBeanFactory.java:141)
> >>         at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> getBeansOfType(DefaultListableBeanFactory.java:194)
> >>         at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> getBeansOfType(DefaultListableBeanFactory.java:188)
> >>         at
> >> org.springframework.context.support.AbstractApplicationContext.getBea
> >> nsOfType(AbstractApplicationContext.java:661)
> >>         at
> >> org.jencks.factory.WorkManagerFactoryBean.getTransactionContextManage
> >> r(WorkManagerFactoryBean.java:92)
> >>         at
> >> org.jencks.factory.WorkManagerFactoryBean.createWorkManager(WorkManag
> >> erFactoryBean.java:196)
> >>         at
> >> org.jencks.factory.WorkManagerFactoryBean.getWorkManager(WorkManagerF
> >> actoryBean.java:84)
> >>         at
> >> org.jencks.factory.BootstrapContextFactoryBean.getWorkManager(Bootstr
> >> apContextFactoryBean.java:79)
> >>         at
> >> org.jencks.factory.BootstrapContextFactoryBean.getObject(BootstrapCon
> >> textFactoryBean.java:53)
> >>         at
> >> org.springframework.beans.factory.support.AbstractBeanFactory.getObje
> >> ctFromFactoryBean(AbstractBeanFactory.java:916)
> >>         ... 28 more
> >> Caused by: javax.naming.CommunicationException [Root exception is
> >> java.rmi.Serve
> >> rException: RemoteException occurred in server thread; nested exception
> >> is:
> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
> >> nested
> >> excep
> >> tion is:
> >>         java.net.MalformedURLException: no protocol: and]
> >>         at
> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
> >>         at
> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
> >>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
> >>         at
> >> org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java
> >> :124)
> >>         at
> >> org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
> >>         at
> >> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
> >>         at
> >> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:147)
> >>         at
> >> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport
> >> .java:86)
> >>         at
> >> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.j
> >> ava:101)
> >>         at
> >> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(Jnd
> >> iObjectFactoryBean.java:164)
> >>         at
> >> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(Jnd
> >> iObjectFactoryBean.java:151)
> >>         at
> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:908)
> >>         at
> >> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:875)
> >>         ... 45 more
> >> Caused by: java.rmi.ServerException: RemoteException occurred in server
> >> thread;
> >> nested exception is:
> >>         java.rmi.UnmarshalException: error unmarshalling arguments;
> >> nested
> >> excep
> >> tion is:
> >>         java.net.MalformedURLException: no protocol: and
> >>         at
> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> >>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
> >>         at java.security.AccessController.doPrivileged(Native Method)
> >>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> >>         at
> >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
> >> 66)
> >>         at
> >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
> >> .java:707)
> >>         at java.lang.Thread.run(Thread.java:595)
> >>         at
> >> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
> >> RemoteCall.java:247)
> >>         at
> >> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
> >> 223)
> >>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> >>         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> >>         at
> >> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
> >>         ... 57 more
> >> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments;
> >> nested ex
> >> ception is:
> >>         java.net.MalformedURLException: no protocol: and
> >>         at
> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> >>         at sun.rmi.transport.Transport$1.run(Transport.java:153)
> >>         at java.security.AccessController.doPrivileged(Native Method)
> >>         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> >>         at
> >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
> >> 66)
> >>         at
> >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
> >> .java:707)
> >>         at java.lang.Thread.run(Thread.java:595)
> >> Caused by: java.net.MalformedURLException: no protocol: and
> >>         at java.net.URL.<init>(URL.java:567)
> >>         at java.net.URL.<init>(URL.java:464)
> >>         at java.net.URL.<init>(URL.java:413)
> >>         at
> >> sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> >>         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java
> :147)
> >>         at
> >> java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> >>         at
> >> org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.ja
> >> va:91)
> >>         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java
> >> :247)
> >>         at
> >> sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
> >> a:197)
> >>         at
> >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:154
> >> 3)
> >>         at
> >> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465)
> >>         at
> >> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
> >> 698)
> >>         at
> >> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
> >>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
> >> :349)
> >>         at javax.naming.CompoundName.readObject(CompoundName.java:554)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> >> java:39)
> >>         at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> >> sorImpl.java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946
> >> )
> >>         at
> >> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1818)
> >>
> >>         at
> >> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
> >> 718)
> >>         at
> >> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
> >>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java
> >> :349)
> >>         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java
> :290)
> >>         at
> >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> >>         ... 6 more
> >> [INFO]
> >>
> ------------------------------------------------------------------------
> >> [INFO] Total time: 1 minute 29 seconds
> >> ===============================================
> >> This is my new xbean.xml file (temporarily lifted out my actual enpoint
> >> due
> >> to error in factory creation):
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
> >>        xmlns:b="http://servicemix.apache.org/samples/bridge"
> >>        xmlns:c="http://servicemix.apache.org/samples/final"
> >>        xmlns:h="http://servicemix.apache.org/samples/hammer">
> >>
> >>         <bean id="bootstrapContext"
> >>                 class="org.jencks.factory.BootstrapContextFactoryBean">
> >>                 <property name="threadPoolSize" value="25" />
> >>         </bean>
> >>         <bean id="jbossMQResourceAdapter"
> >>                 class="
> org.jboss.resource.adapter.jms.JmsResourceAdapter"
> >>                 singleton="true">
> >>              <property name="serverUrl" value="tcp://localhost:1099" />
> >>         </bean>
> >>         <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="managedJmsFactory"
> >> class="org.springframework.jndi.JndiObjectFactoryBean">
> >>            <property name="jndiTemplate"><ref
> >> bean="jbossJndiTemplate"/></property>
> >>            <property
> >> name="jndiName"><value>ConnectionFactory</value></property>
> >>         </bean>
> >> </beans>
> >>
> >> ===============================================
> >>
> >> Martin Landua wrote:
> >> >
> >> > We've been pretty successful with the following configuration (see
> >> below).
> >> > Please note that you might need the latest snapshot.
> >> >
> >> >                                               <jms:endpoints>
> >> >                                                       <jms:endpoint
> >> service="foo:jmsSender"
> >> >
> >> endpoint="endpoint" role="provider" destinationStyle="queue"
> >> >
> >> processorName="jca" jndiDestinationName="queue/testQueue"
> >> >
> >> jndiConnectionFactoryName="java:/JmsXA" />
> >> >                                               </jms:endpoints>
> >> >
> >> > and here is the consumer:
> >> >
> >> >                                                       <jms:endpoint
> >> service="foo:inputReceiver"
> >> >
> >> targetService="foo:rdbmsSender" endpoint="endpoint"
> >> >
> >> role="consumer" processorName="jca"
> >> >
> >> bootstrapContext="#bootstrapContext"
> >> >
> >> resourceAdapter="#jbossMQResourceAdapter"
> >> >
> >> connectionFactory="#managedJmsFactory"
> >> >
> >> defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
> >> >
> >> synchronous="true">
> >> >
> >> <jms:activationSpec>
> >> >
> >> <bean
> >> >
> >> class="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec">
> >> >
> >> <property name="destination"
> >> >
> >> value="queue/testQueue" />
> >> >
> >> <property name="destinationType"
> >> >
> >> value="javax.jms.Queue" />
> >> >
> >> </bean>
> >> >
> >> </jms:activationSpec>
> >> >                                                       </jms:endpoint>
> >> >
> >> > for which you will need the following references in your xbean file:
> >> >
> >> >       <bean id="bootstrapContext"
> >> >               class="org.jencks.factory.BootstrapContextFactoryBean">
> >> >               <property name="threadPoolSize" value="25" />
> >> >       </bean>
> >> >
> >> >       <bean id="jbossMQResourceAdapter"
> >> >               class="
> org.jboss.resource.adapter.jms.JmsResourceAdapter"
> >> >               singleton="true">
> >> >       </bean>
> >> >
> >> >       <bean id="managedJmsFactory"
> >> >               class="org.springframework.jndi.JndiObjectFactoryBean">
> >> >               <property name="jndiName">
> >> >                       <value>java:/JmsXA</value>
> >> >               </property>
> >> >       </bean>
> >> >
> >> > Be sure to use the Connection Factory java:/JmsXA since this is the
> >> one,
> >> > which supports XA transactions if required.
> >> >
> >> > Best regards
> >> > Martin
> >> >
> >> >
> >> >
> >> > johper wrote:
> >> >>
> >> >> Using SM in JBoss with newly built SAR, everythins workd/deploys
> fine
> >> as
> >> >> long as ActiveMQ is the provider.
> >> >> Now I would like to use JBoss-MQ from "within" SM. Changed my
> >> >> JMS-endpoints from using local ActiveMQ factories to JNDI lookups
> for
> >> >> resources in JBoss. But SM does not like my JMS-endpoints?
> >> >> When SM runs inside JBoss is JBoss JNDI tree accessible from my
> >> >> service-assemblies? JBossMQ factory has remote and local JNDI names,
> >> >> should I try the local one instead, since   both SM/JBoss runs in
> same
> >> >> VM?
> >> >>
> >> >> This is what I am trying to do in my xbean file:
> >> >>
> >> >>   <jms:endpoint service="b:jms" endpoint="jms"
> >> >>              role="provider"
> >> >>              soap="true"
> >> >>                 destinationStyle="queue"
> >> >>
> >> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
> >> >>                 jndiProviderURL="localhost"
> >> >>                 jndiDestinationName="queue/myoutput"
> >> >>                 jndiConnectionFactoryName="ConnectionFactory" />
> >> >>
> >> >>   <jms:endpoint service="b:finalconsumer" endpoint="finalconsumer"
> >> >>              targetService="c:final"
> >> >>              role="consumer"
> >> >>              soap="true"
> >> >>              soapVersion="1.1"
> >> >>              destinationStyle="queue"
> >> >>
> >> >> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
> >> >>                 jndiProviderURL="localhost"
> >> >>              jndiDestinationName="queue/myinput"
> >> >>              jndiConnectionFactoryName="ConnectionFactory"
> >> >>              defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
> >> >>
> >> >> In between there is an MDB in JBoss acting as the bridge..
> >> >>
> >> >> TIA
> >> >> Johan
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6077054
> >> Sent from the ServiceMix - User forum at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6094096
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet