[Remoting] - Cat not catch excption when jboss as is down - remote servic
by tony9427
Application environment: JBoss Application Server 4.2.1, JBoss Messaging 1.3.0
THere is a standalone application to receive jms in a while loop
When Jboss server is up, the application runs well.
But When I shutdown the JBoss server and restart it, the application can not run
Part of the code: I want to re-connect JBoss Message when JBoss is down
But it seems the application willl never go to #10 even JBoss is shut down.
| boolean reConnect = false;
| #1 while (true){
| #2 try{
| #3 if(reConnect){ // Try to connect JBoss Connection again
| #4 sf = new ServiceFactory(ic,"/ConnectionFactory");
| #5 reConnect = false;
| #6 }
| #7 String message = receiver.receive(1000);
| #8 }catch(Exception e){
| #9 // No exception is catched
| #10 System.out.println("exception");
| #11 reConnect = true;
| #12 }
| #13}
|
How can I make the application running when jboss is restarted?
Some log information is detected:
2007-10-26 17:34:52,633 ERROR [org.jboss.remoting.transport.bisocket.BisocketServerInvoker] unable to get secondary locator
| org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:530)
| at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:353)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.getSecondaryLocator(BisocketClientInvoker.java:441)
| at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:204)
| at org.jboss.remoting.transport.bisocket.BisocketServerInvoker$1.run(BisocketServerInvoker.java:949)
| Caused by: java.net.ConnectException: Connection refused: connect
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
| at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
| at java.net.Socket.connect(Socket.java:507)
| at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java:187)
| at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.createSocket(BisocketClientInvoker.java:360)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:801)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:526)
| ... 5 more
| 2007-10-26 17:34:52,633 ERROR [org.jboss.remoting.transport.bisocket.BisocketServerInvoker] Unable to recreate control connection: InvokerLocator [null://192.168.164.172:3892/null]
| java.io.IOException: unable to get secondary locator: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
| at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:209)
| at org.jboss.remoting.transport.bisocket.BisocketServerInvoker$1.run(BisocketServerInvoker.java:949)
| 2007-10-26 17:34:58,551 WARN [org.jboss.remoting.LeasePinger] LeasePinger[SocketClientInvoker[12789d2, bisocket://192.168.164.172:4457](5c4o4k4s-3b4bn5-f88ic34s-1-f88ic3ta-5)] failed to ping to server: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099175#4099175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099175
18Â years, 6Â months
[JBoss Seam] - Re: Destroying Context Variable
by jamesjmp
Thank you very much, now I manage to clean the context. After creating a new register, if just after that, I create a new one, the edit window doesn´t display anymore the data of the previous crerated one and the new one is created withouth overriding the info of the former.
One more question, if I go to my list, and select one of the registers,and view its details. Lets´call it pojo3.
Then, the pojoHome is associated to that pojo3 info, and in the pojo.xhtml detail view that pojo 3 info is displayed. Ok, that´s correct up to that moment. If later, I go from the seam-gened pojo.xhtml file to the pojoedit.xhtml file to create a new one, as both pages share the same pojohome object, in the edit window is displayed the pojo 3 info in the fields, and whenever I change one field pojo 3 data is updated right away in the database.
If in the wire I check if that´s a new one and I use contexts.remove... the fields in the edit window are clened, but if I change one field pojo 3 data is updated right away in the database. I don´t see why again it is referencing to that.
Does it happen to you. any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099168#4099168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099168
18Â years, 6Â months
[JCA/JBoss] - Opening connection from a marked rollback tx
by oglueck
I have a case where the transaction is marked rollback during the course of a complex process. But I still have to read from the DB and do some more processing. During that a new DB connection is opened (for read-only purposes) behind the scenes and thats where the connection manager complains:
| Caused by: javax.resource.ResourceException: Transaction is not active: tx=Trans
| actionImpl:XidImpl[FormatId=257, GlobalId=sg1317z.corproot.net/1761318, BranchQu
| al=, localId=1761318]
| at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
| nnection(TxConnectionManager.java:290)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
| onnection(BaseConnectionManager2.java:379)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
| nManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
| erDataSource.java:88)
| ... 188 more
I think the connection manager should allow to use a transaction that is marked rollback because it's perfectly legal to read from the DB even if the tx is going to be rolled back.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099167#4099167
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099167
18Â years, 6Â months
[JBoss Seam] - Re: NoSuchMethodFound createFullTextQuery()
by chrisky
Ok I got it working...
It happens that you have to copy the hiberaten-search.jar and the dependency jars to the jboss lib folder. it wont work if you got it in EAR (even i have include the jar in the application.xml)
"chrisky" wrote : I have the same problem
| JBoss 4.2.1 with Hibernate 3.0.0 without using SEAM(in EJB)
|
|
| | org.hibernate.Session origSession = (org.hibernate.Session)em.getDelegate();
| | FullTextSession session = Search.createFullTextSession(origSession);
| |
| |
| | org.hibernate.Query query;
| | if(searchString.length() > 0) {
| | try {
| | MultiFieldQueryParser parser = new MultiFieldQueryParser(new String[] {"name", "note"},
| | new StandardAnalyzer());
| |
| | query = session.createFullTextQuery(parser.parse(searchString), Task.class);
| | tasks = query.list();
| | } catch (ParseException e) {
| | log.error(e.getLocalizedMessage(), e);
| | tasks = null;
| | }
| | }
| | else {
| | tasks = executeQuery(Task.class, "from Task");
| | }
| |
|
|
| | javax.ejb.EJBException: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.hibernate.search.FullTextSession.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lorg/hibernate/Query;
| | at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
| | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| | 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.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
| | at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| | at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| | 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.dynamicInvoke(StatelessContainer.java:278)
| | at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| | at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| | at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
| | at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
| | at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
| | at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099166#4099166
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099166
18Â years, 6Â months