Http Status 404

2014-02-06 Thread Shivam Mishra
Hye I am using Tomcat 8.0.1 ,my operating system is Windows 8.1 and it is
64- bit configuration .I made a folder in webapps for my servlet but I am
unable to access it Please help


Re: Http Status 404

2014-02-06 Thread Mark Thomas
On 06/02/2014 08:57, Shivam Mishra wrote:
 Hye I am using Tomcat 8.0.1 ,my operating system is Windows 8.1 and it is
 64- bit configuration .I made a folder in webapps for my servlet but I am
 unable to access it Please help

Read this:
http://www.catb.org/~esr/faqs/smart-questions.html

then post a smarter question.

Mark


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



Re: Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext for tomcat 7.0.50

2014-02-06 Thread Mark Thomas
On 06/02/2014 03:32, Kiran Badi wrote:
 Hi All,
 
 I have 3 tomcats installed in my machine, one is 7.0.27, 7.0.35 and 7.0.50
 
 Now when I deploy my war file to 7.0.27/7.0.35 it works perfectly fine and
 deployment goes through.
 
 But on 7.0.50 it fails with below message,
 
 FAIL - Application at context path /myapp could not be started
 
 FAIL - Encountered exception org.apache.catalina.LifecycleException:
 Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
 
 In catalina logs I see below message,
 
 eb 05, 2014 10:22:21 PM org.apache.catalina.deploy.NamingResources cleanUp
 WARNING: Failed to retrieve JNDI naming context for container
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
 so no cleanup was performed for that container

This is just a warning from when Tomcat was trying to shut down the
already broken web application. You need to look earlier in the logs to
find out why it didn't start in the first place.

Generally, when something goes wrong with Tomcat you need to look at the
first error message in the logs and then look at the root cause of that
error.

Mark


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



Re: Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext for tomcat 7.0.50

2014-02-06 Thread Shivam Mishra
2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
06-Feb-2014 14:50:34.636 INFO [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
Tomcat Native library which allows optimal performance in production
environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat
8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
(x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program
Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\IPT;C:\Program
Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
06-Feb-2014 14:50:35.189 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:35.245 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
selector for servlet write/read
06-Feb-2014 14:50:35.251 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:35.258 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
selector for servlet write/read
06-Feb-2014 14:50:35.258 INFO [main]
org.apache.catalina.startup.Catalina.load Initialization processed in 1511
ms
06-Feb-2014 14:50:35.348 INFO [main]
org.apache.catalina.core.StandardService.startInternal Starting service
Catalina
06-Feb-2014 14:50:35.349 INFO [main]
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
Engine: Apache Tomcat/8.0.1
06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\docs
06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\examples
06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\manager
06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\name
06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\ROOT
06-Feb-2014 14:50:38.100 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:38.115 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:38.120 INFO [main]
org.apache.catalina.startup.Catalina.start Server startup in 2861 ms



On Thu, Feb 6, 2014 at 2:37 PM, Mark Thomas ma...@apache.org wrote:

 On 06/02/2014 03:32, Kiran Badi wrote:
  Hi All,
 
  I have 3 tomcats installed in my machine, one is 7.0.27, 7.0.35 and
 7.0.50
 
  Now when I deploy my war file to 7.0.27/7.0.35 it works perfectly fine
 and
  deployment goes through.
 
  But on 7.0.50 it fails with below message,
 
  FAIL - Application at context path /myapp could not be started
 
  FAIL - Encountered exception org.apache.catalina.LifecycleException:
  Failed to start component
 
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
 
  In catalina logs I see below message,
 
  eb 05, 2014 10:22:21 PM org.apache.catalina.deploy.NamingResources
 cleanUp
  WARNING: Failed to retrieve JNDI naming context for container
 
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
  so no cleanup was performed for that container

 This is just a warning from when Tomcat was trying to shut down the
 already broken web application. You need to look earlier in the logs to
 find out why it didn't start in the first place.

 Generally, when something goes wrong with Tomcat you need to look at the
 first error message in the logs and then look at the root cause of that
 error.

 Mark


 -
 To unsubscribe, e-mail: 

Re: Http Status 404

2014-02-06 Thread Neven Cvetkovic
On Feb 6, 2014 9:58 AM, Shivam Mishra shmishra...@gmail.com wrote:

 Hye I am using Tomcat 8.0.1 ,my operating system is Windows 8.1 and it is
 64- bit configuration .I made a folder in webapps for my servlet but I am
 unable to access it Please help

Shivam,

Is your tomcat running? What port number? How did you start tomcat?

Do you see the default application?
e.g. http://localhost:8080

Typical web application would have the following folder structure:

myapp/
myapp/WEB-INF/classes/com/shivamcompany/myproject/web/MyServlet.class
myapp/index.jsp
myapp/images/...
...

You would either make a myapp.war or just copy the folder into
TOMCAT_INSTALL_FOLDER_ON_YOUR_SYSTEM/webapps.

Start your tomcat if it is not started.

Your application should be visible from http://localhost:8080/myweb

How did you compile your servlet?

How is your servlet mapped? Are you using web.xml to map or annotations in
the servlet code?

Your servlet should be visible from
http://localhost:8080/myapp/servlet_mapping

and would execute doGet(...) method you defined in your servlet (if you
just requested the address in the browser).

Hope that helps.
Good luck!


[SECURITY] CVE-2014-0050 Apache Commons FileUpload and Apache Tomcat DoS

2014-02-06 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CVE-2014-0050 Apache Commons FileUpload and Apache Tomcat DoS

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
- - Commons FileUpload 1.0 to 1.3
- - Apache Tomcat 8.0.0-RC1 to 8.0.1
- - Apache Tomcat 7.0.0 to 7.0.50
- - Apache Tomcat 6 and earlier are not affected

Apache Tomcat 7 and Apache Tomcat 8 use a packaged renamed copy of
Apache Commons FileUpload to implement the requirement of the Servlet
3.0 and later specifications to support the processing of
mime-multipart requests. Tomcat 7 and 8 are therefore affected by this
issue. While Tomcat 6 uses Commons FileUpload as part of the Manager
application, access to that functionality is limited to authenticated
administrators.

Description:
It is possible to craft a malformed Content-Type header for a
multipart request that causes Apache Commons FileUpload to enter an
infinite loop. A malicious user could, therefore, craft a malformed
request that triggered a denial of service.
This issue was reported responsibly to the Apache Software Foundation
via JPCERT but an error in addressing an e-mail led to the unintended
early disclosure of this issue[1].

Mitigation:
Users of affected versions should apply one of the following mitigations
- - Upgrade to Apache Commons FileUpload 1.3.1 or later once released
- - Upgrade to Apache Tomcat 8.0.2 or later once released
- - Upgrade to Apache Tomcat 7.0.51 or later once released
- - Apply the appropriate patch
  - Commons FileUpload: http://svn.apache.org/r1565143
  - Tomcat 8: http://svn.apache.org/r1565163
  - Tomcat 7: http://svn.apache.org/r1565169
- - Limit the size of the Content-Type header to less than 4091 bytes

Credit:
This issue was reported to the Apache Software Foundation via JPCERT.

References:
[1] http://markmail.org/message/kpfl7ax4el2owb3o
[2] http://tomcat.apache.org/security-8.html
[3] http://tomcat.apache.org/security-7.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS83P8AAoJEBDAHFovYFnnbOwP/0m80St7x63n6VCiR0aGuGLz
/J004spHfbc+vtg2RumObBTX6mSfvPgO2R4FzE17Etg8QtWreoxb7kjnVXUwjdMX
nb3Yt6IY1yBW1K+YcZRziOQXkRnnjnpC7Lh2o5eqpJ1S7wpXl5PBIXYSxMAsJCuv
axFA0aq5cc17uDAH1z6DPk4149oZz2lHdlBUTTkCh/0PrvcIFxwpej75gUfyaV0y
DGZLs3IpRYcJMS131q72DUt9wBsIqJN0mqUOq2svBS3mlXBcKDjy21b8QiEr8itK
UqwsYUtOZP4nZ4u8j6euxF2fC/ivm/930OGOl9pn2SbkoHJKm/4rz2GYDA9jq07K
XEDeGdTx3ZuDaTaBER8xquETRZ/Rb8dbBxQwzmo6doJNOjsMQFlR+1F+p56AhYd0
klbT6Q7i/Ic3BdRJkUpaYshhtXeAOnH+0u9j4kRXMgJbkMgOacopomFX6HoXr9/i
RHGbwwSZViLooR88Yg0FU2230+9mJLXxaJ6usHrtq4dS9ElSV320OCyisNjMX5hi
5SFYMSy+z0nsK2O6yCzlukztoFhvaNecvy3I8w5EKytweyFlPzxXn6QpQjG+ffb5
ql7TZRrApiaewp4crzBcZSAjDzRNiQpcI2xTTN/H9u/yk8lrhOULi4pljKCudvmM
eIWblFdpoPVl0iqvsXA9
=uzLf
-END PGP SIGNATURE-

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



UserDatabase resource into META-INF/context.xml

2014-02-06 Thread Jose María Zaragoza
Hello:

I'm using Tomcat 6.0.24

I want to set a realm per only one application, so I define in its
META-INF/context.xml

?xml version=1.0 encoding=UTF-8?
Context
Resource auth=Container
 description=User database that can be updated and saved
 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
name=MyUserDatabase
 pathname=conf/my-users.xml
 type=org.apache.catalina.UserDatabase /

Realm className=org.apache.catalina.realm.UserDatabaseRealm
resourceName=MyUserDatabase/
/Context

my-users.xml is stored in $CATALINA_BASE/conf/


But it doesn't work; a javax.naming.NameNotFoundException exception is
thrown when Tomcat restarts


If I put Resource under GlobalNamingResources in server.xml , works
fine, But I would prefer to held all configuration in context.xml

is it possible ? or do I need to use GlobalNamingResources ?
is the pathname right ?


Regards

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



Re: UserDatabase resource into META-INF/context.xml

2014-02-06 Thread Konstantin Kolinko
2014-02-06 Jose María Zaragoza demablo...@gmail.com:
 Hello:

 I'm using Tomcat 6.0.24

 I want to set a realm per only one application, so I define in its
 META-INF/context.xml

 ?xml version=1.0 encoding=UTF-8?
 Context
 Resource auth=Container
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 name=MyUserDatabase
  pathname=conf/my-users.xml
  type=org.apache.catalina.UserDatabase /

 Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=MyUserDatabase/
 /Context

 my-users.xml is stored in $CATALINA_BASE/conf/


 But it doesn't work; a javax.naming.NameNotFoundException exception is
 thrown when Tomcat restarts


 If I put Resource under GlobalNamingResources in server.xml , works
 fine, But I would prefer to held all configuration in context.xml

 is it possible ? or do I need to use GlobalNamingResources ?

With the current code: no.
It is hardcoded to do JNDI lookup in the global context.

It might be possible to port localDataSource option from
DataSourceRealm class.
(MMV. It depends on what ClassLoader is active when
MyUserDatabase.startInternal() is invoked).

 is the pathname right ?

In general I'd prefer to write ${catalina.base}/conf/my-users.xml,
but that is just my preference.

Best regards,
Konstantin Kolinko

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



Re: Http Status 404

2014-02-06 Thread Shivam Mishra
My tomcat and its example application is running but I got an error with my
own application .My port number is 8080 .I compile my servlet programme in
jdk 7 .and my web.xml file is below
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;

web-app
  servlet
servlet-nameMyServlet/servlet-name
servlet-classTestServlet/servlet-class

  /servlet
servlet-mapping
servlet-nameMyServlet/servlet-name
url-pattern/TestServlet/url-pattern
/servlet-mapping
/web-app
My servlet class name is TestServlet


On Thu, Feb 6, 2014 at 3:53 PM, Neven Cvetkovic
neven.cvetko...@gmail.comwrote:

 On Feb 6, 2014 9:58 AM, Shivam Mishra shmishra...@gmail.com wrote:
 
  Hye I am using Tomcat 8.0.1 ,my operating system is Windows 8.1 and it is
  64- bit configuration .I made a folder in webapps for my servlet but I am
  unable to access it Please help

 Shivam,

 Is your tomcat running? What port number? How did you start tomcat?

 Do you see the default application?
 e.g. http://localhost:8080

 Typical web application would have the following folder structure:

 myapp/
 myapp/WEB-INF/classes/com/shivamcompany/myproject/web/MyServlet.class
 myapp/index.jsp
 myapp/images/...
 ...

 You would either make a myapp.war or just copy the folder into
 TOMCAT_INSTALL_FOLDER_ON_YOUR_SYSTEM/webapps.

 Start your tomcat if it is not started.

 Your application should be visible from http://localhost:8080/myweb

 How did you compile your servlet?

 How is your servlet mapped? Are you using web.xml to map or annotations in
 the servlet code?

 Your servlet should be visible from
 http://localhost:8080/myapp/servlet_mapping

 and would execute doGet(...) method you defined in your servlet (if you
 just requested the address in the browser).

 Hope that helps.
 Good luck!



Re: Http Status 404

2014-02-06 Thread Neven Cvetkovic
On Feb 6, 2014 4:21 PM, Shivam Mishra shmishra...@gmail.com wrote:

 My tomcat and its example application is running but I got an error with
my
 own application .My port number is 8080 .I compile my servlet programme in
 jdk 7 .and my web.xml file is below
 ?xml version=1.0 encoding=ISO-8859-1?
 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
 http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;

 web-app
   servlet
 servlet-nameMyServlet/servlet-name
 servlet-classTestServlet/servlet-class

   /servlet
 servlet-mapping
 servlet-nameMyServlet/servlet-name
 url-pattern/TestServlet/url-pattern
 /servlet-mapping
 /web-app
 My servlet class name is TestServlet



Ok, great.

Now tell us about directory structure of your application, what files,
where did you put the servlet class file, etc.

Also what do logs say once you deploy your app?


Re: Http Status 404

2014-02-06 Thread Tim Watts
On Thu, 2014-02-06 at 10:32 -0500, Neven Cvetkovic wrote:
 On Feb 6, 2014 4:21 PM, Shivam Mishra shmishra...@gmail.com wrote:
 
  My tomcat and its example application is running but I got an error with
 my
  own application .My port number is 8080 .I compile my servlet programme in
  jdk 7 .and my web.xml file is below
  ?xml version=1.0 encoding=ISO-8859-1?
  !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;
 
  web-app
servlet
  servlet-nameMyServlet/servlet-name
  servlet-classTestServlet/servlet-class
 
/servlet
  servlet-mapping
  servlet-nameMyServlet/servlet-name
  url-pattern/TestServlet/url-pattern
  /servlet-mapping
  /web-app
  My servlet class name is TestServlet
 
 
 
 Ok, great.
 
 Now tell us about directory structure of your application, what files,
 where did you put the servlet class file, etc.
 
 Also what do logs say once you deploy your app?

And just as importantly: What URL are you using to access your app?




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



Re: Http Status 404

2014-02-06 Thread Shivam Mishra
My directory structure is C:\Program Files\Apache Software
Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
Servlet
Description of my logs is below
06-Feb-2014 14:50:22.684 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.742 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:22.793 INFO [Thread-9]
org.apache.catalina.core.StandardService.stopInternal Stopping service
Catalina
06-Feb-2014 14:50:22.912 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.916 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[ajp-nio-8009]

2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
06-Feb-2014 14:50:34.636 INFO [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
Tomcat Native library which allows optimal performance in production
environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat
8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
(x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program
Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\IPT;C:\Program
Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
06-Feb-2014 14:50:35.189 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:35.245 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
selector for servlet write/read
06-Feb-2014 14:50:35.251 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:35.258 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
selector for servlet write/read
06-Feb-2014 14:50:35.258 INFO [main]
org.apache.catalina.startup.Catalina.load Initialization processed in 1511
ms
06-Feb-2014 14:50:35.348 INFO [main]
org.apache.catalina.core.StandardService.startInternal Starting service
Catalina
06-Feb-2014 14:50:35.349 INFO [main]
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
Engine: Apache Tomcat/8.0.1
06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\docs
06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\examples
06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\manager
06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\name
06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\ROOT
06-Feb-2014 14:50:38.100 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:38.115 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:38.120 INFO [main]
org.apache.catalina.startup.Catalina.start Server startup in 2861 ms
06-Feb-2014 15:07:38.488 INFO
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
06-Feb-2014 15:07:38.489 INFO
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.core.StandardContext.reload Reloading Context with name
[/name] has started
06-Feb-2014 15:07:38.928 INFO
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.core.StandardContext.reload Reloading Context with name
[/name] is completed
06-Feb-2014 15:07:48.932 INFO

question regarding tomcat source code and dependencies

2014-02-06 Thread Leo Donahue
This question was spawned by two things:

I'm reading a book on Dependency Injection
The latest security announcement - reading the source for FileUploadBase.java

Some reading material suggests that one use a simple factory pattern
to move object creation dependencies to a different class.

I see where the object dependencies that FileUploadBase.java has, like
FileItemIteratorImpl, just simply place those dependent classes in the
same java source file.

I don't see a problem with that approach, should I?

Leo

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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Howard W. Smith, Jr.
On Wed, Feb 5, 2014 at 2:09 PM, javier_esp...@hna.honda.com wrote:

 OK, this is what I see in the Event Viewer under General tab
 The tomcat7 service terminated with service-specific error Incorrect
 function..

 Under Details tab, I see the following in XML view
 - Event xmlns=http://schemas.microsoft.com/win/2004/08/events/event;
   - System
 Provider Name=Service Control Manager Guid=
 {555908d1-a6d7-4695-8e1e-26931d2012f4} EventSourceName=Service
 Control Manager /
 EventID Qualifiers=491527024/EventID
 Version0/Version
 Level2/Level
 Task0/Task
 Opcode0/Opcode
 Keywords0x8080/Keywords
 TimeCreated SystemTime=2014-02-05T19:04:06.253413900Z /
 EventRecordID67562/EventRecordID
 Correlation /
 Execution ProcessID=872 ThreadID=6044 /
 ChannelSystem/Channel
 ComputerTORAHMLF3DTKX1.am.mds.honda.com/Computer
 Security /
 /System
   - EventData
 Data Name=param1tomcat7/Data
 Data Name=param2%%1/Data
 /EventData
   /Event

   Can anyone tell me what that is trying to tell me?

   Thank you


did you see anything else in the Event Viewer that occurred around the same
time that this event occurred (in Event Viewer)?

also, i wonder if he following can help solve this issue?

  - EventData
Data Name=param1tomcat7/Data
Data Name=param2%%1/Data
/EventData


Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread André Warnier

Hi.

javier_esp...@hna.honda.com wrote:

OK, this is what I see in the Event Viewer under General tab
The tomcat7 service terminated with service-specific error Incorrect
function..



Let's start from the beginning.

If you don't get logfiles in the Tomcat/logs directory, then chances are that Windows does 
not even begin to run Tomcat, and that there is an error right at the start, when it tries 
to run it.


So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11

That will explain /what/ you are actually running, when you (try to) run Tomcat as a 
Service in Windows, and why it is different from running Tomcat in a command window.

Go ahead, read it, we'll wait right here.

... some time later :

Now you know
- that tomcat7.exe is a Windows executable program
- it is the program which the Windows Service Manager tries to start, when you start the 
Tomcat7 Service
- but tomcat7.exe is not really Tomcat; it is a wrapper program that runs the Java JVM 
which in turn runs Tomcat.


And to start the Java JVM, and pass to this java JVM the appropriate parameters, 
tomcat7.exe reads these parameters from the Windows Registry somewhere.


And to be nice, the Tomcat developers have even provided a specialised GUI editor, that 
allows you to view, set or modify these Tomcat Registry parameters that are used by 
tomcat7.exe.
And that is the program tomcat7w.exe.  So go ahead now, double-click on tomcat7w.exe, and 
look at the information it shows in the various tabs.

That is probably where something is wrong.

Or else what is wrong, is that the version of tomcat7.exe that you have installed, does 
not match the version of Windows that you are running.  For example, tomcat7.exe is a 
32-bit program, but your Windows PC runs a 64-bit version of Windows.  Or vice-versa.


Or that in the Service definition of the Tomcat7 Service, the path to tomcat7.exe is 
incorrect.

You see that path in the first tab of the GUI.




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



RE: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Jeffrey Janner
 -Original Message-
 From: André Warnier [mailto:a...@ice-sa.com]
 Sent: Thursday, February 06, 2014 10:33 AM
 To: Tomcat Users List
 Subject: Re: unable to start Tomcat through the Windows Services panel
 
 Hi.
 
 javier_esp...@hna.honda.com wrote:
  OK, this is what I see in the Event Viewer under General tab The
  tomcat7 service terminated with service-specific error Incorrect
  function..
 
 
 Let's start from the beginning.
 
 If you don't get logfiles in the Tomcat/logs directory, then chances
 are that Windows does not even begin to run Tomcat, and that there is
 an error right at the start, when it tries to run it.
 
 So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11
 
 That will explain /what/ you are actually running, when you (try to)
 run Tomcat as a Service in Windows, and why it is different from
 running Tomcat in a command window.
 Go ahead, read it, we'll wait right here.
 
 ... some time later :
 
 Now you know
 - that tomcat7.exe is a Windows executable program
 - it is the program which the Windows Service Manager tries to start,
 when you start the
 Tomcat7 Service
 - but tomcat7.exe is not really Tomcat; it is a wrapper program that
 runs the Java JVM which in turn runs Tomcat.
 
 And to start the Java JVM, and pass to this java JVM the appropriate
 parameters, tomcat7.exe reads these parameters from the Windows
 Registry somewhere.
 
 And to be nice, the Tomcat developers have even provided a specialised
 GUI editor, that allows you to view, set or modify these Tomcat
 Registry parameters that are used by tomcat7.exe.
 And that is the program tomcat7w.exe.  So go ahead now, double-click on
 tomcat7w.exe, and look at the information it shows in the various tabs.
 That is probably where something is wrong.
 
 Or else what is wrong, is that the version of tomcat7.exe that you have
 installed, does not match the version of Windows that you are running.
 For example, tomcat7.exe is a 32-bit program, but your Windows PC runs
 a 64-bit version of Windows.  Or vice-versa.
 
 Or that in the Service definition of the Tomcat7 Service, the path to
 tomcat7.exe is incorrect.
 You see that path in the first tab of the GUI.
 

André -
Good points. I'd been following this thread out of curiosity and was just 
beginning to think that it was obviously a service configuration error.  I 
don't have the entire thread handy, and haven't looked at MarkMail, but I don't 
remember anyone asking the OP exactly *how* he installed the service. One would 
assume he used the bat file that is designed to do this, since he mentions 
running tomcat from the console using startup.bat (a clear giveaway that he's 
not using the fine Windows installer package that someone spent a lot of time 
crafting).
Personally, I only use the installer, and never run into startup problems 
unless I've set some optional parameter to an invalid value, e.g. setting a 
heap size  than 1.5GB on a 32-bit machine, etc.
As you said, if you're not seeing any log files generated, then the java isn't 
even getting started, so it could be several factors, not the least of which is 
an invalid path to the JVM or the Tomcat jar files, etc.
Jeff


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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Howard W. Smith, Jr.
On Thu, Feb 6, 2014 at 11:42 AM, Jeffrey Janner jeffrey.jan...@polydyne.com
 wrote:

  -Original Message-
  From: André Warnier [mailto:a...@ice-sa.com]
  Sent: Thursday, February 06, 2014 10:33 AM
  To: Tomcat Users List
  Subject: Re: unable to start Tomcat through the Windows Services panel
 
  Hi.
 
  javier_esp...@hna.honda.com wrote:
   OK, this is what I see in the Event Viewer under General tab The
   tomcat7 service terminated with service-specific error Incorrect
   function..
  
 
  Let's start from the beginning.
 
  If you don't get logfiles in the Tomcat/logs directory, then chances
  are that Windows does not even begin to run Tomcat, and that there is
  an error right at the start, when it tries to run it.
 
  So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11
 
  That will explain /what/ you are actually running, when you (try to)
  run Tomcat as a Service in Windows, and why it is different from
  running Tomcat in a command window.
  Go ahead, read it, we'll wait right here.
 
  ... some time later :
 
  Now you know
  - that tomcat7.exe is a Windows executable program
  - it is the program which the Windows Service Manager tries to start,
  when you start the
  Tomcat7 Service
  - but tomcat7.exe is not really Tomcat; it is a wrapper program that
  runs the Java JVM which in turn runs Tomcat.
 
  And to start the Java JVM, and pass to this java JVM the appropriate
  parameters, tomcat7.exe reads these parameters from the Windows
  Registry somewhere.
 
  And to be nice, the Tomcat developers have even provided a specialised
  GUI editor, that allows you to view, set or modify these Tomcat
  Registry parameters that are used by tomcat7.exe.
  And that is the program tomcat7w.exe.  So go ahead now, double-click on
  tomcat7w.exe, and look at the information it shows in the various tabs.
  That is probably where something is wrong.
 
  Or else what is wrong, is that the version of tomcat7.exe that you have
  installed, does not match the version of Windows that you are running.
  For example, tomcat7.exe is a 32-bit program, but your Windows PC runs
  a 64-bit version of Windows.  Or vice-versa.
 
  Or that in the Service definition of the Tomcat7 Service, the path to
  tomcat7.exe is incorrect.
  You see that path in the first tab of the GUI.
 

 André -
 Good points. I'd been following this thread out of curiosity and was just
 beginning to think that it was obviously a service configuration error.


Agreed, and I was following this thread for the same reason.


 I don't have the entire thread handy, and haven't looked at MarkMail, but
 I don't remember anyone asking the OP exactly *how* he installed the
 service.


I had the same thought.


 One would assume he used the bat file that is designed to do this, since
 he mentions running tomcat from the console using startup.bat (a clear
 giveaway that he's not using the fine Windows installer package that
 someone spent a lot of time crafting).


Honestly, I forgot all the specific details of how/when I installed
tomcat/tomee as a Windows service, but I found it quite intuitive...using
the .bat file approach via Windows Command Prompt. The .bat file informed
me of the proper 'usage', and I easily installed tomcat/tomee as a Windows
Service, via command line (or .bat file), accordingly.

And I do use the tomcat7w.exe to modify java options, etc... I never have
to open Windows 'Services' to start/stop tomcat/tomee.


Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread André Warnier

André Warnier wrote:

Hi.

javier_esp...@hna.honda.com wrote:

OK, this is what I see in the Event Viewer under General tab
The tomcat7 service terminated with service-specific error Incorrect
function..



Let's start from the beginning.

If you don't get logfiles in the Tomcat/logs directory, then chances are 
that Windows does not even begin to run Tomcat, and that there is an 
error right at the start, when it tries to run it.


So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11

That will explain /what/ you are actually running, when you (try to) run 
Tomcat as a Service in Windows, and why it is different from running 
Tomcat in a command window.

Go ahead, read it, we'll wait right here.

... some time later :

Now you know
- that tomcat7.exe is a Windows executable program
- it is the program which the Windows Service Manager tries to start, 
when you start the Tomcat7 Service
- but tomcat7.exe is not really Tomcat; it is a wrapper program that 
runs the Java JVM which in turn runs Tomcat.


And to start the Java JVM, and pass to this java JVM the appropriate 
parameters, tomcat7.exe reads these parameters from the Windows Registry 
somewhere.


And to be nice, the Tomcat developers have even provided a specialised 
GUI editor, that allows you to view, set or modify these Tomcat Registry 
parameters that are used by tomcat7.exe.
And that is the program tomcat7w.exe.  So go ahead now, double-click on 
tomcat7w.exe, and look at the information it shows in the various tabs.

That is probably where something is wrong.

Or else what is wrong, is that the version of tomcat7.exe that you have 
installed, does not match the version of Windows that you are running.  
For example, tomcat7.exe is a 32-bit program, but your Windows PC runs a 
64-bit version of Windows.  Or vice-versa.


Or that in the Service definition of the Tomcat7 Service, the path to 
tomcat7.exe is incorrect.

You see that path in the first tab of the GUI.



Correction :
(it's correct in the FAQ, but wrong above)

The tomcat7.exe 32- or 64-bit version must match the 32- or 64-bit version *of the JVM* 
that you are running, not the version of Windows.


Of course, on a 32-bit Windows you can only run a 32-bit JVM, but I suppose that's not 
your case.
You /could/ be running a 64-bit JVM, and be trying to start it with a 32-bit tomcat7.exe, 
and that would not work.


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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread javier_espana
The entry in the Event Viewer just before the Error entry says The tomcat7
service entered the stopped state.

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***





From:   Howard W. Smith, Jr. smithh032...@gmail.com
To: Tomcat Users List users@tomcat.apache.org,
Date:   02/06/2014 08:09 AM
Subject:Re: unable to start Tomcat through the Windows Services panel



On Wed, Feb 5, 2014 at 2:09 PM, javier_esp...@hna.honda.com wrote:

 OK, this is what I see in the Event Viewer under General tab
 The tomcat7 service terminated with service-specific error Incorrect
 function..

 Under Details tab, I see the following in XML view
 - Event xmlns=http://schemas.microsoft.com/win/2004/08/events/event;
   - System
 Provider Name=Service Control Manager Guid=
 {555908d1-a6d7-4695-8e1e-26931d2012f4} EventSourceName=Service
 Control Manager /
 EventID Qualifiers=491527024/EventID
 Version0/Version
 Level2/Level
 Task0/Task
 Opcode0/Opcode
 Keywords0x8080/Keywords
 TimeCreated SystemTime=2014-02-05T19:04:06.253413900Z /
 EventRecordID67562/EventRecordID
 Correlation /
 Execution ProcessID=872 ThreadID=6044 /
 ChannelSystem/Channel
 ComputerTORAHMLF3DTKX1.am.mds.honda.com/Computer
 Security /
 /System
   - EventData
 Data Name=param1tomcat7/Data
 Data Name=param2%%1/Data
 /EventData
   /Event

   Can anyone tell me what that is trying to tell me?

   Thank you


did you see anything else in the Event Viewer that occurred around the same
time that this event occurred (in Event Viewer)?

also, i wonder if he following can help solve this issue?

  - EventData
Data Name=param1tomcat7/Data
Data Name=param2%%1/Data
/EventData



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



Re: Http Status 404

2014-02-06 Thread Tim Watts
On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
 My directory structure is C:\Program Files\Apache Software
 Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
 Servlet

That last part should be ...\WEB-INF\classes (lower case 'c').  If that
doesn't fix it then, again I ask, what URL are you using to access the
app?


 Description of my logs is below
 06-Feb-2014 14:50:22.684 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:22.742 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:22.793 INFO [Thread-9]
 org.apache.catalina.core.StandardService.stopInternal Stopping service
 Catalina
 06-Feb-2014 14:50:22.912 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:22.916 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
 [ajp-nio-8009]
 
 2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
 06-Feb-2014 14:50:34.636 INFO [main]
 org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
 Tomcat Native library which allows optimal performance in production
 environments was not found on the java.library.path: C:\Program
 Files\Apache Software Foundation\Tomcat
 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
 Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
 (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
 Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
 MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program
 Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
 Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
 Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
 Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
 Engine Components\IPT;C:\Program
 Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
 Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
 06-Feb-2014 14:50:35.189 INFO [main]
 org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:35.245 INFO [main]
 org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
 selector for servlet write/read
 06-Feb-2014 14:50:35.251 INFO [main]
 org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:35.258 INFO [main]
 org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
 selector for servlet write/read
 06-Feb-2014 14:50:35.258 INFO [main]
 org.apache.catalina.startup.Catalina.load Initialization processed in 1511
 ms
 06-Feb-2014 14:50:35.348 INFO [main]
 org.apache.catalina.core.StandardService.startInternal Starting service
 Catalina
 06-Feb-2014 14:50:35.349 INFO [main]
 org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
 Engine: Apache Tomcat/8.0.1
 06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\docs
 06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\examples
 06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\manager
 06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\name
 06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\ROOT
 06-Feb-2014 14:50:38.100 INFO [main]
 org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:38.115 INFO [main]
 org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:38.120 INFO [main]
 org.apache.catalina.startup.Catalina.start Server startup in 2861 ms
 06-Feb-2014 15:07:38.488 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
 06-Feb-2014 15:07:38.489 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.core.StandardContext.reload 

Re: Http Status 404

2014-02-06 Thread Shivam Mishra
My url is http://localhost:8080/name/TestServlet


On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org wrote:

 On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
  My directory structure is C:\Program Files\Apache Software
  Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
  Servlet

 That last part should be ...\WEB-INF\classes (lower case 'c').  If that
 doesn't fix it then, again I ask, what URL are you using to access the
 app?


  Description of my logs is below
  06-Feb-2014 14:50:22.684 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:22.742 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
  [ajp-nio-8009]
  06-Feb-2014 14:50:22.793 INFO [Thread-9]
  org.apache.catalina.core.StandardService.stopInternal Stopping service
  Catalina
  06-Feb-2014 14:50:22.912 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:22.916 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
  [ajp-nio-8009]
 
  2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
  06-Feb-2014 14:50:34.636 INFO [main]
  org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
  Tomcat Native library which allows optimal performance in production
  environments was not found on the java.library.path: C:\Program
  Files\Apache Software Foundation\Tomcat
  8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
  Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
  (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
 
 Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
  Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
  MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL
 SDK\2.0\bin\x86;C:\Program
  Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
  Management Engine Components\DAL;C:\Program Files\Intel\Intel(R)
 Management
  Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
  Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
  Engine Components\IPT;C:\Program
 
 Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
  Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
  06-Feb-2014 14:50:35.189 INFO [main]
  org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:35.245 INFO [main]
  org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
 shared
  selector for servlet write/read
  06-Feb-2014 14:50:35.251 INFO [main]
  org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
  [ajp-nio-8009]
  06-Feb-2014 14:50:35.258 INFO [main]
  org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
 shared
  selector for servlet write/read
  06-Feb-2014 14:50:35.258 INFO [main]
  org.apache.catalina.startup.Catalina.load Initialization processed in
 1511
  ms
  06-Feb-2014 14:50:35.348 INFO [main]
  org.apache.catalina.core.StandardService.startInternal Starting service
  Catalina
  06-Feb-2014 14:50:35.349 INFO [main]
  org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
  Engine: Apache Tomcat/8.0.1
  06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
  org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
  application directory C:\Program Files\Apache Software Foundation\Tomcat
  8.0\webapps\docs
  06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
  org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
  application directory C:\Program Files\Apache Software Foundation\Tomcat
  8.0\webapps\examples
  06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
  org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
  application directory C:\Program Files\Apache Software Foundation\Tomcat
  8.0\webapps\manager
  06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
  org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
  application directory C:\Program Files\Apache Software Foundation\Tomcat
  8.0\webapps\name
  06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
  org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
  application directory C:\Program Files\Apache Software Foundation\Tomcat
  8.0\webapps\ROOT
  06-Feb-2014 14:50:38.100 INFO [main]
  org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:38.115 INFO [main]
  org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
  [ajp-nio-8009]
  06-Feb-2014 14:50:38.120 INFO [main]
  org.apache.catalina.startup.Catalina.start Server startup in 2861 ms
  06-Feb-2014 15:07:38.488 INFO
  

Re: Http Status 404

2014-02-06 Thread Shivam Mishra
Now my browser is showing this error as below:

Exception report

*message* *Error instantiating servlet class TestServlet*

*description* *The server encountered an internal error that prevented it
from fulfilling this request.*

*exception*

javax.servlet.ServletException: Error instantiating servlet class TestServlet

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)

org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)

org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)

org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)

org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

*root cause*

java.lang.IllegalAccessException: Class
org.apache.catalina.core.DefaultInstanceManager can not access a
member of class TestServlet with modifiers 
sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
java.lang.Class.newInstance(Unknown Source)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)

org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)

org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)

org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)

org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)



On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra shmishra...@gmail.comwrote:

 My url is http://localhost:8080/name/TestServlet


 On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org wrote:

 On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
  My directory structure is C:\Program Files\Apache Software
  Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
  Servlet

 That last part should be ...\WEB-INF\classes (lower case 'c').  If that
 doesn't fix it then, again I ask, what URL are you using to access the
 app?


  Description of my logs is below
  06-Feb-2014 14:50:22.684 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:22.742 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
  [ajp-nio-8009]
  06-Feb-2014 14:50:22.793 INFO [Thread-9]
  org.apache.catalina.core.StandardService.stopInternal Stopping service
  Catalina
  06-Feb-2014 14:50:22.912 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
  [http-nio-8080]
  06-Feb-2014 14:50:22.916 INFO [Thread-9]
  org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
  [ajp-nio-8009]
 
  2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
  06-Feb-2014 14:50:34.636 INFO [main]
  org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
  Tomcat Native library which allows optimal performance in production
  environments was not found on the java.library.path: C:\Program
  Files\Apache Software Foundation\Tomcat
 
 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
  Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
  (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
 
 Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
  Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
  MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL
 SDK\2.0\bin\x86;C:\Program
  Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
  Management Engine Components\DAL;C:\Program Files\Intel\Intel(R)
 Management
  Engine Components\IPT;C:\Program Files 

Installation issues of Tomcat on IBM i Series server OS - V7R1; Java 1.7

2014-02-06 Thread Jakati, Shekar
Hi Tomcat/IBM experts,

  We are trying to install  Tomcat 7.0.50 on our iSeries server and getting the 
below error. If any of you experts can point me to what the error means and how 
I can resolve it or any pointers at all, It will be much appreciated. I have 
attached the partial log file below.


Regards

sj

Feb 05, 2014 6:59:43 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the java.library.path: 
/QSYS.LIB/NQSYS.LIB:/QSYS.LIB:/QSYS.LIB/QSYS2.LIB:/QSYS.LIB/QHLPSYS.LIB:/QSYS.LIB/QUSRSYS.LIB:/QSYS.LIB/RBTSYSLIB.LIB:/QSYS.LIB/QSHELL.LIB:/QSYS.LIB/TOMCAT.LIB:/QSYS.LIB/QTEMP.LIB:/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit/jre/lib/ppc:/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit/jre/lib/ppc/classic:/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit/jre/lib/ppc/default:/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit/jre/bin:/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit/jre/bin/classic
Feb 05, 2014 6:59:44 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [http-bio-8080]
Feb 05, 2014 6:59:45 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [ajp-bio-8009]
Feb 05, 2014 6:59:45 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2765 ms
Feb 05, 2014 6:59:45 AM org.apache.catalina.users.MemoryUserDatabase open
WARNING: Exception configuring digester to permit java encoding names in XML 
files. Only IANA encoding names will be supported.
org.xml.sax.SAXNotRecognizedException: 
http://apache.org/xml/features/allow-java-encodings
at gnu.xml.aelfred2.JAXPFactory.setFeature(JAXPFactory.java:102)
at 
org.apache.tomcat.util.digester.Digester.setFeature(Digester.java:547)
at 
org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:413)
at 
org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:104)
at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)
at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:332)
at 
org.apache.naming.NamingContext.lookup(NamingContext.java:843)
at 
org.apache.naming.NamingContext.lookup(NamingContext.java:154)
at 
org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:119)
at 
org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:73)
at 
org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:36)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:140)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:112)
at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:84)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at 
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at 
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:725)
at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:690)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:618)
at 
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)

Feb 05, 2014 6:59:45 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 05, 2014 6:59:45 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.50
Feb 05, 2014 6:59:45 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory 
/Tomcat/apache-tomcat-7.0.50/webapps/ROOT
Feb 05, 2014 6:59:45 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory 
/Tomcat/apache-tomcat-7.0.50/webapps/ROOT
java.lang.ExceptionInInitializerError
 

Re: Http Status 404

2014-02-06 Thread Tim Watts
On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:
 Now my browser is showing this error as below:
 
 Exception report
 
 *message* *Error instantiating servlet class TestServlet*
 
 *description* *The server encountered an internal error that prevented it
 from fulfilling this request.*
 
 *exception*
 
 javax.servlet.ServletException: Error instantiating servlet class TestServlet
   
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
   
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
   
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
   
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
   
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
   
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
   
 org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
   
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
   
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)
 
 *root cause*
 
 java.lang.IllegalAccessException: Class
 org.apache.catalina.core.DefaultInstanceManager can not access a
 member of class TestServlet with modifiers 

You probably didn't declare it as 'public class ...'.  If that's not the
case perhaps you could post the source.

(Just a gentle pre-emptive reminder: This list is run by volunteers to
help folks with their Tomcat problems, not to teach basic Java or
Servlet coding.)


   sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
   java.lang.Class.newInstance(Unknown Source)
   
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
   
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
   
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
   
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
   
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
   
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
   
 org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
   
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
   
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)
 
 
 
 On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra shmishra...@gmail.comwrote:
 
  My url is http://localhost:8080/name/TestServlet
 
 
  On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org wrote:
 
  On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
   My directory structure is C:\Program Files\Apache Software
   Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
   Servlet
 
  That last part should be ...\WEB-INF\classes (lower case 'c').  If that
  doesn't fix it then, again I ask, what URL are you using to access the
  app?
 
 
   Description of my logs is below
   06-Feb-2014 14:50:22.684 INFO [Thread-9]
   org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
   [http-nio-8080]
   06-Feb-2014 14:50:22.742 INFO [Thread-9]
   org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
   [ajp-nio-8009]
   06-Feb-2014 14:50:22.793 INFO [Thread-9]
   org.apache.catalina.core.StandardService.stopInternal Stopping service
   Catalina
   06-Feb-2014 14:50:22.912 INFO [Thread-9]
   org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
   [http-nio-8080]
   06-Feb-2014 14:50:22.916 INFO [Thread-9]
   org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
   [ajp-nio-8009]
  
   2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
   06-Feb-2014 14:50:34.636 INFO [main]
   org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
   Tomcat Native library which allows optimal performance in production
   environments was not found on the java.library.path: C:\Program
   Files\Apache Software Foundation\Tomcat
  
  8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
   Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
   (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
  
  

retain context.xml across war updates

2014-02-06 Thread Steve Lopez
Is there a way to ensure an applications context.xml isn't deleted across 
reloads of the war file?We have server-specific settings in each 
context.xml and are looking for a way to deploy the same WAR file across each 
Tomcat instance.

My first attempt at this was to put the context.xml into ~ catalina 
/conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when the 
app is unloaded.

Is there a setting to tell Tomcat *not* to delete the context.xml in 
~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best practice' for 
providing configuration settings to each Tomcat while also enabling a simple 
continuous integration and deployment of WAR files for an application across 
multiple Tc instances.  Creating custom war files (one for each server) 
seems brittle and risky if the wrong war is accidentally deployed on the wrong 
server.

Specifically, context.xml contains custom settings for 
memcached-session-manager which specifies the primary and fallback memcache 
host.  These would be different for each server when using sticky sessions.

Thanks,
Steve

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



Re: retain context.xml across war updates

2014-02-06 Thread Mark Thomas
On 06/02/2014 17:55, Steve Lopez wrote:
 Is there a way to ensure an applications context.xml isn't deleted across 
 reloads of the war file?We have server-specific settings in each 
 context.xml and are looking for a way to deploy the same WAR file across each 
 Tomcat instance.
 
 My first attempt at this was to put the context.xml into ~ catalina 
 /conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when 
 the app is unloaded.
 
 Is there a setting to tell Tomcat *not* to delete the context.xml in 
 ~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best practice' 
 for providing configuration settings to each Tomcat while also enabling a 
 simple continuous integration and deployment of WAR files for an application 
 across multiple Tc instances.  Creating custom war files (one for each 
 server) seems brittle and risky if the wrong war is accidentally deployed on 
 the wrong server.
 
 Specifically, context.xml contains custom settings for 
 memcached-session-manager which specifies the primary and fallback memcache 
 host.  These would be different for each server when using sticky sessions.

http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html

HTH,

Mark


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



Re: Http Status 404

2014-02-06 Thread Shivam Mishra
Its running thank you very much ...



On Thu, Feb 6, 2014 at 11:24 PM, Tim Watts t...@cliftonfarm.org wrote:

 On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:
  Now my browser is showing this error as below:
 
  Exception report
 
  *message* *Error instantiating servlet class TestServlet*
 
  *description* *The server encountered an internal error that prevented it
  from fulfilling this request.*
 
  *exception*
 
  javax.servlet.ServletException: Error instantiating servlet class
 TestServlet
 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
 
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
 
 org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
 
  *root cause*
 
  java.lang.IllegalAccessException: Class
  org.apache.catalina.core.DefaultInstanceManager can not access a
  member of class TestServlet with modifiers 

 You probably didn't declare it as 'public class ...'.  If that's not the
 case perhaps you could post the source.

 (Just a gentle pre-emptive reminder: This list is run by volunteers to
 help folks with their Tomcat problems, not to teach basic Java or
 Servlet coding.)


sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
 
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
 
 org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
 
 
 
  On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra shmishra...@gmail.com
 wrote:
 
   My url is http://localhost:8080/name/TestServlet
  
  
   On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org
 wrote:
  
   On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
My directory structure is C:\Program Files\Apache Software
Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file
 of
Servlet
  
   That last part should be ...\WEB-INF\classes (lower case 'c').  If
 that
   doesn't fix it then, again I ask, what URL are you using to access the
   app?
  
  
Description of my logs is below
06-Feb-2014 14:50:22.684 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.742 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:22.793 INFO [Thread-9]
org.apache.catalina.core.StandardService.stopInternal Stopping
 service
Catalina
06-Feb-2014 14:50:22.912 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.916 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[ajp-nio-8009]
   
2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
06-Feb-2014 14:50:34.636 INFO [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based
 Apache
Tomcat Native library which allows optimal performance in production
environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat
   
  
 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program
 Files
(x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
   
  
 

RE: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread javier_espana
Andre:
I used the batch file SERVICE.BAT INSTALL  without any additional
parameters.  Was I missing some parameter? Or is there a better way of
installing Tomcat?

Thank you

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***





From:   Jeffrey Janner jeffrey.jan...@polydyne.com
To: 'Tomcat Users List' users@tomcat.apache.org, 'Tomcat Users
List' users@tomcat.apache.org,
Date:   02/06/2014 08:43 AM
Subject:RE: unable to start Tomcat through the Windows Services panel



 -Original Message-
 From: André Warnier [mailto:a...@ice-sa.com]
 Sent: Thursday, February 06, 2014 10:33 AM
 To: Tomcat Users List
 Subject: Re: unable to start Tomcat through the Windows Services panel

 Hi.

 javier_esp...@hna.honda.com wrote:
  OK, this is what I see in the Event Viewer under General tab The
  tomcat7 service terminated with service-specific error Incorrect
  function..
 

 Let's start from the beginning.

 If you don't get logfiles in the Tomcat/logs directory, then chances
 are that Windows does not even begin to run Tomcat, and that there is
 an error right at the start, when it tries to run it.

 So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11

 That will explain /what/ you are actually running, when you (try to)
 run Tomcat as a Service in Windows, and why it is different from
 running Tomcat in a command window.
 Go ahead, read it, we'll wait right here.

 ... some time later :

 Now you know
 - that tomcat7.exe is a Windows executable program
 - it is the program which the Windows Service Manager tries to start,
 when you start the
 Tomcat7 Service
 - but tomcat7.exe is not really Tomcat; it is a wrapper program that
 runs the Java JVM which in turn runs Tomcat.

 And to start the Java JVM, and pass to this java JVM the appropriate
 parameters, tomcat7.exe reads these parameters from the Windows
 Registry somewhere.

 And to be nice, the Tomcat developers have even provided a specialised
 GUI editor, that allows you to view, set or modify these Tomcat
 Registry parameters that are used by tomcat7.exe.
 And that is the program tomcat7w.exe.  So go ahead now, double-click on
 tomcat7w.exe, and look at the information it shows in the various tabs.
 That is probably where something is wrong.

 Or else what is wrong, is that the version of tomcat7.exe that you have
 installed, does not match the version of Windows that you are running.
 For example, tomcat7.exe is a 32-bit program, but your Windows PC runs
 a 64-bit version of Windows.  Or vice-versa.

 Or that in the Service definition of the Tomcat7 Service, the path to
 tomcat7.exe is incorrect.
 You see that path in the first tab of the GUI.


André -
Good points. I'd been following this thread out of curiosity and was just
beginning to think that it was obviously a service configuration error.  I
don't have the entire thread handy, and haven't looked at MarkMail, but I
don't remember anyone asking the OP exactly *how* he installed the service.
One would assume he used the bat file that is designed to do this, since he
mentions running tomcat from the console using startup.bat (a clear
giveaway that he's not using the fine Windows installer package that
someone spent a lot of time crafting).
Personally, I only use the installer, and never run into startup problems
unless I've set some optional parameter to an invalid value, e.g. setting a
heap size  than 1.5GB on a 32-bit machine, etc.
As you said, if you're not seeing any log files generated, then the java
isn't even getting started, so it could be several factors, not the least
of which is an invalid path to the JVM or the Tomcat jar files, etc.
Jeff


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




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



Re: retain context.xml across war updates

2014-02-06 Thread Jesse Barnum
Mark, which version of Tomcat 7 implemented the behavior described in that 
document?

--Jesse Barnum, President, 360Works
http://www.360works.com
Product updates and news on http://facebook.com/360Works
(770) 234-9293
== Don't lose your data! http://360works.com/safetynet/ for FileMaker Server ==

On Feb 6, 2014, at 1:02 PM, Mark Thomas ma...@apache.org wrote:

 On 06/02/2014 17:55, Steve Lopez wrote:
 Is there a way to ensure an applications context.xml isn't deleted across 
 reloads of the war file?We have server-specific settings in each 
 context.xml and are looking for a way to deploy the same WAR file across 
 each Tomcat instance.
 
 My first attempt at this was to put the context.xml into ~ catalina 
 /conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when 
 the app is unloaded.
 
 Is there a setting to tell Tomcat *not* to delete the context.xml in 
 ~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best practice' 
 for providing configuration settings to each Tomcat while also enabling a 
 simple continuous integration and deployment of WAR files for an application 
 across multiple Tc instances.  Creating custom war files (one for each 
 server) seems brittle and risky if the wrong war is accidentally deployed on 
 the wrong server.
 
 Specifically, context.xml contains custom settings for 
 memcached-session-manager which specifies the primary and fallback memcache 
 host.  These would be different for each server when using sticky sessions.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html
 
 HTH,
 
 Mark
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



RE: retain context.xml across war updates

2014-02-06 Thread Steve Lopez
Sorry - I forgot to include the version I'm using.  It is 7.0.34   Soon to be 
7.0.50  (on Ubuntu 12.0.4 LTS, 64-bit)

-Original Message-
From: Jesse Barnum [mailto:jsb_tom...@360works.com] 
Sent: Thursday, February 06, 2014 1:22 PM
To: Tomcat Users List
Subject: Re: retain context.xml across war updates

Mark, which version of Tomcat 7 implemented the behavior described in that 
document?

--Jesse Barnum, President, 360Works
http://www.360works.com
Product updates and news on http://facebook.com/360Works
(770) 234-9293
== Don't lose your data! http://360works.com/safetynet/ for FileMaker Server ==

On Feb 6, 2014, at 1:02 PM, Mark Thomas ma...@apache.org wrote:

 On 06/02/2014 17:55, Steve Lopez wrote:
 Is there a way to ensure an applications context.xml isn't deleted across 
 reloads of the war file?We have server-specific settings in each 
 context.xml and are looking for a way to deploy the same WAR file across 
 each Tomcat instance.
 
 My first attempt at this was to put the context.xml into ~ catalina 
 /conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when 
 the app is unloaded.
 
 Is there a setting to tell Tomcat *not* to delete the context.xml in 
 ~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best practice' 
 for providing configuration settings to each Tomcat while also enabling a 
 simple continuous integration and deployment of WAR files for an application 
 across multiple Tc instances.  Creating custom war files (one for each 
 server) seems brittle and risky if the wrong war is accidentally deployed on 
 the wrong server.
 
 Specifically, context.xml contains custom settings for 
 memcached-session-manager which specifies the primary and fallback memcache 
 host.  These would be different for each server when using sticky sessions.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html
 
 HTH,
 
 Mark
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: Http Status 404

2014-02-06 Thread Neven Cvetkovic
On Thu, Feb 6, 2014 at 11:02 AM, Shivam Mishra shmishra...@gmail.comwrote:

 My directory structure is C:\Program Files\Apache Software
 Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
 Servlet


That should probably be lowercase classes, e.g.

C:\Program Files\Apache Software Foundation\Tomcat
8.0\webapps\name\WEB-INF\classes\MyServlet.class



 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\docs
 06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\examples
 06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\manager
 06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\name
 06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\ROOT


Here you can see all the apps that were successfully deployed: docs,
example, manager, name (your app), ROOT (default application with /
context)


[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
 06-Feb-2014 15:07:38.489 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.core.StandardContext.reload Reloading Context with name
 [/name] has started
 06-Feb-2014 15:07:38.928 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.core.StandardContext.reload Reloading Context with name
 [/name] is completed
 06-Feb-2014 15:07:48.932 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
 06-Feb-2014 15:07:48.932 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.core.StandardContext.reload Reloading Context with name
 [/name] has started
 06-Feb-2014 15:07:49.401 INFO
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.core.StandardContext.reload Reloading Context with name
 [/name] is completed


How did you test your servlet?

Based on your configuration, it is probably something like:
http://localhost:8080/name/TestServlet

Does that work? What is the error message you get?


Re: Http Status 404

2014-02-06 Thread David kerber

On 2/6/2014 1:05 PM, Shivam Mishra wrote:

Its running thank you very much ...


Can you tell us what the trouble was, so other people with the same 
issue can learn from it?








On Thu, Feb 6, 2014 at 11:24 PM, Tim Watts t...@cliftonfarm.org wrote:


On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:

Now my browser is showing this error as below:

Exception report

*message* *Error instantiating servlet class TestServlet*

*description* *The server encountered an internal error that prevented it
from fulfilling this request.*

*exception*

javax.servlet.ServletException: Error instantiating servlet class

TestServlet



org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)



org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)



org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)



org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)



