Pages - Menu

Showing posts with label Admin Server configuration. Show all posts
Showing posts with label Admin Server configuration. Show all posts

Trying to Start a Weblogic Admin Server or Managed Server via a Service on 64bit Windows Fails with "Unable to Find a JVM"

Wednesday, July 24, 2013

If the service was created successfully and however when attempting to start the service, the following window is shown:

The beasvc <Domain>_<ServerName> service on Local Computer started and then stopped. Some services stop automatically  if they have no work to do, for example, the Performance Logs and Alerts service.

Assuming the -log parameter was specified when creating the service as per the note, the <ServerName>-stdout.txt file shows the following:


[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszCmdLine = -client -Xms32m -Xmx200m -XX:MaxPermSize=128m -XX:+UseSpinning  -Xverify:none  -da -Dplatform.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\AS11\MIDDLE~1\patch_wls1033\profiles\default\sysext_manifest_classpath -Xverify:none -classpath etc....
......
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszJavaHome = C:\Oracle\JDK6-64
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszExecDir = C:\Oracle\AS11\MiddlewareStand\user_projects\domains\Test_Domain
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszOldPath = C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszNewPath = C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server\native\win\x64\;C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\JDK6-64\jre\bin;C:\Oracle\JDK6-64\bin;C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszDelay = 0
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszStopClass = []
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszLog = [C:\Oracle\AS11\MiddlewareStand\user_projects\domains\Test_Domain\servers\AdminServer\logs\AdminServer-stdout.txt]
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] Thread created successfully
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] Reporting SCM of SERVICE_START_PENDING with delay=0
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszHost = []
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] lpszPort = []
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] Reporting SCM of SERVICE_RUNNING
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] waiting for multiple events
[Fri Jul 23 11:12:01 2010] [E] [StartJVM] Unable to fine a JVM
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] done waiting for multiple events. Wait=1
[Fri Jul 23 11:12:01 2010] [E] [ServiceStart] Error in JVM. Cause=Unable to find a JVM!
[Fri Jul 23 11:12:01 2010] [I] [ServiceStart] Informing SCM about SERVICE_STOP

CAUSE :

The service is attempting to start Weblogic with the JAVA_OPTION "-client", for example from the log:

 lpszCmdLine = -client -Xms32m -Xmx200m -XX:MaxPermSize=128m -XX:+UseSpinning  -Xverify:none  -da -Dplatform.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\AS11\MIDDLE~1\WLSERV~1.3\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\AS11\MIDDLE~1\patch_wls1033\profiles\default\sysext_manifest_classpath -Xverify:none -classpath

On 64bit Windows for the Service to start the WLS Server, the "-server" option should be used


SOLUTION :

Either edit the existing Registry Entry:

1. Select the Windows "Start" -> "Run" -> "regedit"
2. In the Registry Editor, navigate to: HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/beasvc <Domain_ServerName>/Parameters
3. Double Click on the "CmdLine" variable and change the "value data" from "-client" to "-server". For example change:

-client -Xms32m -Xmx200m -XX:MaxPermSize=128m etc..


to:

-server -Xms32m -Xmx200m -XX:MaxPermSize=128m etc..
or if using JRockit JDK:

-jrockit -Xms32m -Xmx200m -XX:MaxPermSize=128m etc..

4. Attempt to start the service again and it should start successfully. Check the <ServerName>-stdout.txt to make sure the server is up and running.


OR delete the exisitng service and create it again:

1. Delete the existing service from the registry and reboot the server.
2. Edit the $MIDDLEWARE_HOME\wlserver_10.3\server\bin\installSvc.cmd
3. Add "set JAVA_VM=-server", or for JRockit only "set JAVA_VM=-jrockit" at the following section:

@echo off

set JAVA_VM=-server

if "%ADMIN_URL%" == "" goto runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME%

-Dweblogic.management.username=%WLS_USER% -Dweblogic.management.server=\"%ADMIN_URL%\

How to install the Admin Server of a SOA domain as a Windows Service?


To install the Admin Server as a Windows Service, the following steps need to be done.  However not all of these steps are required if a SOA domain is already running with a Database.

1) Install Oracle XE under C:\Oracle\oraclexe
2) Alter the processes amount using sql plus with the following SQL:


        sqlplus / as sysdba
        alter system set processes = 200 scope=spfile;
        commit;


NOTE: For Linux the environment variable RCU_JDBC_TRIM_BLOCKS needs to be set to true.

       RCU_JDBC_TRIM_BLOCKS=true
       Export RCU_JDBC_TRIM_BLOCKS
 


3) Run RCU and select SOA infrastructure under SOA & BPM infrastructure. (User Messaging System auto selected)
 
4) Install WLS 10.3.3 under C:\Oracle\Middleware


5) Install SOA 11.1.1.2 under C:\Oracle\Middleware\Oracle_SOA1


6) Install SOA 11.1.1.3 under C:\Oracle\Middleware\Oracle_SOA1 (To avoid potential issues with the patching utility)


7) Create a SOA Domain with successful testing of the Database schema


