I'm Back !! But need some help . v.62 Server

Results 1 to 4 of 4
  1. #1
    Enthusiast iCyanidex is offline
    MemberRank
    Jun 2013 Join Date
    cm.dispose();Location
    38Posts

    I'm Back !! But need some help . v.62 Server

    You can close this thread I fixed this issue. Thank you "NotaDickLol" for well , not being a dick haha and helping me out.


    https://ibb.co/w6j5wWG
    Last edited by iCyanidex; 22-02-22 at 12:52 AM.


  2. #2
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: I'm Back !! But need some help . v.62 Server

    there is a full stack trace, what else do you need frm us? lol
    at-least tr to solve it yourself

  3. #3
    Novice NotaDickLol is offline
    MemberRank
    Feb 2022 Join Date
    1Posts

    Re: I'm Back !! But need some help . v.62 Server

    xD

    Alright so basically how to read these stack traces to figure out your errors is simple if your break it down.

    I've highlighted the problem files and lines its referring to for you so its easier to locate them in your source.
    Code:
    getInvocableSEVERE: Error executingscript.java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.eval(java.io.Reader)" because "this.engine" is null at scripting.AbstractScriptManager.getInvocable(AbstractScriptManager.java:82)at scripting.event.EventScriptManager.<init>(EventScriptManager.java:59) at handling.channel.ChannelServer.run(ChannelServer.java:243) at 
    First, open up scripting.AbstractScriptManager.java - line 82. Next open up scripting.event.EventScriptManager - line 59. There, you will see a line with something referring to
    Code:
    'this.engine.getInvocable("some bullshit");'
    - however your object has not been initialized so it throws a NullPointerException.. All this means is that you need to make sure you're calling
    Code:
    this.engine = new ScriptEngine();
    (or whatever the fuck scripting engine you actually use would be, rather than ScriptEngine) before scripting.event.EventScriptManager - line 59.

    If you provide the full file, I will PERHAPS spoonfeed it to you later if I choose to drink again tomorrow night. but this should be sufficient to manage it on your own i think.


    *** scratch that you have 2 errors lmao mb #2 -- ***

    Code:
    (7575).[INFO] Channel 1 is online.Exception in thread "main" java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.put(String, Object)" because "entry.iv" is null at scripting.event.EventScriptManager.init(EventScriptManager.java:74) ...


    For this one, you'll go to scripting.event.EventScriptManager.init() - line 74. You'll see a line that says something like
    Code:
    entry.iv... idk man
    and before it you'll wanna add
    Code:
    if (entry.iv != null) {
        entry.iv... idk man
    }
    to wrap it. That will fix your error and allow the server to start, however you will still need to figure out why 'entry.iv' was null in the first place to truly fix the problem. (though I'd bet its related to the first error where your engine is null to begin with - solving the first problem should solve this #2 problem is my best guess so i would focus on the first one)
    Last edited by NotaDickLol; 21-02-22 at 11:03 AM.

  4. #4
    Enthusiast iCyanidex is offline
    MemberRank
    Jun 2013 Join Date
    cm.dispose();Location
    38Posts

    Re: I'm Back !! But need some help . v.62 Server

    Quote Originally Posted by Fraysa View Post
    there is a full stack trace, what else do you need frm us? lol
    at-least tr to solve it yourself
    Sorry, Fraysa. Didn't mean to upset you. Have a beer ;)

    - - - Updated - - -

    Quote Originally Posted by NotaDickLol View Post
    xD

    Alright so basically how to read these stack traces to figure out your errors is simple if your break it down.

    I've highlighted the problem files and lines its referring to for you so its easier to locate them in your source.
    Code:
    getInvocableSEVERE: Error executingscript.java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.eval(java.io.Reader)" because "this.engine" is null at scripting.AbstractScriptManager.getInvocable(AbstractScriptManager.java:82)at scripting.event.EventScriptManager.<init>(EventScriptManager.java:59) at handling.channel.ChannelServer.run(ChannelServer.java:243) at 
    First, open up scripting.AbstractScriptManager.java - line 82. Next open up scripting.event.EventScriptManager - line 59. There, you will see a line with something referring to
    Code:
    'this.engine.getInvocable("some bullshit");'
    - however your object has not been initialized so it throws a NullPointerException.. All this means is that you need to make sure you're calling
    Code:
    this.engine = new ScriptEngine();
    (or whatever the fuck scripting engine you actually use would be, rather than ScriptEngine) before scripting.event.EventScriptManager - line 59.

    If you provide the full file, I will PERHAPS spoonfeed it to you later if I choose to drink again tomorrow night. but this should be sufficient to manage it on your own i think.


    *** scratch that you have 2 errors lmao mb #2 -- ***

    Code:
    (7575).[INFO] Channel 1 is online.Exception in thread "main" java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.put(String, Object)" because "entry.iv" is null at scripting.event.EventScriptManager.init(EventScriptManager.java:74) ...


    For this one, you'll go to scripting.event.EventScriptManager.init() - line 74. You'll see a line that says something like
    Code:
    entry.iv... idk man
    and before it you'll wanna add
    Code:
    if (entry.iv != null) {
        entry.iv... idk man
    }
    to wrap it. That will fix your error and allow the server to start, however you will still need to figure out why 'entry.iv' was null in the first place to truly fix the problem. (though I'd bet its related to the first error where your engine is null to begin with - solving the first problem should solve this #2 problem is my best guess so i would focus on the first one)
    Thank you for highlighting that portion for me , i've been away for quite some time , 7+ years now so im very rusty on java but i found my old server files on an old mediafire account I just wanted to try getting them working check out the old server and old account have some fun with it ya know haha , I will go through with what you have told me and see if I can find why
    this.engine
    is not being initialized in the first place , Could it be just that i need to use older java ? I have Java 8 installed , but used the older update revision. I have done more digging into it and it seems it may be trying to load an Event script on startup that either isn't there or isn't being referenced properly ...

    public EventScriptManager(ChannelServer cserv, String[] scripts) {
    super();
    for (String script : scripts)
    if (!script.equals("")) {
    Invocable iv = getInvocable("event/" + script + ".js", null);
    this appears like if it tries to read an event script that is null or not there it will throw the invocable code i am seeing in the .bat. is this correct ?

    Here are my EventScriptManager and AbstractScriptManager files
    https://www.mediafire.com/file/rvw5w...ager.java/file
    https://www.mediafire.com/file/m34wr...ager.java/file

    - - - Updated - - -

    Here is line 55-90 of Abstract Script Manager.

    protected Invocable getInvocable(String path, MapleClient c) {
    try {
    String scriptPath = "scripts/" + path;
    int prior = 0; //Used for priority of features
    engine = null;
    if (c != null) {
    engine = c.getScriptEngine(scriptPath);
    }
    if (engine == null) {
    File scriptFile = new File(scriptPath);
    FeatureManager fm = new FeatureManager();
    for(int i = 0; i < fm.count(); i++) {
    Feature feat = fm.featureList[i];
    if(feat.isEnabled() && feat.getPriority() > prior) {
    scriptPath = "scripts/feature/" + feat.toString() + "/" + path;
    File tmpScriptFile = new File(scriptPath);
    if(tmpScriptFile.exists())
    scriptFile = tmpScriptFile;
    }
    }
    if (!scriptFile.exists())
    return null;
    engine = sem.getEngineByName("javascript");
    if (c != null) {
    c.setScriptEngine(scriptPath, engine);
    }
    FileReader fr = new FileReader(scriptFile);
    engine.eval(fr); <<<<<<<< This is line 82
    fr.close();
    }
    return (Invocable) engine;
    } catch (Exception e) {
    log.error("Error executing script.", e);
    return null;
    }
    }
    Last edited by iCyanidex; 21-02-22 at 06:07 PM.



Advertisement