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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with java.beans.*;