org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)



org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)



org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)



org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)



org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)

   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)

*root cause*

java.lang.IllegalAccessException: Class
org.apache.catalina.core.DefaultInstanceManager can not access a
member of class TestServlet with modifiers 


You probably didn't declare it as 'public class ...'.  If that's not the
case perhaps you could post the source.

(Just a gentle pre-emptive reminder: This list is run by volunteers to
help folks with their Tomcat problems, not to teach basic Java or
Servlet coding.)



   sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
   java.lang.Class.newInstance(Unknown Source)


org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)



org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)



org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)



org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)



org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)



org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)



org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)



org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)



org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)

   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)



On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra shmishra...@gmail.com
wrote:


My url is http://localhost:8080/name/TestServlet


On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org

wrote:



On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:

My directory structure is C:\Program Files\Apache Software
Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file

of

Servlet


That last part should be ...\WEB-INF\classes (lower case 'c').  If

that

doesn't fix it then, again I ask, what URL are you using to access the
app?



Description of my logs is below
06-Feb-2014 14:50:22.684 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.742 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
[ajp-nio-8009]
06-Feb-2014 14:50:22.793 INFO [Thread-9]
org.apache.catalina.core.StandardService.stopInternal Stopping

service

Catalina
06-Feb-2014 14:50:22.912 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[http-nio-8080]
06-Feb-2014 14:50:22.916 INFO [Thread-9]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
[ajp-nio-8009]

2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
06-Feb-2014 14:50:34.636 INFO [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based

Apache

Tomcat Native library which allows optimal performance in production
environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat




8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program

Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program

Files

(x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS





Re: retain context.xml across war updates

2014-02-06 Thread Mark Thomas
On 06/02/2014 18:22, Jesse Barnum wrote:
 Mark, which version of Tomcat 7 implemented the behavior described in that 
 document?

Strictly, 7.0.48 but that wasn't released. 7.0.50 is the first release
with that behaviour. The 8.0.x releases behave that way as well (some of
the early RCs may not).

Mark


 
 --Jesse Barnum, President, 360Works
 http://www.360works.com
 Product updates and news on http://facebook.com/360Works
 (770) 234-9293
 == Don't lose your data! http://360works.com/safetynet/ for FileMaker Server 
 ==
 
 On Feb 6, 2014, at 1:02 PM, Mark Thomas ma...@apache.org wrote:
 
 On 06/02/2014 17:55, Steve Lopez wrote:
 Is there a way to ensure an applications context.xml isn't deleted across 
 reloads of the war file?We have server-specific settings in each 
 context.xml and are looking for a way to deploy the same WAR file across 
 each Tomcat instance.

 My first attempt at this was to put the context.xml into ~ catalina 
 /conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when 
 the app is unloaded.

 Is there a setting to tell Tomcat *not* to delete the context.xml in 
 ~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best practice' 
 for providing configuration settings to each Tomcat while also enabling a 
 simple continuous integration and deployment of WAR files for an 
 application across multiple Tc instances.  Creating custom war files 
 (one for each server) seems brittle and risky if the wrong war is 
 accidentally deployed on the wrong server.

 Specifically, context.xml contains custom settings for 
 memcached-session-manager which specifies the primary and fallback memcache 
 host.  These would be different for each server when using sticky sessions.

 http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html

 HTH,

 Mark


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

 
 


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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread André Warnier

javier_esp...@hna.honda.com wrote:

Andre:
I used the batch file SERVICE.BAT INSTALL  without any additional
parameters.  Was I missing some parameter? 


Possibly.  Depending on your particulat case, you may have needed to specifiy some option, 
and because you did not, it may have placed a wrong parameter somewhere, or used the wrong 
version of some module.
I don't really now, this is just speculation.  But obviously there is something wrong with 
the way your Service is defined.


Or is there a better way of

installing Tomcat?



If all you want is to run Tomcat as a Service, then yes there is an easier way : download 
the installer version from the Tomcat website, and run it.


I am a bit unfamiliar with the SERVICE.BAT file, but I would guess that it can also be run 
to uninstall the Service that you have already installed now.  If it does offer that, then 
run the SERVICE.BAT uninstall first, and then run the installer that you downloaded. 
You can install it in the same directory as before, and it will just overwrite some files.


As others have testified before, the installer version works fine and does the right thing 
automatically.


Note that the installer version does not install all the files which are contained in 
the zip version, only the subset of them needed to run the Service version.  It does not 
for example install the BAT files, since they are not needed to run the Service.



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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread javier_espana
I remember installing an older version of Tomcat some years ago and it had
a Setup.exe or Install.exe program in its library which invoked the Windows
installer and installed it as a service.  Some of the documentation for
version 7 mentions the Windows installer but does not provide a link or
gives an actual name.  In some other part of the documentation it says to
download the binary version and expand it in its own directory, which I
did, but I can not find a Windows program that will install it and set it
up as a service.
I am running Windows 7  64 bit and I did download the Tomcat 64 bit binary
version

I also tried at the command prompt the following to install it as a
service, which I did, but it still will not start through the Windows
Services panel.
tomcat7 //IS//Tomcat7 --DisplayName=Apache Tomcat 7
--Install=C:\Tomcat7042\bin\tomcat7.exe --Jvm=auto --StartMode=jvm
--StopMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap
--StartParams=start --StopClass=org.apache.catalina.startup.Bootstrap
--StopParams=stop

Thank you

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***





From:   André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org,
Date:   02/06/2014 11:14 AM
Subject:Re: unable to start Tomcat through the Windows Services panel



javier_esp...@hna.honda.com wrote:
 Andre:
 I used the batch file SERVICE.BAT INSTALL  without any additional
 parameters.  Was I missing some parameter?

Possibly.  Depending on your particulat case, you may have needed to
specifiy some option,
and because you did not, it may have placed a wrong parameter somewhere, or
used the wrong
version of some module.
I don't really now, this is just speculation.  But obviously there is
something wrong with
the way your Service is defined.

Or is there a better way of
 installing Tomcat?


If all you want is to run Tomcat as a Service, then yes there is an easier
way : download
the installer version from the Tomcat website, and run it.

I am a bit unfamiliar with the SERVICE.BAT file, but I would guess that it
can also be run
to uninstall the Service that you have already installed now.  If it does
offer that, then
run the SERVICE.BAT uninstall first, and then run the installer that
you downloaded.
You can install it in the same directory as before, and it will just
overwrite some files.

As others have testified before, the installer version works fine and does
the right thing
automatically.

Note that the installer version does not install all the files which are
contained in
the zip version, only the subset of them needed to run the Service version.
It does not
for example install the BAT files, since they are not needed to run the
Service.


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




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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Mark Thomas
On 06/02/2014 19:51, javier_esp...@hna.honda.com wrote:
 In some other part of the documentation it says to
 download the binary version and expand it in its own directory, which I
 did, but I can not find a Windows program that will install it and set it
 up as a service.

Try the download page:
http://tomcat.apache.org/download-70.cgi

Then look for the 32-bit/64-bit Windows Service Installer

Is it really that hard to find?

Mark


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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Mark Eggers

Replies inline.

On 2/6/2014 11:51 AM, javier_esp...@hna.honda.com wrote:

I remember installing an older version of Tomcat some years ago and it had
a Setup.exe or Install.exe program in its library which invoked the Windows
installer and installed it as a service.  Some of the documentation for
version 7 mentions the Windows installer but does not provide a link or
gives an actual name.  In some other part of the documentation it says to
download the binary version and expand it in its own directory, which I
did, but I can not find a Windows program that will install it and set it
up as a service.
I am running Windows 7  64 bit and I did download the Tomcat 64 bit binary
version

I also tried at the command prompt the following to install it as a
service, which I did, but it still will not start through the Windows
Services panel.
tomcat7 //IS//Tomcat7 --DisplayName=Apache Tomcat 7
--Install=C:\Tomcat7042\bin\tomcat7.exe --Jvm=auto --StartMode=jvm
--StopMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap
--StartParams=start --StopClass=org.apache.catalina.startup.Bootstrap
--StopParams=stop

Thank you



The installer is on the download page:

http://tomcat.apache.org/download-70.cgi

It's under Binary Distributions, and it's the last link before Full 
Documentation:


The link title is:

32-bit/64-bit Windows Service Installer (pgp, md5)

This should auto-detect which JVM you have installed on your machine.

As additional points of interest, could you open up a command line 
window and type:


java -version
echo %JRE_HOME%
echo %JAVA_HOME%

and paste the output into a response on the list?

. . . . just my two cents.
/mde/



From:   André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org,
Date:   02/06/2014 11:14 AM
Subject:Re: unable to start Tomcat through the Windows Services panel



javier_esp...@hna.honda.com wrote:

Andre:
I used the batch file SERVICE.BAT INSTALL  without any additional
parameters.  Was I missing some parameter?


Possibly.  Depending on your particulat case, you may have needed to
specifiy some option,
and because you did not, it may have placed a wrong parameter somewhere, or
used the wrong
version of some module.
I don't really now, this is just speculation.  But obviously there is
something wrong with
the way your Service is defined.

Or is there a better way of

installing Tomcat?



If all you want is to run Tomcat as a Service, then yes there is an easier
way : download
the installer version from the Tomcat website, and run it.

I am a bit unfamiliar with the SERVICE.BAT file, but I would guess that it
can also be run
to uninstall the Service that you have already installed now.  If it does
offer that, then
run the SERVICE.BAT uninstall first, and then run the installer that
you downloaded.
You can install it in the same directory as before, and it will just
overwrite some files.

As others have testified before, the installer version works fine and does
the right thing
automatically.

Note that the installer version does not install all the files which are
contained in
the zip version, only the subset of them needed to run the Service version.
It does not
for example install the BAT files, since they are not needed to run the
Service.




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



Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Michal Botka
When an application stores an object into the session and then the
application is reloaded using Tomcat Web Application Manager, the
classloader cannot be garbage collected. As a result, the
OutOfMemoryError: PermGen space error occurs after several reloads.

To illustrate the issue, you can find an example below.
Thanks in advance :-)


1. The EvilClass class whose instances are stored into the session:

public class EvilClass implements Serializable {

// Eat 100 MB from the JVM heap to see that the class is not
garbage collected
protected static final byte[] MEM = new byte[100  20];

private String value;

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

}


2. Servlet which stores EvilClass instances into session

public class TestServlet extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
EvilClass obj = new EvilClass();
obj.setValue(req.getRequestURI());
req.getSession().setAttribute(test, obj);
getServletContext().log(Attribute stored to session  + obj);
}

}


