2009/4/27 Chris Stewart <[email protected]>

>
> This weekend we added SSL security to an application that heavily uses
> Google Guice.  After the update, with some moderately heavy load, the
> application is throwing 500 errors in Tomcat.  The only exception I'm
> seeing in the logs points me to Google Guice.  However, searching
> Google hasn't yielded any clues as to what I'm looking at here.  Has
> anyone seen any sort of exception such as this:
>
> Apr 27, 2009 8:29:42 AM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> java.lang.NoClassDefFoundError: Could not initialize class
> com.google.inject.util.FinalizableReferenceQueue


[ based on this stacktrace I assume you're running Guice 1 ]

the exception suggests the JVM had problems initializing the FRQ class,
possibly due to an exception in the "createAndStart" method that spawns
the background finalizer thread

when you added SSL security did you also enable the Java security manager?
if so then this could explain why the thread is failing to start and causing
the
initialization exception - ie. because it doesn't have the rights to create
a new
thread (but this isn't the cause if the exception is random/infrequent)

another possibility is that by adding SSL you somehow increased the number
of
threads in the application and you're now hitting the maximum number of
threads

similarly if you're now loading multiple copies of guice in separate
classloaders
(again perhaps some setting has changed since adding SSL) then you would be
creating a finalizer thread per classloader

some things to think about:

   monitor your JVM using jstack / jconsole (look at # of threads, etc.)

   instrument the Guice 1 code, especially around creating a thread in FRQ

HTH  -  don't forgot to look into other possibilities, in case this is a red
herring!

       at com.google.inject.util.FinalizableWeakReference.<init>
> (FinalizableWeakReference.java:33)
>        at com.google.inject.util.ReferenceMap$WeakKeyReference.<init>
> (ReferenceMap.java:428)
>        at
> com.google.inject.util.ReferenceMap.referenceKey(ReferenceMap.java:
> 242)
>        at com.google.inject.util.AbstractReferenceCache.internalCreate
> (AbstractReferenceCache.java:45)
>        at com.google.inject.util.AbstractReferenceCache.get
> (AbstractReferenceCache.java:116)
>        at com.google.inject.util.StackTraceElements.forMember
> (StackTraceElements.java:52)
>        at com.google.inject.ProvisionException.createMessage
> (ProvisionException.java:35)
>        at com.google.inject.ProvisionException.<init>
> (ProvisionException.java:29)
>        at com.google.inject.InjectorImpl$SingleParameterInjector.inject
> (InjectorImpl.java:646)
>        at com.google.inject.InjectorImpl.getParameters(InjectorImpl.java:
> 666)
>        at com.google.inject.InjectorImpl$SingleMethodInjector.inject
> (InjectorImpl.java:575)
>        at com.google.inject.InjectorImpl.injectMembers(InjectorImpl.java:
> 674)
>        at com.google.inject.InjectorImpl$8.call(InjectorImpl.java:682)
>        at com.google.inject.InjectorImpl$8.call(InjectorImpl.java:681)
>        at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:
> 747)
>        at com.google.inject.InjectorImpl.injectMembers(InjectorImpl.java:
> 680)
>        at
> com.xperts.dashboard.utility.GuiceVariableResolver.resolveVariable
> (GuiceVariableResolver.java:29)
>        at com.sun.faces.el.VariableResolverChainWrapper.getValue
> (VariableResolverChainWrapper.java:107)
>        at
> javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
>        at com.sun.faces.el.FacesCompositeELResolver.getValue
> (FacesCompositeELResolver.java:72)
>        at
> org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
>        at org.apache.el.parser.AstValue.getValue(AstValue.java:86)
>        at org.apache.el.parser.AstEqual.getValue(AstEqual.java:21)
>        at org.apache.el.ValueExpressionImpl.getValue
> (ValueExpressionImpl.java:186)
>        at com.sun.facelets.el.TagValueExpression.getValue
> (TagValueExpression.java:71)
>        at javax.faces.component.UIComponentBase.isRendered
> (UIComponentBase.java:390)
>        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:924)
>        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
>        at com.sun.facelets.FaceletViewHandler.renderView
> (FaceletViewHandler.java:577)
>        at org.ajax4jsf.application.ViewHandlerWrapper.renderView
> (ViewHandlerWrapper.java:100)
>        at org.ajax4jsf.application.AjaxViewHandler.renderView
> (AjaxViewHandler.java:176)
>        at com.sun.faces.lifecycle.RenderResponsePhase.execute
> (RenderResponsePhase.java:110)
>        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
>        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:
> 139)
>        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:290)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:206)
>        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:
> 178)
>        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
>        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest
> (BaseFilter.java:390)
>        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:235)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:206)
>        at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
> (ExtensionsFilter.java:147)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:235)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:206)
>        at org.apache.catalina.core.StandardWrapperValve.invoke
> (StandardWrapperValve.java:233)
>        at org.apache.catalina.core.StandardContextValve.invoke
> (StandardContextValve.java:175)
>        at org.apache.catalina.authenticator.AuthenticatorBase.invoke
> (AuthenticatorBase.java:525)
>        at org.apache.catalina.core.StandardHostValve.invoke
> (StandardHostValve.java:128)
>        at org.apache.catalina.valves.ErrorReportValve.invoke
> (ErrorReportValve.java:102)
>        at org.apache.catalina.core.StandardEngineValve.invoke
> (StandardEngineValve.java:109)
>        at org.apache.catalina.connector.CoyoteAdapter.service
> (CoyoteAdapter.java:263)
>        at org.apache.coyote.http11.Http11Processor.process
> (Http11Processor.java:844)
>        at org.apache.coyote.http11.Http11Protocol
> $Http11ConnectionHandler.process(Http11Protocol.java:584)
>        at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
> 447)
>        at java.lang.Thread.run(Unknown Source)
> >

-- 
Cheers, Stuart

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to