当我尝试重新启动 Alfresco 时,它会停止并显示以下消息:
p@p:~/alfresco-5.0.d$ ./alfresco.sh restart
Using CATALINA_BASE: /home/p/alfresco-5.0.d/tomcat
Using CATALINA_HOME: /home/p/alfresco-5.0.d/tomcat
Using CATALINA_TMPDIR: /home/p/alfresco-5.0.d/tomcat/temp
Using JRE_HOME: /home/p/alfresco-5.0.d/java
Using CLASSPATH: /home/p/alfresco-5.0.d/tomcat/bin/bootstrap.jar:/home/p/alfresco-5.0.d/tomcat/bin/tomcat-juli.jar
Using CATALINA_PID: /home/p/alfresco-5.0.d/tomcat/temp/catalina.pid
然后我再次尝试,得到了以下结果:
p@p:~/alfresco-5.0.d$ ./alfresco.sh restart
Using CATALINA_BASE: /home/p/alfresco-5.0.d/tomcat
Using CATALINA_HOME: /home/p/alfresco-5.0.d/tomcat
Using CATALINA_TMPDIR: /home/p/alfresco-5.0.d/tomcat/temp
Using JRE_HOME: /home/p/alfresco-5.0.d/java
Using CLASSPATH: /home/p/alfresco-5.0.d/tomcat/bin/bootstrap.jar:/home/p/alfresco-5.0.d/tomcat/bin/tomcat-juli.jar
Using CATALINA_PID: /home/p/alfresco-5.0.d/tomcat/temp/catalina.pid
out 13, 2015 10:39:03 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
out 13, 2015 10:39:03 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Ligação recusada
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
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:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)
The stop command failed. Attempting to signal the process to stop through OS signal.
Tomcat stopped.
我的server.xml:
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<!-- Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /-->
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" maxHttpHeaderSize="32768" />
<Connector port="8009" URIEncoding="UTF-8" protocol="AJP/1.3" redirectPort="8443" />
<Connector port="8443" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
maxThreads="150" scheme="https" keystoreFile="/home/p/alfresco-5.0.d/alf_data/keystore/ssl.keystore" keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000" truststoreFile="/home/p/alfresco-5.0.d/alf_data/keystore/ssl.truststore" truststorePass="kT9X6oe68t" truststoreType="JCEKS"
clientAuth="want" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxHttpHeaderSize="32768" />
<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 "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
我不知道端口是否设置错误或者其他原因,我无法解决这个问题。
有人知道为什么我必须重启两次吗?
答案1
端口是正确的——shutdown 在 server.xml 中的 8005 上,这是预期的——但从您显示的内容来看,您第一次尝试重新启动 Alfresco 似乎停止了它,但没有启动它。您的第二次尝试(通过再次调用 restart)首先尝试停止 Tomcat 服务器,但由于它没有运行,它会告诉您关闭命令没有响应。
您是否想尝试执行 ./alfresco.sh start?如果没有其他操作,如果启动失败,它应该会向您提供另一组消息来解释原因。