3. web.xml part which maps the servlet to an URL

servlet
servlet-nameTestServlet/servlet-name
servlet-classtest.TestServlet/servlet-class
/servlet
servlet-mapping
servlet-nameTestServlet/servlet-name
url-pattern/*/url-pattern
/servlet-mapping


Steps to reproduce the issue:
1. Copy application WAR to the webapps directory.
2. Start Apache Tomcat.
3. Hit TestServlet.
4. Check Heap/PermGen size using Java VisualVM.
5. Reload the application thru Tomcat Web Application Manager.
6. Hit TestServlet again.
7. Perform GC and check Heap/PermGen size again.


Environment:
Apache Tomcat version: 7.0.50
OS: Windows 7 64
JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
Java: version 1.7.0_10, vendor Oracle Corporation


Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread David Kerber

On 2/6/2014 3:13 PM, Michal Botka wrote:

When an application stores an object into the session and then the
application is reloaded using Tomcat Web Application Manager, the
classloader cannot be garbage collected. As a result, the
OutOfMemoryError: PermGen space error occurs after several reloads.


This is true.  What is your question?




To illustrate the issue, you can find an example below.
Thanks in advance :-)


1. The EvilClass class whose instances are stored into the session:

public class EvilClass implements Serializable {

 // Eat 100 MB from the JVM heap to see that the class is not
garbage collected
 protected static final byte[] MEM = new byte[100  20];

 private String value;

 public String getValue() {
 return value;
 }

 public void setValue(String value) {
 this.value = value;
 }

}


2. Servlet which stores EvilClass instances into session

public class TestServlet extends HttpServlet {

 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
 EvilClass obj = new EvilClass();
 obj.setValue(req.getRequestURI());
 req.getSession().setAttribute(test, obj);
 getServletContext().log(Attribute stored to session  + obj);
 }

}


3. web.xml part which maps the servlet to an URL

servlet
servlet-nameTestServlet/servlet-name
servlet-classtest.TestServlet/servlet-class
/servlet
servlet-mapping
servlet-nameTestServlet/servlet-name
url-pattern/*/url-pattern
/servlet-mapping


Steps to reproduce the issue:
1. Copy application WAR to the webapps directory.
2. Start Apache Tomcat.
3. Hit TestServlet.
4. Check Heap/PermGen size using Java VisualVM.
5. Reload the application thru Tomcat Web Application Manager.
6. Hit TestServlet again.
7. Perform GC and check Heap/PermGen size again.


Environment:
Apache Tomcat version: 7.0.50
OS: Windows 7 64
JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
Java: version 1.7.0_10, vendor Oracle Corporation




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



Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread javier_espana
That did it.  It works fine now.

Thank you very much Thomas

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***





From:   Mark Thomas ma...@apache.org
To: Tomcat Users List users@tomcat.apache.org,
Date:   02/06/2014 11:57 AM
Subject:Re: unable to start Tomcat through the Windows Services panel



On 06/02/2014 19:51, javier_esp...@hna.honda.com wrote:
 In some other part of the documentation it says to
 download the binary version and expand it in its own directory, which I
 did, but I can not find a Windows program that will install it and set it
 up as a service.

Try the download page:
http://tomcat.apache.org/download-70.cgi

Then look for the 32-bit/64-bit Windows Service Installer

Is it really that hard to find?

Mark


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




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



RE: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Hyde, Howard
Javier,
Thank you for being my guinea pig today.  I've been having all the same 
problems as you, on the same day, with the same resolution. Following this 
thread finally seems to have provided the breakthrough.
-Howard

-Original Message-
From: javier_esp...@hna.honda.com [mailto:javier_esp...@hna.honda.com] 
Sent: Thursday, February 06, 2014 2:12 PM
To: Tomcat Users List
Subject: Re: unable to start Tomcat through the Windows Services panel

That did it.  It works fine now.

Thank you very much Thomas

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***



--
This message, and any attachments, is for the intended recipient(s) only, may 
contain information that is privileged, confidential and/or proprietary and 
subject to important terms and conditions available at 
http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended 
recipient, please delete this message.

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



RE: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread javier_espana
Oh good.  I am glad that I was not alone.

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***





From:   Hyde, Howard howard.h...@bankofamerica.com
To: Tomcat Users List users@tomcat.apache.org,
Date:   02/06/2014 02:27 PM
Subject:RE: unable to start Tomcat through the Windows Services panel



Javier,
Thank you for being my guinea pig today.  I've been having all the same
problems as you, on the same day, with the same resolution. Following this
thread finally seems to have provided the breakthrough.
-Howard

-Original Message-
From: javier_esp...@hna.honda.com [mailto:javier_esp...@hna.honda.com]
Sent: Thursday, February 06, 2014 2:12 PM
To: Tomcat Users List
Subject: Re: unable to start Tomcat through the Windows Services panel

That did it.  It works fine now.

Thank you very much Thomas

Javier España
Sr. Technical Analyst
Honda North American Services, LLC.
Information Services Division
ISD Applications
1919 Torrance Blvd.,
Torrance, CA 90501
(310) 781-4514
Email: javier_esp...@hna.honda.com
www.honda.com

***Beginning April 1, 2013 my email changed to javier_esp...@hna.honda.com.
Please update your contact information.
Thank you.***



--
This message, and any attachments, is for the intended recipient(s) only,
may contain information that is privileged, confidential and/or proprietary
and subject to important terms and conditions available at
http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended
recipient, please delete this message.

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




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



Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Leon Rosenberg
On Thu, Feb 6, 2014 at 11:58 PM, David Kerber dcker...@verizon.net wrote:

 On 2/6/2014 3:13 PM, Michal Botka wrote:

 When an application stores an object into the session and then the
 application is reloaded using Tomcat Web Application Manager, the
 classloader cannot be garbage collected. As a result, the
 OutOfMemoryError: PermGen space error occurs after several reloads.


 This is true.  What is your question?


I think the OP states, that this shouldn't be the case.

Personally I'm struggling with this one. But since I don't use the
reloading anyway I will relax and wait for enlightenment that is sure to
come from Chuck ;-)

regards
Leon


RE: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Caldarale, Charles R
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] 
 Subject: Re: Tomcat classloader memory leak when an object is stored into 
 session

  When an application stores an object into the session and then the
  application is reloaded using Tomcat Web Application Manager, the
  classloader cannot be garbage collected. As a result, the
  OutOfMemoryError: PermGen space error occurs after several reloads.

 I think the OP states, that this shouldn't be the case.

 Personally I'm struggling with this one. But since I don't use the
 reloading anyway I will relax and wait for enlightenment that is sure to
 come from Chuck ;-)

Since you insist...

Start with the Wiki:
http://wiki.apache.org/tomcat/MemoryLeakProtection

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Leon Rosenberg
On Fri, Feb 7, 2014 at 12:45 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com]
  Subject: Re: Tomcat classloader memory leak when an object is stored
 into session

   When an application stores an object into the session and then the
   application is reloaded using Tomcat Web Application Manager, the
   classloader cannot be garbage collected. As a result, the
   OutOfMemoryError: PermGen space error occurs after several reloads.

  I think the OP states, that this shouldn't be the case.

  Personally I'm struggling with this one. But since I don't use the
  reloading anyway I will relax and wait for enlightenment that is sure to
  come from Chuck ;-)

 Since you insist...


Thank you!
I knew we can always count on you (now seriously) ;-)

best regards
Leon



 Start with the Wiki:
 http://wiki.apache.org/tomcat/MemoryLeakProtection

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail and
 its attachments from all computers.


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




Re: Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext for tomcat 7.0.50

2014-02-06 Thread Kiran Badi
I had a missing jars in lib for this version of tomcat. Once added java
mail api jars, it started to work again.




