xiaodududu / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Guice creation error : Error in custom provider : hides underlying exception #606

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I saw something like the following when a RuntimeException was thrown inside a 
method annotated with @Provides

12:08:39.503 [main] INFO  c.p.s.d.m.DiscoveryServiceMonitoring - Successfully 
registered c.p.s.d.m.DiscoveryServiceMonitoring
2011-02-18 12:08:39.513:WARN::Failed startup of context 
org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@181f327e{/service-discovery-s
ervice,/home/caoilte/projects/discovery-service/src/main/webapp}
com.google.inject.CreationException: Guice creation errors:||1) Error in custom 
provider, java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException|  at 
[...]
[Stack showing location of code annotated with @Provides]

It would be more helpful if Guice logged the exception that was thrown.

Original issue reported on code.google.com by caoi...@gmail.com on 18 Feb 2011 at 12:25

GoogleCodeExporter commented 9 years ago
What version of Guice is this with?  If it wasn't 3.0rc2, can you test it with 
that?  A lot of changes have been made to make exceptions, specifically 
exceptions from @Provides methods, prettier.

Original comment by sberlin on 18 Feb 2011 at 2:49

GoogleCodeExporter commented 9 years ago
2.0
Will try and test. Is the upgrade process difficult?

Original comment by caoi...@gmail.com on 18 Feb 2011 at 3:14

GoogleCodeExporter commented 9 years ago
It should just be a drop in replacement, but may have some quirks depending on 
if you used any of the internal classes (many of which are now hidden) .

Original comment by sa...@google.com on 18 Feb 2011 at 3:26

GoogleCodeExporter commented 9 years ago
Fixed in 3.0rc2. Nice one. You can close. Sorry for not checking against latest 
before raising.

Original comment by caoi...@gmail.com on 18 Feb 2011 at 4:40

GoogleCodeExporter commented 9 years ago
Thanks for confirming!

Original comment by sberlin on 19 Feb 2011 at 8:06