ObjectInputStream中的EOFEException仅在Webstart中发生,而不是在java(w).exe中发生?
熟悉启动Webstart(javaws.exe)与启动应用程序的区别的人。关于流使用java.exe或javaw.exe 这是我只有在使用Webstart时才会遇到的例外情况:ObjectInputStream中的EOFEException仅在Webstart中发生,而不是在java(w).exe中发生?,java,servlets,java-web-start,objectinputstream,eofexception,Java,Servlets,Java Web Start,Objectinputstream,Eofexception,熟悉启动Webstart(javaws.exe)与启动应用程序的区别的人。关于流使用java.exe或javaw.exe 这是我只有在使用Webstart时才会遇到的例外情况: java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readShort(U
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at fasttools.jtools.dss.api.core.remoting.thinclient.RemoteSocketChannel.<init>(RemoteSocketChannel.java:77)
[编辑]
Webstart控制台显示:
Java Web Start 1.6.0_19
使用JRE版本1.6.0_19-b04 Java HotSpot(TM)客户端虚拟机
服务器正在运行相同的1.6u19
[编辑]
JNLP包含:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://127.0.0.1:8080/">
<information>
<title>..</title>
<vendor>..</vendor>
<homepage href="http://127.0.0.1:8080/index.html"/>
<description>..</description>
<icon href="/jws/.."/>
<icon kind="splash" href="/jws/...jpg"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" initial-heap-size="128M" max-heap-size="512M"/>
<jar href="http://127.0.0.1:8080/lib/xx.jar"/>
<jar href="http://127.0.0.1:8080/lib/yy.jar"/>
</resources>
<application-desc main-class="..">
<argument>-host</argument> <argument>127.0.0.1</argument>
<argument>-port</argument> <argument>4359</argument>
<argument>-httpport</argument> <argument>8080</argument>
</application-desc>
</jnlp>
..
..
..
-主机127.0.0.1
-端口4359
-httpport 8080
谢谢我认为您可能需要在JNLP文件中请求权限。尝试添加
//==Server side==
//Thread{
Socket mClientSocket = cServSock.accept();
new DssServant(mClientSocket).start();
//}
DssServant(Socket socket) throws DssException {
try {
OutputStream mOutputStream = new BufferedOutputStream( socket.getOutputStream() );
cObjectOutputStream = new ObjectOutputStream(mOutputStream);
cObjectOutputStream.flush(); //publish streamHeader
InputStream mInputStream = new BufferedInputStream( socket.getInputStream() );
cObjectInputStream = new ObjectInputStream(mInputStream);
..
} catch (IOException e) {
..
}
..
}
//==Client side==
public RemoteSocketChannel(String host, int port, IEventDispatcher eventSubscriptionHandler) throws DssException {
cHost = host;
port = (port == 0 ? DssServer.PORT : port);
try {
cSocket = new Socket(cHost, port);
OutputStream mOutputStream = new BufferedOutputStream( cSocket.getOutputStream() );
cObjectOut = new ObjectOutputStream(mOutputStream);
cObjectOut.flush(); //publish streamHeader
InputStream mInputStream = new BufferedInputStream( cSocket.getInputStream() );
cObjectIn = new ObjectInputStream(mInputStream);
} catch (IOException e) {
..
}
..
}
<security>
<all-permissions/>
</security>
. 噢,天哪
我发现了问题所在。。
从现有程序复制的servlet生成的JNLP文件提供了端口nr参数。但是端口号没有被更正。。
提供的端口是一个(现有)安全套接字。。我的应用程序使用了不安全的套接字
多么严重的错误对不起,我没有发布Jnlp文件。。它已经包含了该设置。您可能还需要对其进行签名。