Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

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--
h1404 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;/managerquot; to
 quot;/manager/textquot;.
/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: 

Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
 quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are pretty
broken (although myApplication.xml only had the magic debug attribute set).


another try:

- remove deployXML=false from server.xml
- cp $tomcat/conf/Catalina/localhost/myApplication.xml 
$tomcat/webapps/myApplication/META-INF/context.xml

- stop then start tomcat

$curl -u name:pwd 
http://localhost:9080/manager/text/reload?path=/myApplication

OK - Reloaded application at context path /myApplication

Edoardo




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



Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
 quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are pretty
broken (although myApplication.xml only had the magic debug attribute set).



- unpack tomcat
- add an user in tomcat-users.xml
- modify server.xml adding deployXML=false to Host
Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true deployXML=false
- use manager application via curl
$ curl -u user:pwd http://localhost:8080/manager/text/reload?path=/example

error page.

# cat manager.2013-10-19.log
19-ott-2013 10.16.17 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Manager as unavailable
19-ott-2013 10.16.17 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Allocate exception for servlet Manager
java.lang.SecurityException: Restricted (ContainerServlet) class 
org.apache.catalina.manager.ManagerServlet
	at 
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:538)
	at 
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)
	at 
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
	at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
	at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at 

RE: can't connect to manager application

2013-10-19 Thread Martin Gainty


  


 Date: Sat, 19 Oct 2013 10:23:11 +0200
 From: edoa...@aspix.it
 To: users@tomcat.apache.org
 Subject: Re: can't connect to manager application
 
 Il 19/10/13 00:24, Mark Eggers ha scritto:
  On 10/18/2013 3:18 PM, André Warnier wrote:
  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--
  h1404 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;/managerquot; to
  quot;/manager/textquot;.
  /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.
  What is the content of that file ?
 
  From the last log file that was posted, these context files are pretty
  broken (although myApplication.xml only had the magic debug attribute set).
 
 
 - unpack tomcat
 - add an user in tomcat-users.xml
 - modify server.xml adding deployXML=false to Host
 Host name=localhost appBase=webapps
 unpackWARs=true autoDeploy=true deployXML=false
 - use manager application via curl
 $ curl -u user:pwd http://localhost:8080/manager/text/reload?path=/example
 
 error page.
 
 # cat manager.2013-10-19.log
 19-ott-2013 10.16.17 org.apache.catalina.core.ApplicationContext log
 INFO: Marking servlet Manager as unavailable
 19-ott-2013 10.16.17 org.apache.catalina.core.StandardWrapperValve invoke
 GRAVE: Allocate exception for servlet Manager
 java.lang.SecurityException: Restricted (ContainerServlet) class 
 org.apache.catalina.manager.ManagerServlet
 at 
 org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:538)
 at 
 org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)
 at 
 org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
 at 
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
 at 
 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
 at 

possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBaseT.onMessage

2013-10-19 Thread Bob DeRemer
I am testing what happens when Encode/Decode Exceptions occur during JSR-356 
communication and found that in the following code in onMessage, the 
((WsSession)session) is NULL.  As a result, the actual DecodeException (cause) 
is lost.

   // Can this message be decoded?
Object payload;
try {
payload = decode(message);
} catch (DecodeException de) {
((WsSession) session).getLocal().onError(session, de);
return;
}


Tracing this further up the stack, I found that Util.getMessageHandlers is 
initializing it and passing NULL in for the session:

if (decoderMatch.getTextDecoders().size()  0) {
MessageHandlerResult result = new MessageHandlerResult(
new PojoMessageHandlerWholeText(listener, m, null,
endpointConfig,
decoderMatch.getTextDecoders(), new Object[1],
0, false, -1, -1),
MessageHandlerResultType.TEXT);
results.add(result);
}

Is this a bug, or do I need to do something else to get this internal session 
initialize - in addition to calling: addMessageHandler(this) in the onOpen of 
my Endpoint-derived class?

Thanks,


Bob DeRemer
Senior Director, Architecture and Development

[Description: Description: Description: Description: 
cid:image001.png@01CBE3DE.51A12030]
http://www.thingworx.comhttp://www.thingworx.com/
Skype: bob.deremer.thingworx
O: 610.594.6200 x812
M: 717.881.3986



Re: can't connect to manager application

2013-10-19 Thread André Warnier

Edoardo Panfili wrote:

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
 quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are pretty
broken (although myApplication.xml only had the magic debug attribute 
set).


another try:

- remove deployXML=false from server.xml
- cp $tomcat/conf/Catalina/localhost/myApplication.xml 
$tomcat/webapps/myApplication/META-INF/context.xml

- stop then start tomcat

$curl -u name:pwd 
http://localhost:9080/manager/text/reload?path=/myApplication

OK - Reloaded application at context path /myApplication



That does look like a bug, doesn't it ?
Or at least, it doesn't look like it matches what is written in 
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html

for deployXML.

What happens if you set autoDeploy=false ?




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



Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 14:21, Martin Gainty ha scritto:







