-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
database creation failed for apache project log4j #103
Comments
Greetings! Thanks for reaching out to us with this issue. I note that your command If that doesn't resolve your issue, we'll be happy to look into this further for you. |
Thank you for your reply! Got same error when I tried "codeql database create ../log4j.db -c "mvn package -X -DskipTests". I think this error should be related to the toolchain plugin used in apache log4j. Here is the toolchain config file from apache log4j ~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the license for the specific language governing permissions and
~ limitations under the license.
-->
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-7-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-9-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<!-- other toolchains -->
</toolchains>
I placed the toolchain config file to ~/.m2/toolchain.xml. The output when I tried "codeql database create ../log4j.db --language java -c "mvn package -X -DskipTests" " is as below: 2021-12-29 20:35:30] [build-stdout] [INFO] Reactor Summary for Apache Log4j 2 2.12.2:
[2021-12-29 20:35:30] [build-stdout] [INFO]
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j 2 ..................................... SUCCESS [ 1.048 s]
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j API Java 9 support .................... FAILURE [ 2.981 s]
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j API ................................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Implementation Java 9 support ......... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Core .................................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Core Integration Tests ................ SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j 1.x Compatibility API ................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j to SLF4J Adapter ...................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j SLF4J Binding ......................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j SLF4J 1.8+ Binding .................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Commons Logging Bridge ................ SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Flume Bridge .......................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Web ................................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Tag Library ........................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j JMX GUI ............................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples ............................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples: Flume - Common ............... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples: Flume - Remote ............... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples: Flume - Embedded ............. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples: Configuration ................ SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Samples: LoggerProperties ............. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j BOM ................................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j JDBC DBCP 2 ........................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j JPA ................................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j CouchDB ............................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j MongoDB 2 ............................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j MongoDB 3 ............................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Cassandra ............................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4J Performance Tests ..................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Streaming Interface ................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j App Server Support .................... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j OSGi .................................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Docker Library ........................ SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Spring Cloud Config Support ........... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Spring Cloud Config Client Support .... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Log4j Sample Configuration Service ................. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Apache Log4j Spring Cloud Config Samples ........... SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] Spring Cloud Config Sample Application ............. SKIPPED
[2021-12-29 20:35:30] [build-stdout] [INFO] ------------------------------------------------------------------------
[2021-12-29 20:35:30] [build-stdout] [INFO] BUILD FAILURE
[2021-12-29 20:35:30] [build-stdout] [INFO] ------------------------------------------------------------------------
[2021-12-29 20:35:30] [build-stdout] [INFO] Total time: 5.034 s
[2021-12-29 20:35:30] [build-stdout] [INFO] Finished at: 2021-12-29T20:35:30+08:00
[2021-12-29 20:35:30] [build-stdout] [INFO] ------------------------------------------------------------------------
[2021-12-29 20:35:30] [build-stdout] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project log4j-api-java9: Compilation failure -> [Help 1]
[2021-12-29 20:35:30] [build-stdout] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project log4j-api-java9: Compilation failure
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[2021-12-29 20:35:30] [build-stdout] at java.lang.reflect.Method.invoke (Method.java:566)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[2021-12-29 20:35:30] [build-stdout] Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1224)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[2021-12-29 20:35:30] [build-stdout] at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
[2021-12-29 20:35:30] [build-stdout] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[2021-12-29 20:35:30] [build-stdout] at java.lang.reflect.Method.invoke (Method.java:566)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[2021-12-29 20:35:30] [build-stdout] at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[2021-12-29 20:35:30] [build-stdout] [ERROR]
[2021-12-29 20:35:30] [build-stdout] [ERROR]
[2021-12-29 20:35:30] [build-stdout] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[2021-12-29 20:35:30] [build-stdout] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[2021-12-29 20:35:30] [build-stdout] [ERROR]
[2021-12-29 20:35:30] [build-stdout] [ERROR] After correcting the problems, you can resume the build with the command
[2021-12-29 20:35:30] [build-stdout] [ERROR] mvn <args> -rf :log4j-api-java9
[2021-12-29 20:35:30] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/home/john/tools/codeql/codeql/tools/linux64/preload_tracer, mvn, package, -X, -DskipTests])
A fatal error occurred: Exit status 1 from command: [mvn, package, -X, -DskipTests]
As you may see, the first module "Apache Log4j 2" compiled by JDK8 is OK, while the second module "Apache Log4j API Java 9 support" compiled by JDK9 encounters a failure. |
Greetings once again, thank you for trying that out for providing this additional information. I've tried to reproduce this issue locally but could not - on my machine, everything seems to work fine. For what it's worth, my <toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/home/edoardo/jvms/jdk-9.0.4</jdkHome>
</configuration>
</toolchain>
</toolchains> where the JDK in The I'm not quite sure why things aren't working for you, and investigating this further is getting beyond my area of expertise (I work on the general parts of the CodeQL CLI rather than the language-specific extractors). Perhaps someone from @github/codeql-java might be able to suggest what may be going wrong for you. |
Thank you for your reply. I followed your setting, and now I can successfully create database. I think the problem might be related to the differences between adoptopenjdk and oracle jdk. The version information of the old jdk9 I used is
The version information of the new jdk9 is
|
Interesting, glad it's working for you now and thank you for the additional information. I'll keep this issue open so we can further investigate what was going wrong before once the Java team are back from the holidays. |
source code: apache-log4j-2.12.3 download from https://downloads.apache.org/logging/log4j/
os: ubuntu-20.04
maven: Apache Maven 3.6.3
codeql: 2.7.3
I can successfully build log4j without any problems with "mvn package -DskipTests ", but when I tried to create a codeql database with "codeql database create log4j.db -c "mvn package -X -DskipTests", I got the following error messages:
The text was updated successfully, but these errors were encountered: