[JBoss Seam] - Re: Seam 2.0.CR1, jBPM and custom entity process variables
by MSchmidke
"pete.muir(a)jboss.org" wrote : Do you still need help with this? Sorry, I lost track of the issue.
Yes and no ...I get perfectly along when I do it without Seam's jBPM support, but of course this is a pity because I want to get the best out of Seam.
To abstract my problem:
When I began my project, I spent two or three days getting jBPM and EJB3 together such that I can reference EJB3 entity beans as jBPM process variables. This wasn't ready documented, but I managed it.
A few weeks later I tried to get Seam into this, but had no success, because Seam wasn't compatible to the way I injected my Persistence Context's Hibernate Session into jBPM (for that jBPM uses Persistence Context's transaction scope which is finally a Seam managed transaction).
I am not sure whether I am doing something wrong or whether this is a feature request.
Did you ever interweave jBPM and EJB3?
Happy Holidays,
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115550#4115550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115550
18 years, 3 months
[JBoss Seam] - Re: How to control end of conversations/state of stateful be
by gus888
"pete.muir(a)jboss.org" wrote : "gus888" wrote : For "How to control end of conversations":
| | I have the same problem. I think that it is critical issue for the core (conversation) of Seam. The Seam forum here suggested that you use "propagation=none" to all other buttons and links which users can reach and propagate away from the current conversation. I think, maybe I am wrong, that this way is not practicable in a production project. One reason is that maybe there are a couple of dozens links and buttons on screen,
|
| So this is just laziness?
| Hi Pete,
First, thank you for your reply. I think that it is not just laziness. The conversation is specifically useful for complicated project, based on Kavin's statements in the tutorial. For a complicated project with top drop-down menus, left bar menus and right bar menus, developers have to put "propagate=none" to **every buttons and links** at every conversation step to prevent users from propagating away from a conversation. Importantly, this way seems that software developers are completely controlled by non-coorporate user's behavior, but based on my little experience, software developers should always control non-coorporate user's behavior. Correct me if I am wrong. Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115548#4115548
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115548
18 years, 3 months
[JBoss Seam] - Re: TransactionCompletionEvent and @Asynchronous
by cpopetz
"pete.muir(a)jboss.org" wrote : "cpopetz" wrote : where anAsyncMethod() is a method marked @Aysnchronous. (I'd mark the observer itself as @Asynchronous, but that gets ignored.)
|
| There is an open feature request for this to be supported (I think it makes good sense).
|
Wonderful, thanks.
"pete.muir(a)jboss.org" wrote : "cpopetz" wrote : However, anAsyncMethod() isn't called asynchronously, because TransactionCompletionEvent is an AsynchronousEvent, and seam disallows spawning one asynchronous call from another.
|
| This was a bug which we fixed for 2.0.0.GA - what version are you using?
|
| You certainly should be able to schedule async calls from other async calls.
|
Indeed, and the above example is working for me since moving to 2.0.0GA. I now have a similar situation that's a little more complicated than above. My @Observer and the @Asynchronous method it invokes are in the same SLSB. (And once @Observers can be @Asynchronous, this will all be moot, because that's what I'm working around.) I had done the following from within the @Observer method:
| @Observer("doLongWorkAfterTxIsDone")
| public void doWork() {
| // this.anAsynchMethod(); //doesn't work; no interceptors
| ejbContext.getBusinessObject(AttachmentStorer.class).anAsynchMethod();
| }
|
| //this is annotated @Asynchronous in the @Local interface
| public void anAsynchMethod() {
| ...
| }
|
But this causes seam to use the SERVER set of interceptors, which does not include AsynchronousInterceptor. I also tried doing Component.getInstance("myComponentName") to obtain an intercepted version of "this", but the method context contains "this" and just returns it, and no interceptors are used on the invocation of anAsynchMethod() in that case either.
It seems that @Asynchronous works well between objects, but not so well for method calls within an object, which is unfortunate, but perhaps that's by design. I can refactor to move the asynchronous code into a different bean, but that's a bit artificial. So I'll probably just use Seam's Work() { } construct.
This is similar to the problem I faced with @TransactionAttribute and intra-bean calls. I think it's a common use-case for a session bean to want to invoke methods upon itself, but in order to have CMT work correctly in the non-default case of having an outer method be non-transactional and repeatedly invoke an inner method which gets its own transaction, this means using getBusinessObject(), which is just plain ugly.
But that's not seam's issue :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115547#4115547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115547
18 years, 3 months
[JBoss Seam] - Re: Unable to use @Asynchronous annotation on Glassfish serv
by usedtoclimb
I was not declaring jboss-seam.jar in application.xml so I resolved that and now a timer runs but it cannot find the EJB containing the @Asynchronous method (SystemManagerBean).
Here is what is displayed when the timer runs (emphasis added)...
EJB5018: An exception was thrown during an ejb invocation on [Dispatcher]
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3869)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:2855)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1401)
at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:99)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1952)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.service(EJBTimerService.java:1948)
at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: systemManager
at org.jboss.seam.Component.newInstance(Component.java:1740)
at org.jboss.seam.Component.getInstance(Component.java:1643)
at org.jboss.seam.Component.getInstance(Component.java:1610)
at org.jboss.seam.Component.getInstance(Component.java:1604)
at org.jboss.seam.core.Dispatcher$AsynchronousInvocation.call(Dispatcher.java:122)
at org.jboss.seam.core.Dispatcher$Asynchronous.execute(Dispatcher.java:88)
at org.jboss.seam.core.Dispatcher.dispatch(Dispatcher.java:165)
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 com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:2824)
... 6 more
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/mlm-ear-1.0/SystemManagerBean/local
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
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)
... 20 more
EJB5119:Expunging timer ['4@@1198695363541@@server@@domain1' 'TimedObject = Dispatcher' 'Application = mlm-ear-1.0' 'BEING_DELIVERED' 'SINGLE-ACTION' 'Container ID = 78557698959015936' 'Wed Dec 26 11:57:02 MST 2007' '0' ] after [2] failed deliveries
I declare the SystemManagerBean as follows:
@Name(value = "systemManager")
| @Stateless
| public class SystemManagerBean implements SystemManager {
|
I made a guess thinking it might be a glassfish embedded EJB issue and added the following to ejb-jar.xml but it did not help.
<session>
| <ejb-name>Dispatcher</ejb-name>
| <ejb-local-ref>
| <ejb-ref-name>mlm-ear-1.0/SystemManagerBean/local</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <local>com.el.mlm.SystemManager</local>
| <ejb-link>SystemManagerBean</ejb-link>
| </ejb-local-ref>
| </session>
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115546#4115546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115546
18 years, 3 months