Java.net.socketException:网络无法实现(Windows 8上的Eclipse)



我通过在Windows 8上使用Eclipse在运行代码时遇到问题。

    package first
    import org.biojava.bio.structure.Atom
    import org.biojava.bio.structure.Structure
    import org.biojava.bio.structure.StructureTools
    import org.biojava.bio.structure.align.StructureAlignment
    import org.biojava.bio.structure.align.StructureAlignmentFactory
    import org.biojava.bio.structure.align.fatcat.FatCatRigid
    import org.biojava.bio.structure.align.fatcat.calc.FatCatParameters
    import org.biojava.bio.structure.align.gui.StructureAlignmentDisplay
    import org.biojava.bio.structure.align.model.AFPChain
    import org.biojava.bio.structure.align.util.AtomCache
    import org.biojava.bio.structure.gui.BiojavaJmol
    import org.biojava.bio.structure.align.gui.jmol.StructureAlignmentJmol
    object Alignment {
      def main(args: Array[String]){
          val name1 = "1YYO.A"
          val name2 = "1YYW.A"
          val cache = new AtomCache()
          val algorithm = StructureAlignmentFactory.getAlgorithm(FatCatRigid.algorithmName)
          val ca1: Array[Atom] = StructureTools.getAtomCAArray(cache.getStructure(name1))
          val ca2: Array[Atom] = StructureTools.getAtomCAArray(cache.getStructure(name2))
          val params: FatCatParameters = new FatCatParameters()
          val afpchain: AFPChain = algorithm.align(ca1, ca2, params)
          afpchain.setName1(name1)
          afpchain.setName2(name2)
          println(afpchain.toFatcat(ca1,ca2))
          StructureAlignmentDisplay.display(afpchain, ca1, ca2)
      }
    }

基本上getStructure方法试图下载PDB文件,但失败并给出以下错误。

Problem while downloading PDB ID 1yyo from FTP server.
Failed URL: ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/yy/pdb1yyo.ent.gz
java.net.SocketException: Network is unreachable: connect
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at sun.net.ftp.impl.FtpClient.openPassiveDataConnection(FtpClient.java:671)
    at sun.net.ftp.impl.FtpClient.openDataConnection(FtpClient.java:710)
    at sun.net.ftp.impl.FtpClient.getFileStream(FtpClient.java:1284)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:428)
    at java.net.URL.openStream(URL.java:1037)
    at org.biojava.bio.structure.io.util.FileDownloadUtils.downloadGzipCompressedFile(FileDownloadUtils.java:96)
    at org.biojava.bio.structure.io.PDBFileReader.downloadPDB(PDBFileReader.java:677)
    at org.biojava.bio.structure.io.PDBFileReader.downloadAndGetInputStream(PDBFileReader.java:795)
    at org.biojava.bio.structure.io.PDBFileReader.getInputStream(PDBFileReader.java:433)
    at org.biojava.bio.structure.io.PDBFileReader.getStructureById(PDBFileReader.java:875)
    at org.biojava.bio.structure.align.util.AtomCache.loadStructureFromPdbByPdbId(AtomCache.java:1173)
    at org.biojava.bio.structure.align.util.AtomCache.getStructure(AtomCache.java:501)
    at first.Alignment$.main(Alignment.scala:24)
    at first.Alignment.main(Alignment.scala)
problem loading:1YYO.A 

我试图重新安装和更新JDK,关闭防火墙,添加了-Djava.net.preferIPv4Stack=true,但我仍然无法解决问题。任何建议将不胜感激。非常感谢!

可能是以下Windows问题:

http://support.microsoft.com/kb/2754804

那是一个适用于Windows 7的人,不确定它是否适用于Windows 8。

相关内容

  • 没有找到相关文章

最新更新