weblogic tips

How to generate the maven weblogic plugin suitable for your weblogic server ?

From the $WLS\server\lib, execute the command :

java -jar wljarbuilder.jar -profile weblogic-maven-plugin

Several jars files are generated, among the weblogic-maven-plugin.jar.
Then, you must deploy weblogic-maven-plugin.jar as a maven artifact in your repository (local or remote according to your needs) in order to be able to declare that plugin in your pom.xml.

The version artifact filled in the deploy file command must match with the maven plugin version in weblogic-maven-plugin.jar.
If you are not sure about the version of the plugin, open weblogic-maven-plugin.jar and open MANIFEST.MF in META-INF folder.

It should look like that :

Manifest-Version: 1.0
Implementation-Vendor: Oracle Corp.
Implementation-Title: WebLogic Maven Plugin for WebLogic Server 10.3  
 Tue Nov 15 08:52:36 PST 2011 1441050 
Implementation-Version: 10.3.6.0
Class-Path: cryptoj.jar

Implementation-Version: 10.3.6.0 is the plugin version.

You can do it with this command line (windows friendly for multiple-line separator):

mvn deploy:deploy-file -Durl=file://D:\m2 ^
                       -Dfile=D:\Oracle\wls10.6.6\wlserver_10.3\server\lib\weblogic-maven-plugin.jar ^
                       -DgroupId=com.oracle.weblogic ^
                       -DartifactId=weblogic-maven-plugin ^
                       -Dversion=10.3.6.0 ^
                       -Dpackaging=jar ^
                       -DgeneratePom=true

How to enable remote debugging with Weblogic 10-11 ?

In startWebLogic.cmd, add the instruction after the domain variable setting:

set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

Here, among others, address=4000 specifies 4000 as port where the remote debugging information is written and suspend=n doesn’t force weblogic to wait until the debugger connects.
This value for the suspend argument allows to enable to use the remote debugging on demand.
Of course, you can change all values.

You may add that instruction after :

set DOMAIN_HOME=D:\Oracle\wls10.6.6\user_projects\domains\base_domain

Finally, you should have something like that :

...
set DOMAIN_HOME=D:\Oracle\wls10.6.6\user_projects\domains\base_domain
set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
...
Ce contenu a été publié dans Non classé. Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *