Page 1 of 1

Ertheia Login Server Error

Posted: Fri Dec 07, 2018 3:25 am
by Phoenex
Hi all,
I am setting up an Ertheia server and everything seems to be working except logging in. I used the Ertheia branches for both the l2j_datapack and Ertheia l2j_server git links found on the main L2J Server web page. The Login Server and Game Server seem to boot up just fine (with the exception of a set of NPC errors but it doesn't seem to cause any issues). I can even make a connection from another computer on my network.

Whenever I try to log in on any computer, I get this error in my L2j Login Server:

Code: Select all

Exception in thread "SelectorThread-20" java.lang.NoSuchMethodError: java.nio.By
teBuffer.position(I)Ljava/nio/ByteBuffer;
        at com.l2jserver.loginserver.network.L2LoginClient.encrypt(L2LoginClient
.java:128)
        at com.l2jserver.mmocore.SelectorThread.putPacketIntoWriteBuffer(Selecto
rThread.java:628)
        at com.l2jserver.mmocore.SelectorThread.prepareWriteBuffer(SelectorThrea
d.java:589)
        at com.l2jserver.mmocore.SelectorThread.writePacket(SelectorThread.java:
500)
        at com.l2jserver.mmocore.SelectorThread.run(SelectorThread.java:187)
I have tested this with both an existing account (created through the SQL Account Manager) and a new account (I have auto-create accounts on) but both result in the same error in the Login Server. I received advice through Glitter to check my L2.exe and server protocol revision. I found that the client was 603 and the Server.Properties says AllowedProtocolRevisions = 603,606,607. Also, nothing more happens in the Login Server window on consecutive attempts to join. Just more infinite spin on the client. If you need any other information just let me know. Thanks in advance!

-Phoenex

PICTURES:'; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" >
Server working before error:
http://prntscr.com/lrs1tk

Client infinite load screen on login attempt:
http://prntscr.com/lrs9rh

Console with error as soon as client attempts to log in:
http://prntscr.com/lrsc89
Edit: Looks like spoilers are broken. Until then:
Server working before error:
http://prntscr.com/lrs1tk

Client infinite load screen on login attempt:
http://prntscr.com/lrs9rh

Console with error as soon as client attempts to log in:
http://prntscr.com/lrsc89

Re: Ertheia Login Server Error

Posted: Fri Dec 07, 2018 2:21 pm
by Sacrifice
Probably is due to libs and core is prepared for java7? Or java8 and you have installed java10 or 11...

Re: Ertheia Login Server Error

Posted: Fri Dec 07, 2018 8:02 pm
by Phoenex
I am running 64bit java jre 8 and also have 64bit java jdk 11. I'll try installing the java 7 environment and post an update.

Re: Ertheia Login Server Error

Posted: Sat Dec 08, 2018 12:56 am
by Phoenex
Definitely worse now. It now no longer starts and has an immediate error: Unsupported major.minor version 52.0 at... at... at...

Photo of the new error:
http://prntscr.com/ls78uf

I reinstalled jre 8 and tried a launch on a clean install. Login Server launches as it originally did and I saw the game server process the "new" Java install files. Unfortunately the login server still produces the same original error after a clean Java installation. Thanks for the advice, but it looks like this isn't going to be the solution. Any other ideas?

Re: Ertheia Login Server Error

Posted: Sat Dec 08, 2018 2:28 am
by Phoenex
I finally found the files I was looking for to help me assess this error. I am no Java wiz but can find my way around it mostly OK. It seems that the first error at com.l2jserver.loginserver.network.L2LoginClient.encrypt(L2LoginClient
.java:128) is coming from the encrypt function block near the bottom where

Code: Select all

buf.position(offset + size);
is called. This comes from the ByteBuffer library who's been assigned 'buf' as a local variable name. The position function through 'buf' runs the function

Code: Select all

public final Buffer position(int newPosition)
This looks like it takes an integer as a variable. The variables 'offset' and 'size' are both declared as integers so this shouldn't be a problem.

I am seeing a possible here that I'm not entirely sure how to fix as I am not fluent in Java nor do I know how these packages interact with one another:
  • The issue might stem from the fact that the parameter of 'offset + size' is greater than the buffer's allowed limit or if 'offset' + 'size' happens to be less than zero.

Re: Ertheia Login Server Error

Posted: Sat Dec 08, 2018 6:42 am
by Phoenex
Good news, I got the login server running correctly and allows clients to connect. I was trying to download and build a different branch to copy some files over to try and replace some of the login server files when Gradle decided it didn't like my java anymore. I did several reinstalls and now the Login Server works like a charm. I am currently on jre10 if that makes a difference but it was more likely I straightened out my mess of environment variables.

Now for the not so good news. The game server is officially broken. I am having trouble getting logs on the situation because the server's logging stops at the first error, then there are tons of lines printed into console, more than can be scrolled back through. So far the best solution was to take a screen recording of console as it ran... Not very elegant but it shows that I am having lots of issues in \game\data\scripts\handlers\effecthandlers\

http://prntscr.com/ls9anj

Re: Ertheia Login Server Error

Posted: Sun Dec 09, 2018 4:44 am
by Phoenex
I'm making progress. When I reinstalled java I installed version 10. It seems that the login server needed my environment variables to be fixed as much as the game server needs java 8. So, I am running 8 again and everything launches as usual. I got the login server and game server running and everything looks perfect.... Until I try to log in. I can log in and the server shows up as online, but as soon as I try to join it I get an error in the game server window that is very similar to the one I was getting on the login server. It also only will appear once, not showing up on consecutive join attempts. It does seem that the server doesn't crash during this as there is still background activity appearing in the console (variable saves etc). Time to do some more research. This is feeling more like a blog with periodic commentary at this point than a support thread. Here's the error if anyone is looking and interested.

Code: Select all

Exception in thread "SelectorThread-255" java.lang.NoSuchMethodError: java.nio.B
yteBuffer.position(I)Ljava/nio/ByteBuffer;
        at com.l2jserver.gameserver.network.L2GameClient.encrypt(L2GameClient.ja
va:204)
        at com.l2jserver.mmocore.SelectorThread.putPacketIntoWriteBuffer(Selecto
rThread.java:628)
        at com.l2jserver.mmocore.SelectorThread.prepareWriteBuffer(SelectorThrea
d.java:589)
        at com.l2jserver.mmocore.SelectorThread.writePacket(SelectorThread.java:
500)
        at com.l2jserver.mmocore.SelectorThread.run(SelectorThread.java:187)
Looks like more encryption issues. Is there a way to disable this process? Yes I know it would be less secure but I am not planning on hosting a public server. Just LAN or PtP is secure enough for me...

Re: Ertheia Login Server Error

Posted: Mon Dec 10, 2018 6:02 am
by Phoenex
After a considerable amount of tinkering I have found some new information that may be the final piece to my puzzle. Somehow I got past the last error now I see a lot of little errors among many of the files. Lots of console lines stating "Override cannot be resolved to a type" and many lines stating where "java.lang.String" is referred to but cannot be accessed. Perhaps a developer missed an import somewhere? How could such a major piece be missing from the puzzle yet I am seemingly the only one to have found it? Back to the files...

Re: Ertheia Login Server Error

Posted: Tue Dec 11, 2018 5:36 am
by Phoenex
Getting closer everyone. I decided that the simplest method might be to just get rid of the encryption. I dug through the server files and eventually found something that was promising. A simple 'true' to 'false' later and I re-compiled the server. I got so close to getting connected to the server. Login works perfectly, even the game server recognizes my Client version protocol. Just a tiny snag left. I immediately get disconnected after joining. This almost seems like a client issue as if I attempt a few times, the client crashes with a general error. Time to keep looking.

Progress screenshot:
http://prntscr.com/ltct8f

Code Adjustment:
http://prntscr.com/ltdini