High-performance Message Driven Beans (MDBs) can be developed through the integration of FioranoMQ Server with the BEA WebLogic Server. This section explains the steps required to integrate FioranoMQ Server with the BEA WebLogic 9.2 Application Server.
Integrating FioranoMQ with Oracle Weblogic Application Server
The steps, below, are required to integrate the FioranoMQ Server with the BEA Weblogic Server:
- Install Weblogic Platform 9.2.3. Copy %FMQ_DIR%\lib\client\all\fmq-client.jar to %WL_HOME%\server\lib.
- Include %WL_HOME%\server\lib\fmq-client.jar in the CLASSPATH of %WL_HOME%\samples\domains\wl_server\setExamplesEnv.cmd. In addition, set WL_HOME = path of your Weblogic home directory.
- Navigate to the folder %WL_HOME%\samples\server\src\examples\ejb20\message and copy the files MessageTraderBean.java, Client.java, ejb-jar.xml and weblogic-ejb-jar.xml extracted from the attached zip file WeblogicIntegration.zip.
- Run %WL_HOME%\samples\server\config\examples\setExamplesEnv.cmd on the command line. This provides the environment required to run the sample.
- Navigate to the folder %WL_HOME%\samples\server\examples\src\examples\ejb\ejb20\message through command prompt and execute the file build.cmd present in the attached zip file WeblogicIntegration.zip. This compiles the Client.java file and adds it to the folder %WL_HOME%\samples\server\examples\build\clientclasses\examples\ejb20\message. In addition, this rebuilds ejb20_message.jar and adds it to the %WL_HOME%\samples\server\examples\src\examples\ejb\ejb20\message\dist.
- Navigate to the folder %WL_HOME%\server\bin and append the CLASSPATH of fmq-client.jar to the existing CLASSPATH found in the file startWLS.cmd %WL_HOME%\server\lib\fmq-client.jar.
- Start the Weblogic Examples Server by clicking on Start > Programs > BEAWeblogic Platform 9.2.3 > Weblogic Server 9.2.3 > Server Tour and Examples> Launch Examples Server.
- Start the FioranoMQ Server by clicking on Start > Programs > Fiorano > FioranoMQ> FioranoMQ Server.
- Run java examples.ejb25.message.Client http://<FMQ_HOST>\<FMQ_PORT>. By default, the FMQ_PORT is 1856. The Client.java sends three messages on primaryTopic located on the FioranoMQ Server.
On the console window of Weblogic Example Server, messages are displayed indicating that messages were received by the MDB deployed on the Weblogic server, listening on primaryTopic and located on FioranoMQ. Download Necessary Files.
Troubleshooting
Setting up the Bean as a Durable Subscriber with ClientID and Subscriber ID
One commonly encountered problem is that although the clientID is specified in the weblogic-jar.xml, the FioranoMQ server admin console accepts it as the subscriberID (client name). This means that the clientID in weblogic-jar.xml becomes the SubscriberID for the FioranoMQ Server. In Weblogic creating the ConnectionFactory or setting its parameters (ClientID) is not done through weblogic-ejbjar.xml. Weblogic-ejbjar.xml is used only to lookup the ConnectionFactory. Therefore, the ClientID cannot be set through weblogic-jar.xml.
As per to JMS settings: The preferred way to assign the client identifier of a client is to configure a client specific ConnectionFactory and then to transparently connect to the connection it creates. Alternatively, a client can set the client identifier of a connection using a provider-specific value.
The ClientID can be set either on the ConnectionFactory or on the Connection. Therefore, a ClientID can be set while making a new ConnectionFactory. In the default ConnectionFactories, the ClientID is set to a particular default value.
Use Connection.setClientID() to set a ClientID on a Connection manually.
IncompatibleClassChangeError
The error IncompatibleClassChangeError is thrown when an incompatible class change occurs. The definition of one of the classes, on which the currently executing method depends, has since changed. This issue can be resolved by adding the fmq-client.jar path in the CLASSPATH.