I am writing an application using the Restlet framework and I have extended
their Application class's "Finder" to not only create an instance of a
ServerResource (a REST API endpoint), but it also calls
BeanProvider.injectFields() on that ServiceResource instance. The problem
is that when I try to make a call to that endpoint I get the following
error:
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303:
No active contexts for scope type javax.enterprise.context.SessionScoped
at
org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:691)
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:79)
at
org.jboss.weld.bean.proxy.CachedBeanInstance.getInstance(CachedBeanInstance.java:66)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
at
com.codepalousa.restlet.raml.data.ToDoDAO$Proxy$_$$_WeldClientProxy.getAllToDos(Unknown
Source)
at
com.codepalousa.restlet.raml.api.ToDosResource.getAllToDo(ToDosResource.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:524)
I do not have any of my producer methods annotated as either RequestScoped
or SessionScoped, so I do not understand the reason for this error.
The code is available at:
https://github.com/InfoSec812/codepalousa-restlet-raml
Any help would be appreciated!!
Thanks,
Deven