Hi Pete,
Thanks for the quick reply. I am using SMPCs, and I made all the config changes specified
in the Seam 2.0 Migration Guide in Fisheye.
Aren't all requests wrapped in a temporary conversation? At any rate, I am inside a
long running conversation. Originally, I was making the itemTextDAO.getTutorialCategories
call from inside a SFSB with ScopeType.CONVERSATION and outjecting it. Then I made it a
member (with a get/set) of that same SFSB instead of outjecting. All with the same
outcome.
Here's the entity query in a conversation scoped SFSB:
| @Stateful
| @Name("tutorialEditAction")
| @Scope(ScopeType.CONVERSATION)
| public class EditActionBean implements EditAction, Serializable {
|
| @PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager entityManager;
|
| @Logger
| private Log log;
|
| private List<ItemText> tutorialCategories;
|
|
| @Create @Begin(join=true)
| public String create() {
| return "created";
| }
|
| @Begin(join=true)
| public String begin() {
| log.info ("Inside tutorialEditAction.begin");
| return "begin";
| }
|
| public List<ItemText> getTutorialCategories() {
| log.info ("Begin tutorialEditAction.getTutorialCategories()");
| if (this.tutorialCategories == null) {
| try {
| Query query = entityManager.createQuery (
| "select it from ItemText it where it.itemCode.itemCodeType.name=:name and
it.locale=:locale order by it.text asc");
| query.setParameter ("name",
ItemCodeType.ItemCodeTypeEnum.TUTORIAL_CATEGORY);
| query.setParameter ("locale", Locale.US.toString());
| this.tutorialCategories = (List<ItemText>) query.getResultList();
|
| } catch (NoResultException ex) {
| this.tutorialCategories = new ArrayList<ItemText>(0);
| }
|
| }
| log.info ("End tutorialEditAction.getTutorialCategories()");
| return this.tutorialCategories;
| }
| public String getCategory() {
| return "Application";
| }
| public void setCategory(String value) {
| }
| @End
| public String save() {
| log.info("Inside tutorialEditAction.save()");
| return "saved";
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| }
|
|
And my xhtml fragment:
| <ui:composition
xmlns="http://www.w3.org/1999/xhtml"
|
xmlns:s="http://jboss.com/products/seam/taglib"
|
xmlns:f="http://java.sun.com/jsf/core"
|
xmlns:h="http://java.sun.com/jsf/html"
|
xmlns:ui="http://java.sun.com/jsf/facelets">
|
|
| <h:form id='tutorialEditForm'>
| <h:selectOneMenu value="#{tutorialEditAction.category}">
| <s:convertEntity />
| <s:selectItems value="#{tutorialEditAction.tutorialCategories}"
| var="category"
| label="#{category.text}"
| noSelectionLabel="-- Select --" >
| </s:selectItems>
| </h:selectOneMenu>
| </h:form>
|
| </ui:composition>
|
|
components.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <components
xmlns="http://jboss.com/products/seam/components"
|
xmlns:core="http://jboss.com/products/seam/core"
|
xmlns:drools="http://jboss.com/products/seam/drools"
|
xmlns:jms="http://jboss.com/products/seam/jms"
|
xmlns:persistence="http://jboss.com/products/seam/persistence"
|
xmlns:security="http://jboss.com/products/seam/security"
|
xmlns:web="http://jboss.com/products/seam/web"
|
xmlns:theme="http://jboss.com/products/seam/theme"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
|
"http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
|
http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
|
http://jboss.com/products/seam/jms http://jboss.com/products/seam/jms-2.0.xsd
|
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
|
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
|
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
|
http://jboss.com/products/seam/theme http://jboss.com/products/seam/theme-2.0.xsd
|
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <core:init debug="true"
jndi-pattern="PhoneScout/#{ejbName}/local"/>
|
| <core:manager concurrent-request-timeout="500"
conversation-timeout="71000000" conversation-id-parameter="cid"/>
|
| <persistence:managed-persistence-context name="entityManager"
auto-create="true"
|
persistence-unit-jndi-name="java:/phoneScoutEntityManagerFactory"/>
|
| <security:identity
authenticate-method="#{authenticateAction.authenticate}"/>
|
| <web:context-filter url-pattern="*.ajax" />
|
| <jms:managed-topic-publisher name="sharedDeviceTopic"
auto-create="true" topic-jndi-name="topic/sharedDeviceTopic"/>
|
| <component
class="org.jboss.seam.remoting.messaging.SubscriptionRegistry"
installed="true">
| <property name="allowedTopics">sharedDeviceTopic</property>
| </component>
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
|
| <factory
name='cmpContextRoot' value='#{facesContext.externalContext.request.contextPath}'
/>
| <factory name='cmpDevicesSubdir' value='#{"/devices"}'
/>
| <factory
name='cmpGraphsSubdir' value='#{cmpDevicesSubdir}/#{deviceHome.id}/graphs'
/>
| <factory
name="cmpDevicesRoot" value="#{cmpContextRoot}/devices"/>
| <factory
name='cmpDeviceRoot' value='#{cmpDevicesRoot}/#{deviceHome.id}' />
| <factory
name="cmpGraphRoot" value="#{cmpDeviceRoot}/graphs"/>
| <factory name='cmp360Subdir' value='/devices/#{deviceHome.id}/#{empty
param.viewof ? "front" : param.viewof}' />
| <factory
name='cmp360Root' value='#{cmpContextRoot}#{cmp360Subdir}' />
|
| </components>
|
|
The full stack trace:
| org.hibernate.TransientObjectException: The instance was not associated with this
session
| at org.hibernate.impl.SessionImpl.getIdentifier(SessionImpl.java:1375)
| at
org.hibernate.search.impl.FullTextSessionImpl.getIdentifier(FullTextSessionImpl.java:331)
| at
org.jboss.seam.persistence.HibernateSessionProxy.getIdentifier(HibernateSessionProxy.java:205)
| at
org.jboss.seam.persistence.HibernatePersistenceProvider.getId(HibernatePersistenceProvider.java:114)
| at org.jboss.seam.framework.EntityIdentifier.<init>(EntityIdentifier.java:15)
| at
org.jboss.seam.ui.converter.EntityConverterStore.put(EntityConverterStore.java:60)
| at org.jboss.seam.ui.converter.EntityConverter.getAsString(EntityConverter.java:69)
| at
org.jboss.seam.ui.converter.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
| at org.jboss.seam.ui.converter.ConverterChain.getAsString(ConverterChain.java:123)
| at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
| at
com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
| at
com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
| at
com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
| at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| 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:63)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
| 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.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(Thread.java:595)
|
Not sure how to proceed to debug the problem,
Thanks,
Al
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059318#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...