aspose file tools*
The moose likes Spring and the fly likes Not looking so much for a fix as what this error means Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Not looking so much for a fix as what this error means" Watch "Not looking so much for a fix as what this error means" New topic
Author

Not looking so much for a fix as what this error means

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
I notice that many posters post,a n ask for a fix without asking what the error means.

When I start up JBoss I get the following error



I am more interested with understanding what the error is.

As I understand it we have a JBoss object com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate

which needs to be converted or matched to a javax.transaction.TransactionManager

for the spring object jtaTransactionManager.

I am not sure what "No matching editors or conversion strategy found"

Since I am upgrading an application from jboss 4 to jboss 5 I would guess that the current jar containing javax.transaction.TransactionManager does not work with JBoss 5 and I need to get a later version.

I am more interested in understanding the error than just getting a fix. This is also a laerning exercise.

Thanks
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate is contained in the
jbossjts-integration.jar which comes with jboss-5.1.0.GA.

So it looks that jtaTransactionManager org.springframework.jndi.JndiObjectFactoryBean needs to be updated
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
TransactionManagerDelegate extends BaseTransactionManagerDelegate which implements TransactionManager.

Therefore I do not understand the error as its casting an object that implements the interface TransactionManager to TransactionManager. That is if I understand the error correctly.

Will welcome any input even a good guesstimate. Most fixes have come through discussion which helps you to understand the problem more.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

To me the error simply is stating that it is trying to cast one type to the other and they aren't compatible. One is a class from JBoss and one is a class from Spring. They shouldn't be in the same hierarchy. Whenever you are using JTA in a Spring applictation, the Spring TransactionManager class for that server is really just delegating calls to the JTA Transaction manager class in JBoss, in this case.

We need a bit more context to state why you are getting this error. But the meaning is as simple as


public class Mark {}

Mark mark = new Mark()

someReferenceToSomeOtherClass.setJohn(mark);

where setJohn's signature is setJohn(John john);

Since this is in configuration, Spring tries to convert the Mark into a John, but Mark isn't a John. And Spring catches the ClassCastException here and throws their Conversion/Editor error. Remember Spring xml configuration is all Strings and Spring uses PropertyEditors or Converters to set things up.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Thanks Mark I understand the error now.

I am converting a app to run on jboss-5.1.0.GA from jboss-4.0.5.GA.

In one of my applicatioContext.xml I ahave the following



which returns the object com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate which as you pointed out it trys to cast to javax.transaction.TransactionManager

TransactionManagerDelegate extends BaseTransactionManagerDelegate
BaseTransactionManagerDelegate implements javax.transaction.TransactionManager.

So the cast should be allowed, that is now the confusing bit.

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Tony Evans wrote:Thanks Mark I understand the error now.

I am converting a app to run on jboss-5.1.0.GA from jboss-4.0.5.GA.

In one of my applicatioContext.xml I ahave the following





Why aren't you just using

<tx:jta-transaction-manager/> tag

This will create a TransactionManager for you using whatever app server you are deployed in. It automatically figures it out and delegates to the app servers JTA Transaction Manager.

Mark
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Thanks Mark, as it stands I am stripping my application down, I dont think it needs TransactionManager, the app is now wrapped in another app an just needs to supply web pages that are iframed.

Found out that JBoss 5 is a lot stricter on parsing XML than JBoss 4 was.

If I do need the TransactionManager, I will use your suggestion.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Tony Evans wrote:Thanks Mark, as it stands I am stripping my application down, I dont think it needs TransactionManager, the app is now wrapped in another app an just needs to supply web pages that are iframed.

Found out that JBoss 5 is a lot stricter on parsing XML than JBoss 4 was.

If I do need the TransactionManager, I will use your suggestion.


I'm not sure I understand why you won't need a TransactionManager. If anyone is calling into that app and inside that app you have use cases and you access the database, you need a TransactionManager.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not looking so much for a fix as what this error means