Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved NUllPointer from WebBuilder

Joined
Nov 3, 2013
Messages
609
Got this when building a web path, it may be related to the server outage.
Code:
java.lang.NullPointerException
 at app.pp.long(qic:164)
 at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.build(fjc:88)
 at com.runemate.game.api.hybrid.location.navigation.web.WebPathBuilder.buildTo(fjc:69)
 at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
 at scripts.mining.locations.Location.walkToMine(Location.java:246)
 at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
 at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
 at com.runemate.game.api.script.framework.LoopingScript.run(orb:45)
 at com.runemate.game.api.script.framework.AbstractScript.start(yub:136)
 at app.Pm.run(lqb:241)
1.1.20 - OSRS
 
Just got another one:
Code:
java.lang.NullPointerException
 at app.lq.try(dyb:233)
 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)
 at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
 at scripts.mining.locations.Location.walkToMine(Location.java:246)
 at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
 at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
 at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
 at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
 at app.TM.run(znb:227)
1.1.21 - OSRS
@Cloud @Arbiter
 
@Cloud @Arbiter
Here's another one:
Code:
java.lang.NullPointerException
 at app.lq.try(dyb:233)
 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)
 at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
 at scripts.mining.locations.Location.walkToMine(Location.java:246)
 at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
 at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
 at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
 at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
 at app.TM.run(znb:227)
1.1.21 - OSRS
 
Oh wait, just noticed that last one is the same as the one before it.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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.
 
Joined
Nov 3, 2013
Messages
609
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.
I'm using the default web.
 
Joined
Nov 3, 2013
Messages
609
Uhm, no you're not. The stacktrace would be very different.
Then somehow this returned a different web, because this is what I am using:
Code:
    private Web web;
    public GenericPathBuilder(){
        web  = Traversal.getDefaultWeb();
    }
    public Path buildTo(Locatable dest){
        Path path = RegionPath.buildTo(dest);     
        if(path == null || path.getNext() == null)
            path = web.getPathBuilder().buildTo(dest);
        if(path == null || path.getNext() == null)
            path = BresenhamPath.buildTo(dest);
        if(path != null && Random.nextInt(100) <= PlayerSense.getAsInteger(CustomPlayerSense.Key.VIEW_PORT_WALKING.playerSenseKey))
            path = ViewportPath.convert(path);
        return path;
    }
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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.
 
Joined
Nov 3, 2013
Messages
609
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.
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.
 
@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:
java.lang.NullPointerException
 at app.lq.try(dyb:233)
 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)
 at scripts.mining.GenericPathBuilder.setWebWalker(GenericPathBuilder.java:42)
 at scripts.mining.locations.Location.walkToMine(Location.java:246)
 at scripts.mining.StandardMiner.walkTo(StandardMiner.java:122)
 at scripts.ExiaMinerAIO.onLoop(ExiaMinerAIO.java:62)
 at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
 at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
 at app.TM.run(znb:227)
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.
 
Top