与启动应用程序相比,熟悉Webstart(javaws.exe)开始差异的任何人。使用java.exe或javaw.exe关于流?ObjectInputStream中的EOFException仅在Webstart不是由java(w).exe发生?
这是使用Webstart的时我只得到异常:
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)
我就是这样设置在两侧的连接
//==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) {
..
}
..
}
[编辑] Webstart的控制台说: Java Web Start 1.6.0_19 使用JRE版本1.6.0_19-b04 Java HotSpot(TM)客户端VM
服务器运行同样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>
感谢
对不起,我也没发布JNLP文件.. 它已经包含了该设置。 – Houtman 2010-04-12 07:06:17
您可能还需要签名。 – 2010-04-13 00:47:51