How do you troubleshoot something like this??!!
This short article will show you. For simplicity I'll talk about the node manager, but the same principles apply for running an admin or managed server as a service.
First, you still have your server logs. Sure the console output is better, but it's a starting point. Check this log for errors and especially take note of the start up variables such as PATH and CLASSPATH. If the server log isn't being created, that tells you WebLogic probably isn't even being started. (Check that you have a license file if you haven't already.)
Ok, so the logs were no help. The next step is to look at how the service is trying to start WebLogic.
When you install WebLogic as a service, you're really setting up beasvc.exe as the service. This is a tool that BEA/Oracle supplies with your WebLogic installation, and all it does is runs WebLogic using parameters stored in the Windows Registry.
To find out what beasvc is doing, you can either:
- Use the beasvc '-debug' mode; or
- Simulate the way beasvc starts WebLogic.
beasvc.exe provides an easy debug mode. To use it,
WL_HOME\server\bin\beasvc.exe -debug "SVC_NAME"
Where WL_HOME is where weblogic server is installed to (Eg.
Running beasvc with this option will give you a lot of useful information. You can find out more about the '-debug' option here.
If the '-debug' option isn't helping, or you need to test something specific, you can always simulate how beasvc starts WebLogic.
What we need to do is get all the environment variables and start-up parameters and then run WebLogic at the command-line.
To find the start-up parameters in the Windows Registry, first obtain the full service name from the Windows Services management console. To do this, right-click on the service you are troubleshooting, and click Properties. Copy the 'Display Name' field.
In regedit, search for the service using this display name. (On the Find dialog, select 'Look at: Keys' only.)
When you've found the node, expand it and select 'Parameters'. This contains all the important start-up parameters and environment variables.
Now that we have the start-up parameters used by beasvc, we can easily simulate it.
First, open a command console (cmd.exe) and change to the directory specified by the ExecDir registry entry.
Set the PATH variable to the value of the Path registry entry. Now run java.exe with no options. If it does not execute, you know that the registry's Path entry is incorrect. You can either edit it with regedit, or fix your installsvc.cmd script and run it again.
Finally, run java.exe again, this time followed by the CmdLine registry entry. This should run WebLogic as beasvc.exe would, except any errors will be printed to the console window.
With services, I frequently encounter various problems caused by incorrect CLASSPATH or PATH values - usually directory names with spaces that aren't surrounded by quotes. Java can interpret these as separate command line parameters, rather than a single file path.
As a general rule, avoid installing WebLogic to a directory that has a space in the name. If you do, use the old 8dot3 path name (use the DIR /X command to obtain these).
If you're having trouble working out why an exception is being thrown, you can check if this site covers your scenario: http://www.insideexceptions.com/. It's a good resource for administrators who understand java.