0

When I am trying to restart Alfresco, it stops with this message:

  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

Then, I try it again, and I got this:

     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.

My 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 &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

I don't know if ports are wrongly set or another thing, and I cannot solve that.

Anyone knows why I have to make two times restart?

3

The ports are right -- shutdown is on 8005 in server.xml, which is what was expected -- but from what you've shown it appears as though your first attempt to restart Alfresco stopped it, but didn't start it. Your second attempt (by calling restart again) first tries to stop the Tomcat server, but since it isn't running it tells you that there's no response to the shutdown command.

Did you want to try doing a ./alfresco.sh start instead? If nothing else, if it fails to start it should give you another set of messages explaining why.

  • When I try to make ./alfresco.sh start, after the first start, i obtain this: p@p:~/alfresco-5.0.d$ ./alfresco.sh start /home/p/alfresco-5.0.d/postgresql/scripts/ctl.sh : postgresql (pid 14439) already running /home/p/alfresco-5.0.d/tomcat/scripts/ctl.sh : tomcat (pid 14467) already running This don't make "restart" to the server. – PRVS Oct 14 '15 at 20:32
  • 1
    I meant to try the ./alfresco.sh start once the Tomcat server was already stopped. After the previous operations you mentioned in your opening post, it seemed pretty clear to me that Tomcat was stopped, which is why it did not respond to a shutdown request. But you're saying that it was actually still running? Try this, then: after you've done a restart of Tomcat (as you did in the first post, which should stop and then start it, but looked like it wasn't starting it), run ps -ef | grep tomcat . This will tell you if there's a Tomcat process running if anything at all is returned. – SCRawl Oct 14 '15 at 20:40
  • And with this, what is the solution ? I stop tomcat but after this the restart gives the same error. Only if i restart only tomcat, don't gives error. – PRVS Oct 16 '15 at 18:02
  • Let's back up a bit. Are you able to get Alfresco to start at all? If so, is the problem just that doing ./alfresco.sh restart stops it but doesn't start it up again? A clearer summary of the issue would be good. – SCRawl Oct 16 '15 at 19:52
  • I can start alfresco with ./alfresco.sh start. And I can restart with ./alfresco.sh restart but only in two times... I put ./alfresco restart and the process stays running with the code above in the post... And then, I make ctrl+c and ./alfresco.sh restart again, and gives the error above in the post too. But restarts in the second time. – PRVS Oct 17 '15 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.