File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol error

 
Ugluth Papadopoulos
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a pretty weird (to me at least) problem. I had some code for a gumball machine example from a book, and it was working fine. When i tried to implement RMI on it I keep cannot find symbol errors for the main class object gumballMachine. I'm not really sure what code I should post, so I'll post what i think might help you. This program uses the state pattern by the way.

This is the main class


This is the interface my state classes implement


and this is the code i'm using to test it.

The test drive has some more code that tests the machine, but i don't think that is important for my problem.
And my state classes aren't something too much, the only change i made to them was make the gumballMachine object on all of them transient. Here's one of them to get the idea.


I'm getting 27 errors: cannot find symbol at the references of the gumballMachine. Hope the code i posted helps, and sorry for the long post.

Thank you in advance.



 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ugluth,

In the codes you have post there is lot of syntax errors like missing spellings, missing curly brackets and also you have used classes and interfaces that have not declared . try to fix them.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Try to fix others error first.and then post the code here..
 
Ugluth Papadopoulos
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm actually i resolved the problem, it was some code that i had in the testdrive class that wasn't supposed to be there. Sorry for the missunderstanding and thank you for your time and replies
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. You can find errors much more quickly if you only write 5 or so lines of code, compile, and start again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic