-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
jetty-maven-plugin doesn't work as expected with Weld CDI #10895
Comments
First things I noticed in your question ...
Double check that XML, it looks bad / invalid. |
Also, as far as Weld versions go ... For Jetty 10.x you would use Weld 3.1.x |
That doesn't work for us. Your code is using Also, AFAIK, Weld 4 and Weld 5 do not support the older |
Yeah ...
|
Thank you, @joakime, for taking a look into it.
Yes, indeed, the formatting was damaged by the Grammarly plugin in the message (it capitalized Jetty in all places).
Sorry for misleading, the link should be to specific brunch which uses Jetty 11. I have updated it with Jetty 12 in my fork, you can start with it https://github.com/astappiev/primefaces-test/tree/jetty12 |
Looks like weld is attempting to use the old school ServletContainerInitializer
This This "more" is solved by the Jetty generic CDI initialization (works with weld and openweb). You can find that in the This will cause 2 things to happen.
[joakim@hyperion astappiev-primefaces-test][jetty12*]$ git branch -v
* jetty12 b84d27f chore: remove unnecessary web.xml filtering
master 5423124 Bump jetty-maven-plugin from 9.4.50.v20221201 to 9.4.51.v20230217 (#242)
[joakim@hyperion astappiev-primefaces-test][jetty12*]$ git diff
diff --git a/pom.xml b/pom.xml
index 2d54e13..5da52f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,6 +95,13 @@
<idleTimeout>60000</idleTimeout>
</httpConnector>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee10</groupId>
+ <artifactId>jetty-ee10-cdi</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ </dependencies>
</plugin>
</plugins>
</build> This should work for you. Keep in mind that on weld, there's multiple ways it can be initialized. See our testcase for possible webapp setups on weld (and the comments indicating the pros / cons of each setup) |
Thank you very much, that solved my issue. |
I have created a similar issue on Weld tracker before, and they pointed me out to these two discussions, which adds a little more light to this topic: |
Jetty version(s)
11.0.18 and 12.0.3
Jetty Environment
ee10
Java version/vendor
(use: java -version)
openjdk version "21" 2023-09-19 LTS
OpenJDK Runtime Environment Corretto-21.0.0.35.1 (build 21+35-LTS)
OS type/version
Win 11
Description
I'm trying to use
jetty-maven-plugin:11.0.18
/jetty-ee10-maven-plugin:12.0.3
withweld-servlet-core:5.1.2.Final
and according to Weld documentation it should be working out of the box:But it doesn't work as expected, the log says:
When I set it manually to Jetty:
It tries to read
org.eclipse.jetty.webapp.DecoratingListener
, which is empty. Before, it also readsorg.eclipse.jetty.cdi
which is also empty.and ended up with
Of course, I tried other options mentioned in Weld's documentation
<modules>cdi-decorate</modules>
doesn't change anythingjakarta.enterprise.inject.spi.BeanManager
is empty.I would be glad to receive some feedback and ideas on where to look, it seems like Jetty does not initialise SPI.
How to reproduce?
https://github.com/astappiev/primefaces-test/tree/jetty12 can be used as a reproducer; when the server starts, it prints that no servlet container is detected.
The text was updated successfully, but these errors were encountered: