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

2 comments:

ClintJCL said...

Maven install command example you provided did not work:

C:\Oracle\Middleware\wlserver_10.3\server\lib>mvn install:install-file -DgroupId=wlclient -DartifactId=wlclient -Dversion=10.
3.3 -Dpackaging=jar -Dfile=wlfullclient.jar
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.225s
[INFO] Finished at: Fri Jan 10 15:07:21 EST 2014
[INFO] Final Memory: 2M/120M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Oracle\Middleware\wlse
rver_10.3\server\lib). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

Marcello said...

Thanks, worked fine.