0

I'll add more information as needed, since I'm not entirely sure where to start. So please, bear with me for a while.

A running Java Maven project, which is in production and in use and running in a Tekton environment.. It's an end-2-end-framework for Selenium, and several projects are using it as we speak.

All I've done with it so far, is run projects that import and use parts of the framework. Never had any problems.

But, seeing as I have to make changes to it, and update it (among others, from selenium 3.x to 4.x), I'm running into problems from the very start.

I've cloned the project form the GitHub environment to my local Ubuntu development environment, and opened it in IntelliJ.

I can build the individual modules in the project. But when I try to do a "mvn clean install", I get this error when it comes to the second module. It only takes about 3 seconds for the install to fail:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.716 s
[INFO] Finished at: 2022-09-26T18:43:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project selenium: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

None of the information provided there give me any clue AFAICS. Neither does it when I use the -e switch:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project felles: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal     org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project felles:         Fatal error compiling
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1086)
....
....
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
at java.lang.ClassLoader.findClass (ClassLoader.java:719)
at java.lang.ClassLoader.loadClass (ClassLoader.java:589)

I cannot find anything related to Mojo in the project.

Any ideas where to start? To clarify: This is a project running in a Tekton environment, and it's in daily use by several projects. So it most certainly builds and runs in that environment. But I'm not able to compile and run it locally.

  • 1. Revert all your modifications 2. Re-start reading (e.g.) https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/ (https://google.com?q=selenium+upgrade+3+to+4) – xerx593 Sep 26 '22 at 16:59
  • That's a good idea. However, I have done no modifications. Zero. Nada. Nix. Zip. I've just downloaded the running version of the code, and tried to run it locally. –  Sep 26 '22 at 17:06
  • Upgrade your maven-compiler-plugin version and give such information here in the post please (JDK version, Maven version etc.)... – khmarbaise Sep 26 '22 at 17:28
  • look like a JDK mismatch issue since it's missing one of the JDK classes `com.sun.tools.javac.code.TypeTags`. Is your JAVA_HOME set correctly? Also, does it use https://projectlombok.org/ – Saif Ahmad Sep 30 '22 at 06:11

1 Answers1

1

This is a bit outside of my realm, but here goes... Are you sure that the maven and java versions are usable on your ubuntu platform? I noticed that you didn't say or at least post that you did the -x switch for more logged info.

I found this on a similar post here : update-ca-certificates -f According to the man page:

update-ca-certificates is a program that updates the directory /etc/ssl/certs to hold SSL certificates and generatescertificates.crt, a concatenated single-file list of certificate

Maven with Ubuntu 15.10, getting errors with: mvn clean install;

I hope this helps. Sorry for being out of my element

Joe Smiff
  • 13
  • 4
  • Every attempt at help is welcome :-) With regards to certificates, I've allready downloaded and written, committed and built code on other projects in the same realm/environment. So my certificates, I'm pretty certain, are up to speed. (Also, I tested your suggestion.) The Java versions are also checked and verified. This particular projects runs on java 1.8, unlike the others that use 11. Before I "downgraded" from 11 to 1.8 on the project in question, there were actual compilation errors. Those are gone. –  Sep 26 '22 at 17:09
  • 1
    At least this is helping me understand this. I am still a bit of n00b as far as developing goes. I never developed on that low of a Java version. That seems like a pain to have to downgrade all the way to 1.8. I will make one more attempt: "Some developers try and change the Java compiler setting within Eclipse from Java 1.5 to Java 1.8, but that only works temporarily. As soon as a new Maven build takes place, the JDK version reverts back to 1.5. The only way to make this a permanent change is to edit the Maven compiler plugin POM entry and force Eclipse and Maven to use Java 1.8." – Joe Smiff Sep 26 '22 at 18:57
  • 1
    https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-force-Maven-JDK-18-support-through-the-POM-file Maybe? – Joe Smiff Sep 26 '22 at 18:57
  • Thanks. However, the project has "allways" been java 1.8, so the only downgrading has been me installing a 1.8 JDK in IntelliJ. –  Sep 27 '22 at 06:40
  • Well I will just end with encouraging words! Good luck sir, I hate that I couldn't have been more help! – Joe Smiff Sep 28 '22 at 16:42