-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 11 support #21
Comments
|
Here's the error I'm getting:
And the code that was the reason I got those errors: EngineIoServer server = new EngineIoServer(); And here's my dependencies in my pom: <dependencies>
<!-- java-express -->
<dependency>
<groupId>com.github.Simonwep</groupId>
<artifactId>java-express</artifactId>
<version>caef9738b4</version>
</dependency>
<!-- - -->
<!-- socket.io client -->
<dependency>
<groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId>
<version>1.0.0</version>
</dependency>
<!-- - -->
<!-- engine.io server -->
<dependency>
<groupId>engine.io</groupId>
<artifactId>server</artifactId>
<version>1.0</version>
</dependency>
<!-- - -->
<!-- socket.io server -->
<dependency>
<groupId>socket.io</groupId>
<artifactId>server</artifactId>
<version>1.0</version>
</dependency>
<!-- - -->
</dependencies> And as you might notice, both the engine.io and socket.io server has been built from your sources by me. So yeah I've just built them myself to try and fix the error. |
Ah I see. |
Aha. I wanted to use it together with java-express, but I guess that's not possible? |
I guess not unless you can run java-express inside a java web server. |
Well could you please provide a simple example of how to use Jetty to end up with a socket.io server? |
Please look at this example. |
Well I can't create a new |
You would need to add dependency on |
So even for you, if you just do EngineIoServer server = new EngineIoServer(); you'll also get that error. And would I add that dependency to the engine.io-server or my project's pom? |
Because I can see that in the example you sent, it does that: |
Also how would I run the server? I can't seem to find any exact location where they run the server. I might just be blind |
Yes, you need to add the dependency in your project. But, simply adding it in will bring a whole lot of problems too unless you're deploying your project on a java server. |
Yeah. That was kind of what I was hoping that you had a simple example for. I found this: https://github.com/socketio/engine.io-server-java/blob/master/docs/using.rst#jetty-server |
Like a simple Jetty example with engine.io and socket.io |
I found a complete Jetty example here. |
Looks promising. Altough I found this again: private final EngineIoServer mEngineIoServer = new EngineIoServer(); would it work in that context then? |
Yes it would work there because Jetty provides all the necessary classes.
…________________________________
From: Daniel Munch <[email protected]>
Sent: Saturday, December 28, 2019, 04:13
To: socketio/engine.io-server-java
Cc: Trinopoty Biswas; Comment
Subject: Re: [socketio/engine.io-server-java] Java 11 support (#21)
Looks promising. Altough I found this again:
private final EngineIoServer mEngineIoServer = new EngineIoServer();
would it work in that context then?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#21?email_source=notifications&email_token=ABMEOFS7MOSPVJHD3LHMCBLQ22AIZA5CNFSM4KACCMK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHX3SFQ#issuecomment-569358614>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABMEOFWALAWQSOT2GRV24YLQ22AIZANCNFSM4KACCMKQ>.
|
Great! I'll try and get that to work. Altough one thing I also need to know is, will a engine.io server be able to communicate with a socket.io client? Server is Java and client is JavaScript. |
For that, you'll need the socket.io server available at
https://github.com/trinopoty/socket.io-server-java
You'll need to compile it yourself as I'm unable to provide it on maven at present.
…________________________________
From: Daniel Munch <[email protected]>
Sent: Saturday, December 28, 2019, 04:23
To: socketio/engine.io-server-java
Cc: Trinopoty Biswas; Comment
Subject: Re: [socketio/engine.io-server-java] Java 11 support (#21)
Great! I'll try and get that to work. Altough one thing I also need to know is, will a engine.io server be able to communicate with a socket.io client? Server is Java and client is JavaScript.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#21?email_source=notifications&email_token=ABMEOFXJXFT533P7VIBVCG3Q22BN3A5CNFSM4KACCMK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHX32OI#issuecomment-569359673>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABMEOFUPQA2XF2445VS6OS3Q22BN3ANCNFSM4KACCMKQ>.
|
Yeah I already have a copy. But like in the example you sent above, I don't really see the engine.io being used anywhere, except the servlets? But I don't see the servlets being used anywhere except the |
Java servers use a bit of magic to find and load servlets at boot. I guess it feels a bit odd not being able to find an entry point looking at the code but it'll work just fine.
…________________________________
From: Daniel Munch <[email protected]>
Sent: Saturday, December 28, 2019 4:32:19 AM
To: socketio/engine.io-server-java <[email protected]>
Cc: Trinopoty Biswas <[email protected]>; Comment <[email protected]>
Subject: Re: [socketio/engine.io-server-java] Java 11 support (#21)
Yeah I already have a copy. But like in the example you sent above, I don't really see the engine.io being used anywhere, except the servlets? But I don't see the servlets being used anywhere except the StartupListener which doesn't get used anywhere. Idk if that's how it's supposed to work, but I can't really see how the servlets would ever be instantiated
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#21?email_source=notifications&email_token=ABMEOFWQANUU7CVP6KDZAILQ22CPXA5CNFSM4KACCMK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHX4CIA#issuecomment-569360672>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABMEOFTF5QLDFOIJDQWK34LQ22CPXANCNFSM4KACCMKQ>.
|
Ah okay I see. I'm a bit new to Java servers. Anyway, I would just create the socket.io server in a servlet right? |
Together with the engine.io server |
Yes. You create the SocketIoServer right after the EngineIoServer. Make sure to set the paths to '/socket.io' if you intend to use socket.io.
Keep the server instances somewhere you can access as you'll need it for attaching event listeners.
…________________________________
From: Daniel Munch <[email protected]>
Sent: Saturday, December 28, 2019 4:37:21 AM
To: socketio/engine.io-server-java <[email protected]>
Cc: Trinopoty Biswas <[email protected]>; Comment <[email protected]>
Subject: Re: [socketio/engine.io-server-java] Java 11 support (#21)
Together with the engine.io server
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#21?email_source=notifications&email_token=ABMEOFXRDW2SWOT6SUM6EOTQ22DCRA5CNFSM4KACCMK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHX4GOI#issuecomment-569361209>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABMEOFUNV2WJFRDTFCYJDMLQ22DCRANCNFSM4KACCMKQ>.
|
I can't seem to get it to work. The server is being hosted, but the servlet isn't get initialized. Do you have some place where I could contact you, perhaps a Discord account? |
Hi. I'm trying to create an engine.io server with Java JDK 11.0.5. Altough I seem to get errors about the
AsyncListener
class, which was also removed after Java 8. Are there any plans to make it support Java 8+?The text was updated successfully, but these errors were encountered: