[JBoss Seam] - Running the Booking sample on MS SQL Srv hungs when pressing
by kaolle
Hi
Is there anyone that knows how to get the booking sample to fully work with the MS SQL Server. I've changed the booking-ds.xml to:
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>bookingDatasource</jndi-name>
<connection-url>jdbc:jtds:sqlserver://localhost:1433;DatabaseName=booking;SelectMethod=cursor;user=sa;password=xx</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
</local-tx-datasource>
when I press the final "confirm"-button which fires the "hotelBooking.confirm" the transaction hungs. My Jboss server.log looks like this:
2007-01-02 18:55:17,843 DEBUG [org.jboss.seam.core.Events] Processing event:bookingConfirmed
2007-01-02 18:55:17,843 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: bookingList
2007-01-02 18:55:17,859 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
2007-01-02 18:55:17,859 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: user
2007-01-02 18:55:17,859 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
2007-01-02 18:55:17,859 DEBUG [org.jboss.seam.Component] selected row: null
2007-01-02 18:55:17,859 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4783147081150464
2007-01-02 18:55:17,859 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2007-01-02 18:55:17,859 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2007-01-02 18:55:17,859 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2007-01-02 18:55:17,859 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
2007-01-02 18:55:17,859 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-01-02 18:55:17,859 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2007-01-02 18:55:17,859 DEBUG [org.hibernate.SQL] select booking0_.id as id0_, booking0_.user_username as user10_0_, booking0_.checkinDate as checkinD2_0_, booking0_.checkoutDate as checkout3_0_, booking0_.hotel_id as hotel11_0_, booking0_.creditCard as creditCard0_, booking0_.smoking as smoking0_, booking0_.beds as beds0_, booking0_.creditCardName as creditCa7_0_, booking0_.creditCardExpiryMonth as creditCa8_0_, booking0_.creditCardExpiryYear as creditCa9_0_ from Booking booking0_ where booking0_.user_username=? order by booking0_.checkinDate
2007-01-02 18:55:17,859 INFO [STDOUT] Hibernate: select booking0_.id as id0_, booking0_.user_username as user10_0_, booking0_.checkinDate as checkinD2_0_, booking0_.checkoutDate as checkout3_0_, booking0_.hotel_id as hotel11_0_, booking0_.creditCard as creditCard0_, booking0_.smoking as smoking0_, booking0_.beds as beds0_, booking0_.creditCardName as creditCa7_0_, booking0_.creditCardExpiryMonth as creditCa8_0_, booking0_.creditCardExpiryYear as creditCa9_0_ from Booking booking0_ where booking0_.user_username=? order by booking0_.checkinDate
2007-01-02 18:55:17,859 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() stefan -> username [1]
2007-01-02 19:00:17,828 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=se10offws0009/37, BranchQual=, localId=37] timed out. status=STATUS_ACTIVE
2007-01-02 19:00:17,859 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=se10offws0009/38, BranchQual=, localId=38] timed out. status=STATUS_ACTIVE
end server.log extract
I compared this with the corresponding log when I used the default database engine: HSQL
which looks like this:
2007-01-03 18:49:18,906 DEBUG [org.jboss.seam.core.Events] Processing event:bookingConfirmed
2007-01-03 18:49:18,906 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: bookingList
2007-01-03 18:49:18,906 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
2007-01-03 18:49:18,906 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: user
2007-01-03 18:49:18,906 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
2007-01-03 18:49:18,906 DEBUG [org.jboss.seam.Component] selected row: null
2007-01-03 18:49:18,906 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4783499505278976
2007-01-03 18:49:18,906 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2007-01-03 18:49:18,906 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2007-01-03 18:49:18,906 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2007-01-03 18:49:18,906 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
2007-01-03 18:49:18,906 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-01-03 18:49:18,906 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2007-01-03 18:49:18,906 DEBUG [org.hibernate.SQL] select booking0_.id as id0_, booking0_.user_username as user10_0_, booking0_.checkinDate as checkinD2_0_, booking0_.checkoutDate as checkout3_0_, booking0_.hotel_id as hotel11_0_, booking0_.creditCard as creditCard0_, booking0_.smoking as smoking0_, booking0_.beds as beds0_, booking0_.creditCardName as creditCa7_0_, booking0_.creditCardExpiryMonth as creditCa8_0_, booking0_.creditCardExpiryYear as creditCa9_0_ from Booking booking0_ where booking0_.user_username=? order by booking0_.checkinDate
2007-01-03 18:49:18,906 INFO [STDOUT] Hibernate: select booking0_.id as id0_, booking0_.user_username as user10_0_, booking0_.checkinDate as checkinD2_0_, booking0_.checkoutDate as checkout3_0_, booking0_.hotel_id as hotel11_0_, booking0_.creditCard as creditCard0_, booking0_.smoking as smoking0_, booking0_.beds as beds0_, booking0_.creditCardName as creditCa7_0_, booking0_.creditCardExpiryMonth as creditCa8_0_, booking0_.creditCardExpiryYear as creditCa9_0_ from Booking booking0_ where booking0_.user_username=? order by booking0_.checkinDate
2007-01-03 18:49:18,906 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() stefan -> username [1]
2007-01-03 18:49:18,906 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
2007-01-03 18:49:18,906 DEBUG [org.hibernate.loader.Loader] result row: EntityKey[org.jboss.seam.example.booking.Booking#1]
It seems that the "...AbstractBatcher" could never open the booking ResultSet for some reason when I'm using the MS SQL Server.
I'm currently running JBoss SEAM 1.1 GA with JBoss Server 4.0.5 GA
I've also tried the Jboss SEAM 1.0.1 GA with JBoss 4.0.4 EJB3-RC8 with the same problem as result.
Please, someone help me!!
/kaolle
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997656#3997656
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997656
19 years, 3 months
[JBoss jBPM] - Re: A Bug or Newbie Error?
by kukeltje
At ease... indeed ;-) Fundamental bugs can slip by testing, fundamental functionality.... naahhhh.... :-)
OK, so instead of you looking at the api, I did it (once, since it is a happy new year!!)
The api docs say this:
| /**
| * returns all the taskInstances for the this process instance. This
| * includes task instances that have been completed previously.
| */
|
and... surprise surprise... there is another method:
| /**
| * is the collection of {@link TaskInstance}s on the given token that are not ended.
| */
| public Collection getUnfinishedTasks(Token token) {
|
|
So I not only confirmed (as in the previous post) that the results are indeed not as you expected, but gave a (more) detailed explanation.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997651#3997651
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997651
19 years, 3 months
[JBoss jBPM] - org.hibernate.AssertionFailure: collection [org.jbpm.graph.d
by arshadnj
Hi,
I am trying to update the due date of a timer through my code and here is the step by step actions I have taken which is leading me to this exception:
1. I am creating a timer through process defintion for a specific state
2. When a enity business date changes, I need to modify the due date of the timer associated with this state.
3. What I do when this business date is changed:
a. I am find the specific timer using SchedulerSession and for the given token
b. Update the due date for this timer and call the deleteTimer and saveTimer by passing the same object (since there is no update timer method).
It is throwing this exception. We are using the spring modules for managing this transactions associated with hibernate and JBPM.
Here is little more info about code:
Process Defintion:
<state name="state name">
| <event type="node-enter">
| <action name="action" class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy">
| <targetBean>actionBeanName</targetBean>
| </action>
| </event>
| <transition name="name" to="another state"></transition>
| <timer name="lateTimer" duedate="1 days" transition="timeout"></timer>
| </state>
and the java code:
bpmTemplate.execute(new JbpmCallback() {
| public Object doInJbpm(JbpmContext context) {
| ProcessInstance processInstance = getProcessInstance(context, enity);
| if (processInstance != null) {
| Token token = processInstance.getRootToken();
| SchedulerSession schedulerSession = context.getSchedulerSession();
| List<Timer> timers = schedulerSession.findTimersByName(
| WorkflowProcessConstants.TIMER_NAME, token);
| Timer timer = timers.get(0);
| if(!TimeUtil.isSameDay(timer.getDueDate(), enityDate)){
| timer.setDueDate(entityDate);
| schedulerSession.deleteTimer(timer);
| schedulerSession.saveTimer(timer);
and finally the stack trace:
org.hibernate.AssertionFailure: collection [org.jbpm.graph.def.Node.leavingTransitions] was not processed by flush()
| org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
| org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:332)
| org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
| org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
| org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
| org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
| org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:496)
| org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469)
| org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
| org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
| org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
| org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
| $Proxy6.updateAndAdjustWorkflow(Unknown Source)
| Controller.onFormSubmit(Controller.java:178)
| AdminBaseFormController.onSubmit(AdminBaseFormController.java:130)
| org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:258)
| org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:259)
| org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
| org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
| org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
| org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
| org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
| org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
| org.donorschoose.web.filter.ActionFilter.doFilter(ActionFilter.java:112)
| org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
| org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
|
|
| note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997648#3997648
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997648
19 years, 3 months
[Installation, Configuration & Deployment] - Re: what a job but at last !
by wiggy
well goodness me thats been difficult. I think it would be as well to put a package together just for the embedded server in an accessible format.
in the end i spotted something on one ofthe seam pages that discusses deploying on the ejb standalone. even better the seam distro ships with a /lib and an an embedded/conf directory with a working set of libraries and config files.
relinked my app to the seam /lib and confdirectoroies and provided my own META-INF directory to load my own datasource mysql data source and persistence.xml.
and by golly my simple hello world test stateless bean worked straight out of the box.
Thats cost me the best part of 3 days trying to get that working
It would be really useful to put a section on the Jboss site/wiki to help with poor little idiots such as myself who wnat to get started easily without all the pain
only thing i could see in the log output was the first line - a Warn
| 17:30:05,753 WARN [BeanSchemaBinding] You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
| ...
|
which sounds possibly not ideal but doesnt stop it all working. Any one got idea what this is trying to tell me and which XML config needs changing?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997646#3997646
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997646
19 years, 3 months
[JBoss Seam] - Customize validation messages
by hamtho2
Hi,
I´m currently doing my first steps with Seam and JSF and, as a long-time Struts-developer, I already see so many improvements in the Seam/EJB3/JSF integration. Thank you for the great work!
But now I´m starting at a very basic problem: validation!
The struts way of life was that you have a validate()-method where you have to validate everything and if an error occured you can assign a customized error-message to an input-field that was localized through the RessourceBundle.
If I do the validation through jsf and the hibernate validation framework I get very unsexy error-messages like ""name": Value is required." if I set required = true and the field was left blank or "has to be between 3 and 2147483647 " or I get an output og my complete regexp if not left blank and the hibernate validation fails. What I would like to do is to show customized error-messages like "Please enter a valid email-adress" or "The password has to have at least 6 characters and 1 number" etc. One thing I found regarding customizing messages was redefining the properties like "javax.faces.component.UIInput.REQUIRED" in the message.properties. But this way the message cannot be customized for every single input-field. So what would be the right way to do in this case? Do I have to write my own validator and tag-library for every inputfield to archieve this (only to display different but customized messages) or is there an other - more elegant and less complex - way?
Thanks for your help
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997645#3997645
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997645
19 years, 3 months