4 Replies Latest reply on Oct 5, 2011 12:42 PM by pchandler

    Jms Component & WebLogic

    pchandler

      Is there a way to load the weblogic JMS connection factory locally/statically  i.e., no JNDI?

       

      <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory" class="???????"></property>
      </bean>
      

       

        • 1. Re: Jms Component & WebLogic
          jradecki

          Yeah, that can be a pain getting to work...You'll have to update w/the correct weblogic

           

           

           

          Edited by: jradical on Oct 3, 2011 7:57 PM

           

          Edited by: jradical on Oct 3, 2011 7:58 PM

          • 2. Re: Jms Component & WebLogic
            pchandler

            Yes. I have wired-up standalone ActiveMQ, Websphere, and SonicMQ. However, I am looking for a WebLogic standalone (no JNDI) example. No sure what the WebLogic JMS provider specific connection factory class is and how to configure it?

            • 3. Re: Jms Component & WebLogic
              jradecki

              Seriously can't help you there w/a non jndi impl; I don't even know if Oracle still maintains Weblogic.  However; if your looking to connect w/a proxy client outside the app server; a 4 line jndi emulator is what you need.  Let me know if you need the code.   Wow, Weblogic..."Now, that's a name I've not heard in a long time...a long time." (Obi-Wan). 

               

              Also, an amq bridge maybe an option for you.

              "Some JMS providers, WebLogic for instance, do not expose a setter for connection properties like host and port (setBrokerUrl) on their ConnectionFactory object. In this case you need to set outboundQueueConnectionFactoryName and jndiOutboundTemplate in your activemq.xml config file."

              http://activemq.apache.org/jms-to-jms-bridge.html

               

              No big deal w/that.  Little reflection and BI can get you around that.  Good luck!

              • 4. Re: Jms Component & WebLogic
                pchandler

                It looks like Weblogic considers  a ConnectionFactory a "JMS Administer Object". Hence, you create/maintain/configure the ConnectionFactory Object outside of your Java JMS code. More true to the JMS Specification.

                 

                Here is the answer:

                Creating a JNDI ConnectionFactory Object in WebLogic's Java Named Directory.

                1.     I Downloaded, Installed, Configured, and Started the WebLogic Server

                2.     I then logged into the WebLogic Console http://myHostName:7001/console

                3.     I followed the instructions

                 

                Wire-up a JMS component as follows:

                <beans>
                    
                     <!-- To configure/install the weblogic JMS connection factory see:  http://download.oracle.com/docs/cd/E13222_01/wls/docs90/ConsoleHelp/taskhelp/jms_modules/connection_factories/CreateConnectionFactories.html -->
                       
                    <!-- Defines the Client connection to the JNDI Server --> 
                    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
                        <property name="environment">
                            <props>
                                <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
                                <prop key="java.naming.provider.url">t3://localhost:7001</prop>
                                <!-- opional ... -->
                                <prop key="java.naming.security.principal">weblogic</prop>
                                <prop key="java.naming.security.credentials">weblogic</prop>
                            </props>
                        </property>
                    </bean>
                    
                    <!-- Gets a Weblogic JMS Connection factory object from JDNI Server by jndiName--> 
                    <bean id="webLogicJmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
                        <property name="jndiTemplate" ref="jndiTemplate"></property>
                        <property name="jndiName" value="jms/connectionFactory"></property>  <!-- the connection factory object is store under this name -->
                    </bean>
                    
                    <!-- Create a new WebLogic Jms Camel Component -->
                    <bean id="weblogicJmsCamelComponent" class="org.apache.camel.component.jms.JmsComponent">
                       <property name="connectionFactory" ref="webLogicJmsConnectionFactory"></property>
                    </bean>
                        
                
                </beans>