Friday, May 6, 2011

Installing Weblogic (3rd party) Libraries using Maven

In my scenario, I am interacting with weblogic JMS queues using Apache Camel. I am using Maven to setup the Camel project in Eclipse. The issue here is that the weblogic (3rd party) libraries are not published in the Maven repo. This causes problems with the build.

In this post, I will describe the steps to configure and install weblogic libraries using maven to successfully execute the project.

Step 1:
For weblogic 10.0 and higher, you need to generate the wlfullclient.jar using the following instructions. (Available here - http://download.oracle.com/docs/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742)

• cd WL_HOME/server/lib
• java -jar ../../../modules/com.bea.core.jarbuilder_X.X.X.X.jar
• wlfullclient.jar is generated in WL_HOME/server/lib

Step 2:
Use Maven install plugin to install the jar files.

• mvn install:install-file -DgroupId=wlclient -DartifactId=wlclient -Dversion=10.3.3 -Dpackaging=jar -Dfile=C:\bea1\wlserver_10.3\server\lib\wlfullclient.jar

I installed 3 jar files using maven.
wl-j2ee-client.jar
wljmsclient.jar
wlfullclient.jar (or) weblogic.jar

Fixes: If you encounter the following error, you need to generate wlfullclient.jar using step 1.
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: weblogic/management/WebLogicMBean