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 Exception thrown on bot load

Client Developer
Joined
Oct 12, 2015
Messages
3,760
When loading bot (my own one which does not use JavaFX or Swing, pNatureThiever if you need to view source @Cloud ), an exception is thrown.

Bot continues to "run" (Spectre UI still shows Pause/Stop) but is idle.

Code:
Caused by: java.lang.UnsupportedOperationException: Calling methods that must query the session for information is no longer allowed within non-bot threads.
java.lang.NullPointerException
    at nul.IiiiiiiiII.do(Unknown Source)
    at nul.IiiiiiiiII.special_uids(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
    at com.sun.proxy.$Proxy8.special_uids(Unknown Source)
    at nul.IiiiIIiIIIii.new(epb:12)
    at nul.IiiiIIiIIIii.new(epb:15)
    at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(obc:4)
    at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(obc:198)
    at com.runemate.game.api.hybrid.queries.GameObjectQueryBuilder.initialDataSet(ryb:237)
    at com.runemate.game.api.hybrid.queries.QueryBuilder.results(bob:248)
    at rm.aUX.validate(x:105)
    at com.runemate.game.api.script.framework.task.TaskScript.onLoop(lrb:147)
    at com.runemate.game.api.script.framework.LoopingScript.run(brb:234)
    at com.runemate.game.api.script.framework.AbstractScript.start(exb:174)
    at nul.iIiiiIiiIiiI.run(aic:232)

@Cloud
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,774
You're calling a method that needs to query the game session. This needs to be done on the client thread by using script.getPlatform and calling it in a callable or runnable. By the looks of it you were trying to get the game objects from within some other thread that you've created.
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,046
You're calling a method that needs to query the game session. This needs to be done on the client thread by using script.getPlatform and calling it in a callable or runnable. By the looks of it you were trying to get the game objects from within some other thread that you've created.
I thought so too, but nothing in his code leaves the bot thread i.e. no JavaFX/Swing Platform.
 
Top