Re: HttpServletResponse return plain text

2013-03-27 Thread Konstantin Kolinko
2013/3/28 Kevin Jenkins :
> I know this isn't the right mailing list but there's a lot
> of knowledgeable people here so I'd give it a shot.
>
> When I was hosting on Google App Engine the java servlet
> HttpServletResponse.sendError would return the 2nd parameter text in plain
> text.
>
> Now that I'm hosting on Tomcat it's putting the text inside an  body.
> I'd like to to return the text in plain text instead.
>
> This is my code:
> String resultStr = "Request " +  req.getRequestURI() + ": __developerId " +
> __developerId + " in use.";
> resp.getWriter().println(resultStr);
> resp.sendError(HttpServletResponse.SC_CONFLICT, resultStr);
>
> I tried this, but it still returned the text inside an HTML body.
>
> resp.setContentType("text/plain");
> String resultStr = "Request " +  req.getRequestURI() + ": __developerId " +
> __developerId + " in use.";
> resp.getWriter().println(resultStr);
> resp.sendError(HttpServletResponse.SC_CONFLICT);
>
> Anyone know how to do this?

sendError() clears response and triggers error page processing
You can specify your own page/servlet for this specific error code
with error-page element in your web.xml.

If you want to keep your message, just use "setStatus()" and return.
If you want to clear response before printing your message, call
ServletResponse.resetBuffer().

Beware that if you have user-provided data in your "text/plain"
response, I would recommend you to specify an explicit charset (e.g.
ISO-8859-1 in your case). If charset is not mentioned in Content-Type
header of an HTTP response, some browsers may start guessing and it
may lead to security issues.

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



Re: Apache Tomcat 7.0.035 and IPv6 environment

2013-03-27 Thread Geett Chanddra Singha
Thanks Konstantin Kolinko!

It will be great help for me if you could provide steps to configure the
same or documents, where in I could get configuration steps.

On Thu, Mar 28, 2013 at 10:56 AM, Konstantin Kolinko  wrote:

> 2013/3/28 Geett Chanddra Singha :
> > Hi All,
> >
> > I have a web application hosted on Apache Tomcat Version 7.0.035.
> > We are trying to make the web application run IPv6 environment.
> >
> > Environment Details
> > Windows 2008 server machine, 64-bit OS
> > Java version: JRE 1.7.x
> >
> > The home page of web application is not accessible using the IPv6
> address.
> > The connectivity to windows server machine goes though IPv6 address.
> >
> > Here is the Tomcat startup log details:
> >
> > Mar 28, 2013 10:21:47 AM org.apache.catalina.core.AprLifecycleListener
> init
> > INFO: Loaded APR based Apache Tomcat Native library 1.1.24 using APR
> > version 1.4
> > .6.
>
> APR connector cannot listen on both IPv4 and IPv6 addresses at the same
> time.
> You have to choose one (with address attribute).
>
> If you need both IPv4 and IPv6, configure 2 connectors.
>
> It has been discussed previously. Search the archives.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Thanks & Regards
Geett Chanddra Singha


Re: Apache Tomcat 7.0.035 and IPv6 environment

2013-03-27 Thread Konstantin Kolinko
2013/3/28 Geett Chanddra Singha :
> Hi All,
>
> I have a web application hosted on Apache Tomcat Version 7.0.035.
> We are trying to make the web application run IPv6 environment.
>
> Environment Details
> Windows 2008 server machine, 64-bit OS
> Java version: JRE 1.7.x
>
> The home page of web application is not accessible using the IPv6 address.
> The connectivity to windows server machine goes though IPv6 address.
>
> Here is the Tomcat startup log details:
>
> Mar 28, 2013 10:21:47 AM org.apache.catalina.core.AprLifecycleListener init
> INFO: Loaded APR based Apache Tomcat Native library 1.1.24 using APR
> version 1.4
> .6.

APR connector cannot listen on both IPv4 and IPv6 addresses at the same time.
You have to choose one (with address attribute).

If you need both IPv4 and IPv6, configure 2 connectors.

It has been discussed previously. Search the archives.

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



Apache Tomcat 7.0.035 and IPv6 environment

2013-03-27 Thread Geett Chanddra Singha
Hi All,

I have a web application hosted on Apache Tomcat Version 7.0.035.
We are trying to make the web application run IPv6 environment.

Environment Details
Windows 2008 server machine, 64-bit OS
Java version: JRE 1.7.x

The home page of web application is not accessible using the IPv6 address.
The connectivity to windows server machine goes though IPv6 address.

Here is the Tomcat startup log details:

Mar 28, 2013 10:21:47 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.24 using APR
version 1.4
.6.
Mar 28, 2013 10:21:47 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], ra
ndom [true].
Mar 28, 2013 10:21:48 AM org.apache.catalina.core.AprLifecycleListener
initializ
eSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012)
Mar 28, 2013 10:21:49 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-9080"]
Mar 28, 2013 10:21:49 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Mar 28, 2013 10:21:49 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3117 ms
Mar 28, 2013 10:21:49 AM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Catalina
Mar 28, 2013 10:21:49 AM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.35
Mar 28, 2013 10:21:49 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\Users\Administrator\Desktop\apache-
tomcat-7.0.35\webapps\docs
Mar 28, 2013 10:21:50 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\Users\Administrator\Desktop\apache-
tomcat-7.0.35\webapps\examples
Mar 28, 2013 10:21:51 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\Users\Administrator\Desktop\apache-
tomcat-7.0.35\webapps\host-manager
Mar 28, 2013 10:21:51 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\Users\Administrator\Desktop\apache-
tomcat-7.0.35\webapps\manager
Mar 28, 2013 10:21:51 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\Users\Administrator\Desktop\apache-
tomcat-7.0.35\webapps\ROOT
Mar 28, 2013 10:21:51 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-9080"]
Mar 28, 2013 10:21:51 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Mar 28, 2013 10:21:51 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2536 ms

Please help me to get solution for this.

-- 
Thanks & Regards
Geett Chanddra Singha


HttpServletResponse return plain text

2013-03-27 Thread Kevin Jenkins
I know this isn't the right mailing list but there's a lot
of knowledgeable people here so I'd give it a shot.

When I was hosting on Google App Engine the java servlet
HttpServletResponse.sendError would return the 2nd parameter text in plain
text.

Now that I'm hosting on Tomcat it's putting the text inside an  body.
I'd like to to return the text in plain text instead.

This is my code:
String resultStr = "Request " +  req.getRequestURI() + ": __developerId " +
__developerId + " in use.";
resp.getWriter().println(resultStr);
resp.sendError(HttpServletResponse.SC_CONFLICT, resultStr);

I tried this, but it still returned the text inside an HTML body.

resp.setContentType("text/plain");
String resultStr = "Request " +  req.getRequestURI() + ": __developerId " +
__developerId + " in use.";
resp.getWriter().println(resultStr);
resp.sendError(HttpServletResponse.SC_CONFLICT);

Anyone know how to do this?


Re: Can ClientAbortException be circumvented?

2013-03-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Thad,

On 3/27/13 5:20 PM, Thad Humphries wrote:
> On Tue, Mar 26, 2013 at 3:56 PM, Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
> Thad,
> 
> Coming a little late to the party...
> 
> On 3/24/13 4:30 PM, Thad Humphries wrote:
 I have a web-app that uses a servlet for downloading files
 from a repository--PDF, Office, images, zip, etc. It works
 with desktop browsers--IE, Firefox, Chrome, and Safari--on
 their various platforms. It also works fine with Firefox from
 Android (2.3 and 4.x tested). However when I try with
 Android's default WebKit browser, the servlet fails
 immediately with 
 org.apache.catalina.connector.ClientAbortException (so says
 the stderr log).
> 
> This smells like it might be a Range request issue. Is the client 
> sending a Range header along with the request? Are you respecting
> it?
> 
> 
>> I don't see a Range header from my servlet. Here's the request;
> 
>> GET 
>> /myapp/webclient/copyObjectServlet?tag=0oATVXQD1B_l4Vzpw9n1X1EeKIXTKk6d&name=grilled_romaine.doc
>>
>> 
HTTP/1.1
>> Host: 10.1.2.1:8080 Accept-Encoding: gzip Accept-Language: en-US 
>> x-wap-profile:
>> http://www.htcmms.com.tw/Android/Common/Ace/A9192-1.0.xml Cookie:
>> JSESSIONID=0AACB4E188B2B68605FE0189C007F7BB Accept-Charset:
>> utf-8, iso-8859-1, utf-16, *;q=0.7 Referer:
>> http://10.1.2.1:8080/myapp/?id=ipad&ref=267 Keep-Alive: 115 
>> User-Agent: Mozilla/5.0 (Linux; U; Android 2.3.5; en-us;
>> HTC-A9192/1.0 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko)
>> Version/4.0 Mobile Safari/533.1 x-att-deviceid: HTC-A9192/1.0 
>> Connection: keep-alive Accept: 
>> application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>
>>  Here's the response:
> 
>> HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Expires: 0 
>> Cache-Control: private Pragma: cache Content-Disposition:
>> attachment; filename="grilled_romaine.doc" Content-Type:
>> application/msword Content-Length: 12288 Date: Wed, 27 Mar 2013
>> 20:46:02 GMT

Hmm... and this particular request/response pair resulted in a
ClientAbortException?

Any idea how many bytes were sent before the exception?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRU24yAAoJEBzwKT+lPKRYYIgP/1ZFfJIPzFl11Vext7mvoxzk
GbzoEscoExWBXo98fcnIx9iq1VvIgPeZrcyR1Q0qDlSWkUlohi84neu8AdCM2jyo
EUTXXwwzEJlIOETngvReHR00FGC8mJohWVnZgv3rFVU8jBQhO9RlFpmTLOkncr0V
zxGYxzrbZ9UEU+/F45WQ3YqzbgJ6aoHJd6gMYttWemerrmuHq/s3MBIXxE2fGXnv
gVg+s6ij924TtB2O5TwYqLdbj/qPAKxqwgI7UyPEvsq1MW6LphcqSQwuw6UvBqxc
dZ8jJddHCv0BJ3Eha2GM8U2wWotLGLMBaWXd4vaE2oAinFn3WyJnhiHUDlzGFbyT
Z7KnS4dzpFtTC3PSxVJHFKP/tZfE4ew/LVHZiEEKjpGLu2NvVTFkXlQyQwzJSL64
O05Tbn/s35+w9pyQT+WFulTEtsJsd4k8bNffWllchm+Kqzcz0G9JhRQtX7e0pV6H
Pz23J9QqRaQremOPKTj0pkKtX02cm4p8C309fBkebCH0XzTka41ky1KUZWVfbuNt
sXF0KevaajylFE8rudrwXIY9/wySb29gNbSdlxSiAykhW91dqCWbC61QIiHBFyZ7
3lhpX1Yi4eCXcwM0FjXytxXELtMWSq9bPQ6thMHhQRNsT3A/XschaXRvxEaIkIM8
6YF/vNPRpTGgzBA/hGUC
=qTPr
-END PGP SIGNATURE-

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



Re: Can ClientAbortException be circumvented?

2013-03-27 Thread Thad Humphries
On Tue, Mar 26, 2013 at 3:56 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Thad,
>
> Coming a little late to the party...
>
> On 3/24/13 4:30 PM, Thad Humphries wrote:
> > I have a web-app that uses a servlet for downloading files from a
> > repository--PDF, Office, images, zip, etc. It works with desktop
> > browsers--IE, Firefox, Chrome, and Safari--on their various
> > platforms. It also works fine with Firefox from Android (2.3 and
> > 4.x tested). However when I try with Android's default WebKit
> > browser, the servlet fails immediately with
> > org.apache.catalina.connector.ClientAbortException (so says the
> > stderr log).
>
> This smells like it might be a Range request issue. Is the client
> sending a Range header along with the request? Are you respecting it?
>

I don't see a Range header from my servlet. Here's the request;

GET
/myapp/webclient/copyObjectServlet?tag=0oATVXQD1B_l4Vzpw9n1X1EeKIXTKk6d&name=grilled_romaine.doc
HTTP/1.1
Host: 10.1.2.1:8080
Accept-Encoding: gzip
Accept-Language: en-US
x-wap-profile: http://www.htcmms.com.tw/Android/Common/Ace/A9192-1.0.xml
Cookie: JSESSIONID=0AACB4E188B2B68605FE0189C007F7BB
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7
Referer: http://10.1.2.1:8080/myapp/?id=ipad&ref=267
Keep-Alive: 115
User-Agent: Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC-A9192/1.0
Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile
Safari/533.1
x-att-deviceid: HTC-A9192/1.0
Connection: keep-alive
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Here's the response:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Expires: 0
Cache-Control: private
Pragma: cache
Content-Disposition: attachment; filename="grilled_romaine.doc"
Content-Type: application/msword
Content-Length: 12288
Date: Wed, 27 Mar 2013 20:46:02 GMT


> I wouldn't be surprised if what's happening is that you are getting a
> Range request (maybe for the first few hundred bytes) and you are
> ignoring it, returning the entire file. Once the client gets enough
> bytes, it simply closes the connection and the rest of the bytes in
> transit fall on the floor.
>
> If the next request is for the last few hundred bytes (frequently,
> this will happen with ZIP and PDF files, since there is critical
> information at the /end/ of the file) and you return the whole file,
> the client may give up at any point (which IMO is silly) in the same way.
>
> > I suspect this is a problem with mobile WebKit, and that
> > circumventing the abort might be a "bad thing" even if it's
> > possible. However I thought I'd inquire here if there is a Tomcat
> > way around it. If not, it seems my alternatives are (1) use Java
> > Mail to mail the user the file, since mail apps open their
> > attachments; and (2) write iOS and Android apps file query and
> > downloading. Neither prospect thrills me.
>
> If the problem truly is Range-related, you may be able to alter your
> servlet to respect the Range request. Of primary benefit will be that
> you will (probably) be sending fewer bytes over the network, which can
> significantly improve performance. Obviously, the secondary benefit
> will be that you don't get these errors anymore.
>
> Of course, coping with Range requests is non-trivial. Be sure to read
> the RFPs very closely.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJRUf1zAAoJEBzwKT+lPKRYrUIQAITTszTQujDkBaKWTVVDlbB6
> xm3m2K6hQls4T743dTY4hGOSWrTPB3ovBpkkfgm1kGxJQsSsRhrD5t8+BhHIIpE7
> Iax24MBD4XTrvPzEuYlx3DSqx2JZK/iDfkffMfmg6Fq74/j3LoStZdTnmts2nQ0l
> BCi5jtU3TMTZdwkNpVMmEiwomY205QBXqAaIEcjs+BtOtvTQakL80XQS3F1FDaPz
> 315pW2cx9JqwWyjmA+5dqPY9zEQVO1JBou7fwMROO1BJ9wo74UxUFDGGETko6ODm
> 4TGd9QpU4Lwnbu9NrK7PxiEnbNGiUC8JGuADpr9lp/jrgg4PyMtFZIVRNUqX5Vkg
> YDnwZFYlcyfmXVa4xHtYogL+qdPb3E0DM+RFfaFy9ka2Q7gwvGVLpHYNancTCicd
> GkU7Hb4mUSZDyR7AAXfJoaLlHVODs2tue8zix8K8y02Rqb49Bc+YS1BB2WgqQSFC
> 0PJ+Z3kWHbZfiTUcz5ZT7SoQsgPtSuagI9SNBBBeFqn2zOdkNkJcgcQ4OKoqDt71
> g3ocpV2PaBtV0cDoL30DiNwy9byrsUKmjlF2b3oyHh4BfxO9UzKPGfd8kgMDg/X0
> Tq7SbPSBwkoOHUVyNCfzMicS4zz/octolUxCS+k+7kC4rqfz98Ke2t7003OLbRqc
> UOO6QgF6KV62ETx5zBve
> =mn1G
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v, 121-24


Re: Velocity Logging

2013-03-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Bruce,

On 3/27/13 10:16 AM, Bruce Pease wrote:
> I am using Wicket 1.4.22 with Tomcat 7.0.37 and JDK 1.6.0_33.  The
> recent upgrade to Tomcat created an issue where the cannot
> 
> be undeployed unless the app is shut down due to the Wicket
> dependency velocity logging in use (1.4).
> 
> 
> 
> We are running a web application under tomcat using the wicket
> framework.  A requirement for Wicket is the velocity libraries.
> The velocity framework is auto loading and writing to a log in the
> conf directory.  Since it is in use I am unable to undeploy the web
> application.  So, I am looking for a way to turn off the velocity
> logging.  Previous version of tomcat does not have this issue
> (7.0.26).

1. Wrong mailing list? (This is for Tomcat, maybe you want Velocity?)
2. Sounds like you are putting your Velocity and/or logging libraries
in a shared location.. is that the case? If so, stop doing that.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRUzyIAAoJEBzwKT+lPKRYVSUQAKVhSnphqObwNZ1ZIJ1hXYOq
t3obA4/yWgKsOjBNlih8bye4bszVLvw3ETXeD5znTax5Pl3R/h9Gv5t84xTQ468d
eyzXvde5G7JfAURk3Lh47smaEdAuNSg4dVlDO+1SzIzkxsKrOOOFvvf69LDUpouY
EWAt27OYfP5UdGqn+TN8TYok87qWhdzMwELvHhWIBq84zUYp4iIrla2CYwpzCje+
yUfi9Qysb/U9dcqSnfmTM2GYZw+KaP0NXZXjfUdNk5B6C1I5YuNoWtOrFZhtwKru
S2OWocAhzEG02JEW+qdcEu4QaPA3KmrvGPNjJ9KTZHOVfDAonMS6Zk6XCFsBdwWi
rP2wIvaPwVYMrkrQBBPaLBttpNPRVI+DRxcheNqWT5r3kiPOP8f8nY1dR7OwTq/x
bsTxej0B0beMz9yIMVmw3gIELMOceFz2ufyBOYWpXWH/hTNw7yWnfSvmLyLJyzp0
0DMBK3svg3ZOqoJq/VVe9e8yHyq1PaSA76k+vqUmcFhoo0gX+4YzQ3fKyTe+XYME
YKpuTxeagxmmx+nPe10QIaOxhxGL8iDfs7GCHAxsDQbiRgae0ViRSHbLBpRDLI40
Vhc2KDf0OItvKRsf2+tZMy0LUHKdfy33ZUHKOkXEMlaXbK6AcX3GS8jJ4JA7x5aq
hD4PWviP7S6ZVO6/7sYL
=cE0X
-END PGP SIGNATURE-

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



Re: AW: [tomcat 5.5.26] why are not all log4j.properties files parsed

2013-03-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Josef,

On 3/27/13 9:51 AM, Stadelmann Josef wrote:
> -Ursprüngliche Nachricht- Von: Christopher Schultz
> [mailto:ch...@christopherschultz.net]
>> 
>> I highly suspect that you have log4j.jar in either common/lib or 
>> shared/lib. In that case, your log4j will initialize only once, 
>> probably incorrectly.
> 
> +++ this is interessting. IA64-2>dir [.shared] Directory
> DKA3:[APACHE.JAKARTA.TOMCAT.shared] classes.DIR;1   lib.DIR;1 
> Total of 2 files. IA64-2>dir [.shared.classes] %DIRECT-W-NOFILES,
> no files found IA64-2>dir [.shared.lib] %DIRECT-W-NOFILES, no files
> found IA64-2>dir Directory DKA3:[APACHE.JAKARTA.TOMCAT.common] 
> classes.DIR;1   endorsed.DIR;1  endorsed^.tar.gz;1
> i18n.DIR;1 lib.DIR;1 Total of 5 files. IA64-2>

Oh, crap: you're using VMS. I'm sure VMS is great, but directory
listings are just incomprehensible garbage. Versioned files and
directories... *eyeroll*...

> we use this lib and classes directory in tomcat. it's here in lib
> where log4j.jar is IA64-2>dir [.lib]*log4j* Directory
> DKA3:[APACHE.JAKARTA.TOMCAT.common.lib] log4j-1^.2^.16.jar;1 Total
> of 1 file. IA64-2> +

Yeah, that'll do it: log4j is probably only being initialized once
because you have it in a shared location.

>> If you want to use log4j in each web application, you should put
>> a separate log4j.jar file in each webapp's WEB-INF/lib
>> directory.
> 
> +++ we have done that ! there is a minor mismatch as tomcat - the 
> oldest dir - has log4j-1.2.15.jarwhile the apps are all at 
> log4j.1.2.16.jar

It's not likely to matter.

> +++ note the observed behavior in parsing and later in logging is 
> different if we use 
> log4j.configuration=/path/to/tomcats/log4j.properties as JVM
> argument from within NetBeans when we start tomcat.

Right: if you specify that, then log4j.properties will be loaded from
a specific place. If you don't then log4j.properties will likely be
loaded from an arbitrary webapp's WEB-INF/classes directory.

>> Are you also trying to use log4j for /Tomcat/ logging? If so, you
>>  have to do that differently as well. I'm not sure how well it
>> works (or if at all) with Tomcat 5.5.
> 
> +++ yes - we really would like to do that

> in example I really need now HostCongig.java's log.debug to print
> out when tomcat lifecycle event does a Reloading Context /axis2
> ... causing us tremendous troubles at the moment. Maybe we'r
> hacked internally by some security folk.
??!

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRUzvKAAoJEBzwKT+lPKRY/WgQALcyZlbQzixsClMwD7ppyigI
4A1jMfRQGqRI99l7v6qbYfMXjGkI17OMY/TO42avSungIYDxJ0t+VBDgd3DO5WHK
1pPO4XMxhcCdHGGGLwNasB+Z9bbsDsMUam3Sb81z3wVIMV7T+Ag96LEEseVZxJne
TjSE+kmR2d5wQEtk+jHkcB/PZtuY3yt2HZVWSDgW2D08Z0N6eK0wrengFbYzRzwa
pF62hYHWBRlUKGZ0ZrZdsrIkvrtmpjg1espw2G7CqL7dn1vRR5AVLeo2gVuBb8OD
ryMxzY891e1sXWCMerFmpgIXEmeFOruYIAVF3C8IfSEgZZ29PCTQ7kv7VjAvRLhz
gsTkdu1ZbWf4Y/gTqYmjCxZsnl7askjf6vhY8AHkncomqDXdHLjjslW2roGkFvn7
4U7t38iMonKNTgj6iOtotdIwBImdfc+AYTaXStot6V2d5mef/k758VyidCIMNJnA
Xo5SFbt/uAXeG3azTe5llaVKGNdrBt2r0H9D4AbG2lpSyqINU165XCsnbNHjvt79
U+KYOmO9Cu76t1iTnGKTHa4bEemvS7KH2d/8IZCGMaWy0MbvlbLVuhCtTqoOXJZZ
EXDNYLGGm0FR7K4O3M2LZzVdUr2uB85cnaCqjlzbcd6M8g2Oof2YGWbvg73KOz4q
ckv//4/e9bRQLjwYcAEu
=Njwq
-END PGP SIGNATURE-

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



Re: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Kevin Jenkins
Thanks, Skype was using that port.


On Wed, Mar 27, 2013 at 10:25 AM, Harris, Jeffrey E. <
jeffrey.har...@mantech.com> wrote:

>
>
> > -Original Message-
> > From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> > Sent: Wednesday, March 27, 2013 1:23 PM
> > To: Tomcat Users List
> > Subject: Re: SSLCertificateKeyFile cannot find file that exists
> >
> > I finally got it working. For anyone else that has the same problem,
> > the solution is very simple and I don't know why there are huge walls
> > of text rather than just saying this
> >
> > To enable APR:
> > 1. Download tomcat-native-1.1.27-win32-bin from
> > http://apache.mirrors.lucidnetworks.net/tomcat/tomcat-
> > connectors/native/1.1.27/binaries/
> > 2. copy tcnative-1.dll to the Tomcat bin directory
> >
> > Get a self-signed key here:
> > http://www.selfsignedcertificate.com/
> >
> > Use this connector in server.xml
> >   > protocol="org.apache.coyote.http11.Http11AprProtocol" SSLEnabled="true"
> >maxThreads="150" scheme="https" secure="true"
> >clientAuth="false" sslProtocol="SSLv3"
> >
> >  SSLCertificateKeyFile="${catalina.base}\conf\13862451_localhost.key"
> >
> >  SSLCertificateFile="${catalina.base}\conf\13862451_localhost.cert"
> > />
> >
> > At least I can do my work now.
> >
> > Unrelated, I cannot start my connector on port 443 or 8443. I commented
> > out every other connector in server.xml but this still happens. As a
> > workaround I changed the port to 8444 but I'm not sure why I need to.
> >
> > SEVERE: Failed to initialize end point associated with ProtocolHandler
> > ["http-ap r-8443"]
> > java.lang.Exception: Socket bind failed: [730
> 048] Only one usage of
> > each socket address (protocol/network address/port) is normally
> > permitted.
> > at
> > org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:446)
> > at
> > org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.jav
> > a:610)1
> >
>
> Check your port usage.  There is probably another application running on
> those ports.
> On Windows, you can use the netstat -a -b -n and look for listeners on
> those ports.
>
> Jeffrey Harris
>
> This e-mail and any attachments are intended only for the use of the
> addressee(s) named herein and may contain proprietary information. If you
> are not the intended recipient of this e-mail or believe that you received
> this email in error, please take immediate action to notify the sender of
> the apparent error by reply e-mail; permanently delete the e-mail and any
> attachments from your computer; and do not disseminate, distribute, use, or
> copy this message and any attachments.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Harris, Jeffrey E.


> -Original Message-
> From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> Sent: Wednesday, March 27, 2013 1:23 PM
> To: Tomcat Users List
> Subject: Re: SSLCertificateKeyFile cannot find file that exists
>
> I finally got it working. For anyone else that has the same problem,
> the solution is very simple and I don't know why there are huge walls
> of text rather than just saying this
>
> To enable APR:
> 1. Download tomcat-native-1.1.27-win32-bin from
> http://apache.mirrors.lucidnetworks.net/tomcat/tomcat-
> connectors/native/1.1.27/binaries/
> 2. copy tcnative-1.dll to the Tomcat bin directory
>
> Get a self-signed key here:
> http://www.selfsignedcertificate.com/
>
> Use this connector in server.xml
>   protocol="org.apache.coyote.http11.Http11AprProtocol" SSLEnabled="true"
>maxThreads="150" scheme="https" secure="true"
>clientAuth="false" sslProtocol="SSLv3"
>
>  SSLCertificateKeyFile="${catalina.base}\conf\13862451_localhost.key"
>
>  SSLCertificateFile="${catalina.base}\conf\13862451_localhost.cert"
> />
>
> At least I can do my work now.
>
> Unrelated, I cannot start my connector on port 443 or 8443. I commented
> out every other connector in server.xml but this still happens. As a
> workaround I changed the port to 8444 but I'm not sure why I need to.
>
> SEVERE: Failed to initialize end point associated with ProtocolHandler
> ["http-ap r-8443"]
> java.lang.Exception: Socket bind failed: [730
048] Only one usage of
> each socket address (protocol/network address/port) is normally
> permitted.
> at
> org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:446)
> at
> org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.jav
> a:610)1
>

Check your port usage.  There is probably another application running on those 
ports.
On Windows, you can use the netstat -a -b -n and look for listeners on those 
ports.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

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



Re: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Kevin Jenkins
I finally got it working. For anyone else that has the same problem, the
solution is very simple and I don't know why there are huge walls of text
rather than just saying this

To enable APR:
1. Download tomcat-native-1.1.27-win32-bin from
http://apache.mirrors.lucidnetworks.net/tomcat/tomcat-connectors/native/1.1.27/binaries/
2. copy tcnative-1.dll to the Tomcat bin directory

Get a self-signed key here:
http://www.selfsignedcertificate.com/

Use this connector in server.xml
 

At least I can do my work now.

Unrelated, I cannot start my connector on port 443 or 8443. I commented out
every other connector in server.xml but this still happens. As a workaround
I changed the port to 8444 but I'm not sure why I need to.

SEVERE: Failed to initialize end point associated with ProtocolHandler
["http-ap
r-8443"]
java.lang.Exception: Socket bind failed: [730048] Only one usage of each
socket
address (protocol/network address/port) is normally permitted.
at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:446)
at
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.jav
a:610)1




On Wed, Mar 27, 2013 at 9:46 AM, Harris, Jeffrey E. <
jeffrey.har...@mantech.com> wrote:

>
>
> > -Original Message-
> > From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> > Sent: Wednesday, March 27, 2013 12:13 PM
> > To: Tomcat Users List
> > Subject: Re: SSLCertificateKeyFile cannot find file that exists
> >
> > Thanks for the answer Jeffery.
> >
> > Regarding the APR connector, I'm guessing since you said that Tomcat
> > doesn't come with it built-in already?
> >
> > Under installation / windows I downloaded this:
> > http://tomcat.apache.org/tomcat-7.0-doc/apr.html
> > I'm looking here http://tomcat.apache.org/tomcat-7.0-doc/apr.html under
> > installation and it said to download binaries here:
> > http://www.motorlogy.com/apache//tomcat/tomcat-
> > connectors/native/1.1.27/binaries/
> >
> > So I did that, copied tcnative-1.dll to D:\Program
> > Files\Java\jdk1.6.0_37\bin
> >
> > But it still didn't work when I clicked startup.bat. There's no
> > instructions on how to actually install APR that I can find beyond
> > saying to download the library. Not sure what to do at this point.
> >
> > Regarding converting the the key file and certificate file to a JKS
> > store... how do I do that/ I did some searching and came up with a wall
> > of complicated instructions. I've already spent hours trying to figure
> > out how to create self-signed keys (which is why I just went to that
> > website to begin with).
> >
> >
> > On Wed, Mar 27, 2013 at 8:49 AM, Harris, Jeffrey E. <
> > jeffrey.har...@mantech.com> wrote:
> >
> > >
> > >
> > > > -Original Message-
> > > > From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> > > > Sent: Wednesday, March 27, 2013 11:46 AM
> > > > To: users@tomcat.apache.org
> > > > Subject: SSLCertificateKeyFile cannot find file that exists
> > > >
> > > > I'm working on a project where I need to test C++ code against an
> > > > HTTPS web server. So I am trying to get Tomcat to work using HTTPS
> > > > on localhost.
> > > > Security does not matter right now, I just need to get an HTTPS
> > > > server online so I can debug the C++.
> > > >
> > > > So I went to http://www.selfsignedcertificate.com/ and under server
> > > > name entered localhost.
> > > >
> > > > It gave me 2 files:
> > > > 3589340_localhost.key
> > > > 3589340_localhost.cert
> > > >
> > > > I copied those files to D:\apache-tomcat-7.0.37\conf
> > > >
> > > > I added this line to d:/apache-tomcat-7.0.37/confg/server.xml
> > > >
> > > >  > > >maxThreads="150" scheme="https" secure="true"
> > > >clientAuth="false" sslProtocol="SSLv3"
> > > >
> > > >
> > SSLCertificateKeyFile="${catalina.base}\conf\3589340_localhost.key"
> > > >
> > > >  SSLCertificateFile="${catalina.base}\conf\3589340_localhost.cert"
> > > > />
> > > >
> > > > I double click "D:\apache-tomcat-7.0.37\bin\startup.bat"
> > > >
> > > > It doesn't work. I don't understand why it does it does not find a
> > > > matching property. The file is there on the harddrive.
> > > >
> > > > WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> > > > property 'SSLC ertificateFile' to 'D:\apache-tomcat-
> > > > 7.0.37\conf\3589340_localhost.cert'
> > > > did not
> > > >  find a matching property.
> > > > Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > > INFO: Initializing ProtocolHandler ["http-bio-8080"] Mar 27, 2013
> > > > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > > INFO: Initializing ProtocolHandler ["http-bio-443"] Mar 27, 2013
> > > > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > > SEVERE: Failed to initialize end point associated with
> > > > ProtocolHandler ["http-bi o-443"]
> > > > java.io.IOException: Keystore was tampered with, or password was
> > > > incorrect
> > > > at
> > > >
> > sun.security.provider.JavaKeyStore.engineL

RE: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Harris, Jeffrey E.


> -Original Message-
> From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> Sent: Wednesday, March 27, 2013 12:13 PM
> To: Tomcat Users List
> Subject: Re: SSLCertificateKeyFile cannot find file that exists
>
> Thanks for the answer Jeffery.
>
> Regarding the APR connector, I'm guessing since you said that Tomcat
> doesn't come with it built-in already?
>
> Under installation / windows I downloaded this:
> http://tomcat.apache.org/tomcat-7.0-doc/apr.html
> I'm looking here http://tomcat.apache.org/tomcat-7.0-doc/apr.html under
> installation and it said to download binaries here:
> http://www.motorlogy.com/apache//tomcat/tomcat-
> connectors/native/1.1.27/binaries/
>
> So I did that, copied tcnative-1.dll to D:\Program
> Files\Java\jdk1.6.0_37\bin
>
> But it still didn't work when I clicked startup.bat. There's no
> instructions on how to actually install APR that I can find beyond
> saying to download the library. Not sure what to do at this point.
>
> Regarding converting the the key file and certificate file to a JKS
> store... how do I do that/ I did some searching and came up with a wall
> of complicated instructions. I've already spent hours trying to figure
> out how to create self-signed keys (which is why I just went to that
> website to begin with).
>
>
> On Wed, Mar 27, 2013 at 8:49 AM, Harris, Jeffrey E. <
> jeffrey.har...@mantech.com> wrote:
>
> >
> >
> > > -Original Message-
> > > From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> > > Sent: Wednesday, March 27, 2013 11:46 AM
> > > To: users@tomcat.apache.org
> > > Subject: SSLCertificateKeyFile cannot find file that exists
> > >
> > > I'm working on a project where I need to test C++ code against an
> > > HTTPS web server. So I am trying to get Tomcat to work using HTTPS
> > > on localhost.
> > > Security does not matter right now, I just need to get an HTTPS
> > > server online so I can debug the C++.
> > >
> > > So I went to http://www.selfsignedcertificate.com/ and under server
> > > name entered localhost.
> > >
> > > It gave me 2 files:
> > > 3589340_localhost.key
> > > 3589340_localhost.cert
> > >
> > > I copied those files to D:\apache-tomcat-7.0.37\conf
> > >
> > > I added this line to d:/apache-tomcat-7.0.37/confg/server.xml
> > >
> > >  > >maxThreads="150" scheme="https" secure="true"
> > >clientAuth="false" sslProtocol="SSLv3"
> > >
> > >
> SSLCertificateKeyFile="${catalina.base}\conf\3589340_localhost.key"
> > >
> > >  SSLCertificateFile="${catalina.base}\conf\3589340_localhost.cert"
> > > />
> > >
> > > I double click "D:\apache-tomcat-7.0.37\bin\startup.bat"
> > >
> > > It doesn't work. I don't understand why it does it does not find a
> > > matching property. The file is there on the harddrive.
> > >
> > > WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> > > property 'SSLC ertificateFile' to 'D:\apache-tomcat-
> > > 7.0.37\conf\3589340_localhost.cert'
> > > did not
> > >  find a matching property.
> > > Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > INFO: Initializing ProtocolHandler ["http-bio-8080"] Mar 27, 2013
> > > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > INFO: Initializing ProtocolHandler ["http-bio-443"] Mar 27, 2013
> > > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > > SEVERE: Failed to initialize end point associated with
> > > ProtocolHandler ["http-bi o-443"]
> > > java.io.IOException: Keystore was tampered with, or password was
> > > incorrect
> > > at
> > >
> sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
> > > at
> > >
> sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:
> > > 3
> > > 8)
> > > at java.security.KeyStore.load(KeyStore.java:1185)
> > > at
> > >
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocke
> > > t
> > > Factory.java:372)
> > >
> > > Thanks in advance for the help.
> >
> > You need to either use the APR connector, or convert the key file and
> > certificate file to a JKS store, and update your configuration.
> >
> > Jeffrey Harris
> >

See the Tomcat documentation 
(http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html) and look in the 
section "Edit the Tomcat Configuration File" to enable APR.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

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

Re: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Kevin Jenkins
Thanks for the answer Jeffery.

Regarding the APR connector, I'm guessing since you said that Tomcat
doesn't come with it built-in already?

Under installation / windows I downloaded this:
http://tomcat.apache.org/tomcat-7.0-doc/apr.html
I'm looking here http://tomcat.apache.org/tomcat-7.0-doc/apr.html under
installation and it said to download binaries here:
http://www.motorlogy.com/apache//tomcat/tomcat-connectors/native/1.1.27/binaries/

So I did that, copied tcnative-1.dll to D:\Program
Files\Java\jdk1.6.0_37\bin

But it still didn't work when I clicked startup.bat. There's no
instructions on how to actually install APR that I can find beyond saying
to download the library. Not sure what to do at this point.

Regarding converting the the key file and certificate file to a JKS
store... how do I do that/ I did some searching and came up with a wall of
complicated instructions. I've already spent hours trying to figure out how
to create self-signed keys (which is why I just went to that website to
begin with).


On Wed, Mar 27, 2013 at 8:49 AM, Harris, Jeffrey E. <
jeffrey.har...@mantech.com> wrote:

>
>
> > -Original Message-
> > From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> > Sent: Wednesday, March 27, 2013 11:46 AM
> > To: users@tomcat.apache.org
> > Subject: SSLCertificateKeyFile cannot find file that exists
> >
> > I'm working on a project where I need to test C++ code against an HTTPS
> > web server. So I am trying to get Tomcat to work using HTTPS on
> > localhost.
> > Security does not matter right now, I just need to get an HTTPS server
> > online so I can debug the C++.
> >
> > So I went to http://www.selfsignedcertificate.com/ and under server
> > name entered localhost.
> >
> > It gave me 2 files:
> > 3589340_localhost.key
> > 3589340_localhost.cert
> >
> > I copied those files to D:\apache-tomcat-7.0.37\conf
> >
> > I added this line to d:/apache-tomcat-7.0.37/confg/server.xml
> >
> >  >maxThreads="150" scheme="https" secure="true"
> >clientAuth="false" sslProtocol="SSLv3"
> >
> >  SSLCertificateKeyFile="${catalina.base}\conf\3589340_localhost.key"
> >
> >  SSLCertificateFile="${catalina.base}\conf\3589340_localhost.cert"
> > />
> >
> > I double click "D:\apache-tomcat-7.0.37\bin\startup.bat"
> >
> > It doesn't work. I don't understand why it does it does not find a
> > matching property. The file is there on the harddrive.
> >
> > WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> > property 'SSLC ertificateFile' to 'D:\apache-tomcat-
> > 7.0.37\conf\3589340_localhost.cert'
> > did not
> >  find a matching property.
> > Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > INFO: Initializing ProtocolHandler ["http-bio-8080"] Mar 27, 2013
> > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > INFO: Initializing ProtocolHandler ["http-bio-443"] Mar 27, 2013
> > 8:44:44 AM org.apache.coyote.AbstractProtocol init
> > SEVERE: Failed to initialize end point associated with ProtocolHandler
> > ["http-bi o-443"]
> > java.io.IOException: Keystore was tampered with, or password was
> > incorrect
> > at
> > sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
> > at
> > sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
> > 8)
> > at java.security.KeyStore.load(KeyStore.java:1185)
> > at
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocket
> > Factory.java:372)
> >
> > Thanks in advance for the help.
>
> You need to either use the APR connector, or convert the key file and
> certificate file to a JKS store, and update your configuration.
>
> Jeffrey Harris
>
> This e-mail and any attachments are intended only for the use of the
> addressee(s) named herein and may contain proprietary information. If you
> are not the intended recipient of this e-mail or believe that you received
> this email in error, please take immediate action to notify the sender of
> the apparent error by reply e-mail; permanently delete the e-mail and any
> attachments from your computer; and do not disseminate, distribute, use, or
> copy this message and any attachments.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Tomcat support for JNDIRealm LDAPS connections

2013-03-27 Thread Wilmoth, Jon
After searching through the Tomcat user forums and bug list it appears there 
are only two options to enable ldaps connections, without modification to the 
Tomcat JNDI Realm itself:

1)  Start Tomcat using system properties that specify the default trust 
keystore & password (e.g. -Djavax.net.ssl.trustStore= 
-Djavax.net.ssl.trustStorePassword=).  The problem with this is it 
requires the password to the trust keystore be provided on the command line.
2)  Add the CA cert to the /lib/security/cacerts file (or 
/lib/security/jssecacerts which has higher precedence) which is used 
as the default trust store.  This has the downside of tying the CA cert 
maintenance lifecycle to the JVM maintenance lifecycle (e.g. upgrades).  It 
also limits the reuse of a JDK installation across applications/Tomcat 
instances.

Are there any plans for org.apache.catalina.realm.JNDIRealm to address these 
items via support for configuring the trust store path/password like 
org.apache.tomcat.util.net.AbstractEndpoint?

Thanks,
Jon


RE: SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Harris, Jeffrey E.


> -Original Message-
> From: Kevin Jenkins [mailto:rak...@jenkinssoftware.com]
> Sent: Wednesday, March 27, 2013 11:46 AM
> To: users@tomcat.apache.org
> Subject: SSLCertificateKeyFile cannot find file that exists
>
> I'm working on a project where I need to test C++ code against an HTTPS
> web server. So I am trying to get Tomcat to work using HTTPS on
> localhost.
> Security does not matter right now, I just need to get an HTTPS server
> online so I can debug the C++.
>
> So I went to http://www.selfsignedcertificate.com/ and under server
> name entered localhost.
>
> It gave me 2 files:
> 3589340_localhost.key
> 3589340_localhost.cert
>
> I copied those files to D:\apache-tomcat-7.0.37\conf
>
> I added this line to d:/apache-tomcat-7.0.37/confg/server.xml
>
> maxThreads="150" scheme="https" secure="true"
>clientAuth="false" sslProtocol="SSLv3"
>
>  SSLCertificateKeyFile="${catalina.base}\conf\3589340_localhost.key"
>
>  SSLCertificateFile="${catalina.base}\conf\3589340_localhost.cert"
> />
>
> I double click "D:\apache-tomcat-7.0.37\bin\startup.bat"
>
> It doesn't work. I don't understand why it does it does not find a
> matching property. The file is there on the harddrive.
>
> WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting
> property 'SSLC ertificateFile' to 'D:\apache-tomcat-
> 7.0.37\conf\3589340_localhost.cert'
> did not
>  find a matching property.
> Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8080"] Mar 27, 2013
> 8:44:44 AM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-443"] Mar 27, 2013
> 8:44:44 AM org.apache.coyote.AbstractProtocol init
> SEVERE: Failed to initialize end point associated with ProtocolHandler
> ["http-bi o-443"]
> java.io.IOException: Keystore was tampered with, or password was
> incorrect
> at
> sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
> at
> sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
> 8)
> at java.security.KeyStore.load(KeyStore.java:1185)
> at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocket
> Factory.java:372)
>
> Thanks in advance for the help.

You need to either use the APR connector, or convert the key file and 
certificate file to a JKS store, and update your configuration.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

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



SSLCertificateKeyFile cannot find file that exists

2013-03-27 Thread Kevin Jenkins
I'm working on a project where I need to test C++ code against an HTTPS web
server. So I am trying to get Tomcat to work using HTTPS on localhost.
Security does not matter right now, I just need to get an HTTPS server
online so I can debug the C++.

So I went to http://www.selfsignedcertificate.com/ and under server name
entered localhost.

It gave me 2 files:
3589340_localhost.key
3589340_localhost.cert

I copied those files to D:\apache-tomcat-7.0.37\conf

I added this line to d:/apache-tomcat-7.0.37/confg/server.xml



I double click "D:\apache-tomcat-7.0.37\bin\startup.bat"

It doesn't work. I don't understand why it does it does not find a matching
property. The file is there on the harddrive.

WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property
'SSLC
ertificateFile' to 'D:\apache-tomcat-7.0.37\conf\3589340_localhost.cert'
did not
 find a matching property.
Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-443"]
Mar 27, 2013 8:44:44 AM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler
["http-bi
o-443"]
java.io.IOException: Keystore was tampered with, or password was incorrect
at
sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
at
sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
8)
at java.security.KeyStore.load(KeyStore.java:1185)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocket
Factory.java:372)

Thanks in advance for the help.


Re: Velocity Logging

2013-03-27 Thread Martin Grigorov
On Wed, Mar 27, 2013 at 4:16 PM, Bruce Pease  wrote:

> I am using Wicket 1.4.22 with Tomcat 7.0.37 and JDK 1.6.0_33.  The recent
> upgrade to Tomcat created an issue where the cannot
>
> be undeployed unless the app is shut down due to the Wicket dependency
> velocity logging in use (1.4).
>
>
>
> We are running a web application under tomcat using the wicket framework.
>  A
> requirement for Wicket is the velocity libraries.  The velocity framework
> is
> auto loading and writing to a log in the conf directory.  Since it is in
> use
> I am unable to undeploy the web application.  So, I am looking for a way to
> turn off the velocity logging.  Previous version of tomcat does not have
> this
> issue (7.0.26).
>
>
http://markmail.org/thread/5yyyidq62klahoi4


>
>
> Thanks in advance for your help.
>
>
>
> Bruce D. Pease
> Technical Team Lead - Web Applications
> CruiseOne(r)   & Cruises Inc(tm)
> 
> 1201 W. Cypress Creek Road, Suite 100
> Fort Lauderdale, FL 33309-1955
> 954-958-3654 (direct) | 954-958-3665 (fax)
> bpe...@wth.com 
>
>
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Velocity Logging

2013-03-27 Thread Bruce Pease
I am using Wicket 1.4.22 with Tomcat 7.0.37 and JDK 1.6.0_33.  The recent
upgrade to Tomcat created an issue where the cannot 

be undeployed unless the app is shut down due to the Wicket dependency
velocity logging in use (1.4).  

 

We are running a web application under tomcat using the wicket framework.  A
requirement for Wicket is the velocity libraries.  The velocity framework is
auto loading and writing to a log in the conf directory.  Since it is in use
I am unable to undeploy the web application.  So, I am looking for a way to
turn off the velocity logging.  Previous version of tomcat does not have this
issue (7.0.26).

 

Thanks in advance for your help.

 

Bruce D. Pease
Technical Team Lead - Web Applications
CruiseOne(r)   & Cruises Inc(tm)
 
1201 W. Cypress Creek Road, Suite 100
Fort Lauderdale, FL 33309-1955
954-958-3654 (direct) | 954-958-3665 (fax)
bpe...@wth.com  

 



Re: Tomcat JDBC connection pool + JMX

2013-03-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jose,

On 3/27/13 8:34 AM, Jose María Zaragoza wrote:
> I'm using tomcat-jdbc as a connection pool in a standalone
> application.
> 
> I would like monitorize this pool by JMX .
> 
> How I can do that ? What is the name of MBean ?

