gpt4 book ai didi

Tomcat 多项服务 - 启动问题

转载 作者:行者123 更新时间:2023-11-28 22:56:08 24 4
gpt4 key购买 nike

我正在尝试使用以下 server.conf 在 Tomcat 中运行两个 BaseX 实例。我遇到了一个奇怪的问题:两者都可以在各自的端口上使用,但是 webapp 本身是同一个 WAR;也就是说,在 webapps/WAR 中的链接出现在从 webapps2 加载的 WAR 中。我不太确定下一步应该做什么——我会在 BaseX 邮件列表上询问,但他们在那里使用的 Tomcat 不多。

这是我的 server.conf

<Service name="Catalina">
<Connector port="8080"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost"
appBase="webapps"
unpackWARs="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log."
suffix=".txt"
pattern="%h %l %u %t &#34;%r&#34; %s %b"/>
</Host>
</Engine>
</Service>
<Service name="Catalina2">
<Connector port="18080"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="18443"/>
<Connector port="18009" protocol="AJP/1.3" redirectPort="18443"/>
<Engine name="Catalina2" defaultHost="localhost">
<Host name="localhost"
appBase="webapps2"
unpackWARS="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs2"
prefix="localhost_Cat2_access_log."
suffix=".txt"
pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b"/>
</Host>
</Engine>
</Service>

当我启动 Tomcat 时,除了第二个 BaseX 应用程序之外,两个服务中的所有内容都加载正常。当 Tomcat 开始加载时,出现以下错误:

INFO: Starting service Catalina2
Nov 03, 2014 7:59:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.53
Nov 03, 2014 7:59:58 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /usr/home/cob/src/apache-tomcat- 7.0.53/webapps2/bX79.war
Nov 03, 2014 7:59:58 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /bX79 threw load() exception
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:330)
at org.basex.BaseXServer.<init>(BaseXServer.java:110)
at org.basex.http.HTTPContext.init(HTTPContext.java:379)
at org.basex.http.BaseXServlet.init(BaseXServlet.java:34)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Nov 03, 2014 7:59:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/home/cob/src/apache-tomcat-7.0.53/webapps2/examples
Nov 03, 2014 7:59:59 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 03, 2014 7:59:59 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 03, 2014 7:59:59 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@25288684')
Nov 03, 2014 7:59:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/home/cob/src/apache-tomcat-7.0.53/webapps2/docs
Nov 03, 2014 7:59:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/home/cob/src/apache-tomcat-7.0.53/webapps2/ROOT
Nov 03, 2014 7:59:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/home/cob/src/apache-tomcat-7.0.53/webapps2/manager
Nov 03, 2014 7:59:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/home/cob/src/apache-tomcat-7.0.53/webapps2/host-manager
Nov 03, 2014 7:59:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-18080"]
Nov 03, 2014 7:59:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-18009"]
Nov 03, 2014 7:59:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8304 ms

我不太确定是哪个端口导致了问题。 netstat 和正在使用的其他端口的 grepping 没有返回任何有用的信息。

最佳答案

作为 Basex 邮件列表人员,我对 Tomcat 了解不多...但是,您收到的错误消息对我来说非常熟悉。查看您的 .basex(或您定义 BaseX 选项的任何其他地方)会很有用。我猜你修改了两个实例的服务器端口以指向不同的端口。

但是,您没有修改 Event port ,因此服务器无法正常启动。尝试修改它以使用其他端口。

关于Tomcat 多项服务 - 启动问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26726273/

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