[JBoss Messaging] - Re: Problems at Startup with MySQL 5 and XAConnection
by timfox
"felipeal" wrote : Hi again, ...
| I thought it was still called JBossMQ and that Jboss Messaging was the name of the next generation's...
|
JBoss Messaging is the new generation JMS provider (http://www.jboss.com/products/messaging) - it's already in 1.0.
JBossMQ is the old JMS provider that is still the default JMS provider for JBoss 4.x.
JBoss Messaging will be the default JMS provider in JBoss 5.x and above.
This forum is about JBoss Messaging, there is another forum that handles JBossMQ queries.
"felipeal" wrote :
| By JBoss TS do you meand the current stuff or Arjuna's ?
|
JBoss Transactions (JBoss TS) is the new name for what used to be called Arjuna transactions (I think) until JBoss bought it.
JBoss TS will be the default transaction manager in JBoss 5, and I think can already be used with JBoss 4.x. I would post a question in the JBoss TS forum to get clarification on this.
"felipeal" wrote :
| Funny, it worked on MySQL, even though I didn't use a XAResource. I mean, my DB connection is configured as <local-tx> instead of <xa-datasource> (in fact, it's the same local-tx datasource used by the JMS RA).
|
I suspect the JCA adaptor may be doing some kind of last resource optimisation here. Best post in the JCA forum - they should be able to help you since I'm not an expert in the JCA area.
"felipeal" wrote :
| My guess is that the only drawback happens when this simple transaction fails (for instance, due to a lock or error in the database), i.e., from the point of the view of the global transaction, the JMS transaction branch is committed (as the prepare phase returned ok), so somehow JBM or JBTS will have to guarantee the messages are written in the database).
|
The messages will already have been written in the prepare stage, so we can guarantee the messages are there. If commit fails then typically this will be a transitory reason e.g. no network connection, db server is down. the transaction manager will retry periodically until it works. If there is a catastrophic failure e.g. bomb in data centre then even 2pc won't help you.
"felipeal" wrote :
| Now, back to the original MySQL issue, the problem still remains: how to configure a XA datasource for a MySQL database on JBoss. I know this is not exactly an issue for the JBoss Messaging forum, but using JBM is the easiest way to reproduce the problem: it's just a matter of setting the JMS xml files to use such datasource and waiting to JBoss to fail on startup... I will fill a Jira issue regarding it (and explaining the whole situation), ok?
|
Felipe- as to how to set up an XA datasource for Mysql - I would suggest you post a message in the JCA forum - they may have some insight here.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968723#3968723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968723
18 years, 4 months
[JBoss Messaging] - Cannot connect to JMS from Service MBean
by chipschoch
I have a service that uses JMS and I have tested it stand alone and it works fine. However, when I wrapped it in the StandardMBean interface and deploy it, it loads and begins to execute. Then I get an exception when it calls ConnectionFactory.createConnection(). Part of the stack:
java.io.IOException: Can not read data for version 4. Supported versions: 1,2
at org.jboss.remoting.transport.socket.ServerThread.versionedRead(ServerThread.java:387)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:439)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:520)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:257)
13:14:11,559 ERROR [SocketClientInvoker] Got marshalling exception, exiting
java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
at org.jboss.serial.io.JBossObjectInputStream.readByte(JBossObjectInputStream.java:227)
at org.jboss.jms.server.remoting.JMSWireFormat.read(JMSWireFormat.java:411)
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
also:
13:14:11,606 ERROR [JBossConnectionFactory] Failed to config client side AOP
java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
java.io.EOFException
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:306)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
at org.jboss.remoting.Client.invoke(Client.java:525)
at org.jboss.remoting.Client.invoke(Client.java:488)
Any ideas anyone? I don't even know what this means. I am using JBoss Messaging 1.01 CR4.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968720#3968720
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968720
18 years, 4 months
[JBoss Messaging] - Re: Problems at Startup with MySQL 5 and XAConnection
by felipeal
Hi again,
First of all, thanks for your quick reply and sorry for the delay on mine's, but the link I was refreshing didn't show your reply, neither did I get an email notifying me about it...
Anyway, your explanation was very good - even though I already knew most of the 2PC/XA stuff (and was more interested to know how JBoss Messaging could participate on a global transaction using a non-XA datasource), it was a very explanation to get logged in the forum :-)
Now, here are a couple more comments...
"timfox" wrote :
| Ok, so in a nutshell this is what happens when use a JBoss Messaging (you meant JBoss Messaging not JBoss MQ, right?)
|
I thought it was still called JBossMQ and that Jboss Messaging was the name of the next generation's...
"timfox" wrote :
| and you are using an JCA XA datasource (this one *does* need to do be XA since you
|
Hmm, that brings the problem back to its roots: how to get a XADatasource from MySQL 5.0 - I will talk more about this issue later on.
"timfox" wrote :
| are using the XA capabilities of your database - make sure your db does have XA capabilities! Some don't)
|
The MySQL 5 + Connector/J 5.1 combo is supposed to XA compliant; at least I can run the following commands in the mysql console:
xa start 'a';
// issues command
xa end 'a';
xa prepare 'a';
xa commit 'a'; // or xa rollback 'a'
"timfox" wrote :
| through the logging the transaction manager will do (if you are using JBoss TS) - since it's not relevant to the question.)
|
Agreed...
"timfox" wrote :
| (Eventually we will log using JBoss TS - but that is a different story).
|
By JBoss TS do you meand the current stuff or Arjuna's ?
"timfox" wrote :
| The app server then calls prepare on XAResource2 - what happens now depends on the implementation of your database. But assuming it supports XA properly,
|
Funny, it worked on MySQL, even though I didn't use a XAResource. I mean, my DB connection is configured as <local-tx> instead of <xa-datasource> (in fact, it's the same local-tx datasource used by the JMS RA).
"timfox" wrote :
| in the database, so we just update it's status to "committed". This happens in a single JDBC transaction
|
My guess is that the only drawback happens when this simple transaction fails (for instance, due to a lock or error in the database), i.e., from the point of the view of the global transaction, the JMS transaction branch is committed (as the prepare phase returned ok), so somehow JBM or JBTS will have to guarantee the messages are written in the database).
"timfox" wrote :
| Next, "commit" is called onn XAResource2. The database doesn't something internal to its implementation that results in the data ending up in the committed state.
|
The database could also have an issue doint that internal stuff, so the above comment is not that relevant...
"timfox" wrote :
| So as you can see there is no need for JBM to need an XA capable database in order to provide a fully functioning XAResource.
| This is by design:
|
That was a clever - and simple - design. Even considering the drawback I mentioned above , as it would be a problem even if JBM relied on a XA-capable datasource - the only difference is that JBM would be 'delegating away' the issue to the database...
"timfox" wrote :
| It definitely should work. If it doesn't please file a bug report.
|
Yes it worked, even more than it should (as the connection to my DB is not XA). The only issue I had was how to get an reference to the javax:/JmsXA from Spring, but that's another problem (basically, I was getting a "not bound exception' when the BeanFactory tried to get the object from JNDI, at the webapp startup; but if I did a lookup on the servlet method, it worked. My guess is this is either a Spring bug or JBoss does not make that object visible to my webapp on startup).
Now, back to the original MySQL issue, the problem still remains: how to configure a XA datasource for a MySQL database on JBoss. I know this is not exactly an issue for the JBoss Messaging forum, but using JBM is the easiest way to reproduce the problem: it's just a matter of setting the JMS xml files to use such datasource and waiting to JBoss to fail on startup... I will fill a Jira issue regarding it (and explaining the whole situation), ok?
Thanks again,
-- Felipe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968715#3968715
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968715
18 years, 4 months