http://wiki.apache.org/tomcat/FAQ/Monitoring

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRUvwiAAoJEBzwKT+lPKRYNJsP/3e32ZCoz2dwL0ND1It7+LJm
cgcqU83hRKSXys0PpeO3mJQMPIP6kTDvfVK81V9fk8IhOUihYCVxtikeRVdUU9x+
HH663kGPVca1KCED2LDRcMVeqJreS/+8BQV9yM/ESg1rD2pOccQMQSbZtPgsjwpX
Xamh/p49yhiYWQD3KCoZMBpytlNGoJB1neW6Nbe/3C/UB+jFnzPd0F5C1H3p5bvD
AZfuk8FBezykB24YeLM3tGua8mz1EfMsIUcE83iCT9r7KCDmJMWkluOQJvWKaRxr
WbPvdfeRcqaJlmArFKkCORI566DbODqPd0mFLjwml3PoudTt1FnwKfrB9OstkGIy
/N/kwQEK40WBfoWhT198fbJse9+6hALSAccTa9oXNVYPmPPaJQqJJ+FT9nJnGzRm
l4KYL/ChItEOKctRe9oeNR1eYle4QxNxB7PAxO8fgvBKOUywhGJ9N1go/iNydT5g
JlLY9mwQL5ZM59FG1p036e8TdAZP+VGVQ0LScmMyo9p1Eobvwz5ouMFYZLDiuCol
RUMMKPRUvpKSFMQhJvA4O28rO8AwAd82D+HBwwk+dd/agOiFJ8ZqdAXX6lKT8PMR
S3n4zZ2z65Dn+ajkf4Oox3WHo40pEQBHUr24pnzOhnoNGgIjlLvCSE2xidXl5wjc
mF4l88uu361edqqAqLFc
=iE5g
-END PGP SIGNATURE-

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



AW: [tomcat 5.5.26] why are not all log4j.properties files parsed

2013-03-27 Thread Stadelmann Josef
Thank you Rainer

we already observed different behavior in parsing if we do so.

Josef

-Ursprüngliche Nachricht-
Von: Rainer Jung [mailto:rainer.j...@kippdata.de] 
Gesendet: Mittwoch, 27. März 2013 10:36
An: users@tomcat.apache.org
Betreff: Re: [tomcat 5.5.26] why are not all log4j.properties files parsed

On 26.03.2013 18:42, Mark Eggers wrote:

> 1. Put the right information in your subject 2. Upgrade 3. Don't post 
> attachments - add the information inline 4. No, context loading order 
> is not guaranteed or enforced 5. Check your applications' log files to 
> see what format is used 6. Try using XML for your application's log4j 
> configuration (should not
>make a difference)
> 7. Post your Tomcat's log4j.properties file inline if the above doesn't
>resolve your issues
> 8. Tell the list if / when your issues are resolved (and how)

... and check that you are not setting the system property log4j.configuration, 
because that will overwrite trying to find the config file via the class loader.

Regards,

Rainer


-
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



AW: [tomcat 5.5.26] why are not all log4j.properties files parsed

2013-03-27 Thread Stadelmann Josef
Hi Christopher

my comment +++

-Ursprüngliche Nachricht-
Von: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Gesendet: Dienstag, 26. März 2013 21:19
An: Tomcat Users List
Betreff: Re: [tomcat 5.5.26] why are not all log4j.properties files parsed

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Josef,

On 3/26/13 12:20 PM, Stadelmann Josef wrote:
> we have multiple applications deployed as war files into tomcat 
> webapps.
> 
> each apps has its class directory among a lib directory

Can you explain that in more detail? I do not understand...

+++ your rigth, my real stupid expression, sorry!

> we use log4j-1.2.16 and so each web apps/web-inf/classes has its 
> log4j.properties file
> 
> what we do not understand is the order in which tomcat deployes the 
> several web apps and what we do even less understand is in which order 
> the various log4j.properties are parsed and used. OR are they just 
> parsed and not used, or later used orperhapsused, I tell you "it is a 
> mess!"

I highly suspect that you have log4j.jar in either common/lib or shared/lib. In 
that case, your log4j will initialize only once, probably incorrectly.

+++ this is interessting.
IA64-2>dir [.shared]
Directory DKA3:[APACHE.JAKARTA.TOMCAT.shared]
classes.DIR;1   lib.DIR;1
Total of 2 files.
IA64-2>dir [.shared.classes]
%DIRECT-W-NOFILES, no files found
IA64-2>dir [.shared.lib]
%DIRECT-W-NOFILES, no files found
IA64-2>dir
Directory DKA3:[APACHE.JAKARTA.TOMCAT.common]
classes.DIR;1   endorsed.DIR;1  endorsed^.tar.gz;1  i18n.DIR;1 lib.DIR;1
Total of 5 files.
IA64-2>

we use this lib and classes directory in tomcat. it's here in lib where 
log4j.jar is 
IA64-2>dir [.lib]*log4j*
Directory DKA3:[APACHE.JAKARTA.TOMCAT.common.lib]
log4j-1^.2^.16.jar;1
Total of 1 file.
IA64-2> +


If you want to use log4j in each web application, you should put a separate 
log4j.jar file in each webapp's WEB-INF/lib directory.

+++ we have done that ! there is a minor mismatch as tomcat - the oldest dir - 
has log4j-1.2.15.jar 
while the apps are all at log4j.1.2.16.jar

+++ note the observed behavior in parsing and later in logging is different if 
we use log4j.configuration=/path/to/tomcats/log4j.properties as JVM argument 
from within NetBeans when we start tomcat.


Are you also trying to use log4j for /Tomcat/ logging? If so, you have to do 
that differently as well. I'm not sure how well it works (or if at all) with 
Tomcat 5.5.

+++ yes - we really would like to do that; 
in example I really need now HostCongig.java's log.debug to print out 
when tomcat lifecycle event  does a Reloading Context /axis2 ... causing us 
tremendous troubles at the moment. Maybe we'r hacked internally by some 
security folk.

As you can see in my previous answer, there is a large 
apache$jakarta_server_output.log and you can see there that log4j.properties 
from DKA3:[APACHE.JAKARTA.TOMCAT.common.lib] is parsed., well thanks to 
CHAINSAW, I have found out all the various active loggers of tomcat; I can say, 
it works. So it is up to us to define proper appenders for various loggers 
doing debug output which will other whise not do any logging. also we need it 
on a one to one basis because just turning on debug-logging fro tomcat is a 
clear no-go in production, but other loggers like those from HostConfig.java 
are real helpful in case of troubles.

Thank you Chris
Josef


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRUgLIAAoJEBzwKT+lPKRYPnQQAMjBdaIFPAbhylE+yPL3aAsQ
RnVWf6sUOQuj+UeJaV+s4jREK9nbwgNaLYskceJZnI+CxsFU7/KhmWdEh4E3PbNA
zh+Iy2Q+3bI2S8SPUBCZEn3CKCMcgUIxcgaPO/IAUeQR0ua6IIF88oBBWmGA2hrq
ibFeACROTHeW+yiixC/nh+5d5RJm3lGwpIoh536D/eugKOY/zEge7XYBoIw3X0YY
j8vz9FDOSmjfAVAr90KskSazIcP1LHOqRhv88RS66gFS1UOWUHuPrFnSqjEy0MeK
OQiyjwl2JhQ0A0wj977kcB7Z/C6O3kCedoHzxJjzwIwcOAuqS+t/i5tE4oAYYPbv
Cnpzoy79E0UszHKoy/ZCC+3XJsB/2Kpg5d5CGjqjICVcicZqCD5Vnu8MUs24+oMp
TQMyXzoB9Wluw5U2v161SFpvoEgByXaG1ibvQ3uk9kRdqMDekN+hhrVpIviNb+/+
AbbrtZWV2ssJIGib7B7UI+v8BxbFkKbXZDJ5AYu7gb+sove5qeCZDN2MlZrbmQfl
+mup3PIX+G8i1Hnl5c92xLVirrEnfumzWjMZ9wbxMeXhk65AkH9zyNiV6EaJ68LE
7OlC7+/BpiPn7sUAvxYwnVk7YOyOx2XvvsBkbzVrjclgp4fW16pH/pQPPAGhJVWY
61drrtfdiLuTJP1w8tiY
=yMAk
-END PGP SIGNATURE-

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



Re: Tomcat JDBC connection pool + JMX

2013-03-27 Thread Daniel Mikusa
On Mar 27, 2013, at 9:23 AM, Jose María Zaragoza wrote:

>> Here's what I see when I look at a Tomcat server with a tomcat-jdbc 
>> connection pool defined.
>> 
>>  
>> tomcat.jdbc:name="",type=ConnectionPool,class=org.apache.tomcat.jdbc.pool.DataSource
>> 
>> I think this might also work (although it appears read-only).
>> 
>>  Catalina:type=DataSource,class=javax.sql.DataSource,name=""
>> 
> 
> 
> Thanks
> But I don't define any JDNI name (  I don't need it )
> This is my code ( Spring )

This is exactly why you should open jconsole or jvisualvm and take a look for 
yourself.

Dan

> 
>  destroy-method="close">
>
> 
> 
> 
>
> value="${database.removeabandoned}" />
> value="${database.validationquery}" />
> 
> 
> 
> Regards
> 
> -
> 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



AW: [tomcat 5.5.26] why are not all log4j.properties files parsed

2013-03-27 Thread Stadelmann Josef
Hi Mark

