-
15. Re: Weld and Jersey web framework problem.
veeramarni84 May 13, 2013 3:36 AM (in response to w0203j)I also have same issue when using jersey, bean.xml with Jboss 7.1.1. Is there a fix to it?
-
16. Re: Weld and Jersey web framework problem.
veeramarni84 May 13, 2013 5:22 PM (in response to veeramarni84)Finally the issue is resolved. Need to add below system config to the JVM.
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"
-
17. Re: Weld and Jersey web framework problem.
w0203j May 14, 2013 3:25 AM (in response to veeramarni84)Hi Veera,
Thanks for your sharing, Finally I can deploy jersey into JBoss 7.1.1 now.
But I seem getting some null pointer exception when invoking the rest services if the root path class has @EJB injection.
By the look of it failed the CDI injection for some reason.
Can you please try inject EJB or some other managed bean into the rest class and invoke it?
Below are the errors I am getting:
When I invoke below:
@EJB(beanName = "TradingPartnerDAOImpl")
private TradingPartnerDAO tpDAO;
@GET
@Path("/Display")
@Produces("text/html")
public String displayTP() {
String result = "<html><body>";
listOFTPinRep = tpDAO.getAllTP(); (line 114)
I am getting:
17:18:38,627 SEVERE [com.sun.jersey.spi.container.ContainerResponse] (http--0.0.0.0-8080-1) The RuntimeException could not be mapped to a response, re-thro
wing to the HTTP container: java.lang.NullPointerException
at package.path.name.TPRepository.displayTP(TPRepository.java:114) [webservices-0.0.1-SNAPSHOT-classes.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_33]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_33]
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchP
rovider.java:185) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [jersey-server-1.17
.1.jar:1.17.1]
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [jersey-server-1.17.1.jar:1.17.1]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-servlet-1.17.1.jar:1.17.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [jersey-servlet-1.17.1.jar:1.17.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [jersey-servlet-1.17.1.jar:1.17.1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10
-
18. Re: Weld and Jersey web framework problem.
mfalzetta Dec 5, 2013 3:09 PM (in response to w0203j)Hi @Jun Wang,
I have the same issue. U fix your code? U can explain how to?
Thanks.
-
19. Re: Weld and Jersey web framework problem.
w0203j Apr 12, 2014 9:57 PM (in response to mfalzetta)No I still couldn't fix this issue and actually switched to JBoss resteasy. All seems working without issue.
Not sure if the latest 1.18.1 version Jersey fix this or not. Can you give it a try and let me know? Thanks.