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 "Remko Popma (JIRA)" <ji...@apache.org> on 2017/02/02 15:42:52 UTC

[jira] [Assigned] (LOG4J2-1803) JMH generated benchmark classes not included in jar

     [ https://issues.apache.org/jira/browse/LOG4J2-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma reassigned LOG4J2-1803:
-----------------------------------

    Assignee: Ralph Goers

> JMH generated benchmark classes not included in jar
> ---------------------------------------------------
>
>                 Key: LOG4J2-1803
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1803
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core, Performance Benchmarks
>    Affects Versions: 2.8
>            Reporter: Remko Popma
>            Assignee: Ralph Goers
>
> Some time after the 2.7 release, the JMH benchmarks stopped working. When trying to execute them, this error occurs:
> {code}
> java.lang.IllegalArgumentException: Benchmark does not match a class
> 	at org.openjdk.jmh.util.ClassUtils.loadClass(ClassUtils.java:90)
> 	at org.openjdk.jmh.runner.BaseRunner.runBenchmark(BaseRunner.java:198)
> 	at org.openjdk.jmh.runner.BaseRunner.runBenchmarks(BaseRunner.java:95)
> 	at org.openjdk.jmh.runner.ForkedRunner.run(ForkedRunner.java:51)
> 	at org.openjdk.jmh.runner.ForkedMain.main(ForkedMain.java:68)
> Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.perf.jmh.generated.FileAppenderBenchmark_julFile
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:195)
> 	at org.openjdk.jmh.util.ClassUtils.loadClass(ClassUtils.java:72)
> 	... 4 more
> {code}
> When I build the project, the classes generated by JMH under log4j-perf/target/generated-sources/annotations are not included in the shaded benchmarks.jar or in log4j-perf-2.8.1-SNAPSHOT.jar...
> The cause seems to be a change in the master pom:
> the {{maven-compiler-plugin}} plugin now has the below section which was not there in 2.7. 
> If I take it out and build only log4j-perf, the benchmarks run without error. (But building all modules fails: some problem in log4j-core...)
> {code}
>   <executions>
>     <execution>
>       <!-- disable annotation processing for first pass -->
>       <id>default-compile</id>
>       <goals>
>         <goal>compile</goal>
>       </goals>
>       <phase>compile</phase>
>       <configuration>
>         <proc>none</proc>
>       </configuration>
>     </execution>
>     <execution>
>       <!-- then do a processing-only pass to generate plugins .dat file -->
>       <id>process-plugins</id>
>       <goals>
>         <goal>compile</goal>
>       </goals>
>       <phase>process-classes</phase>
>       <configuration>
>         <proc>only</proc>
>       </configuration>
>     </execution>
>   </executions>
> {code}
> From the log4j-dev mailing list:
> {quote}
> That maven-compiler-plugin config was originally only included in log4j-core in order to allow the PluginProcessor annotation processor to re-run against log4j-core without needing to split it into its own jar. I'm not sure why it's configured for everything now.
> {quote}
> Potentially related: somebody reported on StackOverflow that [their custom plugin no longer loads with 2.8|http://stackoverflow.com/questions/41938128/log4j-2-8-cannot-load-custom-converters-in-osgi-environment].



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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