2

I'm writing a simple script to facilitate changing JDBC connection URLs in several WL environments, among these both v8.1 and v9.2.

I want to create a standalone script, outside of any WL installation, just including wlst.jar/jython.jar/weblogic.jar, that will work both on WL 8.1 and 9.2 (obviously by referencing different MBeans).

Now, this works OK for WL 8.1. I copy weblogic.jar from the server, and have managed to get ahold of both wlst.jar and jython.jar (wasn't easy, Oracle doesn't host them anymore). Also I need to make sure to locally run under the same JRE as the server (WL8.1 runs on Java 1.4.2).

But if I try to connect to WL 9.2 from this setup, I get a NullPointerException when trying to access any MBean (probably because I'm running on JRE 1.4.2 and WL 9.2 uses 1.5.0).

Also, I am unable to create a standalone environment for WL 9.2. If I copy weblogic.jar from 9.2 and run WLST like so:

java -cp "wlst.jar:jython.jar:weblogic-92.jar" weblogic.WLST

I get a java.lang.NoClassDefFoundError: weblogic/management/configuration/RepositoryMBean error. I can't find this class in weblogic92/server/lib, but it IS inside weblogic.jar from WL 8.1.

So I'm really losing my patience here...

Is there any way to create a standalone WLST client that can connect to any version of WebLogic (8.1 & 9.2 in the meantime)?

I really wouldn't want to have to ssh into the WL environment to run my WLST script...

Any ideas/suggestions are welcome.

Thanks,

Ivan

imiric
  • 143
  • 2
  • 6

2 Answers2

1

I think there are different versions of WLST, one for 1.4 and a different one for 1.5. When you try invoking the 1.5 version, you cannot use java 1.4.

Your best bet is to have a wrapper script that launches the separate WLST sessions and then returns the results uniformly.

0

From WebLogic 9.X onwards, WLST.jar file is shipped as a part of the weblogic.jar file present in BEA_HOME/weblogic922/server/lib directory.

You can just run the WLST as below as below.

java -cp C:\bea103\wlserver_10.3\server\lib\weblogic.jar weblogic.WLST

Else, you can run the setDomainEnv script to set the classpath and then run as below.

java weblogic.WLST

For more WLST Scripts you can refer the link below.

http://weblogic-wonders.com/weblogic/wlst/

Cheers, Anandraj http://weblogic-wonders.com

  • This works if I run WLST from a different directory on a server with WebLogic installed. However, I want to create a standalone WLST environment/script that would work outside of any WebLogic installation. If I copy weblogic.jar to another machine, I get the following error: `Problem invoking WLST - java.lang.RuntimeException: error in finding weblogic.Home`. If I set weblogic.home (-Dweblogic.home="..\\..\\"), then I get: `Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class`. – imiric Mar 03 '11 at 17:37