[JBoss Seam] - save the transient instance before flushing
by odupont
I receive an error when I use this querry in a Statefull Entity (selectApplication):
return em.createQuery("select a from Application a " +
"where lower(a.name) like :name " +
"and lower(a.description) LIKE :description " +
"and a.category = :category order by a.name")
.setParameter("name", name)
.setParameter("description", description)
.setParameter("category", category);
I have 2 entities: Application and Category.
This example comes from DVDStore and the name, description and Category comes from a JSF page:
<h:selectOneMenu value="#{selectApplication.category}">
<s:convertEntity />
<ui:remove> <f:selectItem itemLabel="Any" itemValue="#{anyCategory}" /></ui:remove>
<s:selectItems value="#{allCategories.resultList}" var="category" label="#{category.name}" noSelectionLabel="ANY" />
</h:selectOneMenu>
I receive this error:
javax.servlet.ServletException: Error calling action method of component with id _id39:_id54
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
...
Caused by: javax.faces.el.EvaluationException: /selectApplication.xhtml @48,51 action="#{selectApplication.doSearch}": javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalStateException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.mycompany.seam.refdata.model.Category
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067364#4067364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067364
18Â years, 9Â months
[JBoss Portal] - Error with JSF webapp on AS 4.2.1 + Portal 2.6
by angelo.dangelo
Hi all,
I'm using JBoss Portal 2.6 with JBoss AS 4.2.1. I need to deploy a simple jsf application in the same server, but when I try to access to this application I obtain the following error:
| 13:07:41,000 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| java.lang.ClassCastException: org.apache.catalina.core.ApplicationContextFacade
| at com.sun.faces.portlet.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
| at org.jboss.portal.faces.portlet.JSFMetaBridgeFacesContextFactoryImpl.getFacesContext(JSFMetaBridgeFacesContext
| FactoryImpl.java:47)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:239)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 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:157)
| 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)
|
Could you, please, help me?
Thank you in advance.
Angelo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067355#4067355
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067355
18Â years, 9Â months