Unable to start WLST: “Could Not Find or Load Main Class weblogic.WLST”

The above error means that the correct CLASSPATH has not been set in order to start WLST. The same error can occur for other utilities such as weblogic.Deployer, utils.dbping or even weblogic.Server etc

The root cause is always the same, the required classes are not loaded and here are a couple of  ways to fix the issue.

Continue reading

Passing arguments to WLST scripts

Often when developing WLST scripts, certain arguments must be passed to the script. This can be achieved by passing the arguments at the wlst.sh execution and accessing them in the script using the sys.argv variable. For example, to connect to a local AdminServer by passing the URL, username and password at execution time.

The connect.py script looks like this:

import sys;

connect(sys.argv[2],sys.argv[3],sys.argv[1]);
disconnect();
exit()

Continue reading

WebLogic AdminServer startup and shutdown scripts


Right after creating a WebLogic domain, you can navigate to the domain directory and start the administration server using the startWebLogic.sh script. However, for easier control over the administration server of your domain, you can create some WLST startup and shutdown scripts that manage your admin server via the Node Manager.

The solution below describes two WLST scripts (startAdmin.jy and stopAdmin.jy ) and two platform dependent scripts that you use to call the Jython ones. (startAdmin.sh and stopAdmin.sh for Unix or startAdmin.bat and stopAdmin.bat for Windows)

Continue reading

Cannot connect to Node Manager. : Access to domain for user ‘weblogic’ denied


If you’ve hit this error you are probably trying to control your Weblogic servers via WLST, but you are unable to connect to the Node Manager.

nmConnect(‘weblogic’,’welcome1′,’localhost’,’5556′,’FMW_XPS’,’/shared/oracle/FMW_Home/user_projects/domains/FMW_XPS’,’plain’)
Connecting to Node Manager …
Traceback (innermost last):
File “”, line 1, in ?
File “”, line 123, in nmConnect
File “”, line 648, in raiseWLSTException
WLSTException: Error occured while performing nmConnect : Cannot connect to Node Manager. : Access to domain ‘FMW_XPS’ for user ‘weblogic’ denied.
Use dumpStack() to view the full stacktrace

Assuming you’ve already made sure all the parameters in the nmConnect command are correct and the NM process is up and running, there is actually one more thing to check: has your domain been set up in Production Mode? If so, then the Node Manager credentials have been generated by the Configuration Wizard at domain creation time. While the AdminServer will be aware of these credentials by default (you are able to connect to the NM via de admin console, after all), you will not be able to connect via WLST since you have to provide this random username and password. The solution is to reset the credentials in the Administration Console.

Continue reading