7 Replies Latest reply: Jul 25, 2013 2:11 AM by kmcwilliams69 RSS

    WebLogic as a windows service in OBIEE11g

      I have a script I am using to create WebLogic as a windows service. When I run this on a 32-bit 2008-R2 I have no issues. Am able to get weblogic running and login. When I run it on 64-bit it fails to ever start and get perm gen out of memory errors. Below is my script. I took the call to the installsvc.cmd out and pasted it within the script so I have 1 file. Is there something I am missing or doing wrong here. I keep thinking it is something with java but have yet to find out what. My username and password are set correct but have been x'd out for this post. Has anyone successfully set WebLogic as a windows service in OBIEE11g on a 64-bit platform?

      I also installed a separate 64-bit JDK on the E: drive which I am pointing to for this.

      echo off

      set MW_HOME=E:\Oracle\Middleware
      set OPMN_PORT=9500
      set wls.host=localhost
      set wls.admin.port=7001
      set wls.mgd.port=9704
      set wls.mgd.name=bi_server1
      set BI_URL=http://%wls.host%:%wls.mgd.port%/analytics
      set JAVA_HOME=E:\Java\JDK
      set PRODUCTION_MODE=true
      set DOMAIN_HOME=%MW_HOME%\user_projects\domains\bifoundation_domain
      set WLS_HOME=%MW_HOME%\wlserver_10.3
      set INSTANCE_HOME=%MW_HOME%\instances\instance1
      set ORACLE_BI_HOME=%MW_HOME%\Oracle_BI1
      set ANT_HOME=%MW_HOME%\modules\org.apache.ant_1.7.1
      set DOMAIN_NAME=bifoundation_domain
      set USERDOMAIN_HOME=%MW_HOME%\user_projects\domains\bifoundation_domain
      set SERVER_NAME=AdminServer
      call "E:\Oracle\Middleware\user_projects\domains\bifoundation_domain\bin\setDomainEnv.cmd"

      set WL_HOME=E:\Oracle\Middleware\wlserver_10.3
      call "%WL_HOME%\common\bin\commEnv.cmd"

      set WLS_USER="xxxxxxxxx"
      set WLS_PW="xxxxxxxxxxx"

      @rem Check that the WebLogic classes are where we expect them to be
      if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
      echo The WebLogic Server wasn't found in directory %WL_HOME%\server.
      echo Please edit your script so that the WL_HOME variable points
      echo to the WebLogic installation directory.
      goto finish

      @rem Check that java is where we expect it to be
      if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic
      echo The JDK wasn't found in directory %JAVA_HOME%.
      echo Please edit your script so that the JAVA_HOME variable
      echo points to the location of your JDK.
      goto finish


      if not "%JAVA_VM%" == "" goto noResetJavaVM
      if "%JAVA_VENDOR%" == "BEA" set JAVA_VM=-jrocket
      if "%JAVA_VENDOR%" == "HP" set JAVA_VM=-server
      if "%JAVA_VENDOR%" == "Sun" set JAVA_VM=-server

      if not "%MEM_ARGS%" == "" goto noResetMemArgs
      set MEM_ARGS=-Xms512m -Xmx512m


      @echo on


      rem *** Set Command Line for service to execute within created JVM

      @echo off

      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%\" -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
      goto finish

      @echo on
      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"

      rem *** Set up extrapath for win32 and win64 platform separately
      if "%WL_USE_X86DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\32;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\32\oci920_8

      if "%WL_USE_IA64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\64\oci920_8

      if "%WL_USE_AMD64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\x64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\x64\oci920_8

      rem *** Install the service
      "%WL_HOME%\server\bin\beasvc" -install -svcname:"2.Oracle BI 11g WebLogic" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE% -log:"E:\Oracle\WebLogic-stdout.txt"


      Edited by: J.A.M on Sep 10, 2011 12:26 PM
        • 1. Re: WebLogic as a windows service in OBIEE11g

          If you are using MS Windows 64bit, edit the MIDDLEWARE_HOME\wlserver_10.3\server\bin\installSvc.cmd

          If the WebLogic Domain is using Sun JDK, add "set JAVA_VM=-server",
          if the WebLogic Domain is using JRockit, add "set JAVA_VM="-jrockit"

          If the JAVA_VM mode is not changed from the default '-client' to '-server' the WebLogic Managed Server will fail to start as a MS Windows Service

          • 2. Re: WebLogic as a windows service in OBIEE11g
            This is a section out of the script I posted. Isn't this what you referenced being set and isn't the script not doing that?


            if not "%JAVA_VM%" == "" goto noResetJavaVM
            if "%JAVA_VENDOR%" == "BEA" set JAVA_VM=-jrocket
            if "%JAVA_VENDOR%" == "HP" set JAVA_VM=-server
            if "%JAVA_VENDOR%" == "Sun" set JAVA_VM=-server
            • 3. Re: WebLogic as a windows service in OBIEE11g
              Looks like the script is fine, can you get the error log to narrow down the issue?

              • 4. Re: WebLogic as a windows service in OBIEE11g
                I am getting errors such as the following. What is sad is I can run the startweblogic.cmd from the directory with no issue. There is a start script for all BI services in the start menu. Is there a way to make that a windows service?

                java.lang.OutOfMemoryError: PermGen space


                     at weblogic.application.internal.flow.ApplicationRuntimeMBeanFlow.unprepare(ApplicationRuntimeMBeanFlow.java:64)
                     at weblogic.application.internal.BaseDeployment$1.previous(BaseDeployment.java:619)
                     at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
                     at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
                     at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
                     at weblogic.application.internal.EarDeployment.unprepare(EarDeployment.java:58)
                     at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
                     at weblogic.deploy.internal.targetserver.AppContainerInvoker.unprepare(AppContainerInvoker.java:117)
                     at weblogic.deploy.internal.targetserver.BasicDeployment.unprepare(BasicDeployment.java:287)
                     at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:363)
                     at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
                     at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
                     at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
                     at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
                     at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
                     at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
                     at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
                     at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
                     at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
                     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
                     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
                Caused by: java.lang.OutOfMemoryError: PermGen space

                     at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:227)
                     at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
                     at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
                     at weblogic.application.internal.EarDeployment.unprepare(EarDeployment.java:58)
                     at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
                     Truncated. see log file for complete stacktrace
                <Sep 12, 2011 12:22:41 AM CDT> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: oracle.dms.wls.DMSServletFilter.
                java.lang.OutOfMemoryError: PermGen space
                • 5. Re: WebLogic as a windows service in OBIEE11g

                  Just browsed through support web and found the solution.The default maximum heap space size of 128 Mb was exceeded, causing the exception: java.lang.OutOfMemoryError.


                  Remove the current Windows service for starting the WebLogic Server Admin Server, and reinstall the service with the correct values for memory allocation.

                  1.Uninstall the Windows service.

                  a)Create a batch file (.bat format) with the following script in the domain directory to stop WLS as a Windows service and run this batch file through the command prompt.

                  set DOMAIN_NAME= <Name of your Domain>
                  set SERVER_NAME= <Name of your AdminServer>
                  call "<WL_HOME>\server\bin\uninstallSvc.cmd"

                  For Example:
                  set DOMAIN_NAME=myDomain
                  set SERVER_NAME=AdminServer
                  call "C:\Oracle\Middleware\wlserver_10.3\server\bin\uninstallSvc.cmd"

                  b)After running that script in the command prompt, you will see a statement such as "beasvc _ removed". Look at the Windows services to verify that the service for the Admin Server has been uninstalled.

                  2.Backup and edit the <MW_HOME>/wlserver_10.3/server/bin/installSvc.cmd file, which will be called to create the service by the .cmd file you created in Step 1.

                  3.Just before the line which says if "%ADMIN_URL%" == "" goto runAdmin, add the required value for MEM_ARGS, for instance:

                  set MEM_ARGS=-Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:-UseSSE42Intrinsics
                  if "%ADMIN_URL%" == "" goto runAdmin

                  4.Install the Windows service again

                  • 6. Re: WebLogic as a windows service in OBIEE11g

                    I am able to start weblogic server using the command startWeblogic.cmd from command line and after which i am able to open below links.






                    However, since i dont want to keep the command window open all the time so i wanted to install the service as a windows service so that it can run in the background. I was able to install theservice in windows services using installSvc.cmd but when i start the server using this service it initially gave OutOfMemory Error and permGen space errors.


                    Thanks for this tip...Dpka ...

                    I was able to overcome OutOfMemory Error. However, now i am getting couple of other errors...

                    one of then is  java.lang.ClassNotFoundException: com.bea.wli.sb.transports.JCATransportPostActivationStartup

                    It seems these are some how associated with OSB.

                    Even after these errors it shows "server started in Running Mode" also i am able to open localhost:7001/console. But strange thing is that i am not able to open other 3 links mentioned above. I am not getting any logs n base_domain.log  file and I am also not able to stop the server properly using the windows service.


                    Please help...

                    • 7. Re: WebLogic as a windows service in OBIEE11g

                      hey AshishJain,

                      I had issues with loading OBIEE as Windows services, however I found this helpful article - followed it (changed directories etc for my install) and it worked really well;

                      Paul Cannon's BI Blog: Deploy OBIEE 11g as Services under Windows