You have to add the weblogic.jar to your classpath and in
<servicemix_home>/lib

>From my experience, the best way is to generate and add the jar
wlfullclient.jar from Weblogic 10 server.

please follow instruction from here :
http://edocs.bea.com/wls/docs100/client/jarbuilder.html#wp1077742

poc is the namespace for the service, you can add something like this in the
beans tag

<beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
      xmlns="http://www.springframework.org/schema/beans";

      xmlns:poc="http://www.test.com/poc";

      xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://servicemix.apache.org/jms/1.0
http://servicemix.apache.org/schema/servicemix-jms-3.2.2.xsd
      http://activemq.org/config/1.0
http://activemq.apache.org/schema/core/activemq-core-4.1.1.xsd
      http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>


t_canada wrote:
> 
> Thanks tranchida.
> 
> I have tried to do a mvn install after I configured the xbean.xml and I
> got the following errors:
> 
> =============================================================================
> [INFO] Created Service Unit Analyzer
> [EMAIL PROTECTED]
> 2008-10-27 14:02:53,638 [main           ] INFO 
> ileSystemXmlApplicationContext - Refreshing
> [EMAIL PROTECTED]:
> display name
> [EMAIL PROTECTED];
> startup date [Mon Oct 27 14:02:53 PDT 2008]; ro
> ot of context hierarchy
> 2008-10-27 14:02:53,857 [main           ] INFO 
> XBeanXmlBeanDefinitionReader   - Loading XML bean definitions from URL
> [file:/C:/servicemix/projects/tutorial_jms/tutorial_jms-jms-su/src/main/resources/xbean.xml]
> 2008-10-27 14:02:54,529 [main           ] INFO 
> ileSystemXmlApplicationContext - Bean factory for application context
> [EMAIL PROTECTED]:
> [EMAIL PROTECTED]
> 2008-10-27 14:02:54,544 [main           ] INFO  DefaultListableBeanFactory    
> - Pre-instantiating singletons in
> [EMAIL PROTECTED]:
> defining beans
> [org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint,org.apache.servicemix.jms.endpoints.J
> msProviderEndpoint,connectionFactory,jmsDestinationResolver,weblogicTemplate];
> root of factory hierarchy
> 2008-10-27 14:02:54,732 [main           ] INFO  DefaultListableBeanFactory    
> - Destroying singletons in
> [EMAIL PROTECTED]:
> defining beans
> [org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint,org.apache.servicemix.jms.endpoints.JmsProvi
> derEndpoint,connectionFactory,jmsDestinationResolver,weblogicTemplate];
> root of factory hierarchy
> [WARNING] Failed to generate jbi.xml:
> org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to
> generate service unit descriptor!
> org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to
> generate service unit descriptor!
>         at
> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:206)
>         at
> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo.execute(GenerateServiceUnitDescriptorMojo.java:143)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.springframework.beans.factory.BeanCreationException: Error
> creating bean with name
> 'org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint' defined in URL
> [file:/C:/servicemix/projects/tutorial_jms/tutorial_jms-jms-su/src/main/resources/xbean.xml]:
> Cannot resolve reference to bean 'c
> onnectionFactory' while setting bean property 'connectionFactory'; nested
> exception is org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'connectionFactory' defined in URL
> [file:/C:/servicemix/projects/tutorial_jms/tutorial_jms-jms-su/src/main/resources/xbean.xml
> ]: Invocation of init method failed; nested exception is
> javax.naming.NoInitialContextException: Cannot instantiate class:
> weblogic.jndi.WLInitialContextFactory [Root exception is
> java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
>         at
> org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.init(AbstractXBeanServiceUnitAnalyzer.java:90)
>         at
> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:185)
>         ... 19 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'connectionFactory' defined in URL
> [file:/C:/servicemix/projects/tutorial_jms/tutorial_jms-jms-su/src/main/resources/xbean.xml]:
> Invocation of init method failed; nested exception is javax.naming.NoInit
> ialContextException: Cannot instantiate class:
> weblogic.jndi.WLInitialContextFactory [Root exception is
> java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1174)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
>         ... 31 more
> Caused by: javax.naming.NoInitialContextException: Cannot instantiate
> class: weblogic.jndi.WLInitialContextFactory [Root exception is
> java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
>         at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
>         at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>         at javax.naming.InitialContext.init(InitialContext.java:223)
>         at javax.naming.InitialContext.<init>(InitialContext.java:197)
>         at
> org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:105)
>         at
> org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:83)
>         at
> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
>         at
> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
>         at
> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
>         at
> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
>         at
> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:197)
>         at
> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:184)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
>         ... 37 more
> Caused by: java.lang.ClassNotFoundException:
> weblogic.jndi.WLInitialContextFactory
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:242)
>         at
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
>         at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
>         ... 50 more
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] No sources to compile
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [jar:jar]
> [INFO] Building jar:
> C:\servicemix\projects\tutorial_jms\tutorial_jms-jms-su\target\tutorial_jms-jms-su-1.0-SNAPSHOT.jar
> [INFO] [jbi:jbi-service-unit]
> [INFO] Resolving org.apache.servicemix:servicemix-jms:jar:3.2.2:compile
> [INFO] Resolving org.apache.servicemix:servicemix-shared:jar:3.2.2:compile
> [INFO] Resolving org.apache.servicemix:servicemix-common:jar:3.2.2:compile
> =============================================================================
> 
> Am I missing anything?
> 
> And here is my xbean.xml:
> ========================================================
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
>       xmlns="http://www.springframework.org/schema/beans";
>       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://servicemix.apache.org/jms/1.0
> http://servicemix.apache.org/schema/servicemix-jms-3.2.2.xsd
>       http://activemq.org/config/1.0
> http://activemq.apache.org/schema/core/activemq-core-4.1.1.xsd
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
> 
>         <jms:consumer service="poc:source" endpoint="jms"
>                targetService="poc:destination" targetEndpoint="jms"
>               
> destinationName="com.mdsi.port.paJms.DefaultCIS0.OutboundQueue"
> connectionFactory="#connectionFactory"
>                destinationResolver="#jmsDestinationResolver"/>
> 
>        <jms:provider service="poc:destination" endpoint="jms"
>               
> destinationName="com.mdsi.port.paJms.DefaultCIS0.InboundQueue"
>                connectionFactory="#connectionFactory"
>                destinationResolver="#jmsDestinationResolver" />
> 
>        <bean id="connectionFactory"
>                class="org.springframework.jndi.JndiObjectFactoryBean">
>                <property name="jndiName"
>                        value="com.mdsi.port.paJms.queueConnectionFactory"
> />
>                <property name="jndiTemplate" ref="weblogicTemplate" />
>        </bean>
> 
>        <bean id="jmsDestinationResolver"
>               
> class="org.springframework.jms.support.destination.JndiDestinationResolver">
>                <property name="jndiTemplate">
>                        <ref bean="weblogicTemplate" />
>                </property>
>                <property name="cache">
>                        <value>true</value>
>                </property>
>        </bean>
> 
>        <bean id="weblogicTemplate"
>                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://hpiaapp1:29978
>                                </prop>
>                        </props>
>                </property>
>        </bean>
> </beans>
> 
> ========================================================
> 
> Any help would be greatly appreciated.
> 
> Thanks
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ServiceMix-3.2.2-and-JMS-queue-in-Weblogic-server-tp20159390p20214752.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to