Date: Sat, 19 Oct 2013 10:23:11 +0200
From: edoa...@aspix.it
To: users@tomcat.apache.org
Subject: Re: can't connect to manager application

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are pretty
broken (although myApplication.xml only had the magic debug attribute set).



- unpack tomcat
- add an user in tomcat-users.xml
- modify server.xml adding deployXML=false to Host
Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true deployXML=false
- use manager application via curl
$ curl -u user:pwd http://localhost:8080/manager/text/reload?path=/example

error page.

# cat manager.2013-10-19.log
19-ott-2013 10.16.17 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Manager as unavailable
19-ott-2013 10.16.17 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Allocate exception for servlet Manager
java.lang.SecurityException: Restricted (ContainerServlet) class
org.apache.catalina.manager.ManagerServlet
at
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:538)
at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)
at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at

Re: can't connect to manager application

2013-10-19 Thread André Warnier

Edoardo Panfili wrote:

Il 19/10/13 14:21, Martin Gainty ha scritto:







Date: Sat, 19 Oct 2013 10:23:11 +0200
From: edoa...@aspix.it
To: users@tomcat.apache.org
Subject: Re: can't connect to manager application

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are pretty
broken (although myApplication.xml only had the magic debug 
attribute set).




- unpack tomcat
- add an user in tomcat-users.xml
- modify server.xml adding deployXML=false to Host
Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true deployXML=false
- use manager application via curl
$ curl -u user:pwd 
http://localhost:8080/manager/text/reload?path=/example


error page.

# cat manager.2013-10-19.log
19-ott-2013 10.16.17 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Manager as unavailable
19-ott-2013 10.16.17 org.apache.catalina.core.StandardWrapperValve 
invoke

GRAVE: Allocate exception for servlet Manager
java.lang.SecurityException: Restricted (ContainerServlet) class
org.apache.catalina.manager.ManagerServlet
at
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:538) 


at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511) 


at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) 


at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) 


at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865) 


at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136) 


at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 



Re: can't connect to manager application

2013-10-19 Thread Ognjen Blagojevic

Edoardo,

On 19.10.2013 0:03, Edoardo Panfili wrote:

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


It is great that you took effort to pin-point the source of the problem. 
Often users are not willing to do that.


Now, deployXML=false instructs Tomcat to ignore context descriptors in 
directory webapps/, and to consider only those in directory conf/. That 
means that context descriptor webapps/manager/META-INF/context.xml is 
ignored, so manager application is not properly intialized.


If you want to keep parameter deployXML set to false, I believe you need 
to copy webapps/manager/META-INF/context.xml to 
conf/Catalina/localhost/manager.xml.


-Ognjen



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



RE: possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBaseT.onMessage

2013-10-19 Thread Bob DeRemer
I have re-posted to DEV so please disregard

From: Bob DeRemer [mailto:bob.dere...@thingworx.com]
Sent: Saturday, October 19, 2013 8:46 AM
To: Tomcat Users List
Subject: possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when 
DecodeException is caught in PojoMessageHandlerWholeBaseT.onMessage

I am testing what happens when Encode/Decode Exceptions occur during JSR-356 
communication and found that in the following code in onMessage, the 
((WsSession)session) is NULL.  As a result, the actual DecodeException (cause) 
is lost.

   // Can this message be decoded?
Object payload;
try {
payload = decode(message);
} catch (DecodeException de) {
((WsSession) session).getLocal().onError(session, de);
return;
}


Tracing this further up the stack, I found that Util.getMessageHandlers is 
initializing it and passing NULL in for the session:

if (decoderMatch.getTextDecoders().size()  0) {
MessageHandlerResult result = new MessageHandlerResult(
new PojoMessageHandlerWholeText(listener, m, null,
endpointConfig,
decoderMatch.getTextDecoders(), new Object[1],
0, false, -1, -1),
MessageHandlerResultType.TEXT);
results.add(result);
}

Is this a bug, or do I need to do something else to get this internal session 
initialize - in addition to calling: addMessageHandler(this) in the onOpen of 
my Endpoint-derived class?

Thanks,


Bob DeRemer
Senior Director, Architecture and Development

[Description: Description: Description: Description: 
cid:image001.png@01CBE3DE.51A12030]
http://www.thingworx.comhttp://www.thingworx.com/
Skype: bob.deremer.thingworx
O: 610.594.6200 x812
M: 717.881.3986



Re: can't connect to manager application

2013-10-19 Thread Mark Eggers

On 10/19/2013 7:44 AM, Ognjen Blagojevic wrote:

Edoardo,

On 19.10.2013 0:03, Edoardo Panfili wrote:

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


It is great that you took effort to pin-point the source of the problem.
Often users are not willing to do that.

Now, deployXML=false instructs Tomcat to ignore context descriptors in
directory webapps/, and to consider only those in directory conf/. That
means that context descriptor webapps/manager/META-INF/context.xml is
ignored, so manager application is not properly intialized.

If you want to keep parameter deployXML set to false, I believe you need
to copy webapps/manager/META-INF/context.xml to
conf/Catalina/localhost/manager.xml.

-Ognjen


Yep, reproducible on Windows 7.

