Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoSuchMethodError with ManyToMany and ManyToOne

 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,

I have a strange problem:
Suppose that I have two classes, A and B.
Suppose that I have a ManyToOne from A to B, bidirectional.
If I try to invoke A.getB(), I get a NoSuchMethodError.
So, I tried to check the methods of my class and results that getB() returns java.lang.String, and NOT B. So, using ejbQL, I can read this field, but as string ("select a.B from A a" -> List<String> .

The strange thing is that the A.getClass() method gives the correct class name and B.getAs() returns correctly a List<A>.



I get a similar problem when I create a many-to-many unidirectional from A to B: in this case, no such List<B> getB() method results in A, so that I get a NoSuchMethodError, as above.

Thanks a lot in advances!

P.S. I'm working with JBoss 4.2.0
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've also tried with a simple OneToOne unidirectional.
The result is the same.

Watching the jboss logs, it seems that it completely ignores the getter method for the OneToOne.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic