[EJB 3.0] - ClassCastException in the InvokeRemoteInterceptor
by mindflyer
Client application lookups SLSB in the JNDI and invokes its method. If SLSB throws exception (in this example - DAOException), I see on the client side ClassCastException.
Caused by: java.lang.ClassCastException: net.uk.topdog.td2.common.dao.DAOException
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
at $Proxy4.executeCommands(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.uk.topdog.td2.common.jndi.RemoteProxy.invokeRemote(RemoteProxy.java:75)
at net.uk.topdog.td2.common.jndi.RemoteProxy.invoke(RemoteProxy.java:40)
at $Proxy4.executeCommands(Unknown Source)
at net.uk.topdog.td2.common.dao.client.ClientUnTypedDAOImpl.executeCommands(ClientUnTypedDAOImpl.java:173)
... 12 more
I saw ClassCastException for EJBException also.
And ClassCastException for NotFoundInDispatcherException if I used clustered SLSB.
My SessionBean :
@Stateless(name = "UnTypedEmfDAORemoteSessionBean")
@Remote(UnTypedEmfSerializableDAO.class)
@Interceptors({EmfPreparerForSerialization.class})
public class UnTypedEmfDAORemoteSessionBean implements UnTypedEmfSerializableDAO { ... }
I use JBoss 4.0.5.GA with jboss-EJB-3.0_RC9_Patch_1 now.
Earlier I used JBoss 4.0.4.GA with EJB 3.0 RC7 and didn't see ClassCastException.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010062#4010062
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010062
19Â years, 2Â months
[JBoss jBPM] - ?oncurrent workflow execution in separate threads
by enpx
Hi,
Suppose, I have this simple workflow:
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="0">
| <start-state name="start">
| <transition to="work"></transition>
| </start-state>
| <node name="save data to database">
| <action class="mypackage.DbSave"/>
| <transition to="end"></transition>
| </node>
| <end-state name="end"></end-state>
| </process-definition>
|
It is possible to automatically execute it with this simple code:
| ProcessInstance processInstance = jbpmContext.getProcessInstance(id);
| Token token = processInstance.getRootToken();
| while(!processInstance.hasEnded()) {
| token.signal();
| jbpmContext.save(processInstance);
| }
|
Sometimes workflow can include concurrent steps:
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="0">
| <start-state name="start">
| <transition name="" to="fork"></transition>
| </start-state>
| <node name="save data to database 0">
| <action class="mypackage.DbSave0"/>
| <transition name="" to="join"></transition>
| </node>
| <node name="save data to database 1">
| <action class="mypackage.DbSave1"/>
| <transition name="" to="join"></transition>
| </node>
| <end-state name="end"></end-state>
| <fork name="fork">
| <transition to="save data to database 1"></transition>
| <transition to="save data to database 0"></transition>
| </fork>
| <join name="join">
| <transition to="end"></transition>
| </join>
| </process-definition>
|
Is it possible to execute nodes "save data to database 0" and "save data to database 1" in separate threads?
I tried to read chapter 9 (Process Modelling) and 13 (Asynchronous continuations) in User Guide about async node attribute, but I can't understand how can I write code to automatically execute such workflows.
My questions are:
1. How can I define jBPM Command Executor in standalone application and how to communicate between Command Executor main while cycle? How can this cycle looks like? Can anybody give me example code?
2. Can I run different nodes concurrenly only with JMS thread pool?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010053#4010053
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010053
19Â years, 2Â months
[JBoss AOP] - AOP and Scoped Classloader
by jimmycallaghan
I have a server with a number of EAR files deployed. One of these applications (call it EAR1) is logging it's own metrics from within it's own code.
To replace this, I have created another metrics application that will use AOP to intercept certain method calls as they happen in EAR1. All of this is working just fine. However, the EAR1 exists on a server with another 3 applications that use the same core classes and these core classes are of different versions. Currently each of these applications uses it's own scoped classloader as defined in their own jboss-app.xml.
To get my AOP application to work properly I've had to remove the jboss-app.xml file in EAR1 and in the AOP application and leave it in the other 3 apps. However, now I'm getting a lot of errors when the other applications deploy:
ERROR [STDERR] [error] ClassLoader has been garbage collected.. Do verbose mode if you want full stack trace.
What I really need to do is deploy my AOP application (itself an EAR file) that only applies to the classes in EAR1. Is there any way to do this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010049#4010049
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010049
19Â years, 2Â months