gpt4 book ai didi

java.net.SocketException : Network is unreachable (Eclipse on Windows 8)

转载 作者:行者123 更新时间:2023-12-01 13:36:22 28 4
gpt4 key购买 nike

我在 Windows 8 上使用 Eclipse 运行代码时遇到问题。下面的代码在 Linux 上的 Eclipse 中运行顺利,但在 Windows 8 中则不然。

    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。

关于java.net.SocketException : Network is unreachable (Eclipse on Windows 8),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21239143/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com