top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Update the Tomcat JVM configuration

+2 votes
481 views

I am updating the Tomcat JVM configuration to enable java assertions as below:

a. Once tomcat server is configured in local eclipse,I pressed F3 on it.
b. Click on Open launch configuration link.
c. Go to Arguments tab.
d. Add -ea at the beginning of JVM arguments.

Then Finally I restarted my tomcat. Here is what I am getting....

 Server Tomcat v7.0 Server at localhost failed to start.
 Error: Could not find or load main class -ea

Any suggestions...

posted Dec 6, 2013 by Naveena Garg

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

Works for me:

OS: Windows 7 Home Premium 64 bit
IDE: Eclipse Kepler J2EE (with lots of plugins)
JDK: JDK 1.7.0_45
Tomcat: 7.0.42 (launched from within Eclipse)

VM arguments in the Arguments tab of the Edit launch configuration properties window:

-ea 
-Dcatalina.base="C:Usersmdeggersworkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0" 
-Dcatalina.home="C:UsersmdeggersApacheapache-tomcat-7.0.42" 
-Dwtp.deploy="C:Usersmdeggersworkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebapps" 
-Djava.endorsed.dirs="C:UsersmdeggersApacheapache-tomcat-7.0.42endorsed"

Verified by looking at the running Tomcat with VisualVM

answer Dec 7, 2013 by Sanketi Garg
Thank you, It works now..:)
I wasn't correctly updating the arguments instead of putting hyphen for every line....some of the lines were missing hyphens.
Similar Questions
+1 vote

For lack of funds initially and now for a stalemate in the project, we do not have a JVM monitoring tool yet. JavaMelody was recently discussed. I like the fact that there is a dashboard and history of metrics. In looking at it, I find JavaMelody lacking in in-depth diagnostics of the JVM. Top-N SQL statements, Transaction Tracing, metrics co-relation, call-back tree, thresholds and alerting are a few.

Are there are any OpenSource projects that instrument the JVM at byte-code and provide detailed metrics more than what JMX offers? Or am I missing something with JavaMelody?

0 votes

There is a Java Virtual Machine completely implemented in Java called JPF. In other words, when you run a Java program within this machine, it's a JVM-within-a-JVM execution. Obviously, this uses a lot of resources and I was thinking of ways how that could be reduced.

An idea I have is to compile JPF with GCJ to native code, thereby resulting in only one JVM that is used when running a Java program within JPF.

Do you see any inherent limitations to this idea, i.e. reasons why it wouldn't work? I'm not a JVM expert so it's hard for me to see any obvious obstacles.

+2 votes

Is the intermediate code prepared by one used by another?

0 votes

It's a little bit frustrating to configure Tomcat 8.5.8 with log4j2.

I put the following jars in $CATALINA_HOME/lib
log4j 2 core (log4j-core-2.6.2.jar)
log4j 2 api (log4j-api-2.6.2.jar)

Delete the file $CATALINA_HOME/conf/logging.properties
Put the new log4j 2 config file (log4j2.xml) in $CATALINA_HOME/lib

No errors but the created catalina.out file is empty and the console layout doesn't change, What else to check or change?

+1 vote

Is the PEM-based certificate configuration available for both JSSE-based and APR-based connectors in Tomcat 9 at this point? The documentation says e.g. the "certificateFile" attribute is for "OpenSSL Only", and when I try to launch Tomcat using the NIO connector and a PEM-based certificate file, Tomcat says that the keystore is corrupted (even though no keystore was actually specified).

...