[JBossCache] - Re: TreeCache CacheLoader Issue
by robnor
My current workaround:
| public static void storeTracker(ImportTracker tracker)
| {
| logDebug("storeTracker() - start");
|
| try
| {
| if (useTreeCache)
| {
| logDebug("ImportTracker - PUT");
| boolean transactionActive = false;
| try
| {
| TreeCacheMBean cache = CacheHelper.getImportCache();
| Transaction trans = CacheHelper.getImportCache().getTransactionManager().getTransaction();
| if (trans != null)
| {
| logDebug("TRANSACTION STATUS: " + getTransactionStatusString(trans.getStatus()));
| if (trans.getStatus() != Status.STATUS_COMMITTED)
| {
| transactionActive = true;
| }
| }
| else
| {
| logDebug("NO TRANSACTION");
| transactionActive = false;
| }
| }
| catch (SystemException ex)
| {
| slog.error("Transaction Error!", ex);
| }
|
| CacheHelper.getImportCache().get(nodename).put("importTracker", tracker);
|
|
| Fqn fqn = CacheHelper.getImportCache().get(nodename).getFqn();
| try
| {
| ImportTracker tr = (ImportTracker) CacheHelper.getImportCache().get(fqn, "importTracker");
| ImportTracker tr2 = (ImportTracker) CacheHelper.getImportCache().getCacheLoader().get(fqn).get("importTracker");
| if (tracker.equals(tr))
| {
| logDebug("Tracker objects are EQUAL");
| }
| else
| {
| logDebug("Tracker object are NOT EQUAL");
| logDebug("Putting updated Tracker hard in cacheloader");
| if (!transactionActive)
| {
| CacheHelper.getImportCache().getInstance().getCacheLoader().put(fqn, "importTracker", tracker);
| logDebug("Done!");
| }
| }
| logDebug("COMPARING WITH Tracker received from cacheloader");
| if (tracker.equals(tr2))
| {
| logDebug("Tracker objects are EQUAL");
| }
| else
| {
| logDebug("Tracker object are NOT EQUAL");
| logDebug("Putting updated Tracker hard in cacheloader");
| if (!transactionActive)
| {
| CacheHelper.getImportCache().getInstance().getCacheLoader().put(fqn, "importTracker", tracker);
| logDebug("Done!");
| }
| }
|
|
| }
| catch (Exception ex)
| {
| ex.printStackTrace();
| }
| logDebug("PUT - Performed!");
| }
| else
| {
| // === this should not be necessary as aop detects setting on methods ===
| CacheHelper.getImportPojoCache().putObject(nodename, tracker);
| }
| }
| catch (CacheException ex)
| {
| slog.error("Failed to store importtracker in cache", ex);
| }
| logDebug("storeTracker() - stop");
|
| }
|
|
| public static ImportTracker getTracker()
| {
| ImportTracker retval = null;
| if (useTreeCache)
| {
| TreeCacheMBean cache = CacheHelper.getImportCache();
|
| if (!cache.exists(nodename, "importTracker"))
| {
| logDebug(nodename + "/importTracker does not exist, creating a new");
| ImportTracker tracker = new ImportTracker();
| try
| {
| cache.put(nodename, "importTracker", tracker);
| retval = (ImportTracker) cache.get(nodename).get("importTracker");
| }
| catch (CacheException e)
| {
| slog.error("Failed to retrieve ImportTracker", e);
| }
| }
| else
| {
| try
| {
| retval = (ImportTracker) cache.get(nodename).get("importTracker");
| }
| catch (CacheException e)
| {
| slog.error(e);
| }
| }
| }
| else
| {
| PojoCacheMBean cache = CacheHelper.getImportPojoCache();
|
| if (!cache.exists(nodename, "importTracker"))
| {
| slog.debug(nodename + "/importTracker does not exist, creating a new");
| ImportTracker tracker = new ImportTracker();
| try
| {
| cache.putObject(nodename, tracker);
| retval = (ImportTracker) cache.getObject(nodename);
| }
| catch (CacheException e)
| {
| slog.error("Failed to create ImportTracker", e);
| }
| }
| else
| {
| try
| {
| retval = (ImportTracker) cache.getObject(nodename);
| }
| catch (CacheException e)
| {
| slog.error(e);
| }
| }
| }
| return retval;
| }
|
|
plese dont look at the pojocahce stuff, it will not be used atm
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043882#4043882
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043882
19 years
[Messaging, JMS & JBossMQ] - Multiple innvocation for single object(Message) in Queue
by evijayan2
Hi Guyz,
I have a MDB running in two machines A and B, Queue is common for both MDB's.
Queue is residing on Machine A.
I posted 5 Objects(message) (eg. Obj1, Obj2, Obj3...Obj5) from Java client to Queue.
The onMessage part is designed to consume 2minutes for execution.
Both MDB's are consuming messages parallel, but the consumed Objects(messages) is repeatedly picked up for execution by MDB's even after completion of the consumed message.
Pls suggest the working pattern of the MDB message handling.
Jboss Version 4.0.3.
public void onMessage(Message msg){
System.out.println("OnMessage is called............."+getTime());
String countId="";
try
{
ObjectMessage objMsg = (ObjectMessage)msg;
Count objCount = (Count)objMsg.getObject();
countId=objCount.getOrderNumber();
System.out.println("Message Received***********:"+countId);
for (int i=0;i<5000;i++ ) {
for (int j=0;j<9999999;j++ ) {
;
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println("OnMessage is End process........."+getTime()+"*******"+countId);
}
Jboss.xml
-----------
<enterprise-beans>
<message-driven>
<ejb-name>TestMDB</ejb-name>
<configuration-name>TestMDB</configuration-name>
<message-driven-destination>javax.jms.Queue</message-driven-destination>
<destination-jndi-name>queue/CountTestQueue</destination-jndi-name>
</message-driven>
</enterprise-beans>
<container-configurations>
<!-- Configurations for async count MDBs -->
<container-configuration>
<container-name>TestMDB</container-name>
<call-logging>false</call-logging>
<container-invoker>org.jboss.ejb.plugins.jms.JMSContainerInvoker</container-invoker>
<container-interceptors>
org.jboss.ejb.plugins.LogInterceptor
org.jboss.ejb.plugins.SecurityInterceptor
<!-- CMT -->
org.jboss.ejb.plugins.TxInterceptorCMT
org.jboss.ejb.plugins.MetricsInterceptor
org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
<!-- BMT -->
org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT
org.jboss.ejb.plugins.MetricsInterceptor
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
<instance-cache/>
<persistence-manager/>
<transaction-manager>org.jboss.tm.TxManager</transaction-manager>
<container-invoker-conf>
<!-- RemoteJMSProvider -->
DefaultJMSProvider
StdJMSPool
2
1
True
</container-invoker-conf>
<container-cache-conf/>
<container-pool-conf>
2
1
true
</container-pool-conf>
<commit-option>B</commit-option>
<role-mapping-manager/>
<authentication-module/>
</container-configuration>
</container-configurations>
Pls check it and give correct suggestion
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043881#4043881
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043881
19 years
[JBossWS] - Error deploying webservice on Tomcat 5.5 + JBossWS 1.2.1
by clkanth
I used Tomcat 5.5 (Standalone) + JBossWS1.2.1. The Integration is successful. The jbossws-deploy directory is also created. But when a deploy the WebService that is compliant of JAX-WS & JSR 181, I get the below error. Any help is highly appreciated.
-----------------------------------------------------------------------------
ERROR [TomcatServiceEndpointPublisher] Cannot deploy file: C:\Program Files\Apache Software Foundation\Tomcat 5.5\jbossws-deploy\InvetoryServices.war
java.io.IOException: Destination must be a directory.
at org.jboss.util.file.JarUtils.unjar(JarUtils.java:260)
at org.jboss.ws.integration.tomcat.wspublish.process(wspublish.java:68)
at org.jboss.ws.integration.tomcat.TomcatServiceEndpointPublisher.publishServiceEndpoint(TomcatServiceEndpointPublisher.java:80)
at org.jboss.ws.integration.tomcat.TomcatServiceEndpointPublisher.deployFile(TomcatServiceEndpointPublisher.java:135)
at org.jboss.ws.integration.tomcat.TomcatServiceEndpointPublisher.scanDeployDir(TomcatServiceEndpointPublisher.java:112)
at org.jboss.ws.integration.tomcat.TomcatServiceEndpointPublisher.access$100(TomcatServiceEndpointPublisher.java:44)
at org.jboss.ws.integration.tomcat.TomcatServiceEndpointPublisher$Scanner.run(TomcatServiceEndpointPublisher.java:192)
at java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------------
Below are the main steps of the sample build file i am using.
<!---->
Thanks and Regards
CLK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043880#4043880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043880
19 years
[JBoss jBPM] - Re: leaving transition on sub processes
by pbrewer_uk
Has there been any further developments on this?
I'm starting to use sub-processes and it would be very convenient to have the leaving transition of the process-state dependent on the end-state of the sub-process.
So, if the queryProcess ends in a state of "Details received" I would like the process-state to use the "detailsReceived" transition. Is this possible, if so what do I have to do to configure it?
TIA, Pete.
process-state node:
| <process-state name="Medical query process">
| <sub-process name="queryProcess" />
| <variable name="member" access="read,write" />
| <transition name="noResponseRecieved" to="Medical details not entered" />
| <transition name="detailsReceived" to="Medical details received"/>
| </process-state>
|
sub process:
| <process-definition name="queryProcess">
|
| <start-state name="start">
| <transition name="" to="Call member"></transition>
| </start-state>
|
| <task-node name="Call member">
| <task name="telephoneCustomerTask" description="Telephone Customer">
| <assignment actor-id="#{actor.id}" />
| </task>
| <transition name="member provided details" to="Details received"></transition>
| <transition name="member unavailable" to="Details unobtainable"></transition>
| </task-node>
|
| <end-state name="Details received" />
| <end-state name="Details unobtainable" />
| </process-definition>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043879#4043879
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043879
19 years
[Clustering/JBoss] - Re: Session Replication - Concurrency Problems?
by alpheratz-jb
Has anyone followed up on this issue?
I am also seeing this (behind a cisco loadbalancer), my session timeout is 40 mins and I don't think that I am hitting this limit...
|
| 2007-05-08 16:14:38,538 INFO
| [org.jboss.ha.framework.server.ClusterFileTransfer
| ] Start push of file TCEEar.ear to cluster.
| 2007-05-08 16:14:40,658 INFO
| [org.jboss.ha.framework.server.ClusterFileTransfer
| ] Finished push of file TCEEar.ear to cluster.
| 2007-05-08 16:22:32,036 INFO
| [org.jboss.web.tomcat.tc5.session.CacheListener] Possible concurrency problem: Replicated version id 4 matches in-memory version f or session Q6LCsX8DWbft3ejbmvog7Q**
| 2007-05-08 16:22:40,274 INFO
| [org.jboss.web.tomcat.tc5.session.CacheListener] Possible concurrency problem: Replicated version id 1 matches in-memory version f or session Q6LCsX8DWbft3ejbmvog7Q**
| 2007-05-08 16:22:45,256 INFO
| [org.jboss.web.tomcat.tc5.session.CacheListener] Possible concurrency problem: Replicated version id 2 matches in-memory version f or session Q6LCsX8DWbft3ejbmvog7Q**
|
Cheers,
Alph
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043877#4043877
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043877
19 years
[JBossWS] - JBoss 4.0.2 + JbossWS 1.2.1 Integration problem
by clkanth
Hi,
I used the installation procedures in the install.txt file of JBossWS 1.2.1 to integrate with JBoss 4.0.2. I executed "ant deploy-jboss40" command which said the build was successfull. But if I run JBoss, I get the following exception. Any pointers for resolving is highly appreciated.
Thanks in advance
--------------------------------------------------------------------------------------
15:17:08,821 ERROR [MainDeployer] could not create deployment: file:/C:/chilal/AllOthers/jboss-4.0.2/server/al
l/deploy/jbossws40.sar/
org.jboss.deployment.DeploymentException: Unexpected error during load of: org.jboss.ws.integration.jboss42.De
ployerInterceptorJSE, msg=org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean; - nested throwable: (j
ava.lang.ClassNotFoundException: Unexpected error during load of: org.jboss.ws.integration.jboss42.DeployerInt
erceptorJSE, msg=org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean)
-------------------------------------------------------------------------------------
org.jboss.deployment.DeploymentInfo@34f8ecfc { url=file:/C:/chilal/AllOthers/jboss-4.0.2/server/all/deploy/jbo
ssws40.sar/ }
deployer: org.jboss.deployment.SARDeployer@5fcf29
status: Deployment FAILED reason: Unexpected error during load of: org.jboss.ws.integration.jboss42.Deployer
InterceptorJSE, msg=org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean; - nested throwable: (java.la
ng.ClassNotFoundException: Unexpected error during load of: org.jboss.ws.integration.jboss42.DeployerIntercept
orJSE, msg=org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean)
state: FAILED
watch: file:/C:/chilal/AllOthers/jboss-4.0.2/server/all/deploy/jbossws40.sar/META-INF/jboss-service.xml
altDD: null
lastDeployed: 1178619339469
lastModified: 1178615714944
Thanks
CLK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043875#4043875
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043875
19 years
[JBoss Seam] - Problem with @Asynchronous in tests
by endremr
Hello!
I have just tried to use @Asynchronous for scheduled jobs, and it seems to work just as it should. Really easy to get things going :)
But I have some problems running my tests since the dispatcher fails to initialize when running in embedded server. I boot the embedded server myself, but I think I do it just like Seam does. Everything else works.
But as soon as I have a class with a method that is annotated with @Asynchronous, my embedded boot fails with:
Failed to invoke @Configuration method org.jboss.seam.mock.SeamTest.init:java.lang.NullPointerException
| FAILED: init
| javax.ejb.EJBException: java.lang.NullPointerException
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| at $Proxy32.scheduleInvocation(Unknown Source)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
| at org.javassist.tmp.java.lang.Object_$$_javassist_2.scheduleInvocation(Object_$$_javassist_2.java)
| at org.jboss.seam.interceptors.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| at no.schibstedsok.wpadmin.selfservice.scheduling.TVAksjonenService_$$_javassist_1.importPersonsRecurring(TVAksjonenService_$$_javassist_1.java)
| at no.schibstedsok.wpadmin.selfservice.scheduling.TVAksjonenImport.startService(TVAksjonenImport.java:54)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| at no.schibstedsok.wpadmin.selfservice.scheduling.TVAksjonenImport_$$_javassist_0.startService(TVAksjonenImport_$$_javassist_0.java)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
| at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
| at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
| at org.jboss.seam.Component.newInstance(Component.java:1746)
| at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
| at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145)
| at org.jboss.seam.init.Initialization.init(Initialization.java:504)
| at org.jboss.seam.mock.SeamTest.init(SeamTest.java:701)
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.core.Dispatcher.schedule(Dispatcher.java:215)
| at org.jboss.seam.core.Dispatcher.scheduleInvocation(Dispatcher.java:205)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| ... 89 more
| ... Removed 42 stack frames
I'm using Seam 1.2.1 with JBoss 4.0.4.
Does anyone has an advice what could be wrong?
And does the dispatcher work in embedded server?
And another thought:
Scheduled jobs should maybe not be run embedded since testing of this class could be tested just as a pojo, and the job should not run when testing other classes. In that case, is there a way of disabling the scheduling in tests?
Thanks!!
Endre
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043874#4043874
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043874
19 years