[JBoss Seam] - Conversational ?
by lcoetzee
Hi,
we have a problem that used to be addressed by @Conversational. However with Seam 2 I am not sure how to address it. The scenario:
I have a current long running conversation. During this conversation a page (view.xhtml) is displayed. view.xhtml contains an s:link with an action in a stateful bean:
<s:link action="#{contentManagementBean.editContent}"
| id="editContents"/>
Based on the outcome of editContent the pages.xml displays the appropriate edit page.
The stateful bean has an @In(required=true)
| @In(required = true,value="selectedGroupingForView")
| @Out(required=true)
| private Grouping selectedGroupingForView;
However, a problem occurs when the long running conversation expires, the various elements in the conversation context are removed, and when the uses then selects the s:link. Obviously the stateful bean cant inject the "required" values, which results an exception.
Is there anyway to protect/prevent this type of problem ?
Thanks
Louis
| Caused by org.jboss.seam.RequiredException with message: "In attribute requires non-null value: contentManagementBean.selectedGroupingForView"
|
| org.jboss.seam.Component.getValueToInject(Component.java:2164)
| org.jboss.seam.Component.injectAttributes(Component.java:1594)
| org.jboss.seam.Component.inject(Component.java:1415)
| org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:45)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:54)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
| sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:597)
| org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
| org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
| $Proxy160.editContent(Unknown Source)
| 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.seam.util.Reflections.invoke(Reflections.java:21)
| org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
| org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
| org.javassist.tmp.java.lang.Object_$$_javassist_26.editContent(Object_$$_javassist_26.java)
| 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.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
| org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
| org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
| org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
| org.jboss.seam.navigation.Pages.callAction(Pages.java:620)
| org.jboss.seam.navigation.Pages.preRender(Pages.java:289)
| org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:543)
| org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:455)
| org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
| org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
| com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
| com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
| org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| java.lang.Thread.run(Thread.java:619)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076672#4076672
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076672
18Â years, 8Â months
[EJB 3.0] - Re: compounded primary key with ejb 3.0
by jfheintz
Here it is, and many thanks for your help
/////////////////// BrowserStatEJB3 /////////////////////
@javax.persistence.Entity
@javax.persistence.IdClass(BrowserStatPK.class)
@javax.persistence.Table(name="SI_BROWSERSTAT")
public class BrowserStatEJB3 {
private BrowserStatPK pk;
@javax.persistence.Column(name="view")
private int view;
@javax.persistence.Id
@javax.persistence.Column(name="timeUnit_timeUnitId", nullable=false, updatable=false, insertable=false)
private java.lang.Long timeUnitTimeUnitId;
@javax.persistence.ManyToOne(fetch = javax.persistence.FetchType.LAZY)
@javax.persistence.JoinColumn(name="timeUnit_timeUnitId")
private com.statinfo.stat.data.timeUnit.TimeUnitEJB3 timeUnit;
@javax.persistence.Id
@javax.persistence.Column(name="site_siteId", nullable=false, updatable=false, insertable=false)
private java.lang.Long siteSiteId;
@javax.persistence.ManyToOne(fetch = javax.persistence.FetchType.LAZY)
@javax.persistence.JoinColumn(name="site_siteId")
private com.statinfo.stat.data.site.SiteEJB3 site;
@javax.persistence.Id
@javax.persistence.Column(name="browserDesc_browserDescId", nullable=false, updatable=false, insertable=false)
private java.lang.String browserDescBrowserDescId;
@javax.persistence.ManyToOne(fetch = javax.persistence.FetchType.LAZY)
@javax.persistence.JoinColumn(name="browserDesc_browserDescId")
private com.statinfo.stat.data.parameter.browserDesc.BrowserDescEJB3 browserDesc;
public BrowserStatEJB3() {
}
public BrowserStatPK getPk() {
return this.pk;
}
public void setPk(BrowserStatPK pk) {
this.pk=pk;
}
public int getView() {
return this.view;
}
public void setView(int value) {
this.view=value;
}
}
/////////////////// BrowserStatPK /////////////////////
public class BrowserStatPK implements java.io.Serializable {
final static long serialVersionUID = 1L;
private transient int _hashCode = 0;
public java.lang.Long timeUnitTimeUnitId;
public java.lang.Long siteSiteId;
public java.lang.String browserDescBrowserDescId;
public BrowserStatPK() {
}
public BrowserStatPK( java.lang.Long timeUnitTimeUnitId, java.lang.Long siteSiteId, java.lang.String browserDescBrowserDescId) {
this.setTimeUnitTimeUnitId(timeUnitTimeUnitId);
this.setSiteSiteId(siteSiteId);
this.setBrowserDescBrowserDescId(browserDescBrowserDescId);
}
.. getter + setter ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076667#4076667
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076667
18Â years, 8Â months
[JBoss Seam] - does seam support authenticate from get parameter?
by chibi
i have a empty ssoLogin.xhtml
and a ssoLogin.page.xml like this
| <page>
| <navigation from-action="#{identity.login}">
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/home.xhtml" />
| </rule>
| </navigation>
| </page>
|
and my authenticator is
| ......
| @RequestParameter private Integer userid;
| public boolean authenticate()
| {
| log.info("authenticating #0", userid);
| if(userid != null && userid > 0){
| user = entityManager.find(User.class, userid);
| facesMessages.add("found user = " + user);
| if(user == null){
| facesMessages.add("login failed");
| return false;
| }else{
| facesMessages.add("login success");
| identity.addRole("user");
| return true;
| }
| }else{
| facesMessages.add("userid empty");
| return false;
| }
| }
|
then i try to open ssoLogin.seam?userid=1, it will show me the empty file without running authenticate function(no log info, no message, jpda trigger did not engage)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076664#4076664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076664
18Â years, 8Â months
[JBoss jBPM] - Re: seem a new bug on TaskMgmtInstance to removeSignalling o
by holly77
I encountered the same problem an will create a JIRA issue for it:
I think there is a bug in TaskMgmtinstance.removeSignalling(Token token) of jBPM versions 3.1.4 and 3.2:
| /**
| * removes signalling capabilities from all task instances related to the given token.
| */
| public void removeSignalling(Token token) {
| if (taskInstances!=null) {
| Iterator iter = taskInstances.iterator();
| while (iter.hasNext()) {
| TaskInstance taskInstance = (TaskInstance) iter.next();
| taskInstance.setSignalling(false);
| }
| }
| }
|
So when ending a Token this method is called for the Token to be ended.
But as you can see signalling is set to false for all TaskInstances that are in the current TaskMgmtInstance.
It has to be checked, that signalling is removed only from TaskInstances belonging to the given Token, i.e.
| /**
| * removes signalling capabilities from all task instances related to the given token.
| */
| public void removeSignalling(Token token) {
| if (taskInstances!=null) {
| Iterator iter = taskInstances.iterator();
| while (iter.hasNext()) {
| TaskInstance taskInstance = (TaskInstance) iter.next();
| /****************************************************************************************/
| // check, that signalling is removed only from TaskInstances belonging to the given Token
| /****************************************************************************************/
| if(taskInstance.getToken.getId() == token.getId)
| taskInstance.setSignalling(false);
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076659#4076659
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076659
18Â years, 8Â months
[JBoss Portal] - Re: LDAP Authentication
by roth
"bdaw" wrote : When you switch identity store to LDAP you need to provide default admin user/role - admin/Admin - for administration. This is needed by CMS.
Is this a hardcoded dependency? I switched to ldap and so far managed to map admin access to one of my ldap roles for 'User Portlet', 'Role Portlet', 'WSRP Portlet' and 'Admin Portlet', but not for CMS.
I am not sure however if this was a good approach, maybe I should just fall back for the database to provide the admin user/role. I get all sorts of weird errors which I think is related to me not having a user/role called 'admin' in my ldap.
Also, when running with ldap like this, the following 7 tables are never generated, which causes more errors:
jbp_endpoint_info, jbp_producer_info, jbp_reg_prop_desc, jbp_reg_prop_desc_aliases, jbp_reg_prop_desc_usages, jbp_reg_property,
jbp_registration_info.
All other tables are generated at the first startup.
Thanks,
Tobias
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076652#4076652
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076652
18Â years, 8Â months