JBoss 6.2 EAP with JDK7 : java.lang.ClassCastException: java.util.logging.LoggingProxyImpl cannot be cast to sun.util.logging.LoggingProxy
Hey,
I was running into an issue on JBoss EAP 6.2 w/ JDK7 when instantiating a custom class that extended from sun.net.www.protocol.http.HttpURLConnection. I was getting the following stacktrace:
14:52:23,703 ERROR [stderr] (127.0.0.1:8009-1) java.lang.ExceptionInInitializerError
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.PlatformLogger$DefaultLoggerProxy.
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.PlatformLogger.
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.PlatformLogger.getLogger(PlatformLogger.java:202)
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at sun.net.www.protocol.http.HttpURLConnection.
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at ...HttpTimeoutHandler.openConnection(HttpTimeoutHandler.java:44)
14:52:23,704 ERROR [stderr] (127.0.0.1:8009-1) at java.net.URL.openConnection(URL.java:971)
...
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.jsp.products.producthierarchy_jsp._jspService(producthierarchy_jsp.java:456)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
14:52:23,706 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482)
...
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
14:52:23,707 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
...
14:52:23,708 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
...
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)
14:52:23,709 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.web.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:134)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.web.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:99)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.web.session.JvmRouteValve.invoke(JvmRouteValve.java:92)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.web.session.LockingValve.invoke(LockingValve.java:64)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
14:52:23,710 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) at java.lang.Thread.run(Thread.java:744)
14:52:23,711 ERROR [stderr] (127.0.0.1:8009-1) Caused by: java.lang.ClassCastException: java.util.logging.LoggingProxyImpl
cannot be cast to sun.util.logging.LoggingProxy
14:52:23,712 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.LoggingSupport$1.run(LoggingSupport.java:57)
14:52:23,712 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.LoggingSupport$1.run(LoggingSupport.java:49)
14:52:23,712 ERROR [stderr] (127.0.0.1:8009-1) at java.security.AccessController.doPrivileged(Native Method)
14:52:23,712 ERROR [stderr] (127.0.0.1:8009-1) at sun.util.logging.LoggingSupport.
14:52:23,712 ERROR [stderr] (127.0.0.1:8009-1) ... 61 more
The solution was to add 'path name="sun/util/logging"/' to jboss\modules\system\layers\base\sun\jdk\main\module.