[JBoss Seam] - Unable to use @Asynchronous annotation on Glassfish server
by usedtoclimb
When I attempt to use the @Asynchronous annotation as described in the reference manual (section 17.1.1. Asynchronous methods) I receive an InstatiationException with the message "Could not instantiate Seam component: org.jboss.seam.core.dispatcher". I have narrowed down the issue as follows:
Asynchronous method in interface SystemManager.java
| @Asynchronous
| public void asyncTest();
Implemented in SystemManagerBean.java
| public void asyncTest(){
| System.out.println("This is a test of async method.");
| }
Called from Manager.xhtml
| <br/><h:commandButton value="Call Async Test" action="#{systemManager.asyncTest}" />
Dispatcher added to Components.xml
| <core:dispatcher/>
I am using Seam 1.2.1 on a Glassfish server. I am able to use a commandButton to call other methods in the same bean from the same jsf page, but when I call the "asyncTest()" method I get the stack trace shown below.
Any suggestions are appreciated.
org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
javax.faces.el.EvaluationException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
...etc...
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at org.jboss.seam.Component.newInstance(Component.java:1740)
at org.jboss.seam.Component.getInstance(Component.java:1643)
at org.jboss.seam.Component.getInstance(Component.java:1610)
at org.jboss.seam.Component.getInstance(Component.java:1589)
at org.jboss.seam.Component.getInstance(Component.java:1584)
at org.jboss.seam.core.Dispatcher.instance(Dispatcher.java:238)
at org.jboss.seam.interceptors.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:26)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
at org.javassist.tmp.java.lang.Object_$$_javassist_3.asyncTest(Object_$$_javassist_3.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
... 57 more
Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/env/mlm-ear-1.0/Dispatcher/local [Root exception is java.lang.NullPointerException]
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.seam.Component.instantiateSessionBean(Component.java:1107)
at org.jboss.seam.Component.instantiate(Component.java:1093)
at org.jboss.seam.Component.newInstance(Component.java:1736)
... 75 more
Caused by: java.lang.NullPointerException
at com.sun.ejb.EJBUtils.resolveEjbRefObject(EJBUtils.java:296)
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:945)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
... 80 more
#{systemManager.asyncTest}: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
javax.faces.FacesException: #{systemManager.asyncTest}: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
...etc...
Caused by: javax.faces.el.EvaluationException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
... 56 more
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at org.jboss.seam.Component.newInstance(Component.java:1740)
at org.jboss.seam.Component.getInstance(Component.java:1643)
at org.jboss.seam.Component.getInstance(Component.java:1610)
at org.jboss.seam.Component.getInstance(Component.java:1589)
at org.jboss.seam.Component.getInstance(Component.java:1584)
at org.jboss.seam.core.Dispatcher.instance(Dispatcher.java:238)
at org.jboss.seam.interceptors.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:26)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
at org.javassist.tmp.java.lang.Object_$$_javassist_3.asyncTest(Object_$$_javassist_3.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
... 57 more
Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/env/mlm-ear-1.0/Dispatcher/local [Root exception is java.lang.NullPointerException]
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.seam.Component.instantiateSessionBean(Component.java:1107)
at org.jboss.seam.Component.instantiate(Component.java:1093)
at org.jboss.seam.Component.newInstance(Component.java:1736)
... 75 more
Caused by: java.lang.NullPointerException
at com.sun.ejb.EJBUtils.resolveEjbRefObject(EJBUtils.java:296)
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:945)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
... 80 more
executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@2e8c5c) threw exception
javax.faces.FacesException: #{systemManager.asyncTest}: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.dispatcher
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
...etc...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115134#4115134
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115134
18 years, 4 months
[JBoss Seam] - resetting/clearing a session scoped SFSB
by asookazian
I have a conversation scoped SFSB which has a session scoped SFSB injected into it as follows:
@In(create=true)
| private NoteLocal noteAction;
In my xhtml, there is a h:selectOneMenu coded as follows:
| <h:form id="peerForm">
| <h:selectOneMenu id="selectPeer" value="#{peerAction.employeeId}">
| <a4j:support event="onchange"
| onchange="changePeer()"/>
| <f:selectItems value="#{peerAction.peers}" />
| </h:selectOneMenu>
| </h:form>
The javascript function changePeer() does the following:
| function changePeer() {
| Richfaces.showModalPanel('mpChangePeer',{width:450, top:200});
| }
And the modalPanel is as follows:
| <rich:modalPanel id="mpChangePeer" minHeight="200" minWidth="450"
| height="500" width="500" zindex="2000">
|
| <f:facet name="header">
| <a4j:outputPanel>
| <h:outputText id="mpChangePeerWarning" value="Warning"/>
| </a4j:outputPanel>
| </f:facet>
|
| <a4j:form id="a4jChangePeer">
| <h:outputText value="Are you sure you want to switch to a peer? You will lose all unsaved changes."/>
| <BR/>
| <h:panelGrid columns="2">
| <a4j:commandButton value="Continue"
| action="#{securityAuditAction.findAuditList}"
| onclick="Richfaces.hideModalPanel('mpChangePeer')"
| ajaxSingle="true"
| reRender="mainForm"/>
| <BR/>
| <a4j:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('mpChangePeer')"/>
| </h:panelGrid>
| </a4j:form>
|
| </rich:modalPanel>
My question is when the user clicks 'Continue' button, I need to reset and/or clear and/or instantiate a new instance of the session scoped SFSB so that the data is fresh/clear and data shows properly in the dataTable of the main form.
What is the best way to do this in Seam?
The other question (which I may post on richfaces forum) is that if they click 'Cancel' then I need to reset to h:selectOneMenu value to the previous value. How do I do this? thx.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115132#4115132
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115132
18 years, 4 months
[JBoss Seam] - Re: A customer JSF tag to display Graphics2D in Seam PDF out
by EricJava
"norman.richards(a)jboss.com" wrote : I couldn't think of a good name. Component is too generic. JSF component. AWT component. Seam component? To me "swing" is synonymous with Java GUI components. So p:swing, despite not being technically correct, seemed to me to be the only thing captured the idea of a GUI component being inserted. I'm still open to suggestions.
Ok, swing is fine. You're right, Component is used in every other sentences when talking about Java anything.
"norman.richards(a)jboss.com" wrote : BTW, the problem with the LAF wasn't just that the components were being rendered differently but that they weren't being rendered at all with the default LAF on my machine. That's very troubling because it means none of this is guaranteed to work out of the box.
Hmm. What kind of machine? I only have Linux machines here so that's all I've tested on. As you say, anyone using Swing JComponents is going to want to set the LAF to something that looks more generic or cross-platform. I don't know what's the right way (the "Seam way") of doing that. Could there be a setting for Swing UI LaF in the components.xml file?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115125#4115125
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115125
18 years, 4 months
[JBoss Portal] - Re: CMS security not working
by DanielGallot
anonymous wrote : anonymous wrote :
| | But there is another effect I don't understand : "myRole" got read access to "/MyTopDirectory/TheUsableDirectory" and not to other directories where it has not been granted write access. Specifying 'write' access to '/TheUsableDirectory' should recurse to other directories under '/TheUsableDirectory', and since write implies read, you should have 'read' access there. *Except ofcouse if you specifically specify permissions on nodes under this, which override the recursing permissions*
| Are you overriding the recursing permissions the nodes?
OK, I understand why "myRole" get read access to '/TheUsableDirectory' (hence we should have write access), but I don't understand why it has not read access on '/TheUsableDirectory2' since it has read access to "/".
I am not overriding more than what I describe.
anonymous wrote : Reason I ask is if you grant read access to 'MyTopDirectory" but no access to '/', then you will not get access to 'MyTopDirectory' for obvious security reasons. Permissions only recurse down the tree, not up the tree.
|
OK I have to grant read access to "/".
anonymous wrote : for myRole2 who needs write access to /MyUsableDirectort2 but only read access to /MyUsableDirectory, then for permissions on /MyUsableDirectory make sure you grant this role atleast *read access*
In fact I don't want to grant "myRole2" with read access to /MyUsableDirectory.
But when "overriding the recursing permissions" happens ? As soon as you make one change for a given role in whatever directory ? That would explain why the read access is no more available to '/TheUsableDirectory2'....
Thanks and Merry christmas you too. I am on holidays now until 02/01/2008.
Happy to read you next year !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115112#4115112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115112
18 years, 4 months
[JBoss Portal] - Re: CMS security not working
by sohil.shah@jboss.com
anonymous wrote :
| But there is another effect I don't understand : "myRole" got read access to "/MyTopDirectory/TheUsableDirectory" and not to other directories where it has not been granted write access.
|
btw, one more thing, if you are overriding the recursing permissions, which looks like you are, then
for myRole2 who needs write access to /MyUsableDirectort2 but only read access to /MyUsableDirectory, then for permissions on /MyUsableDirectory make sure you grant this role atleast *read access*
same goes for myRole getting read/write on MyUsableDirectory - specify write access for it there
and myRole getting read on MyUsableDirectory - specify read access for myRole on that, not write access
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115109#4115109
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115109
18 years, 4 months