wood burning stoves*
The moose likes Beginning Java and the fly likes Problems with java.beans.*; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems with java.beans.*;" Watch "Problems with java.beans.*;" New topic
Author

Problems with java.beans.*;

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Hello:
I was seeing some classes from java.beans.*package, more specificly Expression and Statement classes. This pagefrom Java Almanac shows how gets getters and setters methods using these classes.
So, I created a test class. In this class I try to use getters and setters from a Internal class, a external class but in same java file than test class and a external class in another java file.
It follows the code from test class:

Now external class code:

Well, I runned this test class and I got this:

java.lang.NoSuchMethodException: TestaStatement$InnerClass0.setValue(Integer0);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testInnerClass(TestaStatement.java:26)
at TestaStatement.main(TestaStatement.java:72)
java.lang.NoSuchMethodException: <unbound>=TestaStatement$InnerClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testInnerClass(TestaStatement.java:32)
at TestaStatement.main(TestaStatement.java:72)
java.lang.NoSuchMethodException: OuterClass0.setValue(Integer1);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testOuterClass(TestaStatement.java:42)
at TestaStatement.main(TestaStatement.java:73)
java.lang.NoSuchMethodException: <unbound>=OuterClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testOuterClass(TestaStatement.java:48)
at TestaStatement.main(TestaStatement.java:73)
java.lang.NoSuchMethodException: ExternClass0.setValue(Integer2);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testExternClass(TestaStatement.java:58)
at TestaStatement.main(TestaStatement.java:74)
java.lang.NoSuchMethodException: <unbound>=ExternClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testExternClass(TestaStatement.java:64)
at TestaStatement.main(TestaStatement.java:74)

I do not understand why beans are called "TestaStatement$InnerClass0", "OuterClass0" e "ExternClass0". Where did this "0" come? Did I do something wrong in my code. What do you think?
Thanks,


=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
I'm going to move this to Java in General (beginner).
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'm afraid this one's a might' bit too complicated for us simple folk. For us, beans is somethin' we eat out of a can. Sometimes they're hot. Sometimes they're cold.
I'm moving this on over to the Intermediate forum. Hopefully, some fancy talkers there can give you a hand.
[ August 17, 2003: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
GeeCON Prague 2014
 
subject: Problems with java.beans.*;