我已多次使用此爬虫。过去几年至少每天一次。今天突然间,当我尝试打开.jar文件时,我得到了这个:'Java JAR文件“Crawler.jar”检查控制台是否有可能的错误消息。我有最新版本的java环境和SDK。我尝试运行'java -jar Crawler.jar',这就是结果:
log4j:ERROR Could not read configuration file [data/log4j.properties].
java.io.FileNotFoundException: data/log4j.properties (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:306)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:324)
at Crawler.main(Crawler.java:75)
log4j:ERROR Ignoring configuration file [data/log4j.properties].
Failed to open connection.
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection refused
STACKTRACE:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:244)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at DatabaseConnector.getConnection(DatabaseConnector.java:34)
at DatabaseConnector.foundTable(DatabaseConnector.java:65)
at TextOutput.<init>(TextOutput.java:21)
at Crawler.main(Crawler.java:77)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at DatabaseConnector.getConnection(DatabaseConnector.java:34)
at DatabaseConnector.foundTable(DatabaseConnector.java:65)
at TextOutput.<init>(TextOutput.java:21)
at Crawler.main(Crawler.java:77)
Exception in thread "main" java.lang.NullPointerException
at DatabaseConnector.foundTable(DatabaseConnector.java:68)
at TextOutput.<init>(TextOutput.java:21)
at Crawler.main(Crawler.java:77)
我根本不是一个Java人。如果有人对我能做些什么来解决这个问题有任何见解,那将非常感激。