Apache Tika安装在Windows 10中失败

时间:2016-02-09 07:26:24

标签: windows apache-tika

我已经下载了tikka.jar文件并运行了以下命令

  

java -jar tika.jar

我收到以下错误

Feb 09, 2016 11:30:09 AM org.apache.tika.server.TikaServerCli main
INFO: Starting Apache Tika 1.11 server
Feb 09, 2016 11:30:09 AM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:9998/
Feb 09, 2016 11:30:09 AM org.slf4j.impl.JCLLoggerAdapter info
INFO: jetty-8.y.z-SNAPSHOT
Feb 09, 2016 11:30:09 AM org.slf4j.impl.JCLLoggerAdapter warn
WARNING: FAILED SelectChannelConnector@localhost:9998: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.Server.doStart(Server.java:293)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:417)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
        at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
        at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
        at org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:88)
        at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:206)
        at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:213)

Feb 09, 2016 11:30:09 AM org.slf4j.impl.JCLLoggerAdapter warn
WARNING: FAILED org.eclipse.jetty.server.Server@6973bf95: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.Server.doStart(Server.java:293)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:417)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
        at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
        at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
        at org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:88)
        at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:206)
        at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:213)

Feb 09, 2016 11:30:09 AM org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine addServant
SEVERE: Could not start Jetty server on port 9,998: Address already in use: bind
Feb 09, 2016 11:30:10 AM org.apache.tika.server.TikaServerCli main
SEVERE: Can't start
org.apache.cxf.service.factory.ServiceConstructionException
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:219)
        at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:213)
Caused by: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 9,998: Address already in use: bind
        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:428)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
        at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)
        at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
        at org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:88)
        at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:206)
        ... 1 more
Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.Server.doStart(Server.java:293)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:417)
        ... 7 more

我正在检查,TCP使用相同的端口

TCP    127.0.0.1:9998         0.0.0.0:0              LISTENING

为了安装apache tika,我如何将9998端口号更改为其他端口?

1 个答案:

答案 0 :(得分:2)

首先,与大多数事情一样,使用--help选项运行Apache Tika Server以找出它支持的内容!你会得到这样的东西:

org.apache.tika.server.TikaServerCli main
INFO: Starting Apache Tika 1.12-SNAPSHOT server
usage: tikaserver
 -?,--help                      this help message
 -c,--config <arg>              Tika Configuration file to override
                                default config with.
 -C,--cors <arg>                origin allowed to make CORS requests
                                (default=NONE)
                                all allowed if "all"
 -d,--digest <arg>              include digest in metadata, e.g.
                                md5,sha256
 -dml,--digestMarkLimit <arg>   max number of bytes to mark on stream for
                                digest
 -h,--host <arg>                host name (default = localhost, use * for
                                all)
 -l,--log <arg>                 request URI log level ('debug' or 'info')
 -p,--port <arg>                listen port (default = 9998)
 -s,--includeStack              whether or not to return a stack trace
                                if there is an exception during 'parse'

从那以后,您会看到狡猾的标题--port-p选项将允许您更改使用的端口(谁曾想过?)

因此,确定了一个合适的端口,例如9999,重新运行Tika Server

java -jar tika-server-1.11.jar --port 9999