1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved NUllPointer from WebBuilder

Discussion in 'Client & Site Support' started by Exia, Sep 1, 2015.

  1. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Got this when building a web path, it may be related to the server outage.
    Code (Text):
    1. java.lang.NullPointerException
    2.  at app.pp.long(qic:164)
    3.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(fjc:88)
    4.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(fjc:69)
    5.  at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
    6.  at scripts.mining.locations.Location.walkToMine(Location.java:246)
    7.  at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
    8.  at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
    9.  at com.runemate.game.api.script.framework.LoopingScript.run(orb:45)
    10.  at com.runemate.game.api.script.framework.AbstractScript.start(yub:136)
    11.  at app.Pm.run(lqb:241)
    12. 1.1.20 - OSRS
    --- Double Post Merged, Sep 1, 2015, Original Post Date: Aug 31, 2015 ---
    Just got another one:
    Code (Text):
    1. java.lang.NullPointerException
    2.  at app.lq.try(dyb:233)
    3.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(uec:274)
    4.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(uec:81)
    5.  at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
    6.  at scripts.mining.locations.Location.walkToMine(Location.java:246)
    7.  at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
    8.  at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
    9.  at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
    10.  at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
    11.  at app.TM.run(znb:227)
    12. 1.1.21 - OSRS
    @Cloud @Arbiter
    --- Double Post Merged, Sep 1, 2015 ---
    @Cloud @Arbiter
    Here's another one:
    Code (Text):
    1. java.lang.NullPointerException
    2.  at app.lq.try(dyb:233)
    3.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(uec:274)
    4.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(uec:81)
    5.  at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
    6.  at scripts.mining.locations.Location.walkToMine(Location.java:246)
    7.  at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
    8.  at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
    9.  at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
    10.  at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
    11.  at app.TM.run(znb:227)
    12. 1.1.21 - OSRS
    --- Double Post Merged, Sep 1, 2015 ---
    Oh wait, just noticed that last one is the same as the one before it.
     
  2. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    A couple thoughts off the top of my head. I'm assuming the issue is that something in your web is a bit... odd...
    1. An edge could be missing it's target vertex.
    2. An edge could be missing its start vertex.

    Now how this could happen, I'm not entirely sure.
     
  3. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    I'm using the default web.
     
  4. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Uhm, no you're not. The stacktrace would be very different.
     
  5. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Then somehow this returned a different web, because this is what I am using:
    Code (Text):
    1.     private Web web;
    2.     public GenericPathBuilder(){
    3.         web  = Traversal.getDefaultWeb();
    4.     }
    5.     public Path buildTo(Locatable dest){
    6.         Path path = RegionPath.buildTo(dest);    
    7.         if(path == null || path.getNext() == null)
    8.             path = web.getPathBuilder().buildTo(dest);
    9.         if(path == null || path.getNext() == null)
    10.             path = BresenhamPath.buildTo(dest);
    11.         if(path != null && Random.nextInt(100) <= PlayerSense.getAsInteger(CustomPlayerSense.Key.VIEW_PORT_WALKING.playerSenseKey))
    12.             path = ViewportPath.convert(path);
    13.         return path;
    14.     }
    15.  
     
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    That code is never shown anywhere in the stacktrace. It's saying that
     at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(uec:274)
     at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(uec:81)
    were called and if it was using the default web it would be using custom implementations instead of the api implementations.
    It's also never referencing the method that you posted the code for above.
     
  7. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Sorry, this is a bit my bad for not fully reading the trace and making an assumption. However I don't think that trace is correct because never in my entire code base do I call the function "setWebWalker", which is why I never thought it would be in the trace and made the assumption.

    There is a completely different problem here, and I'm 100% confused on what it is since that trace does not match my code.

    I'll take a look at my older revisions, but I don't ever remember calling that function.
    --- Double Post Merged, Sep 3, 2015, Original Post Date: Sep 2, 2015 ---
    @Cloud So, I've got another exception here, and it seems like the problem may not just be in the web, but it is in the stack trace generation as well.
    So let me just outline what I've found:
    Code (Text):
    1. java.lang.NullPointerException
    2.  at app.lq.try(dyb:233)
    3.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(uec:274)
    4.  at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(uec:81)
    5.  at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
    6.  at scripts.mining.locations.Location.walkToMine(Location.java:246)
    7.  at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
    8.  at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
    9.  at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
    10.  at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
    11.  at app.TM.run(znb:227)
    12. 1.1.21 - OSRS
    1. The trace indicates function setWebWalker
    2. The trace indicates line 42 of GenericPathBuilder
    3. Line 42 is not setWebWalker, it is buildTo
    4. Line 42 of GenericPathBuilder is path = web.getPathBuilder().buildTo(dest);

    So my conclusion is that the trace has indicated the wrong function name but is correct with the line numbers. This means there are two errors here, the error with stack trace generation and the original error that comes from a nullpointer in the default web.

    I'll add a catch to my code to see if I can give you a bit more info about where the path is being generated from and to.
     

Share This Page

Loading...