You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2015/05/29 06:59:47 UTC

Log4j2 doesn't work with Google AppEngine

After switching to Log4j2 we broke all deployments to Google AppEngine
:) Maybe you have idea what to do? I'm going to ask on Log4j2 list

Uncaught exception from servlet
java.lang.ExceptionInInitializerError
at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:55)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:56)
at org.apache.struts2.tiles.StrutsTilesListener.<clinit>(StrutsTilesListener.java:50)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:375)
at org.mortbay.jetty.webapp.WebXmlConfiguration.newListenerInstance(WebXmlConfiguration.java:650)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initListener(WebXmlConfiguration.java:631)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(WebXmlConfiguration.java:368)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:289)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configure(WebXmlConfiguration.java:222)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXmlConfiguration.java:180)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1247)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:230)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.security.AccessControlException: access denied
("java.lang.RuntimePermission" "getClassLoader")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)
at java.security.AccessController.checkPermission(AccessController.java:572)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56)
at java.lang.ClassLoader.checkClassLoaderPermission(ClassLoader.java:1606)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1525)
at org.apache.logging.log4j.util.LoaderUtil.findUrlResources(LoaderUtil.java:192)
at org.apache.logging.log4j.util.LoaderUtil.findResources(LoaderUtil.java:183)
at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:90)
at org.apache.logging.log4j.util.PropertiesUtil.<clinit>(PropertiesUtil.java:36)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Log4j2 doesn't work with Google AppEngine

Posted by Lukasz Lenart <lu...@apache.org>.
2015-06-15 9:30 GMT+02:00 Johannes Geppert <jo...@apache.org>:
> Great news! :-)
>
> Do you know what exactly the problem and solution was?

Changes in code ;-)

https://github.com/apache/logging-log4j2/commit/1ab494651e3ebcaa292fd1ac395054043f69837a
https://github.com/apache/logging-log4j2/commit/4fba3c46052ba79bbfb20b9ab25041fafcdc4213
https://github.com/apache/logging-log4j2/commit/d55f00fbff5dcb69138734e2734723f5d693bf5b


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Log4j2 doesn't work with Google AppEngine

Posted by Johannes Geppert <jo...@apache.org>.
Great news! :-)

Do you know what exactly the problem and solution was?

#################################################
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep


2015-06-15 9:03 GMT+02:00 Lukasz Lenart <lu...@apache.org>:

> Not an issue anymore, I was able to resolve all the problems with
> Gary's help and now Log4j2 works without any problems on Google
> AppEngine - they must just release 2.4 version as all changes are in
> the master branch ;-)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> 2015-06-15 8:56 GMT+02:00 Johannes Geppert <jo...@apache.org>:
> > If we don't get it running with log4j2 on appengine then another option
> is
> > maybe to not use log4j2 core in the appengine application.
> > The users could use slf4j together with a log4j2 -> slf4j bridge.
> >
> > http://logging.apache.org/log4j/log4j-2.1/log4j-to-slf4j/index.html
> >
> >
> > Johannes
> >
> >
> >
> > #################################################
> > web: http://www.jgeppert.com
> > twitter: http://twitter.com/jogep
> >
> >
> > 2015-05-29 12:34 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> >
> >> Nope, it didn't help
> >>
> >> 2015-05-29 12:25 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> >> > 2015-05-29 11:34 GMT+02:00 Johannes Geppert <jo...@gmail.com>:
> >> >> According to Stackoverflow [1] you need to disable <property
> >> >> name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
> >> >> Also it should be already solved in log4j2 beta.
> >> >>
> >> >> [1]
> >> >>
> >>
> http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae
> >> >
> >> > I will try but it's a different exception. StatusLogger is trying to
> >> > access SystemClassLoader which is prohibited.
> >> >
> >> >
> >> > Regards
> >> > --
> >> > Łukasz
> >> > + 48 606 323 122 http://www.lenart.org.pl/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Log4j2 doesn't work with Google AppEngine

Posted by Lukasz Lenart <lu...@apache.org>.
Not an issue anymore, I was able to resolve all the problems with
Gary's help and now Log4j2 works without any problems on Google
AppEngine - they must just release 2.4 version as all changes are in
the master branch ;-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2015-06-15 8:56 GMT+02:00 Johannes Geppert <jo...@apache.org>:
> If we don't get it running with log4j2 on appengine then another option is
> maybe to not use log4j2 core in the appengine application.
> The users could use slf4j together with a log4j2 -> slf4j bridge.
>
> http://logging.apache.org/log4j/log4j-2.1/log4j-to-slf4j/index.html
>
>
> Johannes
>
>
>
> #################################################
> web: http://www.jgeppert.com
> twitter: http://twitter.com/jogep
>
>
> 2015-05-29 12:34 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
>
>> Nope, it didn't help
>>
>> 2015-05-29 12:25 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
>> > 2015-05-29 11:34 GMT+02:00 Johannes Geppert <jo...@gmail.com>:
>> >> According to Stackoverflow [1] you need to disable <property
>> >> name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
>> >> Also it should be already solved in log4j2 beta.
>> >>
>> >> [1]
>> >>
>> http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae
>> >
>> > I will try but it's a different exception. StatusLogger is trying to
>> > access SystemClassLoader which is prohibited.
>> >
>> >
>> > Regards
>> > --
>> > Łukasz
>> > + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Log4j2 doesn't work with Google AppEngine

