[JBoss jBPM] - Re: org.hibernate.TransientObjectException object references
by warmonga
@kukeltje: Many thanks for your immediate reply!
anonymous wrote : Yes, it is understandable what you want to achieve, process wise. What I still do not understand is why you try to implement it by run-time modifying of the processdefinition.
This is because I want to give the user the possibility to model his/her process in jBPM and, separated from that, define a set of business rules that should hold. Thus my validation mechanism is to function on any process no matter how it is modelled. The only thing that needs to be done by my "validation tool" in the XML-file of the process itself is to add the ActionHandler to each TaskNode programmatically.
anonymous wrote :
| Questions:
| - If you do not want the 'next' task to show up directly, when do you want it to show up and is there any trigger for it
|
Ok I want, in case any of the rules fires, the process to stop, a new TaskInstance (which in my current implementation is outside of the current process in a kind of "alert process" only holding this one Task with the error message) to be displayed, and after the user clicked on that task instance that showed up (I assume that the user changes some data in his backend systems in order to make the system "rule conform" again) the process should be continued. So I thought a call of processInstance.suspend() at the moment when the rule fires and a processInstance.resume() at that moment when the TaskInstance of the "alert process" is executed would be best.
anonymous wrote :
| - what if the info entered for it is still not correct?
|
Well as explained above the user does not necessarily need to enter new information, his information is assumed to be changed in the backend by the user / other users. Ok but the question persists: Well, the best solution would be, that the rules are validated again right away and the main process would only continue if this time everything is conform with all rules. So best would be if the ActionHandler which fires the rules or a similar ActionHandler would be called again somehow at this point.
But for now I am Ok with a situation where I just assume that the user corrects his data after I told him that someting is incorrect (through the TaskInstance of the "alert process"), so the rules do not need to fire again and the main process should just continue execution.
anonymous wrote :
| - Why not just use a jsf validator on the input field that requires the entry to be > 4
|
Because of the requirement that the rules do not belong to a specific process and the entries are not necessariliy made through process variables
Any hints for solving this issue?
Many thanks again for your help!
Cheers,
Maurice
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047061#4047061
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047061
18 years, 11 months
[Security & JAAS/JBoss] - Session Beans with its own personal roles
by dav_ua
How to assign own set of user roles for different Session Bean?s?
Here is business logic: we have users, gaining rights for calling Session Bean?s methods
depends on accessory to the group; group contains records in such form:
name of the Session-Bean -> list of roles available for the given bean;
roles define CRUD operations.
CODE:@Stateless
classSessionBeanA
{
@RolesAllowed("CREATE")
void newClass(String name) { ... }
@RolesAllowed("READ")
List getAll() { ... }
@RolesAllowed("DELETE")
void remove(Long id) { ... }
}
@Stateless
class SessionBeanB
{
@RolesAllowed("READ")
List getList() { ... }
@RolesAllowed("UPDATE")
void changeUser(User u) { ... }
}
and groups with these roles for calling methods:
GroupFirst
SessionBeanA ?> { CREATE, READ }
SessionBeanB ?> { UPDATE }
GroupSecond
SessionBeanA ?> { READ, DELETE }
SessionBeanB ?> { READ, UPDATE }
Suppose that,
user User1 consisted in GroupFirst
and
user User2 consisted in GroupSecond,
then the table of available operations has view:
UserSessionBeanAvailable methodsUser1SessionBeanAnewClass()getAll() SessionBeanBchangeUser()
User2SessionBeanAgetAll()remove()
SessionBeanAgetList()changeUser()
With such organization occurs necessity to define capacity of calling methods in different
Session Beans and user must have different rights for each of the Session-Bean.
Please, give an advice: how it all can be organized or, at least, in what
direction I should work?
(Maybe, dynamical change (on the fly) of user?s roles when we calling one
or another SessionBean will be right decision?
If yes, in which way I should go?)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047058#4047058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047058
18 years, 11 months
[JBoss jBPM] - Re: org.hibernate.TransientObjectException object references
by warmonga
@ kukeltje: Thanks for your reply! Ok, the news are not good.
Ok I'll try to real quick explain my scenario, maybe anyone has an idea how to solve it:
I have a scenario where a process instance is to be evaluated by business rules (expressed by drools rules) after each single task instance of the process. This is realized through an ActionHandler, which is attached to each TaskNode and which fires the Drools rules. If any of the rules is not valid, then the process execution should simply stop and the user should get a message, i.e. a task saying "Please check componentX/valueY/wahetever". That is it so far.
What I already tried is the following:
1. Just insert a TaskInstance displaying the message and call processInstance.suspend() in the consequence of the Drools rule. The TaskInstance-part works fine but:
-> Problem: It seems like processInstance.suspend() does not work if called out of an ActionHandler
2. Insert a state node right after the current TaskNode. This inserted state node could also make the process instance pause process execution.
-> Problem: TransientObjectException as described earlier in this thread
3. My current workaround is this: Insert a TaskInstance for the message (as in try no. 1) and then just set the ASYNC attribute of the node following the "node that fires the rule" to true, so that the user, in case any of the rules fires, only sees the inserted TaskInstance in his work list at first, because the task that would be displayed if none of the rules would have fired was set to ASYNC.
-> Problem with that: This does not really stop the process execution, it only requires a second click on "Home" in the task list in order to show the next "regular task" for the user.
Ok, so hopefully this was understandable and hopefully someone has a hint for solving this issue.
Many thanks in advance!
Best regards,
Maurice
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047056#4047056
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047056
18 years, 11 months
[JBoss Seam] - The examples are not running as expected in my environment
by eismeraldo
Hi
The software I have installed under WinXP are: Java jdk1.6.0_01, a fresh jboss-4.0.5.GA, jboss-seam-1.2.1.GA und the cvs version of jboss-seam at Sa. 19. Mai, Tomcat 5.5.23
When I deploy ?ant deploy? the booking example to jboss, the following exception throws:
09:20:43,437 INFO [STDOUT] 09:20:43,437 ERROR [[/seam-booking]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: Could not create Component: authenticator
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
at org.jboss.seam.init.Initialization.init(Initialization.java:503)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
and 100 lines more?.
The same example deployed to Tomcat ?ant deploy.tomcat? displays the first page ?home? correct, but when I will register a new user, then throws the following exception:
INFO: Server startup in 7734 ms
14:31:45,671 ERROR [ExceptionFilter] could not roll back transaction
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:149)
at org.jboss.seam.util.Transactions.isUTTransactionActiveOrMarkedRollback(Transactions.java:122)
at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:50)
at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:128)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
and a second one: = = == == = = = = == == = = = = == == = = = = == == = =
14:31:45,734 INFO [ServletCacheAdministrator] Created new instance of ServletCacheAdministrator
14:31:45,734 INFO [ServletCacheAdministrator] Created new application-scoped cache at key: __oscache_cache
20.05.2007 14:31:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
20.05.2007 14:31:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
20.05.2007 14:31:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
20.05.2007 14:31:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
20.05.2007 14:31:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/ajax4jsf-1.1.1-SNAPSHOT.jar!/META-INF/a4j.taglib.xml
20.05.2007 14:31:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/richfaces-3.0.1-SNAPSHOT.jar!/META-INF/rich.taglib.x
ml
20.05.2007 14:31:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
20.05.2007 14:31:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/Programme/Apache_Software_Foundation/Tomcat_5.5/webapps/jboss-seam-booking/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam-ui.taglib.xml
14:31:46,265 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
14:31:46,265 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
14:31:46,265 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
14:31:46,296 ERROR [ExceptionFilter] could not roll back transaction
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:149)
at org.jboss.seam.util.Transactions.isUTTransactionActiveOrMarkedRollback(Transactions.java:122)
at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:50)
at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:128)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Unknown Source)
14:31:46,312 ERROR [ExceptionFilter] could not roll back transaction
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
and 100 lines more?.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Deploying the example ?registration? to jboss, then the following happens:
14:53:08,390 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jboss-seam-registration.ear,jar=jboss-seam-registration.jar,name=RegisterAction,service=EJB3 with depen
dencies:
14:53:08,406 INFO [JmxKernelAbstraction] persistence.units:ear=jboss-seam-registration.ear,jar=jboss-seam-registration.jar,unitName=userDatabase
14:53:08,656 INFO [EJBContainer] STARTED EJB: org.jboss.seam.example.registration.RegisterAction ejbName: RegisterAction
14:53:08,843 INFO [EJB3Deployer] Deployed: file:/D:/Java/jboss-4.0.5.GA/server/default/tmp/deploy/tmp43817jboss-seam-registration.ear-contents/jboss-seam-registration.jar
14:53:09,062 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jboss-seam-registration.ear,jar=jboss-seam.jar,name=Dispatcher,service=EJB3 with dependencies:
14:53:09,125 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.Dispatcher ejbName: Dispatcher
14:53:09,218 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jboss-seam-registration.ear,jar=jboss-seam.jar,name=TransactionListener,service=EJB3 with dependencies:
14:53:09,296 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.TransactionListener ejbName: TransactionListener
14:53:09,343 INFO [SimpleStatefulCache] Initializing SimpleStatefulCache with maxSize: 100000 timeout: 300 for jboss.j2ee:ear=jboss-seam-registration.ear,jar=jboss-seam.jar,name
=TransactionListener,service=EJB3
14:53:09,375 INFO [EJB3Deployer] Deployed: file:/D:/Java/jboss-4.0.5.GA/server/default/tmp/deploy/tmp43817jboss-seam-registration.ear-contents/jboss-seam.jar
14:53:09,406 INFO [TomcatDeployer] deploy, ctxPath=/seam-registration, warUrl=.../tmp/deploy/tmp43817jboss-seam-registration.ear-contents/jboss-seam-registration-exp.war/
14:53:10,390 INFO [STDOUT] 2007-05-20 14:53:10,390 WARN [main] **-->: Locale name in faces-config.xml null or empty, setting locale to default locale : de_CH
14:53:13,687 INFO [STDOUT] 2007-05-20 14:53:13,687 ERROR [main] **-->: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamList
ener
java.lang.RuntimeException: Could not create Component: register
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
at org.jboss.seam.init.Initialization.init(Initialization.java:503)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Deploying the example ?registration? to tomcat, the first page cams up. but after pressing the button ?Register? the following happens:
INFO: Deploying web application archive jboss-seam-registration.war
2007-05-20 14:59:52,671 WARN [main] **-->: Locale name in faces-config.xml null or empty, setting locale to default locale : de_CH
20.05.2007 14:59:53 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
20.05.2007 14:59:53 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
20.05.2007 14:59:53 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=null
20.05.2007 14:59:53 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
20.05.2007 14:59:53 org.apache.catalina.startup.Catalina start
INFO: Server startup in 40031 ms
2007-05-20 15:00:25,703 ERROR [http-8080-Processor25] **-->: Servlet.service() for servlet Faces Servlet threw exception
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
at org.jboss.seam.Component.instantiateSessionBean(Component.java:1107)
at org.jboss.seam.Component.instantiate(Component.java:1093)
at org.jboss.seam.Component.newInstance(Component.java:1736)
at org.jboss.seam.Component.getInstance(Component.java:1643)
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
The example ?hibernate2? is running on Tomcat and on JBoss without any problems!
What are I doing wrong?
Thank you for any help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047055#4047055
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047055
18 years, 11 months