1. thank you
2. it will take me a bit time to go through what your recommendations
3. your right, I made the test on tomcat 6.0.26 on a PC and 
4. our operating environment runs tomcat 5.5.26 on Intel Itanium OpenVMS servers
5. we know that tomcat 5.5.26 on Itanium OpenVMS is old but HP provides nothing 
any better
6. HP has developed this tomcat to be a fast one, 
hence a lot of shareable images, 
hence not a pure java solution, 
hence more of a native port - to what degree is unknown to us
7. We run our apps on 
JDK 1.6.0-33 on PC and 
JDK 1.6.0-2.p1  on OpenVMS
HP again is not yet able to deliver an OpenJDK-7
and we don't have any clue, even asking many times, about the road-map.
so upgrading is limitted
8. we use apache axis2-1.6.1 on tomcat OpenVMS 5.5.26 / java 1.6.0-2.p1
regarding upgrading to java 1.7 (7.0) 
Ubuntu axis2-1.7.0 from trunk does not even build so far using 
java-7-oracle
so I had to downgrade to java-6-oracle for a clean axis2 trunk 
build on Ubuntu (at home)!
regarding upgrading to java 1.7 - yes - as soon as apache-axis2 is that 
far.
this - as we have to endorse certain jar files 
both JRE/lib/endorsed and tomcat/common/lib/endorsed 
with jars from jdk-7 to make axis2-JAXWS used annotation 
classes run
9. we have a rather complex environment
10. log4j-1.2.16.jar is used at 
DKA3:[APACHE.JAKARTA.TOMCAT.common.lib]
and log4j-1.2.15.jar (my oversight) is used at
DKA3:[APACHE.JAKARTA.TOMCAT.webapps.axis2.WEB-INF.lib]
and log4j-1.2.16.jar is used at
DKA3:[APACHE.JAKARTA.TOMCAT.WEBAPPS.spezplafs.web-inf.lib]
11. to answer your question: " Are you writing all of your output to console? "
no we do not write all output only to consol but to various log files 
as well
12. TOMCAT LOGGING is defined by 
DKA3:[APACHE.JAKARTA.TOMCAT.common.classes]log4j.properties
Note: they are not finalized yet, the ConversionPattern will be 
harmonized to %d [%-5p] <%t> %c (%F:%L) %m%n
[log4j.properties inline begin]
log4j.debug=true
# ---
# Copyright 2001-2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---
log4j.rootLogger=DEBUG, CONSOLE

# in absence of a true TC_CONSole - the log goes into
#  apache$specific:[00]APACHE$JAKARTA_SERVER_OUTPUT.LOG

# ---
# CONSOLE is set to be a ConsoleAppender using a PatternLayout. -
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - %m%n
log4j.appender.CONSOLE.Threshold=INFO

# ---
#- Set your loggers priority to what you need ---
# Logger logging WHAT it logs   WHO is actually logging
log4j.logger.org.apache.catalina=INFO,  TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.catalina.HostConfig=DEBUG,  TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.coyote=INFO,TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.jasper=INFO,TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.jk=INFO,TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.tomcat=INFO,TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.org.apache.commons=INFO,   TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.de.hunsicker.jalopy.io=FATAL,  TC_FAP, CONSOLE, 
TC_CHAINSAW
log4j.logger.httpclient.wire.header=FATAL,  TC_FAP, CONSOLE, 
TC_CHAINSAW

# ---
# define the additivities used to prevent logging twice the same msg
# NOTE: each logger needs an additivity set or you risk logging twice
#
log4j.additivity.org.apache.catalina=false
log4j.additivity.org.apache.catalina.HostConfig=false
log4j.additivity.org.apache.coyote=false
log4j.additivity.org.apache.jasper=false
log4j.additivity.org.apache.jk=false
log4j.additivity.org.apache.tomcat=false
log4j.additivity.org.apache.commons=false

# --

Re: Tomcat JDBC connection pool + JMX

2013-03-27 Thread Jose María Zaragoza
> Here's what I see when I look at a Tomcat server with a tomcat-jdbc 
> connection pool defined.
>
>   
> tomcat.jdbc:name="",type=ConnectionPool,class=org.apache.tomcat.jdbc.pool.DataSource
>
> I think this might also work (although it appears read-only).
>
>   Catalina:type=DataSource,class=javax.sql.DataSource,name=""
>


Thanks
But I don't define any JDNI name (  I don't need it )
This is my code ( Spring )

 
 
 
 
 
 
 
 



Regards

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



Re: Tomcat JDBC connection pool + JMX

2013-03-27 Thread Daniel Mikusa
On Mar 27, 2013, at 8:34 AM, Jose María Zaragoza wrote:

> Hello:
> 
> 
> I'm using tomcat-jdbc as a connection pool in a standalone application.
> 
> I would like monitorize this pool by JMX .
> 
> How I can do that ?

Any number of ways.  There are utilities like jmxsh, you could create custom 
code or even use monitoring software like Nagios or Hyperic.

> What is the name of MBean ?

Here's what I see when I look at a Tomcat server with a tomcat-jdbc connection 
pool defined.

  
tomcat.jdbc:name="",type=ConnectionPool,class=org.apache.tomcat.jdbc.pool.DataSource

I think this might also work (although it appears read-only).

  Catalina:type=DataSource,class=javax.sql.DataSource,name=""

Probably best to take a look at your app with jconsole and jvisualvm and 
confirm.

Dan

> 
> 
> Thanks and regards
> 
> -
> 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 JDBC connection pool + JMX

2013-03-27 Thread Jose María Zaragoza
2013/3/27 Charles Richard :
> Hi,
>
> There might be better ways but I monitor the c3p0 connection pool using
> jmxterm (my jar jmxterm-1.0-alpha-4-uber.jar).
>
> For c3p0, the mbean is com.mchange.Pooled...
>
> Hope this helps a little!


Thanks.
I use cmdline-jmxclient-0.10.3.jar
But I need  to know the path where MBean's Tomcat JDBC connection pool
 is registered to monitorize
Remember is a standalone application

For example, Tomcat's datasource MBean is registered in
Catalina:type=DataSource,path=$paths,host=localhost,class=javax.sql

.DataSource,name="$name"

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



Re: Tomcat response

2013-03-27 Thread Daniel Mikusa
On Mar 27, 2013, at 1:59 AM, Dhaval Jaiswal wrote:

> Sometime i am facing an issue with the tomcat response.

Can you be more specific about the issue that you are facing?  What happens to 
the response?  Do you get any error codes or stack traces?  

> Tomcat not responding to the httpd web server.

Again, more specifics here would be good.  Is Tomcat hung?  Did it crash (i.e. 
the process is no longer running)?  Was it ever working correctly?

> Is there any tool or way wherein i can
> check the response of the tomcat through sessionid or some other method.

1.) What version of Tomcat are you running?
2.) How is Tomcat communicating with HTTPD?  Is it using AJP or HTTP?  
Including your  tags would be helpful.

Without any specifics, it's hard to say exactly.  Here are some general ideas…

1.) Setup a Request Dumper Filter (Tomcat 7) or a Request Dumper Valve (Tomcat 
6) in Tomcat.

  
https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter
  
https://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Request_Dumper_Valve

2.) Setup Wireshark or tcpdump between your HTTPD and Tomcat servers.  
Configure it to grab your AJP or HTTP traffic.

3.) Use HTTPD's mod_dumpio or a similar module.

  https://httpd.apache.org/docs/2.2/mod/mod_dumpio.html

Dan


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



Re: Tomcat JDBC connection pool + JMX

2013-03-27 Thread Charles Richard
Hi,

There might be better ways but I monitor the c3p0 connection pool using
jmxterm (my jar jmxterm-1.0-alpha-4-uber.jar).

For c3p0, the mbean is com.mchange.Pooled...

Hope this helps a little!

Cheers,
Charles

On Wed, Mar 27, 2013 at 9:34 AM, Jose María Zaragoza
wrote:

> Hello:
>
>
> I'm using tomcat-jdbc as a connection pool in a standalone application.
>
> I would like monitorize this pool by JMX .
>
> How I can do that ?
> What is the name of MBean ?
>
>
> Thanks and regards
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Tomcat JDBC connection pool + JMX

2013-03-27 Thread Jose María Zaragoza
Hello:


I'm using tomcat-jdbc as a connection pool in a standalone application.

I would like monitorize this pool by JMX .

How I can do that ?
What is the name of MBean ?


Thanks and regards

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



Re: how to monitor the traffic through the connector

2013-03-27 Thread Daniel Mikusa
On Mar 26, 2013, at 6:32 PM, a wrote:

> Hi,
> 
> I have defined a connector for port80. For example,
>   maxThreads="150"
>   minSpareThreads="25"
>   maxSpareThreads="75"
>   enableLookups="false"
>   acceptCount="100"
>   debug="0"
>   connectionTimeout="2000"
>   disableUploadTimeout="true"
>   compression="on"
>   address="192.168.223.5"/>
> 
> Is there any way to monitor the statistics that get throught the port?

No idea what you mean by this.  Can you elaborate?

> I need to log when the requst is fail,

Do you have an access log valve setup?  That will log the HTTP status code.  
You can grep for 500 to get the errors.

  https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve

> and I need to know the number of
> threads is consumed when the request is fail.

The access log valve can tell you the thread name of the thread that handled 
your request with the "%I" option.  I'm not sure there's an easy way to get the 
total threads in use at the time a request fails though.  What is your 
rationale for needing this information?

Dan


> 
> Thanks
> 
> 
> 
> 
> 
> -
> 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: Can ClientAbortException be circumvented?

2013-03-27 Thread Howard W. Smith, Jr.
On Mon, Mar 25, 2013 at 11:58 AM, Howard W. Smith, Jr. <
smithh032...@gmail.com> wrote:

