[JBoss Messaging] - Messages delivery stops after a while
by lieth78
I am using JBoss 4.0.4 GA and JBoss Messaging 1.0.1 GA on Windows XP.
I have a web application that reads messages from a queue or sends messages to a queue when requested by a client.
I put 10,000 messages into the queue to create my test data.
Now I start a client that polls the web application and loops to try and receive one JMS message : at the beginning, everything works fine,
jboss.jms.server.endpoint.ServerSessionEndpoint] creating consumer for JBossQueue[BBrQueueFillerTest], selector null, subscription null
2006-11-06 19:07:04,974 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483642] constructed
2006-11-06 19:07:04,974 DEBUG [org.jboss.jms.server.ServerPeer] ServerPeer [server.0] caching consumer -2147483642
2006-11-06 19:07:04,974 DEBUG [org.jboss.jms.server.endpoint.ServerSessionEndpoint] created and registered ConsumerEndpoint[-2147483642]
2006-11-06 19:07:04,974 DEBUG [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] ConnectionEndpoint[-2147483646] started
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.client.JBossSession] attempting to create consumer for destination:JBossQueue[BBrQueueFillerTest]
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.server.endpoint.ServerSessionEndpoint] creating consumer for JBossQueue[BBrQueueFillerTest], selector null, subscription null
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483641] constructed
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.server.ServerPeer] ServerPeer [server.0] caching consumer -2147483641
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.server.endpoint.ServerSessionEndpoint] created and registered ConsumerEndpoint[-2147483641]
2006-11-06 19:07:04,990 DEBUG [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] ConnectionEndpoint[-2147483646] started
...
but after about 25 messages, I have the following messages in the JBoss log, and further receive calls return empty results (the queue still contains many messages, but none is returned any more!):
2006-11-06 19:08:22,158 WARN [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] Reference[1449]:RELIABLE has exceed maximum delivery attempts and will be removed
2006-11-06 19:08:22,158 DEBUG [org.jboss.jms.client.remoting.MessageCallbackHandler] MessageCallbackHandler[-2147483643] closing
2006-11-06 19:08:22,158 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483643] NOT started yet!
2006-11-06 19:08:22,158 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483643] NOT started yet!
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483643] NOT started yet!
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483643] NOT started yet!
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.client.container.ClosedInterceptor] ClosedInterceptor.ClientConsumerDelegate[-2147483643] closed
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483586] NOT started yet!
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] ConsumerEndpoint[-2147483586] NOT started yet!
2006-11-06 19:08:22,174 DEBUG [org.jboss.jms.client.remoting.MessageCallbackHandler] MessageCallbackHandler[-2147483586] closing
2006-11-06 19:08:22,174 WARN [org.jboss.jms.server.endpoint.ServerConsumerEndpoint] Reference[1449]:RELIABLE has exceed maximum delivery attempts and will be removed
...
And then, when I stop the client, further errors are displayed in JBoss log:
19:08:32,392 ERROR [ExceptionUtil] ConsumerEndpoint[-2147483592] closing [aac2v-hgilj8-eu76poci-1-eu76u3d4-r]
javax.jms.IllegalStateException: Cannot find delivery to cancel:-2147483592
at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.cancelDelivery(ServerConsumerEndpoint.java:583)
at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.stop(ServerConsumerEndpoint.java:665)
at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.closing(ServerConsumerEndpoint.java:336)
at org.jboss.jms.server.endpoint.advised.ConsumerAdvised.org$jboss$jms$server$endpoint$advised$ConsumerAdvised$closing$aop(ConsumerAdvised.jav
a:64)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:1008)
at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:98)
at org.jboss.remoting.Client.invoke(Client.java:589)
at org.jboss.remoting.Client.invoke(Client.java:581)
at org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:111)
at org.jboss.jms.client.delegate.ClientConsumerDelegate$closing_4945873952494833124.invokeNext(ClientConsumerDelegate$closing_4945873952494833
124.java)
at org.jboss.jms.client.container.ConsumerAspect.handleClosing(ConsumerAspect.java:107)
at org.jboss.aop.advice.org.jboss.jms.client.container.ConsumerAspect26.invoke(ConsumerAspect26.java)
at org.jboss.jms.client.delegate.ClientConsumerDelegate$closing_4945873952494833124.invokeNext(ClientConsumerDelegate$closing_4945873952494833
124.java)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:182)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
at org.jboss.jms.client.delegate.ClientConsumerDelegate$closing_4945873952494833124.invokeNext(ClientConsumerDelegate$closing_4945873952494833
124.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
at org.jboss.jms.client.delegate.ClientConsumerDelegate$closing_4945873952494833124.invokeNext(ClientConsumerDelegate$closing_4945873952494833
124.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientConsumerDelegate$closing_4945873952494833124.invokeNext(ClientConsumerDelegate$closing_4945873952494833
124.java)
at org.jboss.jms.client.delegate.ClientConsumerDelegate.closing(ClientConsumerDelegate.java)
at org.jboss.jms.client.container.ClosedInterceptor.maintainRelatives(ClosedInterceptor.java:300)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:177)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
at org.jboss.jms.client.delegate.ClientSessionDelegate$closing_4945873952494833124.invokeNext(ClientSessionDelegate$closing_494587395249483312
4.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
at org.jboss.jms.client.delegate.ClientSessionDelegate$closing_4945873952494833124.invokeNext(ClientSessionDelegate$closing_494587395249483312
4.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientSessionDelegate$closing_4945873952494833124.invokeNext(ClientSessionDelegate$closing_494587395249483312
4.java)
at org.jboss.jms.client.delegate.ClientSessionDelegate.closing(ClientSessionDelegate.java)
at org.jboss.jms.client.container.ClosedInterceptor.maintainRelatives(ClosedInterceptor.java:300)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:177)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$closing_4945873952494833124.invokeNext(ClientConnectionDelegate$closing_494587395249
4833124.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$closing_4945873952494833124.invokeNext(ClientConnectionDelegate$closing_494587395249
4833124.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$closing_4945873952494833124.invokeNext(ClientConnectionDelegate$closing_494587395249
4833124.java)
at org.jboss.jms.client.delegate.ClientConnectionDelegate.closing(ClientConnectionDelegate.java)
at org.jboss.jms.client.JBossConnection.close(JBossConnection.java:131)
at com.systar.gateway.services.jms.JMSQueueService.endService(JMSQueueService.java:150)
at com.systar.gateway.services.GatewayService.stop(GatewayService.java:269)
at com.systar.gateway.services.GatewayService.stop(GatewayService.java:230)
at com.systar.gateway.services.JavaGateway.stopService(JavaGateway.java:107)
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:324)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at com.systar.gateway.SystarAxisServlet.doPost(SystarAxisServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
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.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:534)
I tried with both Hypersonic and MySql as persistence manager, and tried several isolation levels with MySql too (TRANSACTION_SERIALIZABLE, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ) but I get the same result...
The web application and its client together work perfectly with JBossMQ, so I think the problem does not come from the code itself...
Any idea of what is happenning when using JBoss Messaging?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983516#3983516
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983516
19Â years, 6Â months
[EJB 3.0] - address CMP beans from session bean in other JAR but same EA
by sunstarnova
I've got a problem addressing a CMP bean in a different Eclipse project (the projects should be seperated). Both projects should work fine, but when I try to address the CMP Bean (like I do with the local beans as well) I get the error below.
We have git two EJB projects: core-ejb and persistence-ejb that I have both in a EAR. When I just copy the CMP to my core-ejb project all works fine, but not when I try to access it cross-JAR!
I'm using Entity Manager injection out og an Stateless session bean
@PersistenceContext(unitName="ios") private EntityManager em;
| ...
| ...
| Query query = em.createQuery("SELECT c FROM Config c WHERE c.configClass =:configClass " +
| "AND c.instanceId =:instanceId AND c.deleted=0");
| query.setParameter("configClass", configClassName);
| query.setParameter("instanceId", instanceId);
| try{
| conf = (Config)query.getSingleResult();
| }
| ...
| ...
|
I also tried with
SELECT * FROM com.teec.ios.ejb.cmp.Config c WHERE...
but this also didn't work!
This should be an easy one for an EJB - Guru, so please help!
| Exception in thread "main" javax.ejb.EJBTransactionRolledbackException: javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: Unknown entity: com.teec.ios.ejb.cmp.Config
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:89)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:196)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| at $Proxy129.createConfig(Unknown Source)
| at com.teec.ios.core.ejb.session.MailManagerBean.createMailConfig(MailManagerBean.java:250)
| 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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:308)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:104)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:190)
| at org.jboss.remoting.Client.invoke(Client.java:525)
| at org.jboss.remoting.Client.invoke(Client.java:488)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:133)
| at $Proxy1.createMailConfig(Unknown Source)
| at com.teec.ios.core.client.MailClient.createMailConfig(MailClient.java:63)
| at com.teec.ios.core.client.MailClient.main(MailClient.java:75)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983508#3983508
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983508
19Â years, 6Â months
[JBoss AOP] - I'm in trouble....help
by Giordacchio++
Hi, I'm trying to use Jboss AOP within Jboss AS.
I've already tried to deploy the "Booking" example of Jboss seam (and it works) and the "Inboss" example of Jboss AOP (and it works too).
Now I've written an annotation bound to intercept a login method inside the Booking app.
the annotation interface is:
| @Retention(RetentionPolicy.RUNTIME)
| @Target({ElementType.METHOD})
| public @interface Logger {
|
| Label label() default Label.WARNING;
| String body() default "";
| }
|
the Aspect bound to the annotation is:
@Aspect(scope = org.jboss.aop.advice.Scope.PER_JOINPOINT)
| public class LoggerAspect {
|
|
|
|
| public LoggerAspect() throws FileNotFoundException
| {
| System.out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
| }
|
|
| @PointcutDef("execution( static void *->@logger.Logger(..)) ")
| public static Pointcut mypoint;
|
|
|
| @Bind (pointcut="logger.LoggerAspect.mypoint")
| public Object logger(MethodInvocation invocation) throws Throwable
| {
|
| Logger Lg = (Logger) Invocation.resolveAnnotation(Logger.class);
|
| String s="\n<EVENT>\n\t"+ "<"+Lg.label()+">\n\t\t" +Lg.body()+"\n\t<\\"+Lg.label()+">" +"\n<\\EVENT>";
|
| invocation.invokeNext();
|
| System.out.println(s);
| return null;
| }
|
|
| }
Using the annotation Bind let me free to don't use the jboss-aop.xml file.
Now I've inserted my new annotation on the login EJB:
@Stateless
| @Name("login")
| public class LoginAction implements Login
| {
|
| @In @Out
| private User user;
|
| @PersistenceContext
| private EntityManager em;
|
| @Logger(label = Label.WARNING,body="evento XXXXX")
| public String login()
| {
| List<User> results = em.createQuery("select u from User u where u.username=:username and u.password=:password")
| .setParameter("username", user.getUsername())
| .setParameter("password", user.getPassword())
| .getResultList();
|
| if ( results.size()==0 )
| {
| FacesMessages.instance().add("Invalid login");
| return "login";
| }
| else
| {
| user = results.get(0);
| Contexts.getSessionContext().set("loggedIn", true);
| FacesMessages.instance().add("Welcome, #{user.name}");
| return "main";
| }
|
| }
|
| }
|
By the way inside my annotation I use a ENUM like the following:
| public enum Label
| {
| WARNING,
| DEBUG,
| ERROR
| }
So...why it doesn't work ?? I don't see any result...I know that the println should appear on the log.....the Booking app works but there is no interception !!!
Hellllpppp I'm going crazy.....
Thx
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983507#3983507
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983507
19Â years, 6Â months
[EJB/JBoss] - ObjectNotFoundException: No such entity! Transaction Problem
by caerlama
Hi,
I got a javax.ejb.ObjectNotFoundException: exception trying to get a CMP Bean Data written by a MessageDrivenBean:
I am doing the following steps:
MDB1 read some information from a topic
MDB1 call the create method from a CMP Bean for saving the information in the DB
MDB1 send a message to a queue with the primary key of the CMP Bean written before to the DB
MDB2 read the primary key from the queue and starts a Thread parameterized with the primary key
The Thread tries to get the CMP Bean data using the findByPrimaryKey method.
I traced my Beans and I can recognize that the CMP Bean Data is on the DB ant the create method is finished.
I suppose the problem is that the CMP.create transaction isn?t committed before I try to read the DB record using the CMP.findByPrimaryKey because it works if I insert a wait for 1000 ms and retry to execute the findByPrimaryKey method
Now the question:
How can I be sure that the create transaction is committed before I read it again?
I am running Jboss 4.05, Oracle XE 10 and Java 1.4.2 all on the same server (ubuntu 2.6.15-26-server)
here the completed exception:
19:40:38,778 ERROR [STDERR] javax.ejb.ObjectNotFoundException: No such entity!
19:40:38,779 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:64)
19:40:38,779 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:604)
19:40:38,779 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:315)
19:40:38,779 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:236)
19:40:38,779 ERROR [STDERR] at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1103)
19:40:38,780 ERROR [STDERR] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:721)
19:40:38,780 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:40:38,780 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
19:40:38,780 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:40:38,780 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
19:40:38,780 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1130)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203)
19:40:38,781 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76)
19:40:38,781 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145)
19:40:38,782 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
19:40:38,783 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
19:40:38,783 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514)
19:40:38,783 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:975)
19:40:38,783 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
19:40:38,783 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:40:38,783 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
19:40:38,783 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
19:40:38,783 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
19:40:38,784 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
19:40:38,784 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
19:40:38,784 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
19:40:38,784 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
19:40:38,784 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
19:40:38,784 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:206)
19:40:38,784 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:192)
19:40:38,785 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
19:40:38,785 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
19:40:38,785 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
19:40:38,785 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
19:40:38,785 ERROR [STDERR] at $Proxy136.findByPrimaryKey(Unknown Source)
19:40:38,785 ERROR [STDERR] at edu.leipzig.taskman.TaskCache.getTask(TaskCache.java:287)
19:40:38,785 ERROR [STDERR] at edu.leipzig.taskman.ClientUpdate.addOpenTask(ClientUpdate.java:284)
19:40:38,786 ERROR [STDERR] at edu.leipzig.taskman.ClientManager.taskCreated(ClientManager.java:48)
19:40:38,786 ERROR [STDERR] at edu.leipzig.taskman.ejb.NewTask_PropagatingBean.handleClientTask(NewTask_PropagatingBean.java:254)
19:40:38,786 ERROR [STDERR] at edu.leipzig.taskman.ejb.NewTask_PropagatingBean.onMessage(NewTask_PropagatingBean.java:180)
19:40:38,786 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:40:38,786 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
19:40:38,786 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:40:38,787 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
19:40:38,787 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
19:40:38,787 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
19:40:38,787 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
19:40:38,787 ERROR [STDERR] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
19:40:38,787 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
19:40:38,787 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
19:40:38,788 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:954)
19:40:38,789 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
19:40:38,789 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
19:40:38,789 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
19:40:38,789 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:902)
19:40:38,789 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
19:40:38,789 ERROR [STDERR] at org.jboss.mq.SpySession.run(SpySession.java:323)
19:40:38,790 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
19:40:38,790 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
19:40:38,790 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)
Any Ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983506#3983506
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983506
19Â years, 6Â months
[Messaging, JMS & JBossMQ] - Frustration with basic client and broken examples.
by dbs
We have a need to implement some basic P2P JMS queues in Jboss 4.0.4-GA, and I'm trying to set up a simple example using the sample queue/A JMS queue. The problem is the example in the JBoss wiki does not work, and trying to figure out the 'proper' way to do it is intensely frustrating. What with SpyDestination references and the like - this seems to be a path that I shold not be taking.
The example code I tried is here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=QueueExample
Here's my sample code - it's a bit verbose, but perhaps someone can figure out if I'm mixing approaches or what...
| import javax.naming.NamingException;
| import javax.servlet.ServletException;
| import javax.servlet.http.HttpServlet;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| import java.util.Properties;
|
| import javax.annotation.Resource;
| import javax.jms.Message;
| import javax.jms.Queue;
| import javax.jms.QueueConnection;
| import javax.jms.QueueConnectionFactory;
| import javax.jms.QueueReceiver;
| import javax.jms.QueueSender;
| import javax.jms.QueueSession;
| import javax.jms.Session;
| import javax.jms.TextMessage;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.Reference;
| import org.jboss.mq.SpyQueue;
|
|
| public class Test extends HttpServlet {
|
| static Logger logger = Logger.getLogger(Test.class);
|
| InitialContext initialContext;
| @Resource(mappedName="queue/A") Queue queue;
|
| // snip snip
| QueueConnection qc;
| log.info("Creating jndi context - alternatively use a jndi.properties");
| Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
| properties.put(Context.PROVIDER_URL, "localhost");
|
| InitialContext ctx = new InitialContext(properties);
|
| log.info("Looking up connection factory");
| QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup("UIL2ConnectionFactory");
|
| log.info("Creating connection");
| qc = qcf.createQueueConnection();
| log.info("Creating session");
| QueueSession qs = qc.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
|
| log.info("Creating sender");
| QueueSender sender = qs.createSender (queue);
|
| log.info("Creating message");
| TextMessage message = qs.createTextMessage("hello");
|
|
| log.info("Sending message");
| // This is the error -
| //11:49:13,031 INFO [STDOUT] Sending message
| //11:49:13,031 ERROR [STDERR] java.lang.UnsupportedOperationException: Not constructed with identifyed destination. Usage of method not allowed
| //11:49:13,031 ERROR [STDERR] at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:204)
| //11:49:13,031 ERROR [STDERR] at com.areteinc.servlets.Test.doGet(Test.java:72)
|
| sender.send(queue,message);
|
| log.info("Creating receiver");
| QueueReceiver receiver = qs.createReceiver(queue);
|
| log.info("Try to receive message, it will not work");
| Message received = receiver.receiveNoWait();
| if (received != null)
| throw new RuntimeException("Should not get a message if the connection is not started!");
|
| log.info("You have to start the connection before receiving messages");
| qc.start();
|
| log.info("This receive will work");
| received = receiver.receiveNoWait();
|
| log.info("Got message: " + received);
| // snip snip
|
If I put in a destination type of 'queue' in the sender() call, it tells me this is not a SpyDestination, and we go off spinning in 'spy' land.
Not having a simple, clear example of using JBossMQ, or a clear example of using JBoss Messaging is very frurstating. Help please! We're dead in the water right now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983504#3983504
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983504
19Â years, 6Â months