mercredi 5 décembre 2012

J2EE Solution Logs

Changing the context root of a dynamic web app URL (StackOverflow)
  1. Right click on the project in the project explorer tab, the choose properties.
  2. Set the new context root in the Web Project Settings.
Exception when launching jetty (StackOverflow)
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
It seems that jetty cannot find the asm.jar file in its classpath, check this as follow:
  1. On eclipse, go to the Servers view (or open it via window -> view -> Servers)
  2. Right click on jetty, then choose Open or just type F3
  3. On the Overview tab, click on Open Lauchn Configuration
  4. Go to Classpath tab and check for asm.jar
If you cannot find it, then you should manually download it from the project website.

Register a listener to do things before the VM exits (even if you "Ctrl-C" the running example before it's completed)
private void registerShutdownHook() {
   Runtime.getRuntime().addShutdownHook( new Thread() {
      @Override
      public void run() {
         // do some thing
      }
   });
}

Increase Maven memory, in mvn.bat add:
set MAVEN_OPTS=-Xmx2048m -XX:MaxPermSize=512m

To be continued

Aucun commentaire:

Enregistrer un commentaire