2
我試圖能夠使用ant-contrib遠程啓動一個ant任務。出於測試目的,我已經用以下文件定義了一個服務器和一個調用者。從ant-contrib執行遠程任務時發生EOFException
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="RMI" basedir="." default="start.ant.server">
<target name="start.ant.server">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<antserver port="12345" />
</target>
<target name="remoteant">
<echo message="hi"/>
</target>
</project>
而且
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="RMI" basedir="." default="call.ant.server">
<target name="call.ant.server">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<remoteant machine="localhost" port="12345">
<runtarget target="remoteant"/>
</remoteant>
</target>
</project>
當我啓動服務器,然後運行遠程調用,似乎一切都工作正常,但來電者拋出一個異常:
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2498)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1273)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at net.sf.antcontrib.antserver.client.Client.sendCommand(Client.java:233)
at net.sf.antcontrib.antserver.client.ClientTask.execute(ClientTask.java:144)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
有沒有人發現類似的東西,任何方式來擺脫例外?
感謝,
忽略它似乎是一個版本中的問題。 Ant 1.8.1與ant-contrib 1.0.3b。 http://sourceforge.net/tracker/?func=detail&aid=3323778&group_id=36177&atid=416920給那些想要跟蹤這個bug的狀態的人。 – pedromarce 2012-03-02 15:57:10