Linux

重啟 Alfresco / Tomcat

  • November 8, 2017

當我嘗試重新啟動 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>

我不知道埠是否設置錯誤或其他問題,我無法解決。

任何人都知道為什麼我必須重新啟動兩次?

埠是正確的——關閉是在 server.xml 中的 8005 上,這是預期的——但從您所顯示的情況來看,似乎您第一次嘗試重新啟動 Alfresco 時停止了它,但沒有啟動它。您的第二次嘗試(通過再次呼叫重新啟動)首先嘗試停止 Tomcat 伺服器,但由於它沒有執行,它會告訴您對關閉命令沒有響應。

你想嘗試做一個 ./alfresco.sh 開始嗎?如果不出意外,如果它無法啟動,它應該會給你另一組消息來解釋原因。

引用自:https://serverfault.com/questions/728745