weblogic异常之启动受管服务器 报Error: Could not create the Java Virtual Machine.

时间:2024-03-20 16:09:15

1.问题描述

[weblogic@10_32_68_96 server_68_96]$ ll
total 12
-rw-rw-r-- 1 weblogic weblogic 649 Oct 25 10:10 start.sh
-rw-rw-r-- 1 weblogic weblogic 516 Oct 25 10:33 stop.sh
-rw-rw-r-- 1 weblogic weblogic  68 Oct 25 10:12 view.sh
[weblogic@10_32_68_96 server_68_96]$ sh start.sh 
start.sh: line 2: cd: /weblogic/bea/user_projects/domains/trans/servers/server_68_96/tmp/_WL_user: No such file or directory
start.sh: line 7: cd: /weblogic/bea/user_projects/domains/trans/servers/server_68_96/stage: No such file or directory
clear cache server_68_96, sucessfull
[weblogic@10_32_68_96 server_68_96]$ sh view.sh 
***************************************************
starting weblogic with Java version:
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Starting WLS with line:
/weblogic/jdk1.7.0_67/bin/java -jrockit   -Xms512m -Xmx512m -Dweblogic.Name=server_68_96 -Djava.security.policy=/weblogic/bea/wlserver_10.3/server/lib/weblogic.policy   -da -Dplatform.home=/weblogic/bea/wlserver_10.3 -Dwls.home=/weblogic/bea/wlserver_10.3/server -Dweblogic.home=/weblogic/bea/wlserver_10.3/server   -Dweblogic.management.discover=false -Dweblogic.management.server=10.32.66.193:9001  -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=/weblogic/bea/patch_wls1032/profiles/default/sysext_manifest_classpath  weblogic.Server
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

2.解决方案

在当前应用所属的受管服务器的doman里面
修改文件
/weblogic/bea/user_projects/domains/trans/bin
下面的文件
startWebLogic.sh

%JAVA_VM%为引入的-jrockit参数 ,jrockit我们安装weblogic的时候安装的;
所以需要去掉

2.1.修改前内容startWebLogic.sh

167 # START WEBLOGIC
168 
169 echo "starting weblogic with Java version:"
170 
171 ${JAVA_HOME}/bin/java ${JAVA_VM} -version
172 
173 if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
174         echo "Starting WLS with line:"
175         echo "${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${    SERVER_CLASS}"
176         ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER    _CLASS}
177 else
178         echo "Redirecting output from WLS window to ${WLS_REDIRECT_LOG}"
179         ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER    _CLASS}  >"${WLS_REDIRECT_LOG}" 2>&1
180 fi
181 
182 stopAll
183 
184 popd
185 
186 # Exit this script only if we have been told to exit.
187 
188 if [ "${doExitFlag}" = "true" ] ; then
189         exit
190 fi
191 

2.2.需要删除的内容截图startWebLogic.sh

weblogic异常之启动受管服务器 报Error: Could not create the Java Virtual Machine.

2.3. 修改后内容startWebLogic.sh

startWebLogic.sh

175 
176 if [ "${SERVER_IP}" != "" ] ; then
177         ${WL_HOME}/common/bin/wlsifconfig.sh -addif "${IFNAME}" "${SERVER_IP}" "${IPMASK}"
178 fi
179 
180 # START WEBLOGIC
181 
182 echo "starting weblogic with Java version:"
183 
184 ${JAVA_HOME}/bin/java -version
185 
186 if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
187         echo "Starting WLS with line:"
188         echo "${JAVA_HOME}/bin/java ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY    _SETTINGS} ${SERVER_CLASS}"
189         ${JAVA_HOME}/bin/java ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTI    NGS} ${SERVER_CLASS}
190 else
191         echo "Redirecting output from WLS window to ${WLS_REDIRECT_LOG}"
192         ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${    PROXY_SETTINGS} ${SERVER_CLASS}  >"${WLS_REDIRECT_LOG}" 2>&1
193 fi
194 
195 stopAll
196 
197 popd
198 
199 # Exit this script only if we have been told to exit.
200 
201 if [ "${doExitFlag}" = "true" ] ; then
202         exit
203 fi
204