[
https://issues.jboss.org/browse/SEAMSERVLET-32?page=com.atlassian.jira.pl...
]
Dan Allen commented on SEAMSERVLET-32:
--------------------------------------
Thanks for the find. We'll take a look.
As a general rule, if you are tempted to return null from a scoped producer method,
consider that you probably want to throw an exception to say that you are using the
producer outside of it's intended context. That is, if that is actually the case.
I'll pass this info on once we resolve this issue.
ImplicitHttpServletObjectsProducer.getHttpServletResponse() returns
null
------------------------------------------------------------------------
Key: SEAMSERVLET-32
URL:
https://issues.jboss.org/browse/SEAMSERVLET-32
Project: Seam Servlet
Issue Type: Bug
Components: Catch Integration
Affects Versions: 3.0.0.CR3
Environment: Seam Servlet 3.0.0.CR3
Reporter: Jozef Hartinger
Priority: Blocker
Fix For: 3.0.0.Final
To reproduce:
1.) download the Seam 3.0.0.CR3 dist bundle
2.) deploy the catch-basic-servlet module to JBoss AS 6
3.) visit
http://localhost:8080/catch-basic-servlet/
4.) The exception below occurs when following any of these links:
http://localhost:8080/catch-basic-servlet/Navigation/NullPointerException
http://localhost:8080/catch-basic-servlet/Navigation/WrappedIllegalArg
http://localhost:8080/catch-basic-servlet/Navigation/IOException
{code}
org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a
non-dependent producer method: [method] @Produces @Typed @RequestScoped protected
org.jboss.seam.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletResponse()
org.jboss.weld.bean.AbstractProducerBean.checkReturnValue(AbstractProducerBean.java:256)
org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:362)
org.jboss.weld.context.AbstractContext.get(AbstractContext.java:121)
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87)
org.jboss.weld.proxies.org$jboss$weld$beanProducerMethod-org$jboss$seam$servlet$http$ImplicitHttpServletObjectsProducermethod_getHttpServletResponse()_$$_WeldClientProxy.toString(org$jboss$weld$beanProducerMethod-org$jboss$seam$servlet$http$ImplicitHttpServletObjectsProducermethod_getHttpServletResponse()_$$_WeldClientProxy.java)
java.lang.String.valueOf(String.java:2826)
java.lang.StringBuilder.append(StringBuilder.java:115)
org.jboss.seam.solder.reflection.Reflections.buildInvokeMethodErrorMessage(Reflections.java:399)
org.jboss.seam.solder.reflection.Reflections.invokeMethod(Reflections.java:547)
org.jboss.seam.solder.reflection.Reflections.invokeMethod(Reflections.java:458)
org.jboss.seam.solder.reflection.annotated.InjectableMethod.invoke(InjectableMethod.java:187)
org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:169)
org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:83)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:611)
org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:604)
org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:598)
org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:74)
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira