We are using WebSphere 7- Application server for deploying project and this application server is given simple JVM arguments like this,
–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,
<?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.
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.
or is there any other configuration in Websphere that might be causing this problem?
Note : files and path provided in the JVM arguments exists and has read and execute permissions
Thanks in advance.
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
And either put them in the:
Generic JVM arguments
using -Dparameter=value
Custom Properties
defining parameter as name and value as valueUPDATE
When I've pasted your variables, it contained following invisible chars instead of -D and got the same exception:
–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.
<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
.