3

i have a web app on tomcat when i try to deploy it in net-beans this error occurs.

java.lang.IllegalAccessError: class org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl (in unnamed module @0x3196dd3d) cannot access class com.sun.org.apache.xerces.internal.impl.dv.util.Base64 (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.impl.dv.util to unnamed module @0x3196dd3d

Stack trace

java.lang.IllegalAccessError: class org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl (in unnamed module @0x3196dd3d) cannot access class com.sun.org.apache.xerces.internal.impl.dv.util.Base64 (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.impl.dv.util to unnamed module @0x3196dd3d
    at org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl.run(TomcatManagerImpl.java:533)
    at org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl.list(TomcatManagerImpl.java:372)
    at org.netbeans.modules.tomcat5.deploy.TomcatManager.modules(TomcatManager.java:718)
    at org.netbeans.modules.tomcat5.deploy.TomcatManager.getAvailableModules(TomcatManager.java:529)
    at org.netbeans.modules.tomcat5.optional.TMIDResolver.lookupTargetModuleID(TMIDResolver.java:56)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:349)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:322)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:319)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:440)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:170)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:605)
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:221)
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:141)
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:86)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 1 second)

How can i solve this ? i follwed these questions, but is not working for me java-xBased deployment issue.

openjdK version

openjdk 16 2021-03-16
OpenJDK Runtime Environment 21.3 (build 16+36)
OpenJDK 64-Bit Server VM 21.3 (build 16+36, mixed mode, sharing)

Net-beans version

Apache Netbeans IDE 12.0

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
SHARON XAVIER
  • 272
  • 5
  • 19
  • 1
    Apart from any other issues, using JDK 16 with NetBeans 12.0 is not valid. From the [NetBeans release documentation for 12.0](https://netbeans.apache.org/download/nb120/nb120.html): _"Apache NetBeans 12.0 runs on the JDK LTS releases 8 and 11, as well as on JDK 14, i.e., the current JDK release at the time of this NetBeans release"_. So to resolve this issue, first use JDK 14 instead of JDK 16 as your default platform on NetBeans 12.0, and update your question if the problem persists. – skomisa Apr 20 '21 at 03:41
  • @skomisa i figured it out – SHARON XAVIER Apr 20 '21 at 10:59
  • 1
    And what was the problem?... – skomisa Apr 20 '21 at 17:26
  • @skomisa it is a bug – SHARON XAVIER Apr 21 '21 at 05:12
  • OK. It's good that you pursued this and got a fix, even though that doesn't help you right now. – skomisa Apr 21 '21 at 05:55
  • @skomisa i upgraded to net-beans 12.3 now new error. please checkout the question . https://stackoverflow.com/questions/67228369/can-not-clean-and-build-web-app-in-netbeans – SHARON XAVIER Apr 23 '21 at 10:39

2 Answers2

0

Apache Netbeans 12.0 needs jdk 14 or less To work properly so i recommend installing Amazon Corretto 11 or any jdk 11 distribution and reinstall apache netbeans.