Resolved Exception thrown on bot load

Discussion in 'Developer Support' started by Party, Apr 9, 2016.

  1. 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 (Text):
    1. Caused by: java.lang.UnsupportedOperationException: Calling methods that must query the session for information is no longer allowed within non-bot threads.
    2. java.lang.NullPointerException
    3.     at nul.IiiiiiiiII.do(Unknown Source)
    4.     at nul.IiiiiiiiII.special_uids(Unknown Source)
    5.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    6.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    7.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    8.     at java.lang.reflect.Method.invoke(Method.java:601)
    9.     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    10.     at sun.rmi.transport.Transport$1.run(Transport.java:177)
    11.     at sun.rmi.transport.Transport$1.run(Transport.java:174)
    12.     at java.security.AccessController.doPrivileged(Native Method)
    13.     at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    14.     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    15.     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    16.     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    17.     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    18.     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    19.     at java.lang.Thread.run(Thread.java:722)
    20.     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    21.     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    22.     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
    23.     at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
    24.     at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
    25.     at com.sun.proxy.$Proxy8.special_uids(Unknown Source)
    26.     at nul.IiiiIIiIIIii.new(epb:12)
    27.     at nul.IiiiIIiIIIii.new(epb:15)
    28.     at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(obc:4)
    29.     at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(obc:198)
    30.     at com.runemate.game.api.hybrid.queries.GameObjectQueryBuilder.initialDataSet(ryb:237)
    31.     at com.runemate.game.api.hybrid.queries.QueryBuilder.results(bob:248)
    32.     at rm.aUX.validate(x:105)
    33.     at com.runemate.game.api.script.framework.task.TaskScript.onLoop(lrb:147)
    34.     at com.runemate.game.api.script.framework.LoopingScript.run(brb:234)
    35.     at com.runemate.game.api.script.framework.AbstractScript.start(exb:174)
    36.     at nul.iIiiiIiiIiiI.run(aic:232)
    37.  
    @Cloud

     
  2. Best Answer:
    Post #7 by Cloud, Apr 11, 2016
  3. You're calling a method that needs to query the game session. This needs to be done on the client thread by using script bot.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.
     
  4. I thought so too, but nothing in his code leaves the bot thread i.e. no JavaFX/Swing Platform.
     
  5. I was using OSRS, yeah.
     
  6. Similar problem, OSRS aswell. RS3 works but super slow.
     
  7. Fixed for the next release.
     

Share This Page

Loading...