Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Integration Tests] - Replace use of tomcat:7.0.75-jre8 in tests with higher version which can work on JDK 11 #1302

Open
gaol opened this issue Apr 19, 2024 · 4 comments · May be fixed by #1317
Assignees
Labels

Comments

@gaol
Copy link
Collaborator

gaol commented Apr 19, 2024

Issue Overview

We have enforced JDK 11 now, and tomcat:7.0.75-jre8 is widely used in Dockerfile in integration tests. The container starts with JDK8 but will try to load the tests servlets compiled in JDK 11 which will lead to container error:

[🎩 lgao@lins-p1 arquillian-cube]$ curl -i http://localhost:8081/hello/HelloWorld
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 3307
Date: Tue, 16 Apr 2024 04:08:42 GMT
Connection: close

<html><head><title>Apache Tomcat/7.0.75 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - org/arquillian/cube/servlet/HelloWorldServlet has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (unable to load class org.arquillian.cube.servlet.HelloWorldServlet)</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>org/arquillian/cube/servlet/HelloWorldServlet has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (unable to load class org.arquillian.cube.servlet.HelloWorldServlet)</u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.UnsupportedClassVersionError: org/arquillian/cube/servlet/HelloWorldServlet has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (unable to load class org.arquillian.cube.servlet.HelloWorldServlet)
	org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3209)
	org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1373)
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1861)
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:495)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2473)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.lang.Thread.run(Thread.java:745)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/7.0.75 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.75</h3></body></html>

So we need to

Expected Behaviour

No test failures

Current Behaviour

Test fail with exceptions:

[INFO] Running org.arquillian.cube.servlet.HelloWorldServletIT
[ERROR] Tests run: 8, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 1.020 s <<< FAILURE! -- in org.arquillian.cube.servlet.HelloWorldServletIT
[ERROR] org.arquillian.cube.servlet.HelloWorldServletIT.should_parse_and_load_configuration_file -- Time elapsed: 0.037 s <<< ERROR!
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8081/hello/HelloWorld
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at org.arquillian.cube.servlet.HelloWorldServletIT.should_parse_and_load_configuration_file(HelloWorldServletIT.java:54)
Steps To Reproduce
cd arquillian-cube/docker/ftest-docker-compose
mvn clean install -Dfailsafe.groups=org.arquillian.cube.docker.impl.requirement.RequiresDocker
Additional Information
JDK: 11
main branch
@gaol gaol self-assigned this Apr 19, 2024
@gaol
Copy link
Collaborator Author

gaol commented Apr 19, 2024

I see a https://github.com/arquillian/arquillian-container-tomcat/tree/main/tomcat-managed-10 from the coming rquillian-container-tomcat:1.2.1 , maybe we can consider of migrating to use tomcat 10 in Dockerfile for integration tests.

@fabiobrz fabiobrz linked a pull request Oct 7, 2024 that will close this issue
@fabiobrz
Copy link
Collaborator

fabiobrz commented Oct 7, 2024

Should be fixed in #1317

@fabiobrz fabiobrz added the docker label Oct 7, 2024
@fabiobrz
Copy link
Collaborator

fabiobrz commented Oct 7, 2024

Hi @gaol - similar to #1303 and the related #1306 - this issue could be fixed already by #1317, which takes into account latest changes, and also brings fixes and updates which are all relevant to resume proper Docker integration tests.
I took inspiration from your comments and assigned myself to the issues as well.

@fabiobrz fabiobrz self-assigned this Oct 7, 2024
@gaol
Copy link
Collaborator Author

gaol commented Oct 8, 2024

@fabiobrz great job 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants