Open GoogleCodeExporter opened 9 years ago
These warning messages are actually unrelated to whether the constructor had
@Inject or not - the early exit of the context just meant they were more likely
to appear. See issue 288 and issue 707 for more details about these warnings
and their current status.
Original comment by mccu...@gmail.com
on 7 Aug 2012 at 7:00
I always get the message and can't not start my webapps. So i think it's not
just a warning message but a fatal error. Please advise. Thanks.
Original comment by 234aini
on 2 Sep 2012 at 10:26
None of the messages above relate to startup, only to shutdown. This is
indicated by the line "Context [/api] startup failed due to previous errors",
meaning that an error before that line caused the webapp to not start.
If you search your log files above the line "Context [/api] startup failed due
to previous errors" (or alternatively search down from the first line where the
web container says it is deploying the webapp) then you should find the cause
of the startup failure.
Original comment by mccu...@gmail.com
on 2 Sep 2012 at 10:32
I got this warning message in Fatal level when deploy my webapp to tomcat.
I have tried to kill the tomcat process and then start tomcat again.
In my scenario, it only appear at context listener is loaded.
Actually, I have resolved this problem in my local and I found that it's
caused by that there are some dependence errors. I mean some bindings are
wrong. But what confused me is that why i got this as the error message but
I can not get the 'REAL' exception stack trace.
Any advise?
Original comment by 234aini
on 2 Sep 2012 at 12:00
Regarding binding errors: depending on the actual binding problem you should
either get an exception when you first create the injector or when you try to
get an instance from the injector. Either way an exception will be thrown
describing the problem. Now depending on your application code this exception
may be caught and logged, caught and ignored, or not caught (in which case it
will bubble up to the web container, which may itself log or swallow the
exception). Either way there's not much that Guice can do - it correctly threw
the exception back to the application for it to handle. It doesn't
automatically log these exceptions itself, but leaves it to the application
since the problem might be expected/recoverable. You might want to protect
calls to construct the injector / get instances with try-catch blocks and your
own logging rather than leave it up to the container's uncaught-exception
handler. (Guava's Throwables utility class can be helpful here.)
BTW, for tomcat uncaught exceptions may appear in the localhost log instead of
the usual catalina log where most console messages go:
http://stackoverflow.com/questions/4029864/uncaught-exceptions-in-tomcat-print-t
o-localhost-date-log-instead-of-catalina
Regarding the tomcat messages: see
http://wiki.apache.org/tomcat/MemoryLeakProtection - Tomcat logs these as
'severe' (presumably to attract attention, which seems to work) but they are
not actually fatal and the detection is only run at shutdown of a webapp and
not during startup. In fact for the threadlocals case they often would get
cleaned up (see discussion about the JDK's threadlocal implementation /
expungeStaleEntries in the above link) but tomcat logs them as something to be
investigated (see also the ongoing discussion in issue 288).
Original comment by mccu...@gmail.com
on 2 Sep 2012 at 12:46
Original comment by mccu...@gmail.com
on 2 Sep 2012 at 12:48
Thanks a bunch.
You are exactly right. I found the error message
in localhost.2012-09-02.log.
And also, as you suggestion. I try/catch the exception by my self when
create Guice injector and I finally got the real exception stack trace.
Lots of help. Thanks.
Have to say that it's not caused by Guice and maybe caused by Tomcat or
Struts2 Gucie plugin I am used.
Original comment by 234aini
on 2 Sep 2012 at 1:11
Original issue reported on code.google.com by
herring...@gmail.com
on 6 Apr 2012 at 4:46