[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4006) Setting transaction.auto_close_session=true creates "Session is closed" warnings
by Luc DEW (JIRA)
Setting transaction.auto_close_session=true creates "Session is closed" warnings
--------------------------------------------------------------------------------
Key: JBSEAM-4006
URL: https://jira.jboss.org/jira/browse/JBSEAM-4006
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.0.SP1
Environment: Seam 2.1.0.SP1
Spring 2.5.5
Seam Managed Persistence Context enabled
JTA transaction Manager declared in Spring used.
Persistence unit property :"hibernate.transaction.auto_close_session=true" set to true
Reporter: Luc DEW
Setting the hibernate.transaction.auto_close_session property to true cause "Session is closed!;" warnings in Seam with Seam Managed Persistence Context.
Because for instance, in the SeamPhaseListener's afterServletPhase(PhaseEvent event) the following code is executed:
handleTransactionsAfterPhase(event);
if ( event.getPhaseId() == RENDER_RESPONSE )
{
afterRenderResponse(facesContext);
}
else if ( facesContext.getResponseComplete() )
{
afterResponseComplete(facesContext);
}
If the current JSF phase is "after RENDER_RESPONSE" transaction is terminated (commited or rollbacked) by the handleTransactionsAfterPhaseMethod(event) method. If auto_close_session mode is set to true, the session is closed. But the afterRenderResponse(facesContext) is then executed. This method tries to change session's flush mode. Therefore, a "session is already closed" warning appears !
It should be documented that setting this parameter to true can cause this kind of errors in Seam. But not setting this parameter to true can cause Hibernate sessions leakage if the persistence context not handled by Seam. Also, i am not sure that in any Seam use cases, the managed persistence context is closed properly. Some examples a method annotated @Observer("org.jboss.seam.postInitialization") with or @Async...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3998) Injection of SortedMap throws IllegalArgumentException
by Naresh Bhatia (JIRA)
Injection of SortedMap throws IllegalArgumentException
------------------------------------------------------
Key: JBSEAM-3998
URL: https://jira.jboss.org/jira/browse/JBSEAM-3998
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.0.SP1
Reporter: Naresh Bhatia
I have a bean called instrumentManager that contains a factory to create a SortedMap of Instruments:
@Name("instrumentManager")
@Scope(ScopeType.CONVERSATION)
public class InstrumentManager implements Serializable {
@In private InstrumentRepository instrumentRepository;
@Out(required=false)
private SortedMap<String, Instrument> instrumentMap;
public SortedMap<String, Instrument> getInstrumentMap() {
return instrumentMap;
}
@Factory("instrumentMap")
public void createInstrumentMap() {
List<Instrument> instrumentList = instrumentRepository.findAll();
instrumentMap = new TreeMap<String, Instrument>();
for (Instrument instrument : instrumentList) {
instrumentMap.put(instrument.getSymbol(), instrument);
}
}
}
I am injecting the instrument map in a JSF converter bean:
@Name("instrumentConverter")
@Converter(forClass=Instrument.class)
public class InstrumentConverter implements javax.faces.convert.Converter {
@In(create=true)
private SortedMap<String, Instrument> instrumentMap;
@Override
public Object getAsObject(
FacesContext context, UIComponent component, String value) {
if (StringUtils.isEmpty(value)) {
return null;
}
return instrumentMap.get(value);
}
@Override
public String getAsString(
FacesContext context, UIComponent component, Object value) {
return value.toString();
}
}
When the converter tries to access the instrument map, I get the following exception:
14:22:30.484 WARN [javax.enterprise.resource.webcontainer.jsf.lifecycle] could not set field value: instrumentConverter.instrumentMap
java.lang.IllegalArgumentException: could not set field value: instrumentConverter.instrumentMap
at org.jboss.seam.Component.setFieldValue(Component.java:1884)
at org.jboss.seam.Component.access$600(Component.java:126)
at org.jboss.seam.Component$BijectedField.set(Component.java:2900)
at org.jboss.seam.Component.injectAttributes(Component.java:1693)
at org.jboss.seam.Component.inject(Component.java:1511)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at org.test.myapp.web.util.InstrumentConverter_$$_javassist_11.getAsObject(InstrumentConverter_$$_javassist_11.java)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:167)
at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectOneValue(MenuRenderer.java:188)
at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:301)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:942)
at javax.faces.component.UIInput.validate(UIInput.java:868)
at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
at javax.faces.component.UIInput.processValidators(UIInput.java:672)
at javax.faces.component.UIForm.processValidators(UIForm.java:235)
at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
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.web.IdentityFilter.doFilter(IdentityFilter.java:38)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
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:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
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.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:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: InstrumentConverter.instrumentMap on: org.test.myapp.web.util.InstrumentConverter with value: class java.util.HashMap
at org.jboss.seam.util.Reflections.set(Reflections.java:86)
at org.jboss.seam.Component.setFieldValue(Component.java:1880)
... 67 more
Caused by: java.lang.IllegalArgumentException: Can not set java.util.SortedMap field org.test.myapp.web.util.InstrumentConverter.instrumentMap to java.util.HashMap
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:657)
at org.jboss.seam.util.Reflections.set(Reflections.java:71)
... 68 more
Note that replacing the SortedMap everywhere with just a java.util.Map fixes the problem. So I suspect that somewhere a SortedMap is being initialized with a HashMap.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4003) SecurityInterceptor can fail in a cluster
by Norman Richards (JIRA)
SecurityInterceptor can fail in a cluster
-----------------------------------------
Key: JBSEAM-4003
URL: https://jira.jboss.org/jira/browse/JBSEAM-4003
Project: Seam
Issue Type: Bug
Reporter: Norman Richards
Fix For: 2.1.2.CR1
SecurityInterceptor with an @Restrict clause can cause session replication to fail. Session replication requires calling the hashCode method. If this method throws an exception, session replication fails, putting the application in bad state.
15:47:52,701 WARN [/seam-booking] Failed to replicate session mKN0jWfC7HHRYT1vmOeB-Q__
org.jboss.seam.security.NotLoggedInException
at org.jboss.seam.security.Identity.checkRestriction(Identity.java:217)
at org.jboss.seam.security.SecurityInterceptor$Restriction.check(SecurityInterceptor.java:113)
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:159)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
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:118)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_seam_4.hashCode(Object_$$_javassist_seam_4.java)
at java.util.HashMap$Entry.hashCode(HashMap.java:764)
at java.util.AbstractMap.hashCode(AbstractMap.java:557)
at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.<init>(SimpleCachableMarshalledValue.java:74)
at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.<init>(SimpleCachableMarshalledValue.java:80)
at org.jboss.web.tomcat.service.session.distributedcache.spi.SessionSerializationFactory.createMarshalledValue(SessionSerializationFactory.java:74)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.getMarshalledValue(AbstractJBossCacheService.java:641)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.putSession(AbstractJBossCacheService.java:405)
at org.jboss.web.tomcat.service.session.ClusteredSession.processSessionReplication(ClusteredSession.java:1194)
at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1635)
at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:294)
at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:120)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:613)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3724) Wicket NoConversationPage is often ignored
by Clint Popetz (JIRA)
Wicket NoConversationPage is often ignored
------------------------------------------
Key: JBSEAM-3724
URL: https://jira.jboss.org/jira/browse/JBSEAM-3724
Project: Seam
Issue Type: Bug
Components: Wicket
Reporter: Clint Popetz
Assignee: Clint Popetz
The SeamComponentInstantiationListener will only be invoked when a page/component is first created, which is not the case when back-buttoning into a form that you already submitted, for example. So we're able to back-button into dead conversations. To make sure NoConversationPage is respected we do one of the following:
(a) throw the AbortException() in the ConversationInterceptor
(b) make user pages derive from a SeamWebPage, and override onPageAttached() to check for the annotation/conversation
(c) when instrumenting, if a component is a page subclass, add a synthetic onPageAttached() to do (b) if it doesn't exist, or supplement any existing one.
I prefer (a) because it means a seam-instrumented wicket component will never be called outside a long running conversation if NoConversationId is set, regardless of how the wicket request cycle api changes.
Pete, any thoughts?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years