[JBoss Seam] - Caching select items in UISelectItems - Bug?
by kahliburke
Hi,
We found a problem that started occurring in our application when we upgraded to Seam 2.0.0GA. This occurs when using a List to back <s:selectItems> and using an <h:selectOneMenu> (or listbox).
for example using this component:
| @Name("testComp")
| @Scope(ScopeType.CONVERSATION)
| public class TestComp {
|
|
| private List<String> testStrings = new ArrayList<String>();
|
| private String selectedString;
|
| public List<String> getStrings() {
| return testStrings;
| }
|
| public String getSelectedString() {
| return selectedString;
| }
|
| public List<String> getSelectedStrings() {
| return selectedStrings;
| }
|
| public void addString() {
| testStrings.add("String "+testStrings.size());
| }
|
| public void removeString() {
| testStrings.remove(testStrings.size()-1);
| }
|
| public void setSelectedString(String selectedString) {
| this.selectedString = selectedString;
| }
| }
|
|
and for the UI:
| <h:selectOneListbox value="#{testComp.selectedString}">
| <s:selectItems value="#{testComp.strings}" var="str" label="#{str}"/>
| </h:selectOneListbox><br/>
| <h:commandLink value="add" action="#{testComp.addString}"/><br/>
| <h:commandLink value="remove" action="#{testComp.removeString}"/><br/>
|
Note that I'm assuming that this is all happening within a conversation so that the state of TestComp is the same from request to request. The issue appears to be as a result of only conditionally building the list of select items in UISelectItems. Previously they were always rebuilt in getValue. The problem is that the getValue() method is called during the validation phase, and then when it gets called again, the condition:
| if (value == null || originalValue == null || !originalValue.equals(super.getValue()))
| {
|
is always false. This is true because even though an attempt is made to check whether originalValue is different than the superclass' stored value, in this case they will always be the same object instance, the underlying list.
I thought about whether it would be sensible to try to determine whether the contents of the list are the same, but at that point we're reaching diminishing returns if the goal was to reduce the overhead of getValue().
I've worked around this for now by creating a duplicate JSF component class, removing that conditional, and using that instead of <s:selectItems>
Am I making any incorrect assumptions about the way this should all work, or should I enter a bug report for it?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112136#4112136
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112136
18 years, 4 months
[JBoss Portal] - Class Cast Exception - PortletConfigImpl
by robsummitt
I've been moving along developing portlets using 2.6.2, no problems. All of a sudden I'm getting a class cast exception. I haven't added any jars to the server or to my project. I've even tried copying the portlet jars from the portlal.sar/lib and adding them to my project as a fix, still no luck.
Can anyone give a recommendation as to what to try? I've reinstalled a fresh copy of the 2.6.2 bundled with AS, didn't help.
I know it must be a jar conflict somewhere, just can't seem to figure out where. Is it the "portal-portlet-jsr168api-lib.jar" or "portlet-api-lib.jar" files that could be causing this?
Code that throws the exception:
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/view.jsp);
prd.include(rRequest, rResponse);
21:08:27,996 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: org.jboss.portal.portlet.impl.jsr168.api.PortletConfigImpl
Thanks for any help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112134#4112134
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112134
18 years, 4 months
[JBoss Seam] - Exception "No page context active" when DataModel's scope is
by damnh
Please help me, what is cause of this problem???
This is my code
@Stateful
@Name("rms.csvListAction")
@Scope(SESSION)
@Restrict("#{identity.loggedIn}")
public class CsvTemplateListAction extends BaseAction implements
ICsvTemplateListAction {
...................
@DataModel(scope = ScopeType.PAGE)
private List csvTemplates;
...................
}
When I click button logout, this exception throwed in console:
09:09:18,156 WARN [Component] Exception calling stateful session bean default @Remove method: rms.csvListAction
javax.ejb.EJBException: java.lang.IllegalStateException: No page context active
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:97)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
at $Proxy174.destroy(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:40)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_5.destroy(Object_$$_javassist_5.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
at org.jboss.seam.Component.callDefaultRemoveMethod(Component.java:1979)
at org.jboss.seam.Component.destroy(Component.java:1333)
at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:245)
at org.jboss.seam.contexts.ServletLifecycle.endSession(ServletLifecycle.java:129)
at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:49)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:660)
at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1111)
at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.contexts.FacesLifecycle.invalidateSession(FacesLifecycle.java:141)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:118)
at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:497)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
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:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: No page context active
at org.jboss.seam.ScopeType.getContext(ScopeType.java:120)
at org.jboss.seam.Component.injectDataModelSelection(Component.java:1481)
at org.jboss.seam.Component.injectDataModelSelections(Component.java:1470)
at org.jboss.seam.Component.inject(Component.java:1409)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
... 104 more
09:09:18,218 INFO [Contexts] starting up: org.jboss.seam.security.identity
09:09:18,218 INFO [Contexts] starting up: org.jboss.seam.web.session
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112133#4112133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112133
18 years, 4 months