我已经下载了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端口号更改为其他端口号?
最佳答案
首先,和大多数事情一样,使用--help
选项运行apache tika服务器以了解它支持什么!你会得到这样的东西:
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服务器重新运行为
java -jar tika-server-1.11.jar --port 9999
关于windows - Windows 10中的Apache Tika安装失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35286183/