Running a WebLogic Portal (WLP) 10.3.4 Domain as a Windows Service

To start a WLP server as a Windows service it is simplest to make your own script based on the provided standard script located at WL_HOMEserverbininstallSvc.cmd. The standard script works fine for a plain WLS domain, but lacks some classpath and options necessary for WLP.

Start by making a copy of the installSvc.cmd script and naming it something specific to your domain.

Next, just under SETLOCAL you will find where WL_HOME is defined. Here you will add the definitions you would normally add in a script that later calls installSvc.cmd (as per the standard documentation).

set DOMAIN_NAME=gnma_test_domain
set USERDOMAIN_HOME=D:my_test_domain
set SERVER_NAME=AdminServer
set WLS_USER=weblogic
set WLS_PW=gnmaAdmin01
set PRODUCTION_MODE=true
set MEM_ARGS=-Xms512m –Xmx512m
set MW_HOME=C:OracleMiddleware

Note: I had heard of people using this approach who had issues with the length of the command line. This may be due to their use of the default domain path. In the example above, I use a shorter path.

At this point, edit the DOMAIN_HOMEbinstartWebLogic.cmd and set it to echo both the classpath and the options. Then start the domain and capture the output of those echoes, then shut the domain back down. Now REM out the existing CLASSPATH definition, then use the outputs you captured earlier to set the CLASSPATH and JAVA_OPTIONS like this:

REM set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%;
set CLASSPATH=%MW_HOME%patch_wls1034profilesdefault...
[REMAINING CLASSPATH SNIPPED TO FIT]

set JAVA_OPTIONS= -Xverify:none  -ea -da:com.bea...
[REMAINING CLASSPATH SNIPPED TO FIT]

Note that all absolute paths have been replaced with the definitions created earlier to keep the length down and make the script more portable. You should definitely make your own version rather than copying the above. If you do copy the above, be careful of extra spaces and carriage returns used for formatting this blog entry.

Finally, before the ENDLOCAL, add an uninstall line for later use:

rem call "%WL_HOME%serverbinuninstallSvc.cmd"

And that’s it. Looks really simple, but it took me quite some time to gather all the necessary pieces in order to make it work. Hopefully you find this before you went through half as much research.

The example here uses a domain with only the Admin server and no managed servers. For a variety of reasons I only want the Admin server to be run as a service. The standard documentation along with the example above should allow you to expand this to include managed servers should you feel the need.

If you found this interesting, please share.

© Scott S. Nelson

Changing the Port used by the WebCenter WSRP Producer for .NET

As part of a recent POC effort it was desirable to use a different port from the pre-configured 8678 default. This was achieved by first changing the configured port for the web site in IIS, then updating C:\Oracle\Middleware\WSRPProducerForDotNet\[WSRP_APP_NAME]\wsdl1.0WSRPService.wsdl.

If you found this interesting, please share.

© Scott S. Nelson

java.lang.NoClassDefFoundError: …/WsrpResourceServletInterceptor

Recently I tried packaging a WSRP Interceptor in a JAR to share between applications with the same requirement, but was getting the following error:

java.lang.NoClassDefFoundError: com/bea/wsrp/consumer/resource/WsrpResourceServletInterceptor

Someone ran a JAR scan and found the WsrpResourceServletInterceptor class file located in netuix_servlet.jar.

As usual, due to project timelines we had already gone with moving the interceptor into the web application rather than fixing the NoClassDefFoundError, but if it comes up again I will try adding that to the domain classpath. Or if you run across it and try it, please post the results as a comment here.

If you found this interesting, please share.

© Scott S. Nelson

WLP Table Test Correct

I keep forgetting to post this. The table test query from the installer defaults to Derby/pointbase as:

SQL SELECT COUNT(*) FROM SYS.SYSTABLES

It should be:

SQL SELECT 1 FROM DUAL

if using an Oracle database and

SQL SELECT 1

if using MySQL.

See Default Test Table Name for more.

If you found this interesting, please share.

© Scott S. Nelson

Quicktime Killjoy for WLS

Installed the latest QuickTime recently as required for WebEx, then today I could not start a new WebLogic domain. To save you all the searching I went through, it turns out that the QuickTime adds .;C:Program Files (x86)Javajre6libextQTJava.zip to the classpath, which causes the following error starting WLS:

QTJava.zip was unexpected at this time

Remove the classpath entry and the QTJAVA entry from your environment variables if you have the same issue. If you are starting WebLogic from a console you will need a new console session. If from an IDE, you will need to restart the IDE afterwards for the update to take effect.

If you found this interesting, please share.

© Scott S. Nelson