Updates:
        Status:
        Mergedinto:

Comment #5 on issue 698 by [email protected]: Incorrect error report when using Jersey and Guice and forget to annotate a resource constructor with @Inject
http://code.google.com/p/google-guice/issues/detail?id=698

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-to-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).

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to