shyam
shyam

Reputation: 1388

Tomcat 8.5 not starting after upgrading Ubuntu version

I have just upgraded my Ubuntu distro from 16.04 to 18.04. Now the Tomcat 8.5 which used to work just fine, does not start up properly. The error I get is

30-Apr-2018 19:24:25.195 SEVERE [http-nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
 java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;                                                                                         │
    at org.apache.coyote.http11.Http11InputBuffer.recycle(Http11InputBuffer.java:280)                                                                               │
    at org.apache.coyote.http11.Http11Processor.recycle(Http11Processor.java:1709)                                                                                  │
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:972)                                                                      │
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:940)                                                                      │
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)                                                                          │
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)                                                                              │
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)                                                                              │
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)                                                                              │
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)                                                                           │
    at java.lang.Thread.run(Thread.java:748) 

Does anyone know why this is happening?

Upvotes: 1

Views: 738

Answers (2)

Oleg Ushakov
Oleg Ushakov

Reputation: 1555

Tomcat8 in Ubuntu 18.04 work correct with JDK10 which is set as default after upgrade of Ubuntu.

Upvotes: 0

shyam
shyam

Reputation: 1388

As it turns out this is an issue with an update in Debian upstream. So basically the tomcat version 8.5.30-1 which is available in the Ubuntu 18.04 repositories was compiled on Java 9. So if you are still running your application on Java 8 like I do, you will face this issue.

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895866

Upvotes: 1

Related Questions