On Thu, Feb 6, 2014 at 4:28 AM, Shivam Mishra shmishra...@gmail.com wrote:

 2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
 06-Feb-2014 14:50:34.636 INFO [main]
 org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
 Tomcat Native library which allows optimal performance in production
 environments was not found on the java.library.path: C:\Program
 Files\Apache Software Foundation\Tomcat
 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
 Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
 (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS

 Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
 MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program
 Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
 Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
 Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
 Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
 Engine Components\IPT;C:\Program

 Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
 Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
 06-Feb-2014 14:50:35.189 INFO [main]
 org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:35.245 INFO [main]
 org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
 selector for servlet write/read
 06-Feb-2014 14:50:35.251 INFO [main]
 org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:35.258 INFO [main]
 org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
 selector for servlet write/read
 06-Feb-2014 14:50:35.258 INFO [main]
 org.apache.catalina.startup.Catalina.load Initialization processed in 1511
 ms
 06-Feb-2014 14:50:35.348 INFO [main]
 org.apache.catalina.core.StandardService.startInternal Starting service
 Catalina
 06-Feb-2014 14:50:35.349 INFO [main]
 org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
 Engine: Apache Tomcat/8.0.1
 06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\docs
 06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\examples
 06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\manager
 06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\name
 06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
 org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
 application directory C:\Program Files\Apache Software Foundation\Tomcat
 8.0\webapps\ROOT
 06-Feb-2014 14:50:38.100 INFO [main]
 org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:38.115 INFO [main]
 org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:38.120 INFO [main]
 org.apache.catalina.startup.Catalina.start Server startup in 2861 ms



 On Thu, Feb 6, 2014 at 2:37 PM, Mark Thomas ma...@apache.org wrote:

  On 06/02/2014 03:32, Kiran Badi wrote:
   Hi All,
  
   I have 3 tomcats installed in my machine, one is 7.0.27, 7.0.35 and
  7.0.50
  
   Now when I deploy my war file to 7.0.27/7.0.35 it works perfectly fine
  and
   deployment goes through.
  
   But on 7.0.50 it fails with below message,
  
   FAIL - Application at context path /myapp could not be started
  
   FAIL - Encountered exception org.apache.catalina.LifecycleException:
   Failed to start component
  
 
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
  
   In catalina logs I see below message,
  
   eb 05, 2014 10:22:21 PM org.apache.catalina.deploy.NamingResources
  cleanUp
   WARNING: Failed to retrieve JNDI naming context for container
  
 
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
   so no cleanup was performed for that container
 
  This is just a warning from when Tomcat was trying to shut down the
  already broken web application. You need to look earlier in the logs to
  find out why it 

Re: retain context.xml across war updates

2014-02-06 Thread Jesse Barnum
Thanks, that explains why it's not working for me (I have 7.0.35).

--Jesse Barnum, President, 360Works
http://www.360works.com
Product updates and news on http://facebook.com/360Works
(770) 234-9293
== Don't lose your data! http://360works.com/safetynet/ for FileMaker Server ==

On Feb 6, 2014, at 1:54 PM, Mark Thomas ma...@apache.org wrote:

 On 06/02/2014 18:22, Jesse Barnum wrote:
 Mark, which version of Tomcat 7 implemented the behavior described in that 
 document?
 
 Strictly, 7.0.48 but that wasn't released. 7.0.50 is the first release
 with that behaviour. The 8.0.x releases behave that way as well (some of
 the early RCs may not).
 
 Mark
 
 
 
 --Jesse Barnum, President, 360Works
 http://www.360works.com
 Product updates and news on http://facebook.com/360Works
 (770) 234-9293
 == Don't lose your data! http://360works.com/safetynet/ for FileMaker Server 
 ==
 
 On Feb 6, 2014, at 1:02 PM, Mark Thomas ma...@apache.org wrote:
 
 On 06/02/2014 17:55, Steve Lopez wrote:
 Is there a way to ensure an applications context.xml isn't deleted across 
 reloads of the war file?We have server-specific settings in each 
 context.xml and are looking for a way to deploy the same WAR file across 
 each Tomcat instance.
 
 My first attempt at this was to put the context.xml into ~ catalina 
 /conf/Catalina/localhost/ROOT.xml.   However, Tomcat deletes the file when 
 the app is unloaded.
 
 Is there a setting to tell Tomcat *not* to delete the context.xml in 
 ~catalina/conf/Catalina/[host]/[app]?   If not, what is the 'best 
 practice' for providing configuration settings to each Tomcat while also 
 enabling a simple continuous integration and deployment of WAR files for 
 an application across multiple Tc instances.  Creating custom war 
 files (one for each server) seems brittle and risky if the wrong war is 
 accidentally deployed on the wrong server.
 
 Specifically, context.xml contains custom settings for 
 memcached-session-manager which specifies the primary and fallback 
 memcache host.  These would be different for each server when using sticky 
 sessions.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html
 
 HTH,
 
 Mark
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



Tomcat JNDI Datasource

2014-02-06 Thread David Newman
I have defined a JNDI JDBC datasource as a resource in the global
context.xml file.  I was under the impression that what this does is to
create a shared connection pool that is tomcat wide.  But in practice what
seems to happen is that a new instance of that connection pool is created
for each context that is running in the container.  For example, if I have
6 web applications deployed I end up with 60 connections to my database,
assuming the default initialSize parameter of 10.

Is there a way to have a single connection pool that is shared amongst
deployed applications?

In case it is relevant this is tomcat 7.0.19 using the tomcat connection
pool.

Thanks
-Dave


Re: Tomcat JNDI Datasource

2014-02-06 Thread Filip Hanik
Yes, define the connection pool in server.xml, GlobalNamingResources then
in context.xml define a ContextLink That binds the shared connection pool
to each context.



On Thursday, February 6, 2014, David Newman dnew...@unixmonkeys.com wrote:

 I have defined a JNDI JDBC datasource as a resource in the global
 context.xml file.  I was under the impression that what this does is to
 create a shared connection pool that is tomcat wide.  But in practice what
 seems to happen is that a new instance of that connection pool is created
 for each context that is running in the container.  For example, if I have
 6 web applications deployed I end up with 60 connections to my database,
 assuming the default initialSize parameter of 10.

 Is there a way to have a single connection pool that is shared amongst
 deployed applications?

 In case it is relevant this is tomcat 7.0.19 using the tomcat connection
 pool.

 Thanks
 -Dave



Re: Http Status 404

2014-02-06 Thread Shivam Mishra
I did not make the TestServlet class public .


On Fri, Feb 7, 2014 at 12:05 AM, David kerber dcker...@verizon.net wrote:

 On 2/6/2014 1:05 PM, Shivam Mishra wrote:

 Its running thank you very much ...


 Can you tell us what the trouble was, so other people with the same issue
 can learn from it?







 On Thu, Feb 6, 2014 at 11:24 PM, Tim Watts t...@cliftonfarm.org wrote:

  On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:

 Now my browser is showing this error as below:

 Exception report

 *message* *Error instantiating servlet class TestServlet*

 *description* *The server encountered an internal error that prevented
 it
 from fulfilling this request.*

 *exception*

 javax.servlet.ServletException: Error instantiating servlet class

 TestServlet


  org.apache.catalina.authenticator.AuthenticatorBase.invoke(
 AuthenticatorBase.java:503)


  org.apache.catalina.valves.ErrorReportValve.invoke(
 ErrorReportValve.java:74)


  org.apache.catalina.valves.AbstractAccessLogValve.invoke(
 AbstractAccessLogValve.java:610)


  org.apache.catalina.connector.CoyoteAdapter.service(
 CoyoteAdapter.java:509)


  org.apache.coyote.http11.AbstractHttp11Processor.process(
 AbstractHttp11Processor.java:1015)


  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
 process(AbstractProtocol.java:651)


  org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.
 process(Http11NioProtocol.java:222)


  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
 doRun(NioEndpoint.java:1575)


  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
 run(NioEndpoint.java:1533)

java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
 Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
 Source)
java.lang.Thread.run(Unknown Source)

 *root cause*

 java.lang.IllegalAccessException: Class
 org.apache.catalina.core.DefaultInstanceManager can not access a
 member of class TestServlet with modifiers 


 You probably didn't declare it as 'public class ...'.  If that's not the
 case perhaps you could post the source.

 (Just a gentle pre-emptive reminder: This list is run by volunteers to
 help folks with their Tomcat problems, not to teach basic Java or
 Servlet coding.)


 sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
java.lang.Class.newInstance(Unknown Source)

  org.apache.catalina.authenticator.AuthenticatorBase.invoke(
 AuthenticatorBase.java:503)


  org.apache.catalina.valves.ErrorReportValve.invoke(
 ErrorReportValve.java:74)


  org.apache.catalina.valves.AbstractAccessLogValve.invoke(
 AbstractAccessLogValve.java:610)


  org.apache.catalina.connector.CoyoteAdapter.service(
 CoyoteAdapter.java:509)


  org.apache.coyote.http11.AbstractHttp11Processor.process(
 AbstractHttp11Processor.java:1015)


  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
 process(AbstractProtocol.java:651)


  org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.
 process(Http11NioProtocol.java:222)


  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
 doRun(NioEndpoint.java:1575)


  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
 run(NioEndpoint.java:1533)

java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
 Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
 Source)
java.lang.Thread.run(Unknown Source)



 On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra shmishra...@gmail.com
 wrote:

  My url is http://localhost:8080/name/TestServlet


 On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts t...@cliftonfarm.org

 wrote:


  On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:

 My directory structure is C:\Program Files\Apache Software
 Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file

 of

 Servlet


 That last part should be ...\WEB-INF\classes (lower case 'c').  If

 that

 doesn't fix it then, again I ask, what URL are you using to access the
 app?


  Description of my logs is below
 06-Feb-2014 14:50:22.684 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:22.742 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
 [ajp-nio-8009]
 06-Feb-2014 14:50:22.793 INFO [Thread-9]
 org.apache.catalina.core.StandardService.stopInternal Stopping

 service

 Catalina
 06-Feb-2014 14:50:22.912 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
 [http-nio-8080]
 06-Feb-2014 14:50:22.916 INFO [Thread-9]
 org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
 [ajp-nio-8009]

 2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
 06-Feb-2014 14:50:34.636 INFO [main]
 org.apache.catalina.core.AprLifecycleListener.init The APR based

 Apache

 Tomcat Native library which allows optimal performance in production
 environments was not found on the java.library.path: C:\Program
 Files\Apache Software Foundation\Tomcat


  

What is the best connector configuration for thousands of mostly idle users?

2014-02-06 Thread Jesse Barnum
Problem summary:
My nio polling threads are using too much CPU time.

Application overview:
My application has from 1,300 - 4,000 users connected at any given time. Each 
user sends about 200 bytes, then waits 30 seconds, then sends about 200 bytes, 
and this just loops for each user.
Each user connects with SSL, and we use a long keepalive to ensure that the 
HTTP connection doesn't close, so that we don't have to renegotiate SSL.

Configuration:
Ubuntu 12.0.4 with Tomcat 7.0.35, 1.75 gigs of RAM.

We are using Apache with SSL and mod_proxy_ajp to forward requests to Tomcat. 
It has MPM module enabled, with 500 ThreadsPerChild, so we typically have from 
3-9 Apache instances running.

 IfModule mpm_worker_module
 ServerLimit 12
 ThreadLimit 1000
 
 StartServers 1 
 MinSpareThreads  25
 MaxRequestsPerChild 0
 MaxSpareThreads 500
 ThreadsPerChild 500
 MaxClients  5000
 /IfModule
 


 ProxyPass /WSMRegister ajp://localhost:8009/WSMRegister

We are using the AJP NIO connector on port 8009 on Tomcat with 15 worker 
threads:

 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector port=8009 
 protocol=org.apache.coyote.ajp.AjpNioProtocol 
 redirectPort=8443
 minSpareThreads=1 
 maxThreads=15 
 scheme=https
 secure=true
 URIDecoding=UTF-8
 proxyName=secure2.360works.com
 proxyPort=443 /

Problem detail:
lsof is currently showing 564 open sockets between Apache and Tomcat on port 
8009, with 1,352 users connected to Apache.
The two threads consuming the most CPU time in Tomcat are 
NioBlockingSelector.BlockPoller-2 / 15 and ajp-nio-8009-ClientPoller-0 / 
25. Between them, they are taking 20% of all CPU time for the Tomcat process. 
I get a few times a day when our monitoring software reports slow response 
times, and I'd like to solve this.

Some guesses at solutions:
I'm guessing that the high CPU usage is because they are polling all 564 open 
sockets constantly? Would it make sense to reduce the number of open sockets? I 
didn't configure any maximum and I don't know how to reduce this number. I'm 
also concerned that reducing that might negate any benefits by increasing the 
number of sockets opening and closing between ajp_mod_proxy and the NIO AJP 
connector.

Maybe it's already running at optimal performance and I just need to throw 
hardware at it, but it seems like a solvable problem, because the actual worker 
threads are not doing much at all.

--Jesse Barnum, President, 360Works
http://www.360works.com
Product updates and news on http://facebook.com/360Works
(770) 234-9293
== Don't lose your data! http://360works.com/safetynet/ for FileMaker Server ==


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



SSL with Form Fallback on Tomcat 7 or 8

2014-02-06 Thread Gary Briggs
Evening,

I've been reading this page: http://wiki.apache.org/tomcat/SSLWithFORMFallback
I'm currently using Tomcat 7 on Linux. In short, Neither of the bits
of code linked on that page work for me but the thing described in the
title is what I desire.

I have client certificate authentication working fully within my needs,
but I'm looking for a fallback so I can support allow users without one of
the appropriate smart cards being able to get in. BasicAuth would also
be fine for this project, although I'd much rather it were a form.

Additionally, I'm unclear on what the purpose of optional is on the
clientAuth parameter of a Connector,if it's not for the purpose of
some other fallback authentication mechanism to work. Maybe it's just
implemented because it's integral to the TLS implementation?

