1

I am trying to run a web app made with Netbeans 16 using Apache-Tomcat 10.0.27 on Windows 11. It worked fine on Windows 10 with the same tomcat.

Everything goes fine when starting the server (it takes just 625ms!) but after that, when I try to debug the project, the next error is thrown:

enter image description here

Any help would be greatly appreciated!

carles
  • 174
  • 1
  • 10
  • 1
    You are getting a 'NoSuchMethodError' error on method `Urlencoder.encode(String s, Charset charset)` which was implemented in Java 10. What version of Java is Tomcat using? (It will be using the same version that is used for running NetBeans, and you can use **Help > About** in NetBeans to determine that.) – skomisa Dec 31 '22 at 00:03

1 Answers1

0

Solved.

I do not much know the way it has been solved, but now it works.

Firstly, @Shawn (thru the Tomcat-users mailing list) told me to try Java 11, or even 17. I did it, and a new compilation problem raised with 11, and stood with 17.

What I did after the new build error, and not knowing how to fix it, was to try java 17, which kept giving the same error.

Then I went back to java 8 in the project settings, into the netbeans, and IT WORKED!!!

I feel like Elliot from ET! It works!

carles
  • 174
  • 1
  • 10
  • 1
    Good that you got this to work, but note that your release of Tomcat, [10.0.27, is unsupported](https://tomcat.apache.org/whichversion.html): _"Users of Tomcat 10.0 should be aware that Tomcat 10.0 has now reached end of life. Users of Tomcat 10.0.x should upgrade to Tomcat 10.1.x or later"_. And if you upgrade to a supported version of Tomcat (i.e. 10.1.x or later), you will also have to upgrade to JDK 11 or later. – skomisa Dec 31 '22 at 03:22