« September 2008 | Main | December 2008 »

October 2008 Archives

October 7, 2008

Steps to connect to Weblogic 9.2 using JMS Adapter in Oracle BPEL / ESB

Oracle JMS Adapter is a very special JMS client that can connect to any JMS server whether it is OC4J (In-memory or DB) or a 3rd-party JMS servers like Weblogic, Websphere, Tibco, MQseries or OpenJMS or any other. Once the configuration is correct, it is as simple as connecting to a local queue and producing and consuming the messages.

The following are steps (these are not my steps :) .. I have taken these steps from SOA Best practises document) to connect to Weblogic 9.2 using JMS Adapter in Oracle BPEL / ESB:

Weblogic.jar is a file, which contains almost most of the logic to connect to the Weblogic and tune the configuration of the weblogic server. The best part of Weblogic is that this file alone is enough to connect to the Weblogic and manage it.

1. So, first step to connect to Weblogic is to copy weblogic.jar (from $WL_HOME/weblogic92/server/lib, where WL_HOME is the directory where Weblogic is installed) to the $SOA_ORACLE_HOME/j2ee/[instance_name]/connectors/JmsAdapter/JmsAdapter directory, where SOA_ORACLE_HOME is the directory where SOA Suite is installed.

2. Add the following entry (connection factory properties) to oc4j-ra.xml ($SOA_ORACLE_HOME/j2ee/[instance_name]/application-deployments/default/JmsAdapter):

<connector-factory location="[location_of_the JNDI]" connector-name="[Logical_name_of_this_connection_factory]">
<config-property name="connectionFactoryLocation" value="[global-jndi-name-of-your-non-XA-jmsconnectionfactory-in-weblogic]"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory;java.naming.provider.url=t3://[host:port];java.naming.security.principal=[username];java.naming.security.credentials=[password]"/<
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="false"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value=""/>
<config-property name="password" value=""/>
</connector-factory>


Example:

<connector-factory location="eis/wljms/WLQueue" connector-name="Connection_factory_2_WL">
<config-property name="connectionFactoryLocation" value="pvj/PvjConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory;java.naming.provider.url=t3://[host:port];java.naming.security.principal=[username];java.naming.security.credentials=[password]"/<
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="false"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value=""/>
<config-property name="password" value=""/>
</connector-factory>

If it the end-point is a topic, then change the isTopic property to true. For queue, this property will be false.

Since the WebLogic Server does its authentication during JNDI InitialContext creation, we should not specify a value for the "username" and "password" config-property fields. These fields must be present and set to empty strings as shown above. The WebLogic username and password are specified only as the java naming properties as specified above.

Note:

a. The isTransacted config-property value can be set to true or false. If set to true, this tells the JMS adapter to use a JMS transacted session (which means that only JMS operations performed on this JMS session are included in a transaction). Currently, XA integration with WebLogic JMS is not currently supported.

b. For all WebLogic JMS versions, ensure that the JMS adapter ActivationSpec property UseMessageListener is set to false.

c. For enabling transactions across your BPELs/ ESBs, the acknowledgeMode should be set to CLIENT_ACKNOWLEDGE instead of AUTO_ACKNOWLEDGE.

3. WebLogic 9.x changed the JNDI client-side implementation in a way that causes OC4J JNDI lookups to fail. As a result, you must make the following changes to your Oracle
SOA Suite configuration. Failure to do so generates Oracle BPEL Process Manager and Oracle ESB errors related to not finding JMS destinations and transaction errors.

server.xml — ($SOA_ORACLE_HOME/j2ee/[instance-name]/config directory) Add the property environment-naming-url-factory-enabled="true" in the server.xml configuration file for your instance for any application that includes weblogic.jar from WebLogic 9.x as follows:

<application-server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd"
localhostIsAdmin="true"
application-directory="../applications"
check-for-updates="adminClientOnly"
deployment-directory="../application-deployments"
connector-directory="../connectors"
environment-naming-url-factory-enabled="true"
schema-major-version="10" schema-minor-version="0">

4. The following two patches on top of 10.1.3.3 are also required for an instance that has Oracle ESB installed (whether it is being used or not):

  • Patch 6081699 - Giving Error For Aqjms If Environment-Naming-Url-Factory-Enabled="True" Prop Set

  • Patch 6316554 - Consume Functionality Of Jms Adapter For Bea Weblogic Does Not Work
  • These 4 steps are enough to connect to Weblogic JMS server using JMS Adapter. I tested it with Weblogic 9.2 and it works perfectly.


    Additional Notes:

    1. Some more points here which initially I have spent time to understand due to terminology differences J is to find out what exactly is “global-jndi-name-of-your-non-XA-jmsconnectionfactory-in-weblogic

    To know this:

    a. Goto Weblogic console: http://host:port/console

    b. Under domain configuration, goto Services section and click on JMS Modules:

    JMSAdapter1.JPG

    c. Then click on one of the available modules you have, by default, only one module will be available unless we create any or any other deployment is done.

    d. In the Resources table, you will find the value of the JNDI name for the connection factory:

    JMSAdapter2.JPG

    2. Now this Connection Factory has to be a NON-XA enabled as Weblogic doesn’t support XA Configuration outside Weblogic (internally it is supported). To find out, if this connection factory is XA-enabled or not, these are steps:

    a. Click on the Connection Factory link to go to the configuration:

    JMSAdapter3.JPG

    b. Click on the Transactions tab to check if this is XA enabled or not:

    JMSAdapter4.JPG

    c. By default, this is checked. Uncheck this and then restart your Weblogic server to make the changes into effect.

    Please note that if this check box is checked, JMS Adapter will NOT be able to produce / consume the messages (in 10.1.3.3, producing the messages works, but consuming doesn’t work. In 10.1.3.4, both producing the messages into WL queue and consuming from the WL queue doesn’t work).

    To view this entry in a PDF, please click here to download the file.

    October 22, 2008

    JDeveloper 11g Production Released

    I am so excited to see new JDeveloper 11g production release to the public. It has got tons of new features to play with. One interesting thing is that JDeveloper 11g now has a Installer :) which came as a surprise to me. Until now, we just unzip the package, but now, we have a cool installer, ofcourse as every oracle application install, this one too is a easy ride.

    One major change that we have in this version is that the OC4J container is removed and BEA Weblogic container is used in place of OC4J. I was hurt by this because I like OC4J more than BEA. BEA app container is also a cool product and has a stronger foundation than OC4J. Still need to explore more on this area.

    These are the quick installer steps for installing newwwwww JDeveloper 11g Production release:

    2.png

    3.png

    We can see that this installation is similar to BEA Weblogic installation. Oracle has just managed to combine both the installers (Weblogic and JDeveloper).

    4.png

    5.png

    6.png

    7.png

    8.png

    9.png

    10.png

    11.png

    12.png

    13.png

    14.png

    15.png

    16.png

    17.png

    18.png

    And NOW for the JDeveloper 11g Interface

    1.png

    There are tons of new features in this release and can they can be checked here.

    The quick tutorials can be found here.

    One sad thing I felt is SOA part is removed from this release. From FAQs, I found that it will be released when SOA Suite 11g is released.

    Sooo, until then enjoy the new JDeveloper 11g for developing ADF, Fusion and J2EE apps :)

    About October 2008

    This page contains all entries posted to Learn with Pavan in October 2008. They are listed from oldest to newest.

    September 2008 is the previous archive.

    December 2008 is the next archive.

    Many more can be found on the main index page or by looking through the archives.

    Creative Commons License
    This weblog is licensed under a Creative Commons License.
    Powered by
    Movable Type and Oracle