Results 1 to 7 of 7

Thread: Tomcat not working with Java 1.8

  1. #1

    Default Tomcat not working with Java 1.8

    Hello!

    On Tumbleweed 20171028 I have got installed Tomcat 8.0.44-2.1 and Java 1.8.0.144-5.1 (OpenJDK). Tomcat starts successfully, but is not able to display any page because of "Error parsing HTTP request header" caused by java.lang.NoSuchMethodError.

    Code:
    31-Oct-2017 12:20:41.957 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 866 ms
    31-Oct-2017 12:21:54.589 INFO [http-apr-8080-exec-1] org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP request header
     Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
     java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
            at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:583)
            at org.apache.coyote.http11.InternalAprInputBuffer.parseRequestLine(InternalAprInputBuffer.java:141)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1045)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
            at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2458)
            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)
    31-Oct-2017 12:21:54.609 SEVERE [http-apr-8080-exec-1] org.apache.coyote.http11.AbstractHttp11Processor.endRequest Error finishing response
     java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
            at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:282)
            at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:245)
            at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:214)
            at org.apache.coyote.http11.AbstractOutputBuffer.endRequest(AbstractOutputBuffer.java:378)
            at org.apache.coyote.http11.AbstractHttp11Processor.endRequest(AbstractHttp11Processor.java:1844)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1182)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
            at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2458)
            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)
    31-Oct-2017 12:21:54.609 SEVERE [http-apr-8080-exec-1] org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process Error reading request, ignored
     java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
            at org.apache.coyote.http11.InternalAprOutputBuffer.recycle(InternalAprOutputBuffer.java:113)
            at org.apache.coyote.http11.AbstractHttp11Processor.recycle(AbstractHttp11Processor.java:1874)
            at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.release(Http11AprProtocol.java:247)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:788)
            at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2458)
            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)
    Exception in thread "http-apr-8080-exec-1" java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
            at org.apache.coyote.http11.InternalAprOutputBuffer.recycle(InternalAprOutputBuffer.java:113)
            at org.apache.coyote.http11.AbstractHttp11Processor.recycle(AbstractHttp11Processor.java:1874)
            at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.release(Http11AprProtocol.java:247)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:820)
            at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2458)
            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)
    IMHO the reason is that Tomcat for Tumbleweed 20171028 was compiled with JDK9.
    For example /usr/share/tomcat/lib/catalina.jar META-INF/MANIFEST.MF content is:
    Code:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.9.9
    Created-By: 9-internal+0-adhoc.abuild.jdk9-b656dea9398e (Oracle Corpor
     ation)
    Specification-Title: Apache Tomcat
    Specification-Version: 8.0
    Specification-Vendor: Apache Software Foundation
    Implementation-Title: Apache Tomcat
    Implementation-Version: 8.0.44
    Implementation-Vendor: Apache Software Foundation
    X-Compile-Source-JDK: 1.7
    X-Compile-Target-JDK: 1.7
    On my other installation (Tumbleweed 20170904) Tomcat 8.0.44-1.2 works fine with Java 1.8.0.144-2.1. Here it was compiled with JDK8:
    Code:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.9.9
    Created-By: 1.8.0_144-b01 (Oracle Corporation)
    Specification-Title: Apache Tomcat
    Specification-Version: 8.0
    Specification-Vendor: Apache Software Foundation
    Implementation-Title: Apache Tomcat
    Implementation-Version: 8.0.44
    Implementation-Vendor: Apache Software Foundation
    X-Compile-Source-JDK: 1.7
    X-Compile-Target-JDK: 1.7
    I copied jars from /usr/share/tomcat/lib/ folder of Tumbleweed 20170904 to Tumbleweed 20171028 installation and Tomcat starts working properly.

    Regards,
    Karol

  2. #2
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: Tomcat not working with Java 1.8

    Tumbleweed switched to Java9 as default a few weeks ago so it's logical the .jars were compiled against it.

    You could rebuild it against Java8 in the OBS in case you absolutely require the old JDK for compatibility reasons.
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  3. #3

    Default Re: Tomcat not working with Java 1.8

    Yes, it is logical the .jars were compiled against java 1.9. But they were compiled with Compile-Target-JDK 1.7, so they should work with Java 1.7 and 1.8.
    I think the problem is with OpenJDK 9 and/or in Tomcat, not with Tumbleweed.

    Thank you.

  4. #4
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: Tomcat not working with Java 1.8

    You're absolutely right.

    Please open a bug at the openSUSE Bugzilla vs Tumbleweed distribution and explain the issue with logfiles at; https://bugzilla.opensuse.org/index.cgi

    You can use the same login credentials as here in the forums.
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  5. #5
    Join Date
    Jun 2008
    Location
    Earth,Germany
    Posts
    14

    Default Re: Tomcat not working with Java 1.8

    Hello!
    I'm testing one of our JEE projects (Netbeans, JSF 2.2, primefaces 6.2, Java Platform JDK 1.8, Source format JDK8) on different systems and stumbe here:

    tomcat 9.0.5-1.1
    openJDK 8 1.8.0.161-2.1
    openSUSE Tumbleweed" # VERSION="20180410"

    all say 'plain installation'

    tomcat and the application starts but as soon as i'll try to connect the catalina log gives me a lot:
    ...
    java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
    ...
    java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
    ...
    And no client view -

    I'll find no other posts - only this - is there a solution or shuold this (tumbleweed, tomcat 9, openjdk 8) work?
    (i find no 'tomcat jdk' labeled items in bugzill.opensuse - ?)


    Thanks!

  6. #6
    Join Date
    Jun 2008
    Location
    Earth,Germany
    Posts
    14

    Default Re: Tomcat not working with Java 1.8

    crosschecks:

    same project (see above) - identical *.war on

    tomcat 8.0.50-12.1
    openJDK 1.8.0.161-21.1
    openSUSE Leap VERSION="42.3"

    same project (see above) - downsized to Source/Binary Format to JDK 7

    tomcat 7.0.65
    JRE java-1_7_1-ibm
    SLES 11.4


    both working fine without errors

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: Tomcat not working with Java 1.8

    Quote Originally Posted by menges View Post

    I'll find no other posts - only this -
    And this thread is not exactly your case. Thus you better start a new thread. That will show your problem as e new one for those who are looking for new problems where they can help witth. Hanging your problem at the end of a long solved one is not the best place for the exposure you need.

    Thus create a new thread with a good telling title. Best chance to get help.

    (This thread will be CLOSED to avoid confusion).
    Last edited by hcvv; 13-Apr-2018 at 03:48.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •