Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in Finalizer in AppEngine #488

Closed
gissuebot opened this issue Jul 7, 2014 · 21 comments
Closed

Exception in Finalizer in AppEngine #488

gissuebot opened this issue Jul 7, 2014 · 21 comments

Comments

@gissuebot
Copy link

From vega113 on June 06, 2010 15:03:44

I have an application deployed to Appengine.
When creating injector I get the following exception :
com.google.inject.internal.FinalizableReferenceQueue$SystemLoader
loadFinalizer: Not allowed to access system class loader.
I 06-06 11:15AM 22.876
com.google.inject.internal.FinalizableReferenceQueue <init>: Failed to
start reference finalizer thread. Reference cleanup will only occur when
new references are created.
java.lang.reflect.InvocationTargetException
        at com.google.appengine.runtime.Request.process-0e64cc98a6c1b70c(Request.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
more ................
at com.google.inject.Guice.createInjector(Guice.java:59)
        at
com.google.forumbotty.guice.GuiceServletConfig.getInjector(GuiceServletConfig.java:87)
        at
com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:43)
        at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
more.................
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:355)
        at java.security.AccessController.checkPermission(AccessController.java:567)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.ThreadGroup.checkAccess(Unknown Source)
        at java.lang.Thread.init(Unknown Source)
        at java.lang.Thread.<init>(Unknown Source)
        at com.google.inject.internal.Finalizer.<init>(Finalizer.java:92)
        at com.google.inject.internal.Finalizer.startFinalizer(Finalizer.java:81)
        ... 76 more

Attachment: gist
   GuiceServletConfig.java

Original issue: http://code.google.com/p/google-guice/issues/detail?id=488

@gissuebot
Copy link
Author

From mcculls on June 17, 2010 09:11:10

IIRC this is just an info log message letting you know that Guice couldn't start the finalizer thread in the more restrictive GAE environment - your servlet should still work (if it doesn't then that's a different issue).

@gissuebot
Copy link
Author

From sberlin on June 18, 2010 06:09:06

Not a bug, it's just an info message.

Status: Invalid

@gissuebot
Copy link
Author

From vega113 on July 27, 2010 20:23:09

Thanks for the answers above. You are right, sberlin, The servlet still works, however as I mentione before, the servlet runs on GAE and when the exception happens it eats a lot of CPU - for example:
/installNew?id=*** 200 8303ms 13282cpu_ms 21api_cpu_ms 0kb gzip(gfe)
request to the same servlet that doesn't cause exception
/installNew?id=*** 200 1198ms 468cpu_ms 21api_cpu_ms 0kb gzip(gfe)

The exception happens all the time and its handling eats CPU=money.
So it's not "just an info message".
I really need advice on what can be done to reduce the CPU consumption at least by this exception handling, or event better to prevent the exception to happen.
Thanks

@gissuebot
Copy link
Author

From vega113 on July 27, 2010 20:26:14

I just want to add that its really strange that Guice as a Google supported development doesn't integrate nicely with GAE.

@gissuebot
Copy link
Author

From marius.andreiana on October 13, 2010 11:31:11

Please re-open this.
Info messages should be generated with proper logging, not exceptions.

@gissuebot
Copy link
Author

From richpaul1 on January 05, 2011 14:02:37

My app is also experiencing this issue.

I agree with Marius.

This should be re-opened and fixed so that an exception is not thrown.

@gissuebot
Copy link
Author

From mcculls on January 11, 2011 16:05:16

Note: the potential solution I recently attached for Issue 288 would also help this issue.

@gissuebot
Copy link
Author

From nimbus4321 on February 08, 2011 10:33:01

This issue also occurs on WebSphere 7.x when the default JavaSE security policy is enabled. This is because the default policy prevents application code from creating threads (as per the EJB programming restrictions).

Note that I've also posted on issue 288 asking if the new fix to hat issue (from fry) addresses this issue too.

@gissuebot
Copy link
Author

From icoloma on March 08, 2012 02:34:13

For the record, this is a workaround to put in your startup listener:

Logger.getLogger("com.google.inject.internal.util").setLevel(Level.WARNING);

@gissuebot
Copy link
Author

From huseyn@guliyev.com on April 24, 2012 06:23:20

I agree that this issue should be dealt with. The resolution suggested in comment 9 is not a workaround, but rather a hideout.

@gissuebot
Copy link
Author

From dward@versature.com on January 15, 2013 08:09:38

I also think this issue should be dealt with. Also comment 9 is not a workaround.

@gissuebot
Copy link
Author

From Juan.Gentile@pnvillarreal.me on May 15, 2013 05:33:45

Please reopen this and treat it accordingly. If people end up reading this thread is for a reason. The exception is indicating an error failing to start... and access denied. That is not the normal info message one would expect to see in a log.

@gissuebot
Copy link
Author

From mcculls on May 15, 2013 05:55:57

Note that the FinalizableReferenceQueue message came from an old embedded copy of Guava which started a background thread to handle cleanup of certain weak/soft collections. Guice trunk now includes Guava 11.0.1 that doesn't start a background thread for these collections, so this message will no longer occur.

@gissuebot
Copy link
Author

From Juan.Gentile@pnvillarreal.me on May 15, 2013 05:57:37

thanks

@gissuebot
Copy link
Author

From sowdri on July 03, 2013 06:45:48

I'm using Guice v3.0 + Guava v12.0 the issue still occurs. And its eating CPU.
For a request it took 47306ms.

Kindly fix this.

@gissuebot
Copy link
Author

From mcculls on July 03, 2013 06:57:35

As mentioned above, Guice 3.0 embeds a local copy of Guava repackaged under a different package name. So adding Guava 12.0 to your classpath won't change anything because Guice will still use the old embedded code.

You either need to build Guice trunk locally and use that (at least until the next release is available), or look at http://search.maven.org/#artifactdetails%7Corg.sonatype.sisu%7Csisu-guice%7C3.1.5%7Cjar which is Guice trunk plus some extra patches (these patches include making Guava a proper dependency rather than embedded).

@gissuebot
Copy link
Author

From deletedaccount on January 21, 2014 02:28:06

When is the next release available?  This is a serious problem.

@kiitos6
Copy link

kiitos6 commented May 22, 2017

Hi, did somene find how to fix that warning?

@mcculls
Copy link
Contributor

mcculls commented May 22, 2017

@kiitos6 it shouldn't happen if you use Guice 4.0

@kiitos6
Copy link

kiitos6 commented May 22, 2017

@mcculls Ok I am going to try. I only need to change the guice.jar? or I need another jar dependecy update too?
Thank you

@kiitos6
Copy link

kiitos6 commented May 22, 2017

Is working perfect with guice-4.0 and guice.assistedinject-4.0. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants