Giter VIP home page Giter VIP logo

arquillian-container-tomcat's People

Contributors

aduprat avatar aslakknutsen avatar bartoszmajsak avatar brmeyer avatar cabledave avatar dadrus avatar dependabot-preview[bot] avatar dependabot[bot] avatar deruelle avatar ge0ffrey avatar ianbrandt avatar johntbush avatar kpiwko avatar manovotn avatar matousjobanek avatar mkouba avatar mojavelinux avatar ondrazizka avatar pmuir avatar rhusar avatar sfcoy avatar starksm64 avatar tommysdk avatar tremes avatar trepel avatar vineetreynolds avatar vjuranek avatar zhfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arquillian-container-tomcat's Issues

Tomcat 7 managed NPE

If you set catalinaHome in arquillian.xml to your tomcat installation, you need to set catalinaBase as well. If not a NPE is thrown since in TomcatManagedContainer is executed next line, and CATALINA_BASE is not set.

final String absoluteCatalinaBasePath = new File(CATALINA_BASE).getAbsolutePath();

I think that we could modify this so in case catalinaHome property is set in arquillian.xml but system property not set to CATALINA_BASE, then CATALINA_BASE could be directly the value set in catalinaHome arquillian property.

Support for embedded Tomcat for EE 10

Tomcat has version 10.1 which seems to be EE 10 oriented.
There are some Jakarta EE dependency updates, as well as updates and potential changes to Tomcat APIs.

We can either update existing module or create a new one.
Personally, I wouldn't mind updating existing one because EE 99 setup isn't as interesting (having only the namespace change, it was basically just a stepping stone for EE 10).

Documentation

Where can I find documentation about how to play with Arquilian in embedded tomcat?

Restore managed version

For some unclear reasons (to me and also not apparent from the commit/issue) also the manage version has been removed from the main branch.

The managed version seems to be the most useful to me and should be restored for this project to be useful.

Moreover, this doesn't appear to me that it needs to be specific to the tomcat version. Moreover, elsewhere, I am consuming the 1.1.0.Final and tomcat-managed-8 part of the project to manage tomcat 10.1 instances.

Support for remote Tomcat 8.5.x.

Issue Overview

Support for remote Tomcat 8.5.x.

Expected Behaviour

The current arquillian-tomcat-remote-7 works with Tomcat 8.0.x, but it fails to deploy the WAR into Tomcat 8.5.x.

Current Behaviour
Steps To Reproduce
  1. Go into tomcat-remote-7 dir
  2. Change the Tomcat version to 8.5.x
diff --git a/tomcat-remote-7/pom.xml b/tomcat-remote-7/pom.xml
index c6f62d4..a31aac0 100755
--- a/tomcat-remote-7/pom.xml
+++ b/tomcat-remote-7/pom.xml
@@ -15,8 +15,8 @@
   <name>Arquillian Tomcat Remote 7.x Container</name>
 
   <properties>
-    <tomcat.major.version>7</tomcat.major.version>
-    <tomcat.version>${tomcat.major.version}.0.73</tomcat.version>
+    <tomcat.major.version>8</tomcat.major.version>
+    <tomcat.version>${tomcat.major.version}.5.13</tomcat.version>
   </properties>
 
   <dependencies>
  1. Run the build with mvn clean install -> expect test failures
Additional Information

Stacktrace from one the test failures encountered.

org.jboss.arquillian.container.spi.client.container.DeploymentException: Unable to deploy an archive register-rest-1.0.war
	at org.jboss.arquillian.container.tomcat.remote.TomcatRemoteContainer.deploy(TomcatRemoteContainer.java:123)
	at org.jboss.arquillian.container.tomcat.remote.Tomcat7RemoteContainer.deploy(Tomcat7RemoteContainer.java:33)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
.......
Caused by: java.io.IOException: Error writing request body to server
	at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3518)
	at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3501)
	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
	at org.jboss.arquillian.container.tomcat.IOUtil.copy(IOUtil.java:126)
	at org.jboss.arquillian.container.tomcat.TomcatManager.execute(TomcatManager.java:204)
	at org.jboss.arquillian.container.tomcat.TomcatManager.deploy(TomcatManager.java:87)
	at org.jboss.arquillian.container.tomcat.remote.TomcatRemoteContainer.deploy(TomcatRemoteContainer.java:121)
	at org.jboss.arquillian.container.tomcat.remote.Tomcat7RemoteContainer.deploy(Tomcat7RemoteContainer.java:33)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)
	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)
.......

JVM is terminated due to unsupported configuration flag -Djava.endorsed.dirs (โ‰ฅ JDK 9)

Hi,

starting from Java 9 and onwards the JVM configuration flag java.endorsed.dirs was removed. This configuration flag is currently used for the Tomcat container and causes the JVM to terminate with the following message:

