Quick Question Regarding Jetty 9.1 + Weld 2.1.x Initialization
ryanrutan Feb 1, 2014 11:13 PMJust getting into Weld (a bit late to the party, as I've been working for in node.js due to work), but I am running a project that is using Maven + JEE 6 + Jetty 9.1 + Jersey 2.5.1 and I would like to try throw in Weld to get support for CDI-API... specifically the Events Observer/Inject capabilities for messaging.
Here's the problem, I have been running through issue after issue getting things setup. One issue is the HK2 injection scheme in Jersey, which I might have found a work around for (http://stackoverflow.com/questions/17224270/how-to-enable-cdi-inject-in-web-service-jaxrs-jersey-on-java-se-running-griz…) but not confirmed, but the other one is getting Jersey to get setup with the Weld BeanMapper using the Jersey Maven Plugin.
I'm building a toolkit right now that is almost done, that I would like people to be able to simply spin up locally with jetty, but then deploy the WAR to Tomcat or something more Enterprise"y" when its ready for uat etc..
My questions:
- in your opinions is Weld 2.1.2.FINAL + Jersey 9.1 a good permutation of these two? If not, what permutations are the most stable? (I need to use Jersey 2.5.1 with it, and would prefer to keep Servlet 3.0 annotations.)
- I'm running into an odd issue with my jetty-env.xml.
2014-02-01 22:05:51.923:WARN:oejx.XmlConfiguration:main: Config error at <Call class="org.jboss.weld.environment.jetty.WeldDecorator" name="process"><Arg>| <Ref id="webAppCtx"/>| </Arg></Call> java.lang.IllegalStateException: No Method: <Call class="org.jboss.weld.environment.jetty.WeldDecorator" name="process"><Arg>
<Ref id="webAppCtx"/>
</Arg></Call> on class org.jboss.weld.environment.jetty.WeldDecorator in file:/Developer/_workspace/addon/jive-sdk-java-jersey/src/main/webapp/WEB-INF/jetty-web.xml
2014-02-01 22:05:51.923:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@3d2b92fd
java.lang.IllegalStateException: No Method: <Call class="org.jboss.weld.environment.jetty.WeldDecorator" name="process"><Arg>| <Ref id="webAppCtx"/>| </Arg></Call> on class org.jboss.weld.environment.jetty.WeldDecorator
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:738)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfigur
- From what I can tell about this, the config file is telling Jetty to find org.jboss.weld.environment.jetty.WeldDecorator and inject webAppCtx into the static process method. From a quick look at the Weld sources, I see that WeldDecorator.process is in fact public and static. Note: This class in the XML used to be a Weld...Handler of sorts, but that class looks to have been refactored.
Any help someone could give me about finding the right permutation of library versions for the best possible chance at success, as well as helping me understand the issues with the "NoSuchMethod" issue above, it would be greatly appreciated. Excited to give this extension a good kick in the tires, but having a rough time getting started =\
Thanks in advance,
RR