Posted by Johannes Geppert <jo...@apache.org>.
If we don't get it running with log4j2 on appengine then another option is
maybe to not use log4j2 core in the appengine application.
The users could use slf4j together with a log4j2 -> slf4j bridge.

http://logging.apache.org/log4j/log4j-2.1/log4j-to-slf4j/index.html


Johannes



#################################################
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep


2015-05-29 12:34 GMT+02:00 Lukasz Lenart <lu...@apache.org>:

> Nope, it didn't help
>
> 2015-05-29 12:25 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> > 2015-05-29 11:34 GMT+02:00 Johannes Geppert <jo...@gmail.com>:
> >> According to Stackoverflow [1] you need to disable <property
> >> name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
> >> Also it should be already solved in log4j2 beta.
> >>
> >> [1]
> >>
> http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae
> >
> > I will try but it's a different exception. StatusLogger is trying to
> > access SystemClassLoader which is prohibited.
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Log4j2 doesn't work with Google AppEngine

Posted by Lukasz Lenart <lu...@apache.org>.
Nope, it didn't help

2015-05-29 12:25 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> 2015-05-29 11:34 GMT+02:00 Johannes Geppert <jo...@gmail.com>:
>> According to Stackoverflow [1] you need to disable <property
>> name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
>> Also it should be already solved in log4j2 beta.
>>
>> [1]
>> http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae
>
> I will try but it's a different exception. StatusLogger is trying to
> access SystemClassLoader which is prohibited.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Log4j2 doesn't work with Google AppEngine

Posted by Lukasz Lenart <lu...@apache.org>.
2015-05-29 11:34 GMT+02:00 Johannes Geppert <jo...@gmail.com>:
> According to Stackoverflow [1] you need to disable <property
> name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
> Also it should be already solved in log4j2 beta.
>
> [1]
> http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae

I will try but it's a different exception. StatusLogger is trying to
access SystemClassLoader which is prohibited.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Log4j2 doesn't work with Google AppEngine

Posted by Johannes Geppert <jo...@gmail.com>.
According to Stackoverflow [1] you need to disable <property
name="log4j2.disable.jmx" value="true" /> in appengine-web.xml.
Also it should be already solved in log4j2 beta.

[1]
http://stackoverflow.com/questions/16979283/problems-with-using-log4j-2-in-gae

#################################################
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

2015-05-29 6:59 GMT+02:00 Lukasz Lenart <lu...@apache.org>:

> After switching to Log4j2 we broke all deployments to Google AppEngine
> :) Maybe you have idea what to do? I'm going to ask on Log4j2 list
>
> Uncaught exception from servlet
> java.lang.ExceptionInInitializerError
> at
> org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:55)
> at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:56)
> at
> org.apache.struts2.tiles.StrutsTilesListener.<clinit>(StrutsTilesListener.java:50)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at java.lang.Class.newInstance(Class.java:375)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.newListenerInstance(WebXmlConfiguration.java:650)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initListener(WebXmlConfiguration.java:631)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(WebXmlConfiguration.java:368)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:289)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.configure(WebXmlConfiguration.java:222)
> at
> org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXmlConfiguration.java:180)
> at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1247)
> at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
> at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
> at
> com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
> at
> com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
> at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:230)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
> at
> com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.security.AccessControlException: access denied
> ("java.lang.RuntimePermission" "getClassLoader")
> at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)
> at
> java.security.AccessController.checkPermission(AccessController.java:572)
> at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
> at
> com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56)
> at java.lang.ClassLoader.checkClassLoaderPermission(ClassLoader.java:1606)
> at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1525)
> at
> org.apache.logging.log4j.util.LoaderUtil.findUrlResources(LoaderUtil.java:192)
> at
> org.apache.logging.log4j.util.LoaderUtil.findResources(LoaderUtil.java:183)
> at
> org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:90)
> at
> org.apache.logging.log4j.util.PropertiesUtil.<clinit>(PropertiesUtil.java:36)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>