我正在使用 Pushlet 将消息从服务器端推送到网页并得到上述错误。有谁知道为什么会发生这种情况?
public void run() {
DataInputStream input;
try {
input = new DataInputStream(socket.getInputStream());
String json = input.readUTF();
input.close();
System.out.println("msg from client: " + json);
String subject = "/pushlet/ping";
Event event = Event.createDataEvent(subject);
event.setField("msg", json);
Dispatcher.getInstance().multicast(event);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
这是 web.xml。
<!-- Define the pushlet servlet -->
<servlet>
<servlet-name>pushlet</servlet-name>
<servlet-class>nl.justobjects.pushlet.servlet.Pushlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Define the Servlet Mappings. -->
<!-- The pushlet -->
<servlet-mapping>
<servlet-name>pushlet</servlet-name>
<url-pattern>/pushlet.srv</url-pattern>
</servlet-mapping>