Configuration file and log4j output when using tomcat

79 views
Skip to first unread message

Tralornik

unread,
Jan 23, 2008, 11:31:30 PM1/23/08
to Google Web Toolkit

I am trying to launch a GWT application and when I run the client-
server style, I get an exception that simply says to look in the
server log file for details..

yeah, I looked it up, and I think I understand that I need to install
log4j onto my eclipse, which I think means to simply add the log4j.jar
file(s) into my eclipse project...okay I did that...

However, while I understand how log4j works, I really just want to get
the embedded tomcat to somehow use the log4J.jar file and output the
hidden exception somewhere...but this I do not know how to do, nor is
it really described in any tutorial I have yet to find.

Simply put, I am looking to find out how to:

1) Install log4j into eclipse...is there more to it than simply adding
the jar to your project classpath?

The main point of item 1) is to be able to use log4j, but MORE
importantly to get GWT's embedded tomcat server to use log4j so as to
show me the details of any exception (rather than simply saying
InvocationException)

2) What configuration file do I use to get embedded tomcat to start
using log4j....

3) Most importantly I want the exceptions to appear in the console,
and in a log file (and of course, where is the log file going to get
created!).

Any help on the above would be much appreciated. I can see that many
people struggle with this, but ultimately never create a good
walkthrough or explanation of how to do this.

Thanks again.

walden

unread,
Jan 24, 2008, 8:12:00 AM1/24/08
to Google Web Toolkit


On Jan 23, 11:31 pm, Tralornik <Tralor...@charter.net> wrote:
> I am trying to launch a GWT application and when I run the client-
> server style, I get an exception that simply says to  look in the
> server log file for details..
>
> yeah, I looked it up, and I think I understand that I need to install
> log4j onto my eclipse....

What made you think that? Did you get a class loader problem?



Isaac Truett

unread,
Jan 24, 2008, 8:54:37 AM1/24/08
to Google-We...@googlegroups.com
When you get to the point where the hosted mode Tomcat isn't enough,
you're ready to start using the -noserver hosted mode option. That'll
give you complete control over the server environment. There's plenty
of information about -noserver in previous threads.

Tralornik

unread,
Jan 24, 2008, 12:30:00 PM1/24/08
to Google Web Toolkit
All I want is to do is install log4j so that tomcat will log the full
exception somewhere.

Right now, it simply says "Invocation exception, see server log for
details" but there is no active server log anywhere to be found.

Many people have posted the same issue and the response is generally
to install log4j so that tomcat will utilize the log4j functionality
that is already built into tomcat

I will take a closer look at noserver mode...since even if I get
tomcat to use log4j, I will soon run into issues since I will soon
need to access a server on a different machine.

I had read that by default GWT will only allow access to servers on
the same machine.

Anyone know of a particularly good tutorial on how to use GWT to
access a server on another machine (using the -noserver option I
suppose)?

walden

unread,
Jan 24, 2008, 3:31:45 PM1/24/08
to Google Web Toolkit
I think log4j is bundled with Tomcat. If tomcat is logging anything
at all, like its own startup, then the problem is not that you have
not installed log4j. More likely the problem is that your application
is throwing an unchecked exception which is percolating up into the
GWT RPC layer, where it cannot be serialized and so is not sent to the
client. Try surrounding your entire service call with a 'try..catch
Exception' block and use printStackTrace(), which will go to STDOUT,
which Tomcat logging will grab and throw into its log.

Walden
Reply all
Reply to author
Forward
0 new messages