You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Paresh Varke (JIRA)" <ji...@apache.org> on 2016/02/05 13:09:39 UTC
[jira] [Comment Edited] (LOG4J2-548) Log4j 2.0 with JBoss EAP 6.2
[ https://issues.apache.org/jira/browse/LOG4J2-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15133969#comment-15133969 ]
Paresh Varke edited comment on LOG4J2-548 at 2/5/16 12:09 PM:
--------------------------------------------------------------
Hello, i tried log4j2 with jboss EAP 6.2. My custom plugin was not loaded at log4j2 startup, after debugging org.apache.logging.log4j.core.config.plugins.ResolverUtil.findInPackage method i observed following things
- Protocal of URL is "vfs" not vfszip.
- As protocol of url is neither vfszip nor bundleresource, it goes to "loadImplementationsInJar" method of ResolverUtil.
and in loadImplementationsInJar method, it creates jarInputStream, but here i think it should remove package name from "jarFile" variable before executing jarStream = new JarInputStream(new FileInputStream(jarFile));
I am putting here log4j2 startup logs for more details
15:41:21,651 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,650 ServerService Thread Pool -- 53 DEBUG Starting LoggerContext[name=/mobile] from configuration at null
15:41:21,651 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,651 ServerService Thread Pool -- 53 DEBUG Starting LoggerContext[name=/mobile, org.apache.logging.log4j.core.LoggerContext@2178609b] with configuration XmlConfiguration[location=vfs:/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/log4j2.xml]...
15:41:21,652 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,652 ServerService Thread Pool -- 53 DEBUG Shutdown hook enabled. Registering a new one.
15:41:21,653 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,653 ServerService Thread Pool -- 53 DEBUG Initializing configuration XmlConfiguration[location=vfs:/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/log4j2.xml]
15:41:21,659 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,658 ServerService Thread Pool -- 53 DEBUG Installed script engines
15:41:21,683 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,683 ServerService Thread Pool -- 53 DEBUG Mozilla Rhino Version: 1.7 release 3 PRERELEASE, Language: ECMAScript, Threading: MULTITHREADED, Compile: true, Names: {js, rhino, JavaScript, javascript, ECMAScript, ecmascript}
15:41:36,937 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:36,935 ServerService Thread Pool -- 53 INFO Scanning for classes in [/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/com/logging/appender/log4j2/] matching criteria: annotated with @Plugin
15:41:38,702 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:38,695 ServerService Thread Pool -- 53 ERROR Could not search jar file 'C:\applicationservers\jboss-eap-6.2\standalone\deployments\myear.ear\my-app.war\WEB-INF\lib\logging.jar\com\logging\appender\log4j2' for classes matching criteria: annotated with @Plugin file not found java.io.FileNotFoundException: C:\applicationservers\jboss-eap-6.2\standalone\deployments\myear.ear\my-app.war\WEB-INF\lib\logging.jar\com\logging\appender\log4j2 (The system cannot find the path specified)
15:41:38,703 INFO [stdout] (ServerService Thread Pool -- 53) at java.io.FileInputStream.open(Native Method)
15:41:38,704 INFO [stdout] (ServerService Thread Pool -- 53) at java.io.FileInputStream.<init>(FileInputStream.java:146)
15:41:38,704 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInJar(ResolverUtil.java:310)
15:41:38,705 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.findInPackage(ResolverUtil.java:206)
15:41:38,706 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.PluginRegistry.loadFromPackage(PluginRegistry.java:222)
15:41:38,707 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.PluginManager.collectPlugins(PluginManager.java:152)
15:41:38,707 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:180)
15:41:38,708 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:209)
15:41:38,709 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:492)
15:41:38,709 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:246)
15:41:38,710 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:232)
15:41:38,710 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:140)
15:41:38,711 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:168)
15:41:38,712 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:110)
15:41:38,712 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
15:41:38,713 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:181)
15:41:38,714 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
15:41:38,714 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3772)
15:41:38,715 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
15:41:38,716 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
15:41:38,716 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
15:41:38,717 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
15:41:38,717 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.FutureTask.run(FutureTask.java:262)
15:41:38,718 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
15:41:38,719 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
15:41:38,719 INFO [stdout] (ServerService Thread Pool -- 53) at java.lang.Thread.run(Thread.java:745)
15:41:38,720 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.threads.JBossThread.run(JBossThread.java:122)
15:41:38,720 INFO [stdout] (ServerService Thread Pool -- 53)
15:41:50,981 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:50,980 ServerService Thread Pool -- 53 DEBUG Took 29.296404 seconds to load 0 plugins from package com.logging.appender.log4j2
was (Author: paresh.varke):
Hello, i am trying log4j2 with jboss EAP 6.2. My custom plugin is not loaded at log4j2 startup, after debugging org.apache.logging.log4j.core.config.plugins.ResolverUtil.findInPackage method i observed following things
- Protocal of URL is vfs not vfszip.
- As protocol of url is neither vfszip nor bundleresource, it goes to "loadImplementationsInJar" method of ResolverUtil.
and in loadImplementationsInJar method, it creates jarInputStream, but here i think it should remove package name from "jarFile" variable before executing jarStream = new JarInputStream(new FileInputStream(jarFile));
I am putting here log4j2 startup logs for more details
15:41:21,651 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,650 ServerService Thread Pool -- 53 DEBUG Starting LoggerContext[name=/mobile] from configuration at null
15:41:21,651 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,651 ServerService Thread Pool -- 53 DEBUG Starting LoggerContext[name=/mobile, org.apache.logging.log4j.core.LoggerContext@2178609b] with configuration XmlConfiguration[location=vfs:/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/log4j2.xml]...
15:41:21,652 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,652 ServerService Thread Pool -- 53 DEBUG Shutdown hook enabled. Registering a new one.
15:41:21,653 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,653 ServerService Thread Pool -- 53 DEBUG Initializing configuration XmlConfiguration[location=vfs:/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/log4j2.xml]
15:41:21,659 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,658 ServerService Thread Pool -- 53 DEBUG Installed script engines
15:41:21,683 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:21,683 ServerService Thread Pool -- 53 DEBUG Mozilla Rhino Version: 1.7 release 3 PRERELEASE, Language: ECMAScript, Threading: MULTITHREADED, Compile: true, Names: {js, rhino, JavaScript, javascript, ECMAScript, ecmascript}
15:41:36,937 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:36,935 ServerService Thread Pool -- 53 INFO Scanning for classes in [/C:/applicationservers/jboss-eap-6.2/standalone/deployments/myear.ear/my-app.war/WEB-INF/lib/logging.jar/com/logging/appender/log4j2/] matching criteria: annotated with @Plugin
15:41:38,702 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:38,695 ServerService Thread Pool -- 53 ERROR Could not search jar file 'C:\applicationservers\jboss-eap-6.2\standalone\deployments\myear.ear\my-app.war\WEB-INF\lib\logging.jar\com\logging\appender\log4j2' for classes matching criteria: annotated with @Plugin file not found java.io.FileNotFoundException: C:\applicationservers\jboss-eap-6.2\standalone\deployments\myear.ear\my-app.war\WEB-INF\lib\logging.jar\com\logging\appender\log4j2 (The system cannot find the path specified)
15:41:38,703 INFO [stdout] (ServerService Thread Pool -- 53) at java.io.FileInputStream.open(Native Method)
15:41:38,704 INFO [stdout] (ServerService Thread Pool -- 53) at java.io.FileInputStream.<init>(FileInputStream.java:146)
15:41:38,704 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInJar(ResolverUtil.java:310)
15:41:38,705 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.findInPackage(ResolverUtil.java:206)
15:41:38,706 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.PluginRegistry.loadFromPackage(PluginRegistry.java:222)
15:41:38,707 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.plugins.util.PluginManager.collectPlugins(PluginManager.java:152)
15:41:38,707 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:180)
15:41:38,708 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:209)
15:41:38,709 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:492)
15:41:38,709 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:246)
15:41:38,710 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:232)
15:41:38,710 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:140)
15:41:38,711 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:168)
15:41:38,712 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:110)
15:41:38,712 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
15:41:38,713 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:181)
15:41:38,714 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
15:41:38,714 INFO [stdout] (ServerService Thread Pool -- 53) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3772)
15:41:38,715 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
15:41:38,716 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
15:41:38,716 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
15:41:38,717 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
15:41:38,717 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.FutureTask.run(FutureTask.java:262)
15:41:38,718 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
15:41:38,719 INFO [stdout] (ServerService Thread Pool -- 53) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
15:41:38,719 INFO [stdout] (ServerService Thread Pool -- 53) at java.lang.Thread.run(Thread.java:745)
15:41:38,720 INFO [stdout] (ServerService Thread Pool -- 53) at org.jboss.threads.JBossThread.run(JBossThread.java:122)
15:41:38,720 INFO [stdout] (ServerService Thread Pool -- 53)
15:41:50,981 INFO [stdout] (ServerService Thread Pool -- 53) 2016-02-05 15:41:50,980 ServerService Thread Pool -- 53 DEBUG Took 29.296404 seconds to load 0 plugins from package com.logging.appender.log4j2
> Log4j 2.0 with JBoss EAP 6.2
> -----------------------------
>
> Key: LOG4J2-548
> URL: https://issues.apache.org/jira/browse/LOG4J2-548
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-rc1, 2.1
> Environment: EJB 3.1 , JBoss EAP 6.2 , Windows 7 , Eclipse Kepler
> Reporter: Shehata
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> When trying to use log4j 2.0-rc1 with EJB3.1 i got Error Message:
> "ERROR StatusLogger Could not search jar file 'jboss-eap-6.2\standalone\deployments\Log4J2Ear.ear\lib\log4j-core-2.0-rc1.jar\org\apache\logging\log4j\core' for classes matching criteria: annotated with @Plugin file not found"
> after debugging the application found that the problem is located in :
> org.apache.logging.log4j.core.config.plugins.ResolverUtil
> method: findInPackage --> line number 247
> the protocol used in the jar is vfs not vfszip
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org