Another option is to configure the trust store appropriately, then
self-sign certificates and pass them out. That's still a little hostile
to the users that don't have smartcards in the first place; I have my
Realm hitting up an LDAP server with a username-pass tuple that
non-smartcard-wielding users already have an account on.

Any suggestions or direction would be greatly appreciated; fundamentally,
I have an app, using container security to keep it safe. Most users
will use smartcards to secure a client cert TLS, but not all users have
those smartcards.

Cheers,
Gary

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



Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Michal Botka
Is there a way how to avoid this leak?
I would like to develop an application which can be safely
deployed/undeployed without restarting the server.
OK, now I know that my application cannot store it's objects into
session, but that is very strong requirement which the most of the
applications don't meet.
Thanks for help.

2014-02-06 22:58 GMT+01:00 David Kerber dcker...@verizon.net:
 On 2/6/2014 3:13 PM, Michal Botka wrote:

 When an application stores an object into the session and then the
 application is reloaded using Tomcat Web Application Manager, the
 classloader cannot be garbage collected. As a result, the
 OutOfMemoryError: PermGen space error occurs after several reloads.


 This is true.  What is your question?




 To illustrate the issue, you can find an example below.
 Thanks in advance :-)


 1. The EvilClass class whose instances are stored into the session:

 public class EvilClass implements Serializable {

  // Eat 100 MB from the JVM heap to see that the class is not
 garbage collected
  protected static final byte[] MEM = new byte[100  20];

  private String value;

  public String getValue() {
  return value;
  }

  public void setValue(String value) {
  this.value = value;
  }

 }


 2. Servlet which stores EvilClass instances into session

 public class TestServlet extends HttpServlet {

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse
 resp) throws ServletException, IOException {
  EvilClass obj = new EvilClass();
  obj.setValue(req.getRequestURI());
  req.getSession().setAttribute(test, obj);
  getServletContext().log(Attribute stored to session  + obj);
  }

 }


 3. web.xml part which maps the servlet to an URL

 servlet
 servlet-nameTestServlet/servlet-name
 servlet-classtest.TestServlet/servlet-class
 /servlet
 servlet-mapping
 servlet-nameTestServlet/servlet-name
 url-pattern/*/url-pattern
 /servlet-mapping


 Steps to reproduce the issue:
 1. Copy application WAR to the webapps directory.
 2. Start Apache Tomcat.
 3. Hit TestServlet.
 4. Check Heap/PermGen size using Java VisualVM.
 5. Reload the application thru Tomcat Web Application Manager.
 6. Hit TestServlet again.
 7. Perform GC and check Heap/PermGen size again.


 Environment:
 Apache Tomcat version: 7.0.50
 OS: Windows 7 64
 JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
 Java: version 1.7.0_10, vendor Oracle Corporation



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


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



Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Leon Rosenberg
On Fri, Feb 7, 2014 at 8:38 AM, Michal Botka mr.bo...@gmail.com wrote:

 Is there a way how to avoid this leak?
 I would like to develop an application which can be safely
 deployed/undeployed without restarting the server.
 OK, now I know that my application cannot store it's objects into
 session, but that is very strong requirement which the most of the
 applications don't meet.
 Thanks for help.


But do you have to serialize your sessions? Switching off session
serialization might help.
regards
Leon



 2014-02-06 22:58 GMT+01:00 David Kerber dcker...@verizon.net:
  On 2/6/2014 3:13 PM, Michal Botka wrote:
 
  When an application stores an object into the session and then the
  application is reloaded using Tomcat Web Application Manager, the
  classloader cannot be garbage collected. As a result, the
  OutOfMemoryError: PermGen space error occurs after several reloads.
 
 
  This is true.  What is your question?
 
 
 
 
  To illustrate the issue, you can find an example below.
  Thanks in advance :-)
 
 
  1. The EvilClass class whose instances are stored into the session:
 
  public class EvilClass implements Serializable {
 
   // Eat 100 MB from the JVM heap to see that the class is not
  garbage collected
   protected static final byte[] MEM = new byte[100  20];
 
   private String value;
 
   public String getValue() {
   return value;
   }
 
   public void setValue(String value) {
   this.value = value;
   }
 
  }
 
 
  2. Servlet which stores EvilClass instances into session
 
  public class TestServlet extends HttpServlet {
 
   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse
  resp) throws ServletException, IOException {
   EvilClass obj = new EvilClass();
   obj.setValue(req.getRequestURI());
   req.getSession().setAttribute(test, obj);
   getServletContext().log(Attribute stored to session  + obj);
   }
 
  }
 
 
  3. web.xml part which maps the servlet to an URL
 
  servlet
  servlet-nameTestServlet/servlet-name
  servlet-classtest.TestServlet/servlet-class
  /servlet
  servlet-mapping
  servlet-nameTestServlet/servlet-name
  url-pattern/*/url-pattern
  /servlet-mapping
 
 
  Steps to reproduce the issue:
  1. Copy application WAR to the webapps directory.
  2. Start Apache Tomcat.
  3. Hit TestServlet.
  4. Check Heap/PermGen size using Java VisualVM.
  5. Reload the application thru Tomcat Web Application Manager.
  6. Hit TestServlet again.
  7. Perform GC and check Heap/PermGen size again.
 
 
  Environment:
  Apache Tomcat version: 7.0.50
  OS: Windows 7 64
  JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
  Java: version 1.7.0_10, vendor Oracle Corporation
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 

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




Re: What is the best connector configuration for thousands of mostly idle users?

2014-02-06 Thread Mark Thomas
Jesse Barnum jsb_tom...@360works.com wrote:

Thanks for such a well written question. All the relevant information is 
available and presented clearly and logically.

Problem summary:
My nio polling threads are using too much CPU time.

Are you sure that is the real problem? It sounds like the occasional slowness 
is the problem and the polling threads are the suspected - emphasis on the 
suspected - root cause.

Application overview:
My application has from 1,300 - 4,000 users connected at any given
time. Each user sends about 200 bytes, then waits 30 seconds, then
sends about 200 bytes, and this just loops for each user.
Each user connects with SSL, and we use a long keepalive to ensure that
the HTTP connection doesn't close, so that we don't have to renegotiate
SSL.

How long should the application take to process those 200 bytes? I'm wondering 
what the peak number of concurrent requests, rather than connections, might be.

Configuration:
Ubuntu 12.0.4 with Tomcat 7.0.35, 1.75 gigs of RAM.

We are using Apache with SSL and mod_proxy_ajp to forward requests to
Tomcat. It has MPM module enabled, with 500 ThreadsPerChild, so we
typically have from 3-9 Apache instances running.

 IfModule mpm_worker_module
 ServerLimit 12
 ThreadLimit 1000
 
 StartServers 1 
 MinSpareThreads  25
 MaxRequestsPerChild 0
 MaxSpareThreads 500
 ThreadsPerChild 500
 MaxClients  5000
 /IfModule
 


 ProxyPass /WSMRegister ajp://localhost:8009/WSMRegister

We are using the AJP NIO connector on port 8009 on Tomcat with 15
worker threads:

 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector port=8009 
 protocol=org.apache.coyote.ajp.AjpNioProtocol 
 redirectPort=8443
 minSpareThreads=1 
 maxThreads=15 
 scheme=https
 secure=true
 URIDecoding=UTF-8
 proxyName=secure2.360works.com
 proxyPort=443 /

Problem detail:
lsof is currently showing 564 open sockets between Apache and Tomcat on
port 8009, with 1,352 users connected to Apache.
The two threads consuming the most CPU time in Tomcat are
NioBlockingSelector.BlockPoller-2 / 15 and
ajp-nio-8009-ClientPoller-0 / 25. Between them, they are taking 20%
of all CPU time for the Tomcat process. I get a few times a day when
our monitoring software reports slow response times, and I'd like to
solve this.

How much actual processor time are those threads taking? The 20% is only 
relative and it would be helpful to know what it is relative to.

Do you have access logs available for those times? The number of concurrent 
requests would be a useful number. When working that out you need to be sure if 
the time in the access log is the time the request started or the time it 
finished.

Some guesses at solutions:
I'm guessing that the high CPU usage is because they are polling all
564 open sockets constantly? Would it make sense to reduce the number
of open sockets? I didn't configure any maximum and I don't know how to
reduce this number. I'm also concerned that reducing that might negate
any benefits by increasing the number of sockets opening and closing
between ajp_mod_proxy and the NIO AJP connector.

Some rough numbers.
With a peak of 9 httpd children with 500 threads each - assume at least 4000 
connected clients.
With a request every 30 seconds that is roughly 133 requests a second assuming 
they are perfectly evenly distributed which they won't be.
With 15 worker threads on Tomcat each one will be handling roughly 9 requests a 
second, again assuming even distribution.
That means a request has about 110ms to complete or you run the risk of running 
out of threads. This includes the time to process the request and a little 
overhead for Tomcat to recycle the thread.
I wouldn't be surprised for peak loads to be at least 2-3 times higher due to 
the uneven distribution of requests in time. That means requests have more like 
35-40ms to complete.

I suspect that you are running out of worker threads on the Tomcat side. 
Increasing it from 15 to 30 wouldn't do any harm.

Of course, this is just guess work. You'd need to look at your access logs to 
be sure.

Maybe it's already running at optimal performance and I just need to
throw hardware at it, but it seems like a solvable problem, because the
actual worker threads are not doing much at all.

I agree it sounds like configuration at this point.

Mark


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



Re: Tomcat classloader memory leak when an object is stored into session

2014-02-06 Thread Mark Thomas
Michal Botka mr.bo...@gmail.com wrote:
Is there a way how to avoid this leak?
I would like to develop an application which can be safely
deployed/undeployed without restarting the server.
OK, now I know that my application cannot store it's objects into
session, but that is very strong requirement which the most of the
applications don't meet.

The leak, as described, should not happen.

The sessions are serialized to disk. That disconnects the objects in the 
session from the web application class loader. When they are deseralized it 
will be with the class loader of the new web application.

Therefore, objects in the session should not be retaining references to the old 
web application class loader.

I need to run through the provided test case to see if there is something going 
wrong but at this point I strongly suspect that the source of the leak is 
something else entirely (most likely a leak in a 3rd party library or possibly 
an application bug).

Mark


Thanks for help.

2014-02-06 22:58 GMT+01:00 David Kerber dcker...@verizon.net:
 On 2/6/2014 3:13 PM, Michal Botka wrote:

 When an application stores an object into the session and then the
 application is reloaded using Tomcat Web Application Manager, the
 classloader cannot be garbage collected. As a result, the
 OutOfMemoryError: PermGen space error occurs after several
reloads.


 This is true.  What is your question?




 To illustrate the issue, you can find an example below.
 Thanks in advance :-)


 1. The EvilClass class whose instances are stored into the session:

 public class EvilClass implements Serializable {

  // Eat 100 MB from the JVM heap to see that the class is not
 garbage collected
  protected static final byte[] MEM = new byte[100  20];

  private String value;

  public String getValue() {
  return value;
  }

  public void setValue(String value) {
  this.value = value;
  }

 }


 2. Servlet which stores EvilClass instances into session

 public class TestServlet extends HttpServlet {

  @Override
  protected void doGet(HttpServletRequest req,
HttpServletResponse
 resp) throws ServletException, IOException {
  EvilClass obj = new EvilClass();
  obj.setValue(req.getRequestURI());
  req.getSession().setAttribute(test, obj);
  getServletContext().log(Attribute stored to session  +
obj);
  }

 }


 3. web.xml part which maps the servlet to an URL

 servlet
 servlet-nameTestServlet/servlet-name
 servlet-classtest.TestServlet/servlet-class
 /servlet
 servlet-mapping
 servlet-nameTestServlet/servlet-name
 url-pattern/*/url-pattern
 /servlet-mapping


 Steps to reproduce the issue:
 1. Copy application WAR to the webapps directory.
 2. Start Apache Tomcat.
 3. Hit TestServlet.
 4. Check Heap/PermGen size using Java VisualVM.
 5. Reload the application thru Tomcat Web Application Manager.
 6. Hit TestServlet again.
 7. Perform GC and check Heap/PermGen size again.


 Environment:
 Apache Tomcat version: 7.0.50
 OS: Windows 7 64
 JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
 Java: version 1.7.0_10, vendor Oracle Corporation



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


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



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