javatomcatnetbeansjava-ee-8

Tomcat 10 connection problem in Netbeans 13


I installed Netbeans and Tomcat. This error occurs when I then create and run a sample project. How do I solve this problem? I added Tomcat as a server and it works on localhost. I added the JDK file to the path. I wrote maven plugins in pom file.

--- maven-war-plugin:2.3:war (default-war) @ mavenproject1 ---
        Error injecting: org.apache.maven.plugin.war.WarMojo
        com.google.inject.ProvisionException: Unable to provision, see the following errors:
        
        1) Error injecting constructor, java.lang.ExceptionInInitializerError
          at org.apache.maven.plugin.war.WarMojo.<init>(Unknown Source)
          while locating org.apache.maven.plugin.war.WarMojo
        
        1 error
            at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226)
            at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1053)
            ...
        Caused by: java.lang.ExceptionInInitializerError
            at com.thoughtworks.xstream.XStream.setupConverters (XStream.java:679)
            ...
        Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module
            ...
        Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mavenproject1: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
        -----------------------------------------------------
        realm =    plugin>org.apache.maven.plugins:maven-war-plugin:2.3
        strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
        urls[0] = file:/C:/Users/selim/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.3/maven-war-plugin-2.3.jar
        ...
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------
: ExceptionInInitializerError: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @f2276c9
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

Solution

  • I solve the problem. I'm waiting unpacking central repository