2014-08-28 93 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