This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Aldor Bregosson

Greenhorn
+ Follow
since Jan 04, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aldor Bregosson

Thanks Lasanka, that was a great little hint.

I had continued to use the Sysdeo plugin, but today I tried your solution, and it works fine.

Thanks again,
bye
Aldor.
Hi,

I don't know if I should post this in a Tomcat forum, or in an Eclipse forum, so I'll try it here:

I'm using Eclipse 3.4 and Tomcat 6.0.18 for web app development and local tests. In the olden days, I always used the Sysdeo Tomcat plugin to start, stop and restart Tomcat from inside Eclipse, that was very convenient and worked fine.

Now I've been told that I won't need the Sysdeo plugin any more, Tomcat can be added as a server in Eclipse and started from there - just as BEA WebLogic or Glassfish can be started by adding them as a "target server".

But, trying this, I failed: Eclipse's console says that everything has started all right and the server is started, but the server can't be reached over



nor any other port that may be mentioned.

So I reverted to using the Sysdeo Tomcat plugin and I could start Tomcat from there, and showed me the well known Tomcat entry page.

So what did I miss out on adding Tomcat as a "Target server" to Eclipse ? Comparing the console output of the two variants showed, that the "Eclipse only" variant failed to start the ContextListener as well as the SessionListener:

This was the version that worked (using the Sysdeo plugin):


And that's the version that did not work (starting the server instance from Eclipse itself):


The two bold lines are the ones where the two variants differ. So, what am I missing in the "Eclipse-only" solution ?

A helpful hint is highly appreciated
Cheers
Aldor
As far as I can see, the application you deployed tries to log something through Log4J. Tomcat tries to register a Logger and an "Appender" but can't find one. Hence the NullPointerException.

To have Tomcat use Log4J universally, place both libraries log4j.jar and the Jakarta commons-logging.jar into the $TOMCAT_HOME/common/lib directory. Create your log4j properties file as $TOMCAT_HOME/common/classes/log4j.properties and configure the root logger. Here is the basic log4j.properties I used for this myself:

log4j.rootLogger=info, R
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n

Instead of "info" you can rise the "granularity" of the output by mentioning "warn" or even "debug" in the first line. But be warned: the latter will often produce HUGE amounts of logging output. All "Console" output (also the System.out.println you may have in your application) goes to $TOMCAT_HOME/logs/catalina.out.

Don't forget to restart Tomcat after making these changes.

Let me know if that helps
cheers
Aldor
13 years ago