Resolved getting a java.lang.NoSuchMethodException

Discussion in 'Developer Support' started by Seathe, May 28, 2016.

  1. so when i try to run my bot from intellij i keep getting this error:
    I've googled the error and is says that i'm missing a method somewere, but i'm stumped and don't know what i'm missing. :/

    Code (Text):
    1. package com.seathe.bots.wispCatcher;
    2.  
    3. import com.runemate.game.api.client.embeddable.EmbeddableUI;
    4. import com.runemate.game.api.hybrid.local.Skill;
    5. import com.runemate.game.api.hybrid.location.Area;
    6. import com.runemate.game.api.hybrid.location.Coordinate;
    7. import com.runemate.game.api.hybrid.util.Resources;
    8. import com.runemate.game.api.hybrid.util.StopWatch;
    9. import com.runemate.game.api.script.framework.task.TaskScript;
    10.  
    11. import com.seathe.bots.wispCatcher.Tasks.catchWisp;
    12. import com.seathe.bots.wispCatcher.Tasks.convertWisp;
    13. import javafx.application.Platform;
    14. import javafx.beans.property.ObjectProperty;
    15. import javafx.beans.property.SimpleObjectProperty;
    16. import javafx.fxml.FXMLLoader;
    17. import javafx.scene.Node;
    18.  
    19. import java.io.IOException;
    20.  
    21. /**
    22. * Created by Seathe on 2016-05-27.
    23. */
    24. public class wispCatcher extends TaskScript implements EmbeddableUI{
    25.  
    26.     private Area wispArea;
    27.  
    28.     // GUI variables
    29.     private String location = null;
    30.     private String status = "Loading..";
    31.     private int caught = 0;
    32.     private SimpleObjectProperty<Node> botInterfaceProperty;
    33.  
    34.     private String wispName = null;
    35.  
    36.     private int startDivXp = Skill.DIVINATION.getExperience();
    37.     private int startDivLvl = Skill.DIVINATION.getCurrentLevel();
    38.  
    39.     private StopWatch runtime = new StopWatch();
    40.  
    41.     private wispCatcher() {
    42.         setEmbeddableUI(this);
    43.     }
    44.  
    45.     public void initialize(){
    46.         if(location.equals("Sparkling Wisp")){
    47.             wispName = "Sparkling wisp";
    48.             wispArea = new Area.Rectangular(new Coordinate(2881, 3492), new Coordinate(2889, 3482));
    49.         }
    50.  
    51.         add(new convertWisp(this), new catchWisp(this));
    52.         runtime.start();
    53.     }
    54.  
    55.     public void onStart(String... args){
    56.         setLoopDelay(250, 500);
    57.     }
    58.  
    59.     @Override
    60.     public ObjectProperty<? extends Node> botInterfaceProperty() {
    61.         if (botInterfaceProperty == null) {
    62.             FXMLLoader loader = new FXMLLoader();
    63.             loader.setController(new wispCatcherStartupController (this));
    64.             try {
    65.                 Node node = loader.load(Resources.getAsStream("com/seathe/bots/wispCatcher/wispCatcherStartup.fxml"));
    66.                 botInterfaceProperty = new SimpleObjectProperty<>(node);
    67.             } catch (IOException e) {
    68.                 e.printStackTrace();
    69.             }
    70.         }
    71.         return botInterfaceProperty;
    72.     }
    73.  
    74.     public void setRunningGui(){
    75.         FXMLLoader loader = new FXMLLoader();
    76.         loader.setController(new wispCatcherRunningController(this));
    77.         try {
    78.             Node node = loader.load(Resources.getAsStream("com/seathe/bots/wispCatcher/wispCatcherRunning.fxml"));
    79.             Platform.runLater(() -> botInterfaceProperty.set(node));
    80.         } catch (IOException e) {
    81.             e.printStackTrace();
    82.         }
    83.     }
    84.  
    85.     @Override
    86.     public void onPause() {
    87.         // Pause (stop) the stopwatch objects
    88.         runtime.stop();
    89.     }
    90.  
    91.     @Override
    92.     public void onResume() {
    93.         // Start the stopwatch objects again
    94.         runtime.start();
    95.     }
    96.  
    97.  
    98.     public String getStatus() {
    99.         return status;
    100.     }
    101.     public void setLocation(String location) {
    102.         this.location = location;
    103.     }
    104.     public void setStatus(String status) {
    105.         this.status = status;
    106.     }
    107.     public StopWatch getRuntime() {
    108.         return runtime;
    109.     }
    110.     public int caught() {
    111.         return caught;
    112.     }
    113.     public Area getwispArea() {
    114.         return wispArea;
    115.     }
    116.     public String getwispName(){
    117.         return wispName;
    118.     }
    119.     public void addCaught() {
    120.         caught += 1;
    121.     }
    122.  
    123.     public int getDivXp() {
    124.         return Skill.DIVINATION.getExperience() - startDivXp;
    125.     }
    126.     public int getDivLvl() {
    127.         return Skill.DIVINATION.getCurrentLevel() - startDivLvl;
    128.     }
    129.  
    130.  
    131. }
    132.  
    i'm some what new to java so its probably something stupid i missed :S

     
  2. Best Answer:
    Post #4 by Cloud, May 30, 2016
  3. Recompile all your code. In IntelliJ, Build > Rebuild Project.
     
  4. Thank you for your reply!, so i tried that, and i still get the error. :s
     
  5. You only have a private constructor
     
    Seathe likes this.
  6. Thanks so much!! i got my bot to work! :)
     

Share This Page

Loading...