Question

I am creating WLST scripts which will be run against a server running weblogic which is fairly locked down. I only have permission to view logs and read only access to the console unless a pre-authorised change. I don't have permission to access the entire weblogic domain and run WLST.

I would like to run WLST on a differernt server which has Java installed but not Weblogic.

I was initially hoping to add a weblogic jar to the classpath then run the tool but it seems a bit more complicated that that.

I have been following these instructions without success.

My current setup is this directory structure with jars taken from weblogic 12.1.1:

├── launch.sh
├── lib
│   ├── com.bea.core.utils.full_2.0.0.0.jar
│   ├── com.bea.core.xml.xmlbeans_2.2.0.0.jar
│   ├── com.oracle.cie.comdev_6.4.0.0.jar
│   ├── com.oracle.cie.config_7.2.0.0.jar
│   ├── com.oracle.cie.config-wls_7.2.0.0.jar
│   ├── com.oracle.cie.config-wls-schema_10.3.6.0.jar
│   ├── com.oracle.cie.wizard_6.1.0.0.jar
│   ├── com.oracle.core.weblogic.msgcat_1.3.0.0.jar
│   ├── jython.jar
│   ├── weblogic.jar
│   ├── weblogic.server.modules.jsf2.0_12.1.1.0.jar
│   ├── wlclient.jar
│   ├── wlfullclient.jar
│   └── wlthint3client.jar
└── props.txt

props.txt is empty described on the Oracle forum and launch.sh contains:

java -cp $(echo lib/*.jar | tr ' ' ':') -Dprod.props.file=props.txt -Dbea.home= -Dweblogic.home= weblogic.WLST 

on running launch.sh, i get the error:

sam@ubuntu64vm:~/Desktop/scripts$ ./launch.sh

Initializing WebLogic Scripting Tool (WLST) ...

Problem invoking WLST - java.lang.NullPointerException

Is it possible to create a minimal / portable WLST application?

Was it helpful?

Solution

Standalone WSLT works for Weblogic 10.3.4 by running the following command (see Note 3, this stopped the java.lang.NullPointerException):

java -cp lib/wlfullclient.jar;lib/com.bea.core.xml.xmlbeans_2.2.0.0.jar;lib/com.oracle.cie.comdev_6.3.0.0.jar;lib/com.oracle.cie.config-wls-schema_10.3.4.0.jar;lib/com.oracle.cie.config-wls_7.1.0.0.jar;lib/com.oracle.cie.config_7.1.0.0.jar;lib/com.oracle.cie.wizard_6.1.0.0.jar;lib/com.oracle.core.weblogic.msgcat_1.1.0.0.jar;lib/jython.jar;lib/weblogic.jar -Dprod.props.file=lib/props.txt -Dbea.home= -Dweblogic.home=c:/users/username/wls10 weblogic.WLST your-script.py

Notes about script:

  1. My Example setup of WLST is run from c:/users/username/wls10
  2. The required jar are in c:/users/username/wls10/lib.
  3. The weblogic.home must be set to an absolute path e.g. c:/users/username/wls10'.
  4. You must create a blank props.txt in /lib directory.
  5. I also followed same instructions as above.

OTHER TIPS

my list of libraries needed is following:

coherence.jar
com.bea.core.xml.xmlbeans.jar
com.oracle.cie.comdev_7.7.0.0.jar
com.oracle.cie.config_8.4.0.0.jar
com.oracle.cie.config-external_8.4.0.0.jar
com.oracle.cie.config-owsm_8.4.0.0.jar
com.oracle.cie.config-security_8.4.0.0.jar
com.oracle.cie.config-wls_8.4.0.0.jar
com.oracle.cie.config-wls-external_8.4.0.0.jar
com.oracle.cie.config-wls-schema_8.4.0.0.jar
com.oracle.cie.dependency_1.7.0.0.jar
com.oracle.cie.encryption_2.4.0.0.jar
com.oracle.cie.service-table_1.4.0.0.jar
com.oracle.cie.wizard_7.7.0.0.jar
com.oracle.core.weblogic.msgcat.jar
com.oracle.glcm.common-logging_1.5.0.0.jar
com.oracle.glcm.encryption_2.6.0.0.jar
com.oracle.weblogic.lifecycle.provisioning.api.jar
com.oracle.weblogic.lifecycle.provisioning.core.jar
com.oracle.weblogic.lifecycle.provisioning.wlst.jar
cryptoj.jar
jython-modules.jar
weblogic.jar
wlfullclient.jar
wls-api.jar
wlst-impl.jar

I used jarscan utility to locate all missing classes by trying to run several wlst scripts. Total size is cca 150MB

My launch.sh is following:

#!/bin/bash
MYDIR=$(dirname $0)
CP=$(echo $MYDIR/lib/*.jar | tr ' ' ':')
echo $CP
java -cp $CP -Dprod.props.file=$MYDIR/props.txt -Dbea.home=`pwd` -Dweblogic.home=`pwd` weblogic.WLST $@

Not perfect, but working for me.

I made a script to retrieve all the required files for a Standalone WLST tool

The repository is https://github.com/cheloide/wlst-standalone

The script extracts and install Weblogic Server in a temporary location, creates wlfullclient.jar and then copies the required resources to a directory of your choosing or the working path

I also made another script in the same repo to use the Weblogic.Deployer tool

Currently the tool only works with GNU/Linux; should work with Mac-OS with some tweaks.

I recently faced the same issue on WLS 12.1.3 and ended up with a different set of dependent jars. Here's what I needed:

wlfullclient.jar
weblogic.jar
com.bea.core.xml.xmlbeans_1.0.0.0_2-6-0.jar
com.oracle.cie.comdev_7.1.0.0.jar
com.oracle.cie.config-owsm_8.1.0.0.jar
com.oracle.cie.config-security_8.1.0.0.jar
com.oracle.cie.config-wls-schema_12.1.3.0.jar
com.oracle.cie.config-wls_8.1.0.0.jar
com.oracle.cie.config_8.1.0.0.jar
com.oracle.cie.dependency_1.1.0.0.jar
com.oracle.cie.encryption_2.1.0.0.jar
com.oracle.cie.service-table_1.1.0.0.jar
com.oracle.cie.wizard_7.1.0.0.jar
com.oracle.core.weblogic.msgcat_3.0.0.0.jar
jython-modules.jar

This has been tested for start/stop server and undeploy/deploy application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top