[JBossCache] - TreeCache: How to write atomic updates?
by kapilanand
hi all
I am trying to do the following from two or more hosts that are part of a JBossCache group. (I am using JBossCache 1.4)
If exists(FQN, key)
{
lock FQN
value = get(FQN, key)
value--
if (value == 0)
{
remove(FQN, key)
}
else
{
put(FQN, key, value)
}
unlock FQN
}
There is another thread of code that will increment the value. increment and decrement may happen on any of the hosts.
My intention is only to lock the map and i guess that is only achieved by locking the FQN node. Please correct me if i am wrong.
My question is "how to explicitly lock and unlock the nodes?"
Javadoc for TreeCache._lock() has one-liner saying "Should not be called." I see _releaseAllLocks() and releaseAllLocks().
And is there a mechanism for timing-out the lock. That is what happens if the process/thread that locked the node dies?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974273#3974273
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974273
19 years, 7 months
[JBoss Seam] - Re: dvd store example
by sleuthportal
I deleted the jboss-seam folder, retrieved it again from head, rebuilt the main seam build file with ant, then ran the build.xml in from ant and stated the jboss server and did not see any errors. When I go to:
http://localhost:8080/seam-dvd
I get the following error, any ideas:
08:51:54,397 ERROR [STDERR] Sep 26, 2006 8:51:54 AM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/home.xhtml]
javax.faces.el.EvaluationException: /WEB-INF/incl/store_nav.xhtml @9,49 rendered="#{login.loggedIn}": com.jboss.dvd.seam.Login$$EnhancerByCGLIB$$c7291b11
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:822)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:231)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: Bean: com.jboss.dvd.seam.Login$$EnhancerByCGLIB$$c7291b11, property: loggedIn
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
... 31 more
Caused by: java.lang.reflect.InvocationTargetException
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:585)
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
... 37 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.interceptor.InvocationContext.getTarget()Ljava/lang/Object;
at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109)
at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:582)
at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:108)
at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
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 $Proxy168.isLoggedIn(Unknown Source)
at com.jboss.dvd.seam.Login$$FastClassByCGLIB$$1f053af9.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.jboss.seam.interceptors.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:73)
at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:54)
at org.jboss.seam.ejb.SeamInterceptor.invokeInContexts(SeamInterceptor.java:191)
at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:164)
at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:151)
at org.jboss.seam.interceptors.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:44)
at org.jboss.seam.interceptors.ClientSideInterceptor.intercept(ClientSideInterceptor.java:38)
at com.jboss.dvd.seam.Login$$EnhancerByCGLIB$$c7291b11.isLoggedIn()
... 42 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.interceptor.InvocationContext.getTarget()Ljava/lang/Object;
at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:141)
at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:105)
... 66 more
Caused by: java.lang.NoSuchMethodError: javax.interceptor.InvocationContext.getTarget()Ljava/lang/Object;
at org.jboss.seam.ejb.SeamInterceptor.postConstruct(SeamInterceptor.java:73)
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:585)
at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131)
... 67 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974271#3974271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974271
19 years, 7 months
[JBoss Messaging] - Re: Configuring Destinations
by PeterJ
I just now found the root cause of the problem.
First, I am using JBossAS 4.0.5CR1 (whichever EJB3 implementation that comes with it). I am also using JBoss Messaging 1.0.1CR4 (haven't upgradded to CR5 yet).
The jar file I built contained client code and the MDB. And one other thing - a jndi.properties file. Once I removed the jndi.properties file, the EJB3 MDB deployed successfully. The jndi.properties contained the tpyical information for locahost:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
So it does not appear to be a problem with the EJB3 or Messaging code, simply a packaging issue for my jar file. By the way, I reproduced the problem by adding the jndi.properties file to the mdb-example.ejb3 file generated by the ejb3mdb example.
Therefore, I will not be sending the jar file.
It might by nice, however, if the DLQHandler.createSevice method was modified to look for the class not found exception and generate an error that lets the user know to check the jar file for an extraneous jndi.properties file. Let me know and I will submit a proposed patch.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974268#3974268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974268
19 years, 7 months
[JBoss Getting Started Documentation] - Deployment error, verifier EJB spec violations
by pgarvens
I am working through the Dukes Bank tutorial but deployment step is failing. Snapshot of log errors below. Any suggestions would be appreciated.
.
.
.
10:01:38,186 WARN [verifier] EJB spec violation:
Bean : AccountBean
Section: 12.2.1
Warning: The Bean Provider must provide a remote interface and a remote home interface or
a local interface and a local home interface for the bean.
10:01:38,196 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.2
Warning: The class must be defined as public and must not be abstract.
10:01:38,206 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.5
Warning: Every entity bean must define the ejbFindByPrimaryKey method.
10:01:38,206 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's
local home interface, if any, in the <local-home> element.
Info : Class not found on 'com.sun.ebank.ejb.tx.TxHome': No ClassLoaders found for: com.
sun.ebank.ejb.tx.TxHome
10:01:38,216 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 22.2
Warning: The bean provider must specify the fully-qualified name of the enterprise bean's
local interface, if any, in the element.
Info : Class not found on 'com.sun.ebank.ejb.tx.Tx': No ClassLoaders found for: com.sun.
ebank.ejb.tx.Tx
10:01:38,226 WARN [verifier] EJB spec violation:
Bean : TxBean
Section: 12.2.1
Warning: The Bean Provider must provide a remote interface and a remote home interface or
a local interface and a local home interface for the bean.
10:01:38,266 ERROR [MainDeployer] Could not create deployment: file:/C:/Program Files/jbos
s-4.0.4.GA/server/default/tmp/deploy/tmp50719JBossDukesBank.ear-contents/bank-ejb.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
.
.
.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974266#3974266
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974266
19 years, 7 months