Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Why I like Tomcat 5.5.12 better than Tomcat 5.5.15

Here's what happens with Tomcat 5.5.15:

alotta:~/dev/appfuse mraible$ export CATALINA_HOME=$TOOLS_HOME/apache-tomcat-5.5.15
alotta:~/dev/appfuse mraible$ ant deploy;tstart
Buildfile: build.xml

...

deploy:
    [unwar] Expanding: /Users/mraible/Work/appfuse/dist/webapps/appfuse.war into
 /opt/dev/tools/apache-tomcat-5.5.15/webapps/appfuse

BUILD SUCCESSFUL
Total time: 3 seconds
Using CATALINA_BASE:   /opt/dev/tools/apache-tomcat-5.5.15
Using CATALINA_HOME:   /opt/dev/tools/apache-tomcat-5.5.15
Using CATALINA_TMPDIR: /opt/dev/tools/apache-tomcat-5.5.15/temp
Using JRE_HOME:       /Library/Java/Home
alotta:~/dev/appfuse mraible$ ant reload
Buildfile: build.xml

reload:
   [reload] FAIL - Encountered exception java.lang.NoClassDefFoundError: 
org/apache/log4j/spi/VectorWriter

BUILD FAILED
/Users/mraible/Work/appfuse/build.xml:1063: FAIL - Encountered exception 
java.lang.NoClassDefFoundError: org/apache/log4j/spi/VectorWriter

Total time: 1 second
alotta:~/dev/appfuse mraible$ 

Here's what happens with Tomcat 5.5.12:

alotta:~/dev/appfuse mraible$ export CATALINA_HOME=$TOOLS_HOME/apache-tomcat-5.5.12
alotta:~/dev/appfuse mraible$ ant deploy;tstart

...

BUILD SUCCESSFUL
Total time: 4 seconds
Using CATALINA_BASE:   /opt/dev/tools/apache-tomcat-5.5.12
Using CATALINA_HOME:   /opt/dev/tools/apache-tomcat-5.5.12
Using CATALINA_TMPDIR: /opt/dev/tools/apache-tomcat-5.5.12/temp
Using JRE_HOME:       /Library/Java/Home
alotta:~/dev/appfuse mraible$ ant reload
Buildfile: build.xml

reload:
   [reload] OK - Reloaded application at context path /appfuse

BUILD SUCCESSFUL
Total time: 3 seconds
alotta:~/dev/appfuse mraible$ 

Looks like I'll be sticking with 5.5.12 for the foreseeable future.

Posted in Java at Mar 01 2006, 12:17:13 PM MST 10 Comments
Comments:

looks like you found a bug. you could open a bug report to get it fixed and then move to .15. there appears to be a lot of changes between .12 and .15 (http://tomcat.apache.org/tomcat-5.5-doc/changelog.html).

did you name your macbook pro alotta, and why?

Posted by Erik Weibust on March 01, 2006 at 05:08 PM MST #

Good suggestion Erik. As far as "alotta" - yep, that's her name. My computer-naming scheme has been Austin Powers ever since Julie wanted to name her's "fembot". Alotta, for Alotta Fagina - which seems to be quite fitting. ;-)

Posted by Matt Raible on March 01, 2006 at 05:21 PM MST #

Thats the price you pay for bleeding edge ;) Seriously, what happened to people actually smoke testing containers? I usually smoke test them for at least 2 months before deployment of a live system - by then you should have noticed any significant or show stopper bugs, and hopefully the good citizens will have filed bug reports for any that you have not. Using bleeding edge stuff doesn't seem to be terribly pragmatic to me. Just my $0.02

Posted by Lee on March 02, 2006 at 03:46 AM MST #

??: Illegal access: this web application instance has been stopped already. Could not load org.apache.jasper.runtime.ServletResponseWrapperInclude. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. kpwang

Posted by kp on April 10, 2006 at 05:40 AM MDT #

I had the same problem with Tomcat 5.5.15... the upgrade to recently released 5.5.17 fixed the issue. It looked like something to do with the logging infrastructure, but there as no need to look into it. With the new tomcat version the catalina-ant's deploy/undeploy tasks work without cycling the JVM... which allows for much faster development iterations and continuous integration.

Posted by Jason Thrasher on June 13, 2006 at 09:15 PM MDT #

Still having this problem with tomcat 5.5.17

start-LOCAL:
    [start] FAIL - Application at context path /dosimetry could not be started
    [start] FAIL - Encountered exception java.lang.NoClassDefFoundError: org/apache/log4j/spi/VectorWriter

ok ... try again,

start-LOCAL:
    [start] OK - Started application at context path /dosimetry

Any ideas? It's not a big deal but it is a bug, but not nearly as bad as the

OutOfMemoryError : Perm gen space that pops up all the time.

Should I upgrade to 5.5.20 or better yet downgrade to 5.5.12 or 3.0?

Posted by John Newman on October 20, 2006 at 09:38 AM MDT #

I had the same problem, it turned out that there was a log4j.jar in the commons/liib directory and one in my webapplications /WEB-INF/lib dir. After I removed the log4j.jar from the /WEB-INF/lib dir everything worked fine again.

Posted by Tonny Brucker on April 04, 2007 at 01:45 AM MDT #

I struggled with this problem for a *long* time, but thanks to this post, I installed 5.5.23 (latest stable) and the problem went away! Hooray!

Posted by Daniel Serodio on August 02, 2007 at 08:34 AM MDT #

Also I just found out the other day, this perm gen error is mainly caused by three things

  1. loading too many classes (best situation, sort of normal, just up the perm size)
  2. use of singletons which reference themselves and can't be destroyed. Look at commons discovery
  3. use of commons logging and not calling LogFactory.release(Thread.currentThread().getContextClassLoader()) in your ServletContextListener's contextDestroyed() method to release the resources it takes

doing that fixed it for me.

Posted by John Newman on August 03, 2007 at 07:27 AM MDT #

John - thanks for the tip about LogFactory.release() - I'll have to try adding that in my app. In the meantime, I've noticed the following JAVA_OPTS allow me to develop a Struts 2 + Spring + Hibernate w/o a PermGen error using "mvn jetty:run".

-XX:PermSize=256m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC

Posted by Matt Raible on August 03, 2007 at 01:25 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed