2014-08-28 90 views
2

我们使用的是WebSphere 7应用程序服务器部署项目,该应用程序服务器提供简单的JVM参数就是这样,WebSphere Application Server的JVM参数没有被正确读取

–Dsecurityresource=/web/sharedLibraries/security_config.xml -DConfig=/web/properties/Config.ini 

但是当试图启动应用程序服务器,天然误差(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. 

的JVM参数在WebSphere中的以下位置中给出。

Servers > Server Types > WebSphere application servers > server_name >Java and process management > Process definition > Java virtual machine and in Generic JVM arguments 

它很奇怪,因为它抛出了NoClassDefFoundError。

或者Websphere中是否有任何其他配置可能导致此问题?

注:在JVM参数提供的文件和路径存在,并读取和执行权限

在此先感谢。

+0

看看NoClassDefFoundError我认为你没有提到作为JVM参数的参数。它被解析为类名 – 2014-08-28 09:11:17

+0

@Neeraj:它作为JVM参数传递(编辑后)。但有些如何将它作为类名称进行解析。这一直是个谜。 – naamadheya 2014-08-29 17:11:53

回答

7

你在哪里设置这些参数?
您应该通过管理控制台设置它们:
Servers > Server Types > WebSphere application servers > server_name。 然后,单击Java and process management > Process definition > Java virtual machine

,要么把它们放到:使用-Dparameter=value

  • Custom Properties定义参数名称和值值
  • UPDATE

    • Generic JVM arguments
      当我已经粘贴了你的变量,它包含下面的不可见字符而不是-D,并且得到了相同的异常:

      –Dsecurityresource 
      

      然而,当我去:

      C:\IBM\WebSphere\AppServer85\profiles\AppSrv1\config\cells\cellName\nodes\nodeBame\servers\server1 
      

      和手动固定在server.xml文件条目,服务器正常启动。

      <jvmEntries xmi:id="JavaVirtualMachine_1183121908656" .... genericJvmArguments="-Xquickstart -Dsecurityresource=/web/sharedLibraries/security_config.xml -DConfig=/web/properties/Config.ini" ...> 
      

      所以,请打开与文本编辑器,文件和前第一D修复-字符。

    +0

    是的,正如您所说的 服务器>服务器类型> WebSphere应用程序服务器> server_name> Java和进程管理>进程定义> Java虚拟机以及Generic JVM参数中的参数设置在正确的位置。 对不起,我忘了提前说。 – naamadheya 2014-08-29 17:06:36

    +0

    因为它讲述了java.lang.NoClassDefFoundError:Dsecurityresource = .web.sharedLibraries.security-config.xml我猜测在这个参数后面隐藏了\ n。尝试将这些参数复制到纯文本编辑器并返回,或者手动清理并键入它们。 – Gas 2014-08-29 17:56:43

    +0

    no \ n个字符。所有参数都很好。但仍然是同样的问题。 – naamadheya 2014-09-01 06:17:08