Cannot Find Symbol method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CodeNoob
    New Member
    • Jul 2008
    • 2

    #1

    Cannot Find Symbol method

    please help been working on a project got it down to 5 errors from 100 now i have no idea what to do.
    Code:
     Errors:
    init:
    deps-jar:
    Created dir: C:\Users\Tommy\Desktop\build\classes
    Compiling 306 source files to C:\Users\Tommy\Desktop\build\classes
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\provider\xmlwz\FileStoredPngMapleCanvas.java:14: warning: com.sun.imageio.plugins.png.PNGImageReaderSpi is Sun proprietary API and may be removed in a future release
    import com.sun.imageio.plugins.png.PNGImageReaderSpi;
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\client\MapleCharacter.java:429: cannot find symbol
    symbol  : method getName()
    location: class java.lang.Object
                                   ps.setString(1, GetPet().getName());        // Set name
                                                           ^
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\client\MapleCharacter.java:430: cannot find symbol
    symbol  : method getLevel()
    location: class java.lang.Object
                                   ps.setInt(2, GetPet().getLevel());      // Set Level
                                                        ^
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\client\MapleCharacter.java:431: cannot find symbol
    symbol  : method getCloseness()
    location: class java.lang.Object
                                   ps.setInt(3, GetPet().getCloseness());        // Set Closeness
                                                        ^
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\client\MapleCharacter.java:432: cannot find symbol
    symbol  : method getFullness()
    location: class java.lang.Object
                                   ps.setInt(4, GetPet().getFullness());        // Set Fullness
                                                        ^
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\client\MapleCharacter.java:433: cannot find symbol
    symbol  : method getUniqueId()
    location: class java.lang.Object
                                   ps.setInt(5, GetPet().getUniqueId());   // Set ID        
                                                        ^
    C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\provider\xmlwz\FileStoredPngMapleCanvas.java:47: warning: com.sun.imageio.plugins.png.PNGImageReaderSpi is Sun proprietary API and may be removed in a future release
                           ImageReaderSpi readerSpi = iioRegistry.getServiceProviderByClass(PNGImageReaderSpi.class);
                                                                                            ^
    5 errors
    2 warnings
    BUILD FAILED (total time: 2 seconds)
    Actual file is attached. [Edited by Admin]
    Attached Files
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    [HTML]ps.setString(1, getPet().getNam e()); // Set name
    ps.setInt(2, getPet().getLev el()); // Set Level
    ps.setInt(3, getPet().getClo seness()); // Set Closeness
    ps.setInt(4, getPet().getFul lness()); // Set Fullness
    ps.setInt(5, getPet().getUni queId()); // Set ID [/HTML]

    Hi dude, actually your code is showing error in these lines only. Whether can we use method calling like this. getPet() is a bean method in a class. Using that how can you call getLevel() method. Try to create a object and access those methods using object. Better you just post me with the Bean Class which contains getName(), getLevel() methods

    Regards
    Ramanan Kalirajan

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      moved to java-forum ... javaScript != java :)

      kind regards

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        According to the compiler, your GetPet method returns an object of type Object and the Object class doesn't have any of those methods you are trying to call.
        Notice also the warnings you are getting.

        P.S Use code tags when posting code and post only the relevant parts of the code.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by r035198x
          According to the compiler, your GetPet method returns an object of type Object
          Strange; because according to line 2145 it returns a MaplePet (whatever that
          might be).

          kind regards,

          Jos

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by JosAH
            Strange; because according to line 2145 it returns a MaplePet (whatever that
            might be).

            kind regards,

            Jos
            He seems to have two methods GetPet() (the one he's calling) and getPet() (the one he's probably supposed to be calling).

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #7
              Originally posted by r035198x
              He seems to have two methods GetPet() (the one he's calling) and getPet() (the one he's probably supposed to be calling).
              Ah ok, you must've dug deeper in those thousands lines of code than I did ;-)

              kind regards,

              Jos

              Comment

              • RamananKalirajan
                Contributor
                • Mar 2008
                • 608

                #8
                Whether you got the project working cool or still some errors over there.

                Regards
                Ramanan Kalirajan

                Comment

                • CodeNoob
                  New Member
                  • Jul 2008
                  • 2

                  #9
                  hey guys thanks alot and sorry for posting the whole thing i got it =) thank you guys alot.

                  Comment

                  • MMcCarthy
                    Recognized Expert MVP
                    • Aug 2006
                    • 14387

                    #10
                    I've edited the original post to remove the code which I've placed in a text file and attached it.

                    Mary

                    Comment

                    • r035198x
                      MVP
                      • Sep 2006
                      • 13225

                      #11
                      Originally posted by msquared
                      I've edited the original post to remove the code which I've placed in a text file and attached it.

                      Mary
                      Neat. Thanks.

                      Comment

                      Working...