[JBoss Seam] - Re: Changes not persisted using EntityHome
by gzoller
Wayne,
I think I've found the answer to the mystery. The solution you pointed out from the tutorial wasn't working for me because java.util.List.remove() wasn't implemented for the backing List in Hibernate's PersistentBag at runtime.
I found in the Hibernate docs that collections can wind up being mapped to all kinds of things in Hibernate--apparently not all of them supporting remove(). By adding an @OrderBy annotation to my @OneToMany in my Entity as shown below I can coerce Hibernate to use a List collection that supports remove()--and I wanted the sort anyway:
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "project")
| @OrderBy("date")
| public List<Timecard> getTimecard() {
| return this.timecard;
| }
| public void setTimecard(List<Timecard> timecard) {
| this.timecard = timecard;
| }
|
This list is what I set my @DataModel to in my entity manager code, so that's why all this Hibernate stuff is relevant.
So this is what works for me now:
| public void delete() {
| tc = em.merge(tc); // needed or I get exceptions about unattached objects
| em.remove(tc); // no further issues here after @OrderBy in entity
| tcList.remove(tc); // clean up in-memory @DataModel list
| projectHome.getInstance().getTimecard().remove(tc); // remove from in-memory Entity list for response page render
| tc=null;
| }
|
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035800#4035800
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035800
19 years
[Beginners Corner] - Re: JSPs in JBoss
by AggressiveFish
Hi Peter,
I figured I would give this a try. I copied a simple JSP I had into another directory at the same level as the jmx-console.war one. I tried running the app (i.e. localhost:8080/TmpDir/testjsp.jsp) and the app ran fine. What are the benefits/ requirements of having the other directories in the .war directory (i.e. WEB-INF)?
I notcied that my .class files were going to a totally separate directory (...default/work/.......apache/jsp/). If I wanted to send just my .class files over to another computer without the .jsps in the main .war directory would I simply update the web.xml document with the path of the class file(s) or is there more to it? I tried removing the jsp altogether and leaving the classes (which I didn't think would work) and it didn't work (i.e. ole 404). Thanks again.
AF
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035798#4035798
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035798
19 years
[JBoss Seam] - Using conversations causes the pages to be cached
by hvram
Hi
I have been trying to use a long running conversation and I am facing the following problem . Once the conversation is created Any link that I click always takes me to the first page that was displayed after the conversation was created
This is what I did :
I have a method called searchItem which I have annotated with a @Begin (id="myconv", join=true)
public void myMethod() {
}
I also included this method in the action parameter of the <page_id>.page.xml
I can see that the action is executed . After this visiting debug.seam shows that a conversation named 'myconv' is created.
But after this all the links have a cid=myconv@clr=true as request parameter even though they are not present in the s:link parameters. And the browser displays the first page ( i ensured that there is no browser caching etc) .
Can u let me know how I can proceed ..
Thanks
Regards
Hari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035797#4035797
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035797
19 years
[JBoss jBPM] - jbpm 3.2 Session Is Closed exception in JobSession
by MarkA4
Hi. At the end of processing a Task node along with a few regular nodes, we're getting a "Session is closed" hibernate exception in jbpm 3.2 JobSession class. I'm not sure what to look for here. Ideas? A configuration issue maybe? I did not see other instances of this in Forum or JIRA searches.
JBPM 3.2 on JBoss 4.0.5 with EJB3 and JBoss Messaging configuration
Hibernate Config:
hibernate.dialect: org.hibernate.dialect.SQLServerDialect
| hibernate.connection.datasource: java:/jdbc/jbpm
| hibernate.transaction.factory_class: org.hibernate.transaction.JTATransactionFactory
| hibernate.transaction.manager_lookup_class: org.hibernate.transaction.JBossTransactionManagerLookup
|
JBPM Config:
<service name="persistence">
| <factory>
| <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
| <field name="isCurrentSessionEnabled"><false /></field>
| <field name="isTransactionEnabled"><false /></field>
| </bean>
| </factory>
| </service>
|
Partial trace up to and including the exception:
anonymous wrote : 2007-04-06 17:56:32,796 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.exe.Token - token[19] is unlocked by token[19]
| 2007-04-06 17:56:32,796 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.node.Decision - decision Check_Prepare_PPP_Request_Blk is taking 'Transition(wfEnd_eq_YES)'
| 2007-04-06 17:56:32,796 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.def.GraphElement - event 'node-leave' on 'Decision(Check_Prepare_PPP_Request_Blk)' for 'Token(/)'
| 2007-04-06 17:56:32,796 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.def.GraphElement - event 'transition' on 'Transition(wfEnd_eq_YES)' for 'Token(/)'
| 2007-04-06 17:56:32,811 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.def.GraphElement - event 'node-enter' on 'Node(UPES_Obtain_PPP_Internal_Fees)' for 'Token(/)'
| 2007-04-06 17:56:32,811 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.exe.Token - token[19] is locked by job[2]
| 2007-04-06 17:56:32,811 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.def.GraphElement - event 'after-signal' on 'ProcessState(Prepare_PPP_Request_Blk (sub))' for 'Token(/)'
| 2007-04-06 17:56:32,811 [http-0.0.0.0-8080-3] DEBUG org.jbpm.scheduler.ejbtimer.EjbSchedulerService - deleting timers for process instance org.jbpm.graph.exe.ProcessInstance@12062da
| 2007-04-06 17:56:32,827 [http-0.0.0.0-8080-3] DEBUG org.jbpm.scheduler.ejbtimer.TimerServiceBean - deleting timers for process instance org.jbpm.graph.exe.ProcessInstance@12062da from the ejb timer service
| 2007-04-06 17:56:32,843 [http-0.0.0.0-8080-3] DEBUG org.jbpm.graph.def.GraphElement - event 'after-signal' on 'TaskNode(Prepare PPP Request (ACTOR))' for 'Token(/)'
| 2007-04-06 17:56:32,843 [http-0.0.0.0-8080-3] DEBUG org.jbpm.JbpmContext - closing JbpmContext
| 2007-04-06 17:56:32,843 [http-0.0.0.0-8080-3] DEBUG org.jbpm.svc.Services - closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@1b0c0b8
| 2007-04-06 17:56:32,843 [http-0.0.0.0-8080-3] DEBUG org.jbpm.persistence.db.DbPersistenceService - flushing hibernate session
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.persistence.db.DbPersistenceService - closing hibernate session
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.svc.Services - closing service 'message': org.jbpm.msg.jms.JmsMessageServiceImpl@1a1d061
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.svc.Services - closing service 'scheduler': org.jbpm.scheduler.ejbtimer.EjbSchedulerService@bcecc7
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.scheduler.ejbtimer.EjbSchedulerService - removing the timer service session bean
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.svc.Services - closing service 'tx': org.jbpm.tx.TxService@15d13c3
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.svc.Services - closing service 'logging': org.jbpm.logging.db.DbLoggingService@1bc7b65
| 2007-04-06 17:56:32,874 [http-0.0.0.0-8080-3] DEBUG org.jbpm.db.JobSession - deleting timers for process instance org.jbpm.graph.exe.ProcessInstance@12062da
| 2007-04-06 17:56:32,921 [http-0.0.0.0-8080-3] ERROR com.ourcompany.ourproject.struts.actions.PPPMethodSubmitAction: com.ourcompany.ourproject.utility.LoggableEJBException: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=rl001-m0152bits/71, BranchQual=, localId=71] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.SessionException: Session is closed!)
| at com.ourcompany.ourproject.utility.ExceptionLogUtil.createLoggableEJBException(ExceptionLogUtil.java:13)
| at com.ourcompany.ourproject.struts.actions.PPPMethodSubmitAction.execute(PPPMethodSubmitAction.java:220)
| at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
| at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
| at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
| at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at com.ourcompany.ourproject.filters.CheckUserSession.doFilter(CheckUserSession.java:263)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Unknown Source)
| Caused by: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=rl001-m0152bits/71, BranchQual=, localId=71] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.SessionException: Session is closed!)
| at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
| at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
| 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.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 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:102)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 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.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| at $Proxy129.submitPPPForm(Unknown Source)
| at com.ourcompany.ourproject.struts.actions.PPPMethodSubmitAction.execute(PPPMethodSubmitAction.java:153)
| ... 29 more
| Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=rl001-m0152bits/71, BranchQual=, localId=71] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.SessionException: Session is closed!)
| at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
| at org.jboss.tm.TxManager.commit(TxManager.java:240)
| at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
| ... 47 more
| Caused by: org.hibernate.SessionException: Session is closed!
| at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
| at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1258)
| at org.jbpm.db.JobSession$DeleteJobsSynchronization.beforeCompletion(JobSession.java:190)
| at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
| at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
| at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
| ... 49 more
|
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035795#4035795
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035795
19 years