アプリの起動と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(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 Start1.6.0_19JREバージョン1.6.0_19-b04JavaHotSpot(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>
ありがとう