Il 19/10/13 00:18, André Warnier ha scritto:
Edoardo Panfili wrote:
Il 17/10/13 18:45, Edoardo Panfili ha scritto:
My Tomcat (7.0.42) is listening on port 7080 and I have this
conf/tomcat-users.xml in (production server)

-------
<tomcat-users>
<role rolename="manager-script"/>
  <user username="myname" password="pwd"
roles="manager-script,manager-gui,manager-jmx"/>
</tomcat-users>
----------
if I use

curl -u myname:pwd
http://localhost:7080/manager/text/reload?path=/myApplication

the response is--------------------------
    <h1>404 Not found</h1>
    <p>
     The page you tried to access
     (/manager/text/reload)
     does not exist.
    </p>
    <p>
     The Manager application has been re-structured for Tomcat 7 onwards
and some
     of URLs have changed. All URLs used to access the Manager
application should
     now start with one of the following options:
    </p>
     <ul>
       <li>/manager/html for the HTML GUI</li>
       <li>/manager/text for the text interface</li>
       <li>/manager/jmxproxy for the JMX proxy</li>
       <li>/manager/status for the status pages</li>
     </ul>
    <p>
     Note that the URL for the text interface has changed from
     &quot;/manager&quot; to
     &quot;/manager/text&quot;.
    </p>
    <p>
     You probably need to adjust the URL you are using to access the
Manager
     application. However, there is always a chance you have found a bug
in the
     Manager application. If you are sure you have found a bug, and that
the bug
     has not already been reported, please report it to the Apache
Tomcat team.
    </p>
---------------------------------------------------------


Installation step by step:

Unpack new download from tomcat.apache.org

1- set users
<tomcat-users>
  <user username="edoardo" password="pwd"
    roles="manager-script,manager-gui,manager-jmx,other"/>
</tomcat-users>

then reload tomcat
$curl -u edoardo:pwd
http://localhost:8080/manager/text/reload?path=/examples
OK - Reloaded application at context path /examples


2- copy myApplication from production server
copy configuration file ($tomcat/Catalina/localhost/myApplication.xml)
from production server
stop & start tomcat

$curl -u edoardo:pwd
http://localhost:8080/manager/text/reload?path=/myApplication
OK - Reloaded application at context path /myApplication


3- first modify to server.xml
shutdown tomcat
modify server.xml
<Connector port="8080" protocol="HTTP/1.1"
becomes
<Connector port="9080" protocol="HTTP/1.1"

start then curl again
all well


4- second modify to server.xml
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">
becomes
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true" deployXML="false">

stop-start

$curl -u edoardo:pwd
http://localhost:9080/manager/text/reload?path=/myApplication
javax.servlet.ServletException: Error instantiating servlet class
org.apache.catalina.manager.ManagerServlet
[...]

$curl -u edoardo:pwd
http://localhost:9080/manager/text/reload?path=/myApplication
the same error reported in the initial post (above)



deployXML="false" is recommended at
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html and useful
for me.

One big difference that I see when deployXML="false", is that this file :
(catalina_base)/webapps/myApplication/META-INF/context.xml
is no longer being parsed,
and instead this file is parsed :
$tomcat/Catalina/localhost/myApplication.xml
when you reload your app.
yes, I know, is there for this reason, but also at the first start of the application $tomcat/Catalina/localhost/myApplication.xml is used and no error occurs.

What is the content of that file ?

<!DOCTYPE Context>
<Context path="/myApplication" debug="100" reloadable="false">
        <Resource name="jdbc/myApplication" auth="Container"
                type="javax.sql.DataSource"
                maxActive="8" maxIdle="5" minIdle="3" maxWait="30"
                username="uname" password="pwd"
                driverClassName="org.postgresql.Driver"
                url="jdbc:postgresql://127.0.0.1:5432/myApplication"
                removeAbandoned="true"
                removeAbandonedTimeout="30"
                logAbandoned="true" />

        <Parameter name="javax.servlet.jsp.jstl.sql.dataSource"

value="jdbc:postgresql://localhost:5432/myApplication,org.postgresql.Driver,user,pwd"
                override="false"/>
        <Parameter name="email.uname" value="euser" override="false"/>
        <Parameter name="email.pwd" value="epwd" override="false"/>
        <Parameter name="logFolder" value="/var/log/myApplication"
                override="false"/>
        <Parameter name="blobsFolder"
                value="/var/lib/myApplication/blobs" override="false"/>
        <Parameter name="thumbnailsFolder"
                value="/var/lib/myApplication/thumbnails"
                override="false"/>
        <Parameter name="usersPhotoFolder"
                value="/var/lib/myApplication/utenti" override="false"/>
        <Parameter name="tomcat.porta" value="9080" override="false"/>
</Context>

thank you
Edoardo




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to