java 未正确读取 WebSphere Application Server JVM 参数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25544629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WebSphere Application Server JVM arguments not being read properly
提问by naamadheya
We are using WebSphere 7- Application server for deploying project and this application server is given simple JVM arguments like this,
我们正在使用 WebSphere 7-应用服务器来部署项目,并且这个应用服务器被赋予了简单的 JVM 参数,如下所示,
–Dsecurityresource=/web/sharedLibraries/security_config.xml -DConfig=/web/properties/Config.ini
But when tried to start the application server, a native error (native_stderr.log) is thrown as this,
但是当尝试启动应用服务器时,会抛出一个原生错误(native_stderr.log),如下所示,
<?xml version="1.0" ?>
<verbosegc version="GA24_Java6_SR15_20131016_1337_B170922_CMPRSS">
<initialized>
<attribute name="gcPolicy" value="-Xgcpolicy:optthruput" />
<attribute name="maxHeapSize" value="0x100000000" />
<attribute name="initialHeapSize" value="0xc0000000" />
<attribute name="compressedRefs" value="true" />
<attribute name="compressedRefsDisplacement" value="0x0" />
<attribute name="compressedRefsShift" value="0x3" />
<attribute name="pageSize" value="0x10000" />
<attribute name="requestedPageSize" value="0x10000" />
</initialized>
Exception in thread "main" java.lang.NoClassDefFoundError: Dsecurityresource=.web.sharedLibraries.security-config.xml
Caused by: java.lang.ClassNotFoundException: Dsecurityresource=.web.sharedLibraries.FalconCluster.security-config.xml
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:677)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
</verbosegc>
Could not find the main class: Dsecurityresource=/web/sharedLibraries/security-config.xml. Program will exit.
The JVM arguments are given at the following location in WebSphere.
JVM 参数在 WebSphere 中的以下位置给出。
Servers > Server Types > WebSphere application servers > server_name >Java and process management > Process definition > Java virtual machine and in Generic JVM arguments
its strange as it is throwing NoClassDefFoundError.
它很奇怪,因为它抛出 NoClassDefFoundError。
or is there any other configuration in Websphere that might be causing this problem?
或者 Websphere 中是否有任何其他配置可能导致此问题?
Note : files and path provided in the JVM arguments exists and has read and execute permissions
注意:JVM 参数中提供的文件和路径存在并且具有读取和执行权限
Thanks in advance.
提前致谢。
回答by Gas
Where are you setting these parameters?
You should set them via admin console:Servers > Server Types > WebSphere application servers > server_name
.
Then, click Java and process management > Process definition > Java virtual machine
你在哪里设置这些参数?
您应该通过管理控制台设置它们:Servers > Server Types > WebSphere application servers > server_name
. 然后,点击Java and process management > Process definition > Java virtual machine
And either put them in the:
或者把它们放在:
Generic JVM arguments
using-Dparameter=value
- or
Custom Properties
defining parameter as name and value as value
Generic JVM arguments
使用-Dparameter=value
- 或
Custom Properties
将参数定义为名称,将值定义为值
UPDATE
When I've pasted your variables, it contained following invisible chars instead of -D and got the same exception:
更新
当我粘贴您的变量时,它包含以下不可见字符而不是 -D 并得到相同的异常:
a“Dsecurityresource
However when I went to :
然而,当我去:
C:\IBM\WebSphere\AppServer85\profiles\AppSrv1\config\cells\cellName\nodes\nodeBame\servers\server1
and manually fixed entry in the server.xml
file, server started correctly.
并手动修复server.xml
文件中的条目,服务器正确启动。
<jvmEntries xmi:id="JavaVirtualMachine_1183121908656" .... genericJvmArguments="-Xquickstart -Dsecurityresource=/web/sharedLibraries/security_config.xml -DConfig=/web/properties/Config.ini" ...>
So please open that file with text editor and fix the -
char before first D
.
所以请先用文本编辑器打开该文件并修复-
字符D
。