-
Notifications
You must be signed in to change notification settings - Fork 16
Description
I was trying to migrate (or rather reinvigorate) Weld's Jetty servlet testing and see if I can make it work with Jetty 12 EE 10.
[Note that this module has been dead for some long time so I cannot say if this worked with previous versions of jetty.]
In the end I failed to pinpoint the issue and while I think it has to be some silly misconfiguration, I wasn't able to figure this one myself.
If I run any of those tests, I can see following output and exception:
[INFO] --- surefire:3.0.0-M5:test (default-test) @ weld-servlet-test-jetty ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Mar 11, 2024 4:23:05 PM org.jboss.arquillian.container.jetty.embedded_12_ee10.JettyEmbeddedContainer start
INFO: Starting Jetty Embedded Server 12.0.7 [id:702025003]
Mar 11, 2024 4:23:06 PM org.jboss.arquillian.container.jetty.embedded_12_ee10.ArquillianAppProvider createApp
INFO: Webapp archive location: file:/home/manovotn/GitRepo/core/environments/servlet/tests/jetty/target/arquillian-jetty-temp/export1759194290394713801e810e33b-48e1-47e4-bb71-c216da9be638.war
[INFO] Running org.jboss.weld.environment.servlet.test.discovery.scope.CustomNormalScopeDiscoveryTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.026 s <<< FAILURE! - in org.jboss.weld.environment.servlet.test.discovery.scope.CustomNormalScopeDiscoveryTest
[ERROR] org.jboss.weld.environment.servlet.test.discovery.scope.CustomNormalScopeDiscoveryTest.testCustomNormalScope Time elapsed: 0.007 s <<< ERROR!
java.lang.IllegalArgumentException: ArquillianServletRunnerEE9 not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
Mar 11, 2024 4:23:06 PM org.jboss.arquillian.container.jetty.embedded_12_ee10.JettyEmbeddedContainer stop
INFO: Stopping Jetty Embedded Server [id:702025003]
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] CustomNormalScopeDiscoveryTest.testCustomNormalScope » IllegalArgument Arquill...
The good part is that I can see that Jetty is being started and the deployment is created as well.
The bad part is the exception which tells me pretty much nothing - my guess was missing dependencies but the deployment that gets created actually contains the lib/arquillian-jakarta-servlet-protocol.jar which is the dep that should contains the ArquillianServletRunnerEE9 implementation. Upon further browsing, I can see in the deployment that there is the XML mentioning the servlet as well as as the servlet impl.
How to reproduce:
Here's Weld branch that has the changes and can be used to reproduce with following steps.
- Checkout https://github.com/manovotn/core/tree/weld2784
cd coremvn clean install -DskipTests- Run any of the servlet tests under Jetty; below is an example of one of them
mvn clean verify -Dincontainer -Dtest=CustomNormalScopeDiscoveryTest#testCustomNormalScope -f environments/servlet/tests/jetty/pom.xml
- If you want to inspect the deployment created for given test, it's the
warfile undercore/environments/servlet/tests/jetty/target
Versions used:
- Arquillian is 1.8.0.Final
- Arq. container jetty is 2.0.0.Final
- Jetty is 12.0.7
Any thoughts on what I missed and/or misconfigured? :)