apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.65k stars 850 forks source link

Netbeans 16 - java.lang.NoSuchMethodError: java.net.URLEncoder.encode at org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl.createTempContextXml(TomcatManagerImpl.java:361) #5134

Closed nemanjamilosevic98 closed 1 year ago

nemanjamilosevic98 commented 1 year ago

Apache NetBeans version

Apache NetBeans 16

What happened

Netbeans 16, when i run project, i got: Deploying on Apache Tomcat or TomEE profile mode: false debug mode: false force redeploy: true In-place deployment at /home/nemanja/DSProjects/main2/bet-applications/ibet-apps/ibet-s4/target/ibet-s4 and this exception

java.lang.NoSuchMethodError: java.net.URLEncoder.encode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
    at org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl.createTempContextXml(TomcatManagerImpl.java:361)
    at org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl.initialDeploy(TomcatManagerImpl.java:196)
    at org.netbeans.modules.tomcat5.optional.TomcatIncrementalDeployment.initialDeploy(TomcatIncrementalDeployment.java:126)
    at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:670)
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:221)
    at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:185)
    at org.netbeans.modules.maven.j2ee.execution.ExecutionChecker.executionResult(ExecutionChecker.java:70)
    at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:320)
    at org.netbeans.core.execution.RunClassThread.doRun(RunClassThread.java:132)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:81)

How to reproduce

Run project, tomcat 8.5.37

Did this work correctly in an earlier version?

No / Don't know

Operating System

Ubuntu 20.04

JDK

JDK 1.8

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

On older Netbeans versions the same is working

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

matthiasblaesing commented 1 year ago

Please use at least JDK 11 when running NetBeans. This is only one of the modules, that require it.

matthiasblaesing commented 1 year ago

Ok - the module is not properly marked as requiring JDK 9+ and there is an additional request: #5154

matthiasblaesing commented 1 year ago

Please have a look at the referenced PR. There is also a test build availble.