[JBoss jBPM] - Problem synchronize database with timers
by wanap
Hello, I've working with timers and I'm very boring of testing things...:(
I'm working with jbpm 3.1.4.
My problem is that I've a simple process with 2 activities:
process-definition
xmlns="urn:jbpm.org:jpdl-3.1" name="TaskNode TpoDesarrollo">
<start-state name="Inicio">
</start-state>
<!--
<cancel-timer name='alarma' />
-->
<end-state name="Fin">
</end-state>
the First action saves the instance process cause i've read that's necessary to solve some problems with the db and timers.
public class SalvaIDP implements ActionHandler{
private static final long serialVersionUID = 1L;
@SuppressWarnings("deprecation")
public void execute(ExecutionContext executionContext) throws Exception {
System.out.println("EOOOOO-->Ha pasado por el SALVA IDP");
try{
ProcessInstance p=executionContext.getProcessInstance();
JbpmContext.getCurrentJbpmContext().save(p);
}catch(Exception e)
{e.toString();}
}
}
The second action only makes a System.out.println to makes me secure that it's executed.
public class Traza implements ActionHandler {
private static final long serialVersionUID = 1L;
@SuppressWarnings("deprecation")
public void execute(ExecutionContext executionContext) throws Exception {
try{
System.out.println("EOOOOO-->Ha pasado por el Traza!!!");
}catch(Exception e)
{e.toString();}
}
Here's the error that is displayed on the console...
13:29:20,446 INFO [STDOUT] EOOOOO-->Ha pasado por el SALVA IDP
13:29:20,466 WARN [StatefulPersistenceContext] Narrowing proxy to class org.jbpm.graph.node.State - this operation breaks ==
13:29:20,487 INFO [[/jbpm]] WARNING: Component _id13 just got an automatic id, because there was no id assigned yet. If this component was created dynamically (i.e. not by a JSP tag) you should assign it an explicit static id or assign it the id you get from the createUniqueId from the current UIViewRoot component right after creation!
13:29:40,070 INFO [STDOUT] EOOOOO-->Ha pasado por el Traza!!!
13:29:40,078 INFO [STDOUT] EOOOOO-->Ha pasado por el Traza!!!
13:29:40,195 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#94]
at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1625)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2198)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2108)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2364)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:850)
at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:1043)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1033)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1013)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at org.jbpm.db.SchedulerSession.cancelTimersForProcessInstance(SchedulerSession.java:169)
at org.jbpm.scheduler.db.DbSchedulerService.cancelTimersByProcessInstance(DbSchedulerService.java:55)
at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:275)
at org.jbpm.graph.exe.ProcessInstance$$FastClassByCGLIB$$5167cc59.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.graph.exe.ProcessInstance$$EnhancerByCGLIB$$8a87710f.end()
at org.jbpm.graph.exe.Token.notifyParentOfTokenEnd(Token.java:261)
at org.jbpm.graph.exe.Token.end(Token.java:233)
at org.jbpm.graph.exe.Token.end(Token.java:193)
at org.jbpm.graph.node.EndState.execute(EndState.java:46)
at org.jbpm.graph.def.Node.enter(Node.java:316)
at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$78a94010.enter()
at org.jbpm.graph.def.Transition.take(Transition.java:119)
at org.jbpm.graph.def.Node.leave(Node.java:382)
at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.graph.node.State$$EnhancerByCGLIB$$4ee1586a.leave()
at org.jbpm.graph.exe.Token.signal(Token.java:174)
at org.jbpm.graph.exe.Token.signal(Token.java:137)
at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$979a7a4.signal()
at org.jbpm.scheduler.exe.Timer.execute(Timer.java:118)
at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:118)
at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
13:29:40,202 ERROR [SchedulerSession] org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#94]
Can somebody help me???
Sorry my english, I'm a spanish student and I've not much idea of speaking english :(
Thanks for your attention
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128719#4128719
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128719
18 years, 2 months
[Microcontainer] - Re: Questions on describe/classloader deployers and CL scope
by gcompienne
anonymous wrote :
| Where do you see it getting created?
| Since it's the AbstractTopLevelClassLoaderSystemDeployer that does this in AS5 --> VFSTopLevelClassLoaderSystemDeployer, and its stage is CLASSLOADER.
|
Ok, so I suspect the problem I am getting is the fact that the BaseClassLoader is created by the VFSTopLevelClassLoaderSystemDeployer before my CL deployer gets called (logical as the system one was loaded first).
That is interesting. In my case, ideally, I would not want to have to change the conf/bootstrap-beans.xml to change the order of the deployers and insert mine.
So is there a way that at the describe stage I could provide enough information to tell the VFSTopLevelClassLoaderSystemDeployer not to kick in yet or change the order they will be prioritized? (input, outputs would be one way, and I am wondering: should I try to remove/relocate the input needed by VFSTopLevelClassLoaderSystemDeployer to work...?).
Thanks.
Gilles.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128711#4128711
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128711
18 years, 2 months
[JBoss Seam] - Re: Retrofitting SEAM to existing JSF project
by tedder
should have mentioned earlier, also using RichFaces & Ajax4JSF in the legacy application. The full stack trace I see is
java.lang.NullPointerException
org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:72)
org.ajax4jsf.context.AjaxContext.getCurrentInstance(AjaxContext.java:101)
org.ajax4jsf.application.AjaxViewHandler.createView(AjaxViewHandler.java:83)
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:201)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
edu.mit.broad.util.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:30)
edu.mit.broad.security.AuthenticationFilter.doFilter(AuthenticationFilter.java:59)
note
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128707#4128707
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128707
18 years, 2 months
[JBoss Seam] - strange behaviour with security rules 2.0.1GA
by jamesjmp
hi!
I have just started to work with the latest releases (SEAM 2.0.1.GA and JBOSS 4.2.2)
I am testing the security and something strange happens with my application.
Restrictions defined in my pages.xml with s:hasRole work ok, but in the .drl file they are not working properly.
This is my authenticate method:
| public boolean authenticate() {
| if (((identity.getUsername().equalsIgnoreCase("admin")) && (identity.getPassword().equalsIgnoreCase("hola")))) {
| identity.addRole("adminGral");
| return true;
| }
| else if (((identity.getUsername().equalsIgnoreCase("simpleuser")) && (identity.getPassword().equalsIgnoreCase("bonjour")))) {
| identity.addRole("user");
| return true;
| }
| }
|
This are restrictions defined in pages.xml:
| <page view-id="/FirmChoose.xhtml">
| <restrict>#{s:hasRole('adminGral')}</restrict>
| </page>
|
| <page view-id="/FirmList.xhtml">
| <restrict/>
| </page>
|
and this is the rule defined in my security.drl
| rule FirmList
| when
| c: PermissionCheck(name == "/FirmList.xhtml", action == "render")
| Role(name == "adminGral")
| then
| c.grant();
| end;
|
When I authenticate with simpleuser as it has user role I may not access to
the restricted pages (FirmList and FirmChoose) and the following exception appears:
12:27:41,671 ERROR [SeamPhaseListener] uncaught exception
org.jboss.seam.security.AuthorizationException: Authorization check failed for permission [/FirmList.xhtml,render]
at org.jboss.seam.security.Identity.checkPermission(Identity.java:486)
at org.jboss.seam.navigation.Page.checkPermission(Page.java:214)
at org.jboss.seam.navigation.Page.preRender(Page.java:238)
at org.jboss.seam.navigation.Pages.preRender(Pages.java:309)
at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:549)
at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:460)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
....
That is ok. But on the other hand if I authenticate with admin, I am allowed to access to FirmChoose ( #{s:hasRole('adminGral')} works perfectly) but howewer I may not acces to FirmList (FirmList does not grant my access in spite of having adminGral role)
I wonder if I have missed to configure something or if I am doing something wrong. (hope it not to be a bug)
thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128702#4128702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128702
18 years, 2 months
[Microcontainer] - Re: ClassLoaderMetaData not propagating (yet?) to classloade
by gcompienne
Ok, here is the code for TestDescribeDeployer:
| package protomcf.test.deployer;
|
| import java.util.List;
|
| import org.jboss.deployers.spi.DeploymentException;
| import org.jboss.deployers.spi.deployer.DeploymentStages;
| import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
| import org.jboss.deployers.structure.spi.ClassLoaderFactory;
| import org.jboss.deployers.structure.spi.DeploymentUnit;
| import org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData;
| import org.jboss.logging.Logger;
|
| import protomcf.test.metadata.ParserMetaData;
|
| public class TestDescribeDeployer extends AbstractRealDeployer {
|
| private final Logger log = Logger.getLogger(TestDescribeDeployer.class);
|
| public TestDescribeDeployer() {
| setStage(DeploymentStages.DESCRIBE);
| setInputs(new Class<?>[] {ParserMetaData.class, ClassLoaderMetaData.class});
| //setInput(ParserMetaData.class);
| //setInput(ClassLoaderMetaData.class);
| setOutput(ClassLoaderMetaData.class);
| //setOutput(TestMetaData.class);
| //setAllInputs(true);
| }
|
| @Override
| protected void internalDeploy(DeploymentUnit unit) throws DeploymentException {
| log.debug("TestDescribeDeployer deploy called...");
| ClassLoaderMetaData clmd = unit.getAttachment(
| ClassLoaderMetaData.class);
| if (clmd != null) {
| Utils.displayCLMetaData(clmd, log);
| }
| ClassLoaderFactory clf = unit.getAttachment(ClassLoaderFactory.class);
| if (clf != null) {
| log.debug("ClassLoaderFactory is " + clf);
| } else {
| log.debug("ClassLoaderFactory not present...");
| }
| ParserMetaData pmd = unit.getAttachment(ParserMetaData.class);
| if (pmd != null) {
| log.debug("ParserMetaData found: " + pmd);
| clmd.setDomain("TestAppDomain");
| clmd.setImportAll(false);
| Utils.displayCLMetaData(clmd, log);
| unit.addAttachment(ClassLoaderMetaData.class, clmd);
| } else {
| log.debug("ParserMetaData not present...");
| }
| }
|
| }
|
Also here follows a more readable version of the log:
| [MainDeployerImpl] Add deployment: vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
| [MainDeployerImpl] Scheduling deployment: vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar parent=null
| [DeployersImpl] Deploying vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
| [TestParserDeployer] TestDeployerParser parsing...
| [TestParserDeployer] TestDeployerParser returning: ParserMetaData(a)9674968[testapp.BaseTestServlet]
| [TestDescribeDeployer] TestDescribeDeployer deploy called...
| [TestDescribeDeployer] ** ClassLoaderMetaData = org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData@17a4a80
| [TestDescribeDeployer] ** Name = vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
| [TestDescribeDeployer] ** Domain = <DEFAULT>
| [TestDescribeDeployer] ** Parent Domain = null
| [TestDescribeDeployer] ** isImportAll? true
| [TestDescribeDeployer] ** Export all = NON_EMPTY
| [TestDescribeDeployer] ClassLoaderFactory not present...
| [TestDescribeDeployer] ParserMetaData found: ParserMetaData(a)9674968[testapp.BaseTestServlet]
| [TestDescribeDeployer] ** ClassLoaderMetaData = org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData@17a4a80
| [TestDescribeDeployer] ** Name = vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
| [TestDescribeDeployer] ** Domain = TestAppDomain
| [TestDescribeDeployer] ** Parent Domain = null
| [TestDescribeDeployer] ** isImportAll? false
| [TestDescribeDeployer] ** Export all = NON_EMPTY
| [BaseClassLoader] Created BaseClassLoader@1b152ad with policy VFSClassLoaderPolicy@aaff99{domain=null roots=[JarEntryHandler(a)26648165[path=apptest.jar/WEB-INF/classes context=file:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/ real=jar:file:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar!/WEB-INF/classes/], MemoryContextHandler@7525824[path=classes context=vfsmemory://5c4o1e5d-iof0j2-fckddmwn-1-fckdgjxg-1l real=vfsmemory://5c4o1e5d-iof0j2-fckddmwn-1-fckdgjxg-1l/classes]] delegates=[] exported=[testapp]NON_EMPTY}
| [BaseClassLoaderDomain] ClassLoaderDomain@12462b3{<DEFAULT>} registerClassLoader BaseClassLoader@1b152ad{VFSClassLoaderPolicy@aaff99{domain=null roots=[JarEntryHandler(a)26648165[path=apptest.jar/WEB-INF/classes context=file:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/ real=jar:file:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar!/WEB-INF/classes/], MemoryContextHandler@7525824[path=classes context=vfsmemory://5c4o1e5d-iof0j2-fckddmwn-1-fckdgjxg-1l real=vfsmemory://5c4o1e5d-iof0j2-fckddmwn-1-fckdgjxg-1l/classes]] delegates=[] exported=[testapp]NON_EMPTY}}
| [TestClassloaderDeployer] ** ClassLoaderMetaData = org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData@17a4a80
| [TestClassloaderDeployer] ** Name = vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
| [TestClassloaderDeployer] ** Domain = TestAppDomain
| [TestClassloaderDeployer] ** Parent Domain = null
| [TestClassloaderDeployer] ** isImportAll? false
| [TestClassloaderDeployer] ** Export all = NON_EMPTY
| [TestClassloaderDeployer] ClassLoaderFactory not present...
| [TestClassloaderDeployer] ClassLoader is BaseClassLoader@1b152ad
| [TestClassloaderDeployer] ** module = org.jboss.deployers.plugins.classloading.Module@12f5047
| [Ejb3Deployer] ********* Ejb3Deployer Begin Unit: apptest.jar jar: apptest.jar
| [Ejb3Deployment] EJB3 deployment time took: 0
| [DeployersImpl] Fully Deployed vfsfile:/C:/jboss5-beta3/jboss-5.0.0.Beta3/server/default/deploy/apptest.jar
|
On the log, you can see that TestDescribeDeployer did set the domain to "TestAppDomain" and the TestClassloaderDeployer clearly pick that up.
However on the two lines where the base class loader is created (in between the describe and CL deployer) we can clearly see that the domain is equal to default. I wonder what would also be the status of the "import" state but I can't display it yet (I will need to give it a go with a debugger at some point).
Thanks for your help.
Gilles.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128700#4128700
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128700
18 years, 2 months