[JBoss jBPM] - java.lang.ClassCastException: com.sample.action.AutomatedAsy
by mone
Hi,
I am calling actionhandler from transition action like this
CheckDuplicatelist
I am getting class cast exception
19:00:42,013 ERROR [GraphElement] action threw exception: com.sample.action.AutomatedAsyncflowHandler
java.lang.ClassCastException: com.sample.action.AutomatedAsyncflowHandler
at org.jbpm.graph.def.Action.execute(Action.java:121)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:255)
at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
at org.jbpm.graph.def.Transition.take(Transition.java:138)
at org.jbpm.graph.def.Node.leave(Node.java:393)
at org.jbpm.graph.node.StartState.leave(StartState.java:70)
at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$ad0ec870.leave()
at org.jbpm.graph.exe.Token.signal(Token.java:194)
at org.jbpm.graph.exe.Token.signal(Token.java:157)
at org.jbpm.jsf.core.action.SignalActionListener.handleAction(SignalActionListener.java:56)
at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
at javax.faces.component.UICommand.broadcast(UICommand.java:368)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
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.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(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112267#4112267
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112267
18 years, 4 months
[JBoss Seam] - Re: [newbie] timezones and s:convertDateTime
by mars1412
after some other hours of trying, changing and debugging, I already know somthing more :-)
when I change the timezone via the timezone-switcher, the timezone will be set to the new value, BUT at that time the date-time that I display on the page has already been converted (using the "old" timezone) and thus will not reflect the timezone change. when I refresh the page manually again, it is ok (which is of course an unreasonable demand to our webusers..).
anyway, here is what I think, why this happens:
when I press the button in my page, a POST request will be sent to the server (the action to execute is of course timezone.select).
In the phases of the JSF lifecycle, the following will happen:
* Apply Request Values Phase
| timeZoneSelector.select event is queued (not executed)
| * Process Validations Phase
| s:convertDateTime will call its converter: DateTimeConverter, which will convert the date/time using the current time zone, which is of course still the "old" timezone
| * Update Model Phase
| the converted date/time from the last step is pushed to the model
| the new TimeZone is pushed into model
| * Invoke Application Phase
| the queued event is now executed:
| - from now on the new time zone is active
| - TimeZoneSelector raises "org.jboss.seam.timeZoneSelected" event
| * Render Response Phase
| the page is rendered and the value of my date/time field is still that one calculated in the Process Validations Phase (with the old timezone)
when I now refresh the page manually, the new timezone is already active and now the DateTimeConverter uses this new timezone and the calculated value will be displayed as expected.
since I'm a newbie with all that JSF, SEAM, etc. stuff, I appreciate any coments on this..
following questions that are still open:
* any ideas for a solution/workaround? how can I avoid that manually refreshing of the page
| * who observes the "org.jboss.seam.timeZoneSelected" event?? I searched through all seam .java files, but couldn't find any observer?
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112264#4112264
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112264
18 years, 4 months
[JBoss Seam] - JBPM and Seam problem
by trouby
Hey,
I was wondering why Seam deploys each jbpm process every time I start JBossAS, that's the normal behavior? after few restarts JBPM tables looks too dirty, I think it would be wise to check the version of the process somehow and only deploy when a change occurs,
Anyway, I tried to avoid setting my processes through components.xml and deploy them in runtime but I'm having some problems,
Here's my try:
{code}
@In(value="org.jboss.seam.bpm.jbpm")
private Jbpm jbpm;
@In
private JbpmContext jbpmContext;
ProcessDefinition pd = jbpm.getProcessDefinitionFromXml(xmlProcessDefinition);
jbpmContext.deployProcessDefinition(pd);
{code}
At the moment jbpm.getProcessDefinitionFromXml(xmlProcessDefinition); gets invoked I see many JBPM lines warming up and then I get the following exceptions:
{code}
20:18:16,234 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
20:18:16,234 INFO [SchemaUpdate] Running hbm2ddl schema update
20:18:16,250 INFO [SchemaUpdate] fetching database metadata
20:18:16,250 ERROR [SchemaUpdate] could not get database metadata
java.sql.SQLException: You cannot set autocommit during a managed transaction!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnecti
ava:482)
at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:322)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderC
ctionHelper.java:36)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:127)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:314)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91
at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94)
at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
at org.jbpm.JbpmContext.getSession(JbpmContext.java:506)
at org.jboss.seam.bpm.ManagedJbpmContext.joinTransaction(ManagedJbpmContext.java:175)
at org.jboss.seam.bpm.ManagedJbpmContext.getJbpmContext(ManagedJbpmContext.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
at org.jboss.seam.Component.callComponentMethod(Component.java:2067)
at org.jboss.seam.Component.unwrap(Component.java:2093)
....
{code}
It's working, I mean, JBPM starts(many lines appear, all JBPM conf mappings, etc...), then the process gets deployed and everything work.
well, after the first deployment time, I don't see this errors again and all work perfectly...(unless I restart Jboss again of course)
As a workaround, I just left one process within components.xml so seam starts JBPM when the -server starts-, so no error occur that way, but it's ugly...
I guess I'm already in a transaction and then JBPM starts in the middle or something... if so, is there a way to start JBPM when the server loads? (without setting any processes in components.xml?), if it's another issue then fix me :)
Many thanks,
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112258#4112258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112258
18 years, 4 months
[JBoss Portal] - Manage the HttpSession
by marimuthub
Hi,
We have AuthenticationFilter for our application. Each request from any portal page of our application is going through AuthenticationFilter.
We are getting forbidden error for the following scenario
Open new browser login to application using user name called âXâ. Login is success and user is directed to user home page. Close the browser
Open new browser login to application using user name called âYâ. Here we getting
Forbidden error instead of redirecting to user home page
We are managing the HttpSession as follows for each scenario.
User Login:
=============
// To get the session
HttpSession session = request.getSession();
// To set any value
request.getSession().getServletContext().getContext("/portal")
.setAttribute(key,value);
// Forward to user home page
RequestDispatcher rd = request.getSession().getServletContext() .getContext("/portal").getRequestDispatcher(
resUrl.toString());
rd.forward(request, response);
Subsequent request after login :
========================
HttpSession session = req.getSession();
User logout:
============
// to remove any value
req.getSession().getServletContext().getContext("/portal")
.removeAttribute(key)
// to invalidate the session
req.getSession().invalidate();
Please help us to resolve the issue
Regards
Marimuthu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112254#4112254
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112254
18 years, 4 months