8) Modify the nodemanager.properties file, located under <Middleware_home>\<WL_Home>\common\nodemanager folder and set the following values to the properties:

CrashRecoveryEnabled=true
StartScriptEnabled=true

9) Install NodeManager as a Windows Service.


Optional: At this point, to check the the proper SOA deployments status we can start the admin server through the scripts, start node manager through the windows service, and start the soa_server1 through the administration console.
Which is actually a command to the node manager to start the server. After the soa_server1 is in running mode, go to deployments and you can note that the deployments are healthy.
You should stop the servers before continuing. 
 


10) Create the following script to install the Admin Server as a Windows Service (change the values, and set them as your's environment, I had to use Jrockit for SOA, thus JAVA_VM is -jrockit, 
Sun's JAVA_VM is -client, for Windows 64 bit and Sun JDK JAVA_VM is -server  


Note : If you are trying to Start a Weblogic Admin Server or Managed Server via a Service on 64bit Windows Fails with "Unable to Find a JVM".Please refer below link.

http://learn-weblogic.blogspot.in/2013/07/trying-to-start-weblogic-admin-server.html
@echo off
        SETLOCAL
        set DOMAIN_NAME=soa_domain
        set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\soa_domain
        set SERVER_NAME=AdminServer
        set PRODUCTION_MODE=false
        set WLS_USER=weblogic
        set WLS_PW=weblogic1
        set JAVA_OPTIONS=-Dweblogic.Stdout="C:\Oracle\Middleware\user_projects\domains\SOA\Admin_stdout.txt" -Dweblogic.Stderr="C:\Oracle\Middleware\user_projects\domains\SOA\Admin_stderr.txt"
        set JAVA_VM=-jrockit
        set MEM_ARGS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
        set MAX_CONNECT_RETRIES=3
        set HOST=localhost
        set PORT=7001
        call "C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"
        ENDLOCAL


11) Edit the installSvc.cmd script file located in <wl_home>\server\bin
The script will now use the right script to set the environment variables: setDomainEnv.cmd instead of the default commEnv.cmd.


        ...
        @echo off
        SETLOCAL
      
        set WL_HOME=D:\Oracle\Middleware11gR1PS3\wlserver_10.3
        rem call "%WL_HOME%\common\bin\commEnv.cmd"
        call "%USERDOMAIN_HOME%\bin\setDomainEnv.cmd"
      
        @rem Check that the WebLogic classes are where we expect them to be
        :checkWLS
        ...


12) At this point we need to run the script file we created to install the admin server as a windows service. This script will not run successfully but fail with "oracle.fabric.common.classloaderurl.handler" is not recognized as an internal or external command, operable program or batch file.

However it's important for the script to fail in order to obtain some key information, the CMDLINE variable value. The script needs to be invoked using a command prompt window and not by double clicking on the script file. 

Why is this?
 
In the new version of the setDomainEnv.cmd, the property PROTOCOL_HANDLERS is set to five protocol handlers concatenated together by a pipe ( | ): oracle.mds.net.protocol"|"oracle.fabric.common.classloaderurl.handler"|"oracle.fabric.common.uddiurl.handler"|"oracle.bpm.io.fs.protocol. This property is assigned to JAVA_OPTIONS 
which is used again in the installSvc.cmd script 
when setting the CMDLINE property. 



       set CMDLINE="-client -Xms512m -Xmx1024m -XX:PermSize=128m              
        -XX:MaxPermSize=512m -Dweblogic.Stdout="D:\Oracle ".....

       -Djava.protocol.handler.pkgs=oracle.mds.net.protocol" |            

       "oracle.fabric.common.classloaderurl.handler" |  
       "oracle.fabric.common.uddiurl.handler" | "oracle.bpm.io.fs.protocol

       .... weblogic.Server"


 As you can see there are additional spaces added between the protocol handler packages now. This causes the problem. As the previous version only assigned one protocol handler package this problem never occurred until now.

To work around this issue the value of CMDLINE needs to be changed from:

 

       set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath   
       \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME%                             
       -Dweblogic.management.username=%WLS_USER% 
       -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% 
       -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

 To the complete CMDLINE value from the previous run, which failed (remember to remove the spaces and note the strong> assignation).


       set CMDLINE="-jrockit -Xms512m -Xmx1024m -XX:PermSize=128m 
       -XX:MaxPermSize=512m -Dweblogic.Stdout="D:\Oracle ......    -Djava.protocol.handler.pkgs=strong>oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol
       .... weblogic.Server"


 At this point the service creation should work.

13) The Node Manager is now running as a windows service and the admin server can be started from the windows services as well. 
Once up and running the administration console can be used to start soa_server1 and the SOA applications can be accessed.




Note 1: As a good practice, always check the registry of the Windows Service installation.
Sometimes the workaround we did to install the service (strong>dms...)
Will break the soa-infra application to work (core of SOA)

So check the registry in:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\beasvc <DomainName>_AdminServer\Parameters]

Edit CmdLine. And change the following parameter from the line: 



-Djava.protocol.handler.pkgs=strong>oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol

To:

-Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol
 

Blogger news

Blogroll

Most Reading