$JAVA_HOME/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Cheers,
Tassilo

tomcat-remote-7 service not declared properly

META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension

It contains
org.jboss.arquillian.container.tomcat.remote_6.TomcatRemoteExtension

it should be
org.jboss.arquillian.container.tomcat.remote_7.TomcatRemoteExtension

Automatically use free Port

Hi, is it possible to adjust plugin, so it allows automatic search for a free port?
The org.apache.catalina.startup.Tomcat class allows this by passing 0 as port:

tomcatServer.setPort(0);
try {
    tomcatServer.start();
    assertThat(tomcatServer.getConnector().getLocalPort()).isGreaterThan(0);
} 
catch (LifecycleException e) {
    fail("Failed to start Tomcat server");
}

When i pass 0 in setup(TomcatConfiguration) the TomcatContainer::start method will pass 0 to Tomcat and Tomcat identifies any free port. Checking tomcat.getConnector().getLocalPort() after tomcat.start() give me the free port.

But in the TomcatContainer::deploy method, the original port 0 is passed to create a HTTPContext.

Is it possible to change this to new HTTPContext(tomcat.getHost().getName(), tomcat.getConnector().getLocalPort()); so it uses the port used by tomcat?

We are using the tomcat-embedded-8 version of the plugin.

Refactor main branch to only have jakarta.servlet

We have too many versions of Tomcat in here to maintain effectively, and with the javax.servlet to jakarta.servlet split, there is a natural point to separate legacy vs active. We need to move the javax.servlet based containers to a new branch and have main target jakarta.servlet with only Tomcat 10.1 and higher.

Add Tomcat 10 Embedded module

For Weld servlet testing, we've been consuming the embedded module. With Jakarta EE 9, tooling breaks due to namespace changes.

There is now Tomcat 10 (not yet final) which uses EE 9 so I've been experimenting with what needs to be done with regards to Arq-Tomcat setup.
The main issue is that it needs to use the newly created jakarta CDI test enricher instead of the old one. However, the old one gets inherited from the project hierarchy so it will need to be tweaked or excluded.

Running on snapshot of Arq. core with changes mentioned in arquillian/arquillian-core#248 and on snapshot of this repo's tomcat 9 profile adapted, I can execute Weld's Tomcat servlet testing (with only 1 failure which is related to JSF setup).

If my understanding is correct, then this project uses Arq. core servlet protocol and the aforementioned test enrichers, hence we will need a release of Arq. core with fix to arquillian/arquillian-core#248 before we can resolve this issue.

Correct solution here would be to introduce a separate module that will handle Tomcat 10+ and avoid inheriting obsolete artifacts.

Update Weld 5 version, re-add tests

As part of #87 we need to set Weld 4 version to Weld 3 just to be able to compile and build. This also requires us to temporarily remove Tomcat10EmbeddedInContainerIT which I could only test with snapshots.

We should update to Weld 4 Alpha4 once it is out.
The linked PR contains a separate commit which removes the test - we can revert that one to easily bring back the test.

setting bindHttpPort to 0 crashes Arquillian

Hi,

I wanted to use embedded-tomcat + Arquillian in my integration tests. Everything was fine when I ran the tests with only one process and the bindHttpPort was set to a reasonable number (12345, to be exact). However, as the number of tests grew, it became important to run the tests in parallel. Tomcat itself will pick a random port number if the port number is set to 0, which motivated me to set bindHttpPort to 0 in the first place. However, after doing that, I got a stacktrace like below:

java.net.NoRouteToHostException: Can't assign requested address
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.execute(ServletMethodExecutor.java:206)
        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.access$000(ServletMethodExecutor.java:43)
        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor$1.run(ServletMethodExecutor.java:99)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

It appears to me that Arquillian uses the hard-coded bindHttpPort (i.e., 0) to invoke ServletMethodExecutor.execute, which apparently won't work in this case.

So, is it possible to work around that? I am looking for a solution in which I can have Tomcat to use a random port, then retrieve it programmatically, and use it to construct url in the tests.

Thank you very much.

Tests failed when upgrading to 10.1.x

Issue Overview

I maintained a starter template project for Jakarta EE 9 servlet container, and initially I used Apache Tomcat 10.0.x, all tests(very simple) worked well.

But when the Tomcat is upgraded to 10.1.x by dependabot, there is a test failed to pass.

Expected Behaviour

working well with Tomcat 10.1.x

Current Behaviour

Failed.

Steps To Reproduce
  1. Clone https://github.com/hantsy/jakartaee9-servlet-starter-boilerplate
  2. mvn clean verify -Pit-tomcat
Additional Information

The error stack on Github actions, https://github.com/hantsy/jakartaee9-servlet-starter-boilerplate/actions/runs/3851795673/jobs/6563339110

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.