Comments (6)
@vkurland please switch to updated version com.codeminders.socketio:socket-io:1.0.3
we have released yesterday. I have tried chat demo with Jetty 9.4.7 RC0 and it works fine
from socket.io-server-java.
It looks like your API has changed. I used to use your class JettySocketIOServlet but I can't find it anymore. How do I build a servlet to handle Socket-IO connections? In my application, I need this to be a part of existing web server that has lots of other servlets and serves everything on the same port
from socket.io-server-java.
Please use com.codeminders.socketio.server.transport.websocket.WebsocketIOServlet
instead of former
JettySocketIOServlet
for example,
public class ChatSocketServlet extends WebsocketIOServlet {
....
public void init(ServletConfig config) throws ServletException {
super.init(config);
of("/foo").on(new ConnectionListener() {
@Override
public void onConnect(final Socket socket) {
socket.on("bar", new EventListener() {
@Override
public Object onEvent(String name, Object[] args, boolean ackRequested) {
return "OK";
}
});
.....
}
}
}
.....
}
You can also catch me on Skype to discuss things, I would be happy to help
from socket.io-server-java.
this helps, I was able to move onto the next step. Unfortunately, this wasn't enough.
Caused by: java.lang.NoSuchFieldError: WRITE_DURATIONS_AS_TIMESTAMPS
at com.fasterxml.jackson.datatype.joda.ser.DurationSerializer.(DurationSerializer.java:28)
at com.fasterxml.jackson.datatype.joda.ser.DurationSerializer.(DurationSerializer.java:25)
at com.fasterxml.jackson.datatype.joda.JodaModule.(JodaModule.java:43)
at net.happygears.nw2.json.JsonObjectMapperFactory.actuallyCreateMapper(JsonObjectMapperFactory.java:71)
at net.happygears.nw2.json.JsonObjectMapperFactory.createMapper(JsonObjectMapperFactory.java:52)
at net.happygears.nw2.db.hbm.AreaModel.(AreaModel.java:32)
at java.lang.Class.forName0(Native Method)
this has nothing to do with Socket-io but as far as I understand, this error is caused by incompatible versions of jackson-databind and jackson-datatype-joda.
Looks like your library depends on jackson-databind v2.4.0 which is a bit too old and it causes compatibility issues with my code that depends on a newer version.
Is there a particular reason you need the old one? I believe anything newer than 2.5.0 should work for me but as fyi, my pom.xml declares dependency on jackson-core 2.9.0.pr3
pom that comes with your library declares this:
<dependencies> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.1</version> <scope>provided</scope> </dependency> </dependencies>
from socket.io-server-java.
bumped dependency versions to the latest ones:
- Guava 23.0
- Jackson 2.9.1
Please try with snapshot version built from source code
from socket.io-server-java.
I have worked around this issue by excluding transient dependencies:
<dependency> <groupId>com.codeminders.socketio</groupId> <artifactId>socket-io</artifactId> <version>1.0.3</version> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> </exclusions> </dependency>
looks like your server works for me now, thank you
from socket.io-server-java.
Related Issues (11)
- Not running on Jetty, JSR-356 support unavailable HOT 5
- please merge the fix from 1.0.2-a to master HOT 1
- "Missing request header" exception HOT 2
- please make new release with our recent fixes
- 1.0.7 failing on every message HOT 1
- Why does not XHRTransportConnection implement timeouts, while Websocket do? HOT 1
- Expected binary marker in the payload HOT 12
- Http session isn't available from com.codeminders.socketio.server.Socket with websocket transport at least in Jetty 9.4.7 HOT 1
- xhr-polling sessions do not seem to honor timeout and at the same time, have unbounded internal message queue
- server never switches to websocket HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io-server-java.