[EJB/JBoss] - Removed entity beans can be resurrected in container's memor
by rydenius
Hi.
I have an enterprise application containing a large number of BMP entity beans that are created, findByPrimaryKey:ed, and removed by a number of separate clients. I have a problem that occurs rarely, but sometimes:
Let us say that we have two EJB transactions A and B. They both try to access the same entity C. A, which enters first and locks the bean C to the transaction, want to call remove() on the bean. B calls a little bit later on findByPrimaryKey() for C or some random business method on C.
When C.remove() has executed by A, C is immediately removed from the EJB container's bean cache. But the DB transaction which executed the remove may still not be committed when transaction B enters the stage. Since A's transaction is not yet committed, B will not see the modifications it has done in DB, and since C is now removed from bean cache, B will cause ejbActivate() and ejbLoad() to be called on a new C instance, which then is added to the beancache (if commit options permits and transaction B is not rollbacked). Meanwhile, transaction A is committed, and C is permanently removed from persistent storage. But the ghost instance of C added in bean cache as a sideeffect of B will live on until next ejbLoad() when a NoSuchEntityException hopefully is thrown and C is really permanently removed from bean cache. But if using commit option A, that may take a while, especially when cache timeouts are set to get high performance.
But is this really a problem? Yes it is for us. A removed bean may act as if it still exists for some time after removal. And also, if any business methods are invoked on the ghost instance, inconsistent data may be stored in the DB.
But does this really happen, the window for this problem must be so small? Not often, I admit. But sometimes it does, and that is trouble for us. Espescially, JMS events may cause multiple clients to take action on the same bean simultaneously.
So, what is the solution for this? I can't be the only one who has seen this behavior? Is there a standard pattern to avoid this without loosing performance? Or is this just a bug in JBoss that needs to be fixed? Or am I just using the wrong transaction isolation level on my data source?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993149#3993149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993149
19 years, 4 months
[Beginners Corner] - Error when trying to stop JBoss
by msavoy
I am getting the following error when trying to STOP the JBoss server from within Eclipse 3.2.1 (Any direction or help would be greatly appreciated as I could not find an answer to this question in this forum. Thank you.):
| Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
| at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
| at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
| 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 sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
| at sun.rmi.transport.Transport$1.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at sun.rmi.transport.Transport.serviceCall(Unknown Source)
| at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
| at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
| at sun.rmi.server.UnicastRef.invoke(Unknown Source)
| at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
| at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
| at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
| at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| at $Proxy0.invoke(Unknown Source)
| at org.jboss.Shutdown$ServerProxyHandler.invoke(Shutdown.java:266)
| at $Proxy1.shutdown(Unknown Source)
| at org.jboss.Shutdown.main(Shutdown.java:237)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993147#3993147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993147
19 years, 4 months
[JBoss jBPM] - Deploying process programatically, Hibernate
by jstachera
Hi,
I have question which is related to deployment of process definition from the code, as it is shown below. Actually it is more hibernate issue, since every new deployed Process Definition is not getting a consecutive ID number in JBPM_PROCESS_DEFINITION table. So the JBPM_PROCESS_DEFINITION table looks like that:
| ID | Name | ver| .... | ...
| --------------------------------------------------
| 1 | websale | 1 | FALSE | 2
| 2162 | SimpleSplitTest | 1 | FALSE | 2163
| ----------------------------------------------------
|
why the SimpleSplitTest did not get ID = 2 ??
| public static void deployProcessPar(String filePath) throws JbpmAtflowException, FileNotFoundException {
| JbpmContext context = getAdminContext();
| try {
| ZipInputStream zip = new ZipInputStream(new FileInputStream(filePath));
| ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zip);
| context.deployProcessDefinition(processDefinition);
| }
| catch (Exception e) {
| throw new JbpmAtflowException("Could not deploy process PAR archive", e);
| }
| finally {
| context.close();
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993144#3993144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993144
19 years, 4 months
[JBoss jBPM] - No SOAPMessage in HTTP-Request body invoking WS
by bertrand.njiipwo
Hello community,
I have the following problem:
I'm trying to call a web service inside my BPEL-Process running unter the jbpm-Engine from JBoss. During his execution the process call an"virtually deployed" web service which should not be used at runtime (This because jBPM require the deployement of process partners). Instead of this service the call have to be redirected to a remote service wich can only deal with request like: http://127.0.0.1:8089/context/serviceName. But inside this simple HTTP-Request the SOAPMessage the BPEL process concatenate before performing the call has to be present in the HTTP-Body of this request.
On my old System i was using BPWS4J from IBM alphaWorks as BPEL-Engine. Now i move to jBPM.BPEL (1.beta1 with JBoss AS-4.0.4.GA and jBPM-3.1.1) and i have the problem that, the jPBM-Engine didn't inject automatically the required SOAPMessage in the HTTP-Request before the web service call is performed.
Any one has some ideas if this is the case on the jbpm-Engine?
Every tipps or advice will be welcomed and help a lot.
Cheers
Bertrand
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993143#3993143
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993143
19 years, 4 months