Environment: Windows 7 Home Premium 64 bit
 JRE 1.7.0_45 64 bit
 Tomcat 7.0.42 (stock, edited tomcat-users.xml)
 cygwin / curl

curl -u user:pass http://127.0.0.1:8080/manager/text/reload?
   path=examples

1. As is - works as expected
   This is good, since that's how NetBeans controls Tomcat

2. set deployXML=false in host node
   reload examples fails (stack trace)
   probe also fails to run since it needs privileged=true

3. copy context.xml to %CATALINA_BASE%\conf\Catalina\localhost
   manager context.xml -- manager.xml
   probe context.xml -- probe.xml

4. restart Tomcat
   reloads work as expected
   probe works as expected

/mde/

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



Re: can't connect to manager application

2013-10-19 Thread Ognjen Blagojevic

Mark,

On 19.10.2013 17:51, Mark Eggers wrote:

On 10/19/2013 7:44 AM, Ognjen Blagojevic wrote:

If you want to keep parameter deployXML set to false, I believe you need
to copy webapps/manager/META-INF/context.xml to
conf/Catalina/localhost/manager.xml.


Yep, reproducible on Windows 7.


Thanks for verifying.

-Ognjen

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



Re: can't connect to manager application

2013-10-19 Thread André Warnier

Ognjen Blagojevic wrote:

Mark,

On 19.10.2013 17:51, Mark Eggers wrote:

On 10/19/2013 7:44 AM, Ognjen Blagojevic wrote:

If you want to keep parameter deployXML set to false, I believe you need
to copy webapps/manager/META-INF/context.xml to
conf/Catalina/localhost/manager.xml.


Yep, reproducible on Windows 7.


Thanks for verifying.



I think that Edoardo and I were being blinded by the MyApplication context.xml, and did 
not click that the Manager too must have his context moved to conf/Catalina/localhost/ 
when deployXML=false.



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



Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 16:19, André Warnier ha scritto:

Edoardo Panfili wrote:

Il 19/10/13 14:21, Martin Gainty ha scritto:







Date: Sat, 19 Oct 2013 10:23:11 +0200
From: edoa...@aspix.it
To: users@tomcat.apache.org
Subject: Re: can't connect to manager application

Il 19/10/13 00:24, Mark Eggers ha scritto:

On 10/18/2013 3:18 PM, André Warnier wrote:

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--
h1404 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;/managerquot; to
quot;/manager/textquot;.
/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.
What is the content of that file ?


 From the last log file that was posted, these context files are
pretty
broken (although myApplication.xml only had the magic debug
attribute set).



- unpack tomcat
- add an user in tomcat-users.xml
- modify server.xml adding deployXML=false to Host
Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true deployXML=false
- use manager application via curl
$ curl -u user:pwd
http://localhost:8080/manager/text/reload?path=/example

error page.

# cat manager.2013-10-19.log
19-ott-2013 10.16.17 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Manager as unavailable
19-ott-2013 10.16.17 org.apache.catalina.core.StandardWrapperValve
invoke
GRAVE: Allocate exception for servlet Manager
java.lang.SecurityException: Restricted (ContainerServlet) class
org.apache.catalina.manager.ManagerServlet
at
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:538)

at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)

at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)

at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)

at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)

at

Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 16:44, Ognjen Blagojevic ha scritto:

Edoardo,

On 19.10.2013 0:03, Edoardo Panfili wrote:

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


It is great that you took effort to pin-point the source of the problem.
Often users are not willing to do that.

thanks to so many people ready to help!



Now, deployXML=false instructs Tomcat to ignore context descriptors in
directory webapps/, and to consider only those in directory conf/. That
means that context descriptor webapps/manager/META-INF/context.xml is
ignored, so manager application is not properly intialized.

_sorry_ must read carefully documentation! as usual!

deployXML: Set to false if you want to disable parsing the context XML 
descriptor embedded inside the application (located at 
/META-INF/context.xml).



I thought that in any case if application.xml was not present in 
conf/Catalina/localhost Tomcat would read that in applicatin/META-INF

I was wrong.


If you want to keep parameter deployXML set to false, I believe you need
to copy webapps/manager/META-INF/context.xml to
conf/Catalina/localhost/manager.xml.

Great! right (and sounds also logic now)

it works in the virtual machine and also in production server.

thank you again to all
Edoardo


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



Re: can't connect to manager application

2013-10-19 Thread Edoardo Panfili

Il 19/10/13 19:53, André Warnier ha scritto:

Ognjen Blagojevic wrote:

Mark,

On 19.10.2013 17:51, Mark Eggers wrote:

On 10/19/2013 7:44 AM, Ognjen Blagojevic wrote:

If you want to keep parameter deployXML set to false, I believe you
need
to copy webapps/manager/META-INF/context.xml to
conf/Catalina/localhost/manager.xml.


Yep, reproducible on Windows 7.


Thanks for verifying.



I think that Edoardo and I were being blinded by the MyApplication
context.xml, and did not click that the Manager too must have his
context moved to conf/Catalina/localhost/ when deployXML=false.


I (unfortunately) never thought to move context.xml files for default 
applications.


thank you again to all!
Edoardo



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