> On Mon, Mar 25, 2013 at 11:54 AM, Howard W. Smith, Jr. <
> smithh032...@gmail.com> wrote:
>
>> On Mon, Mar 25, 2013 at 9:00 AM, Thad Humphries > > wrote:
>>
>>> On Sun, Mar 24, 2013 at 4:46 PM, Konstantin Kolinko
>>> wrote:
>>>
>>> > 2013/3/25 Thad Humphries :
>>> > > I have a web-app that uses a servlet for downloading files from a
>>> > > repository--PDF, Office, images, zip, etc. It works with desktop
>>> > > browsers--IE, Firefox, Chrome, and Safari--on their various
>>> platforms. It
>>> > > also works fine with Firefox from Android (2.3 and 4.x tested).
>>> However
>>> > > when I try with Android's default WebKit browser, the servlet fails
>>> > > immediately with org.apache.catalina.connector.ClientAbortException
>>> (so
>>> > > says the stderr log).
>>> >
>>> > 1. Is this issue specific to some kind of files, or it occurs with all
>>> of
>>> > them?
>>> >
>>>
>>> All of them--PDF, XLS, DOC, DOCX, TIFF, ZIP, etc. Every file type I've
>>> tried.
>>>
>>
>> Hmmm, interesting thread (and responses so far). I think I am aware of
>> this 'Android default Webkit browser' you are referring to. I always avoid
>> using it, and download Google Chrome from Google Play store to my Android
>> devices, and I don't think I ever tested my web app with the default
>> browser installed on Android devices.
>>
>> I have downloaded PDF files (generated in-memory) from my java/JSF web
>> app to Android device, and I have never seen this ClientAbortException. my
>> web app also has at least one iPad enduser (which has Google Chrome
>> installed on iPad). I am unaware of his experience and I don't think he
>> downloads PDF files from web app to his iPad, but I am quite confident that
>> it works or will work. :)
>>
>> > >
>>>
>> > > I suspect this is a problem with mobile WebKit, and that circumventing
>>> > the
>>> > > abort might be a "bad thing" even if it's possible. However I
>>> thought I'd
>>> > > inquire here if there is a Tomcat way around it. If not, it seems my
>>> > > alternatives are (1) use Java Mail to mail the user the file, since
>>> mail
>>> > > apps open their attachments; and (2) write iOS and Android apps file
>>> > query
>>> > > and downloading. Neither prospect thrills me.
>>>
>>
>> Okay, i just tested this with/in my web app on my Google Nexus 7
>> (android, of course). I offer Download, Print, and View hyperlinks within
>> the web app. Mind you, this is PrimeFaces xhtml below.
>>
>> ---download---
>> >
>>  actionListener="#{pf_ordersController.refreshContractsToDownload()}">
>> 
>> 
>>
>> Test and results:
>>
>> clicked Download button, PDF downloaded to Google Nexus 7 (Google Chrome
>> browser, of course), showed up in notifications, instead of PDF Viewer app,
>> I selected to open the PDF document in Adobe Acrobat (app that was
>> downloaded from Google Play).
>>
>> ---view---
>> >
>>  actionListener="#{pf_ordersController.refreshContractsToDownload()}">
>> > contentDisposition="inline"/>
>> 
>>
>> Test and results:
>>
>> clicked View button, I saw another web page tab open rather quickly in
>> the Google Chrome browser on Google Nexus 7, and then the new tab closed
>> immediately, and then I saw the 'Starting download' toast (at bottom of
>> Google Nexus 7), but I didn't see the file in notifications or downloads,
>> and I didn't see any exceptions in my TomEE/tomcat7 logs.
>>
>> With that said, maybe I just duplicated this issue/exception that you
>> have been experiencing. If I'm not mistaking, PrimeFaces is using the
>> servlet solution for file downloads.
>>
>> So, based on this test of mine, it is best to offer a 'download'
>> hyperlink 'only' on mobile devices as I am already detecting mobile devices
>> when they login to the web app.
>>
>> Thanks for this topic. now I know what i 'need' to do. :)
>>
>>
> Forgot to mention; i would definitely provide an option for files to be
> emailed to endusers. my web app has that option as well as it is more
> reliable.
>
> i have found that endusers do a lot of multi-tasking on mobile devices,
> and mobile browsers seem to lose connection when they go to some other app.
> i may not be describing this correctly, but I have noticed this behavior,
> myself.
>
>
UPDATE:

1. Reached out to 2 mobile endusers of my web app that does file downloads

2. iPad enduser says that the View commandLink
(contentDisposition="inline") works 'always', he has no issues

3. Android enduser informed me that the View commandLink
(contentDisposition="inline") 'does not always' work, sometimes it works,
sometimes it does

4. Per the test results, this email thread, and what my endusers want, i
just made a change to 'only' provide the View commandLink
(contentDisposition="inline") to iPad (and nonmobile devices), and the
Download commandlink is provided to Android endusers


Re: [ANN] Apache Tomcat 7.0.39 released

2013-03-27 Thread Amit A
Did OCSP made it to this list?
—
Sent from Mailbox for iPhone

On Wed, Mar 27, 2013 at 4:31 PM, Mark Thomas  wrote:

> The Apache Tomcat team announces the immediate availability of Apache
> Tomcat 7.0.39.
> Apache Tomcat is an open source software implementation of the Java
> Servlet and JavaServer Pages technologies.
> This release contains a number of bug fixes and improvements compared to
> version 7.0.37. The notable changes include:
> - There have been multiple improvements in the bytes to/from characters
>   conversion process. The core conversion process has been refactored
>   to use the NIO APIs. This has resulted in a number of improvements
>   including invalid UTF-8 byte sequences at the end of a series of
>   bytes now trigger a conversion error rather than being silently
>   swallowed. Errors detected in request URIs will be replaced with the
>   replacement character (allowing the application to respond to the
>   invalid URI as it wishes) and errors in request bodies will trigger
>   an IOException. The use of the JVM provided UTF-8 decoder has been
>   replaced by a better UTF-8 decoder derived from Apache Harmony. This
>   improved decoder has earlier detection of error conditions and more
>   closely follows the Unicode specification regarding the use of
>   replacement characters.
> - The annotation scanning process now provides more information if the
>   scan fails due to broken class dependencies. There is now enough
>   information to identify the class(es) at fault. The JAR scanning
>   process that supports annotation scanning has also seen multiple
>   improvements and fixes including the exclusion by default of the
>   Bootstrap class path from the scan.
> - Upgraded a number of Tomcat's dependencies including Commons Daemon to
>   1.0.14, Commons IO to 2.4 and Commons FileUpload to r1458500. A new
>   dependency on Commons Codec was added to replace Tomcat's internal
>   Base64 encoder/decoder.
> Please refer to the change log for the complete list of changes:
> http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
> Note: This version has 4 zip binaries: a generic one and three
>   bundled with Tomcat native binaries for Windows operating systems
>   running on different CPU architectures.
> Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
>   to version 1.1.24 or later of the AJP/native library and it is
>   recommended that you upgrade to 1.1.27
> Downloads:
> http://tomcat.apache.org/download-70.cgi
> Migration guides from Apache Tomcat 5.5.x and 6.0.x:
> http://tomcat.apache.org/migration.html
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org

[ANN] Apache Tomcat 7.0.39 released

2013-03-27 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 7.0.39.
Apache Tomcat is an open source software implementation of the Java
Servlet and JavaServer Pages technologies.

This release contains a number of bug fixes and improvements compared to
version 7.0.37. The notable changes include:

- There have been multiple improvements in the bytes to/from characters
  conversion process. The core conversion process has been refactored
  to use the NIO APIs. This has resulted in a number of improvements
  including invalid UTF-8 byte sequences at the end of a series of
  bytes now trigger a conversion error rather than being silently
  swallowed. Errors detected in request URIs will be replaced with the
  replacement character (allowing the application to respond to the
  invalid URI as it wishes) and errors in request bodies will trigger
  an IOException. The use of the JVM provided UTF-8 decoder has been
  replaced by a better UTF-8 decoder derived from Apache Harmony. This
  improved decoder has earlier detection of error conditions and more
  closely follows the Unicode specification regarding the use of
  replacement characters.
- The annotation scanning process now provides more information if the
  scan fails due to broken class dependencies. There is now enough
  information to identify the class(es) at fault. The JAR scanning
  process that supports annotation scanning has also seen multiple
  improvements and fixes including the exclusion by default of the
  Bootstrap class path from the scan.
- Upgraded a number of Tomcat's dependencies including Commons Daemon to
  1.0.14, Commons IO to 2.4 and Commons FileUpload to r1458500. A new
  dependency on Commons Codec was added to replace Tomcat's internal
  Base64 encoder/decoder.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

Note: This version has 4 zip binaries: a generic one and three
  bundled with Tomcat native binaries for Windows operating systems
  running on different CPU architectures.

Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
  to version 1.1.24 or later of the AJP/native library and it is
  recommended that you upgrade to 1.1.27

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

Migration guides from Apache Tomcat 5.5.x and 6.0.x:
http://tomcat.apache.org/migration.html

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



Re: [tomcat 5.5.26] why are not all log4j.properties files parsed

2013-03-27 Thread Rainer Jung
On 26.03.2013 18:42, Mark Eggers wrote:

> 1. Put the right information in your subject
> 2. Upgrade
> 3. Don't post attachments - add the information inline
> 4. No, context loading order is not guaranteed or enforced
> 5. Check your applications' log files to see what format is used
> 6. Try using XML for your application's log4j configuration (should not
>make a difference)
> 7. Post your Tomcat's log4j.properties file inline if the above doesn't
>resolve your issues
> 8. Tell the list if / when your issues are resolved (and how)

... and check that you are not setting the system property
log4j.configuration, because that will overwrite trying to find the
config file via the class loader.

Regards,

Rainer


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