Re: Test Mail, Please Ignore

2014-05-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Leon,

I think the backlog from the outage is still bring processed.

At any rate, your message did in fact make it out.

- -chris

On 5/9/14, 12:14 PM, Leon Rosenberg wrote:
 I am wondering that I don't see any mails for a whole day on the
 list, this is pretty unusual, so I try with a TestMail
 
 Leon
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTdCakAAoJEBzwKT+lPKRYgrQP/R2l+E0oYiSagMsZOvn3S2fz
eGX5PkNd0TfoKklEtNt1evLdvwpJWVx5o6dvRVGmxIgnTqa8XXEbfOyfMJ5xTgOO
b3pegaQmT82hv/kTu/agrHvbv5ALuvkJyKH/iXS8N2A0KrvaktSXia7jAJYyz0X6
2MWF0+vtyCwnpj6TTby8B9iJhz7VA4pR5g7e4sDNoqBFjro4K5ME7AGY3ReOSNvv
6H0Bcqi4huFfIpzcvXSMtr5AKqB+Cww32IKDz9J5ZxzdgT7nOGVKfBJNFdiXPISS
SEHBUfh4c3ObPvcTsFjcZiSPzcMYCamPKeKcy+3zJpk8jWM4UXH4eQaHyrcBnJNN
IsiykvKwlQnJPqIkVvce2ChiJ4GoJBiDzK/ebUHb87JSL4iS3u4FuZ2IkTFpHVgQ
u1p8KIbbU8JPnQKL9fuUMxLDU4d6y4lDCVOefZ29CcdUYxvUtNV5mbbYF6yrc0Hi
Rl4vZVw2R8Z03Ef69Vq5MYh5OpNcXr8N77p1sFV5Rrd9Gz4jPx/WBJ2befsgsG7e
0zPwWoy980noboGqEUbimrsH53IYst5NIaaZsH8/RemGjALPX4oMcKkE+J3sI8gu
vi4/mYTfQrR3jmdH9nmFq2bknkIRDbwV8LxZr5GHBNw+AYC4/7ayOIrD0WNi6GM9
LbQlttJS9OSyZ1sw7rtu
=NWnX
-END PGP SIGNATURE-

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



Application monitoring

2014-05-15 Thread David kerber
I am working on a small Tomcat servlet to monitor other tomcat-based 
applications running on the same physical machine, and am trying to 
figure out the best way to communicate between the monitoring app, and 
the monitored apps.


My setup has several tomcat instances of a single application, each 
running from its own directory, and listening on its own TCP port.  So 
there is no direct communication between the instances.


I'm trying to monitor various data about the application, not about 
tomcat itself or the JVM. So I want to collect such things as the number 
of requests it has processed, the last data received, etc, and not 
things like memory and cpu usage.  It is my app, so I can (and expect to 
need to) add methods or servlets to return the information I want to 
collect.


My question is, what is the best way to make the request to get the 
data?  Would  URL request from the monitoring app to the monitored app 
be appropriate, and then parse the response out for display in a 
browser?  If so, what java class is likely to be useful for this 
communication?  I will have all the information needed to connect to the 
application instance (server, port, etc), but want it to be portable 
across OS types.


Thanks!

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



Re: Tomcat 8.0.3.0 getting never before seen by google Illegal State Exception. Sevlets outputting the audio output from the previous runs of the program instead of the current run.

2014-05-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Leigh,

On 5/1/14, 9:22 AM, L. HAYWARD wrote:
 https://github.com/Leighbee13/RUNTHIS/tree/master

For your first web application, you just *had* to use jQuery, eh?

Okay, I've got no jQuery experience, but it looks like when you click
the Add Song button, the add_more handler runs:

$('#add_more').click(function() {
var current_count;
if ($('.addsort').length !== 0) {
current_count =
parseInt($('#inputs').children(':last-child').children().first().attr('name'));
}else{
current_count=1;
}
var next_count = current_count + 1;
$('#sortable').append('li id= song' + next_count + '
name='+next_count+
' class=ui-state-defaultspan class=ui-icon
ui-icon-arrowthick-2-n-s/span img class=deletesong
src=images/delete.png alt=del width=20 height=20 style=float:
right;/li');
$('#inputs').append('pinput type=file id=file_' +
next_count + ' class = addsort name =' + next_count + '
accept=.wav, .au* required//p');
});

This is the markup from your JSP:

div id=inputs
pbutton type='button' id=add_more
style=float: right;Add Song/button!--a id=add_more
href=#Add song/a--/p
h3Songs:/h3
p input type=file class= addsort
id=file_1 name =1 accept=.wav, .au* required//p
/div

If I read the jQuery code correctly, it's going to choose the first
child of the last child of the DIV and use that element's name as
the current_count, then add one to it to get the next_count.

I believe the first child of the last child of the DIV is actually the
button, which would make the current_count nil, as it has no name
attribute. If I've got this wrong, please correct me.

You might want to eliminate the jQuery from the equation and just
hard-code the form to have some specific number of file inputs and
just leave some of them blank for testing. You can always check for
null-ness on the server side (and you should, since the user could
always leave one of the dynamically-added ones blank).

Okay, comments on the actual Java code:

1. Do not have doGet call doPost. It's not going to work. Just remove
goGet entirely, and the parent class will return a Method Not
Supported error to the client.

2. What does the stdout log usually look like for a good run? How
about a bad one?

3. If the part.write() call fails, you are screwed. You shouldn't just
(log and) ignore the exception. Instead, you should blow up and tell
the user that something bad happened.

4. What's the program select thing? Does that interact with the
other audio clips uploaded? Why are you using a java.util.Scanner?

5. When you call requestDispatcher.forward(), you need to return from
the doPost method ASAP. The way your servlet is written, the rest of
the servlet will continue on running (trying to overlay the songs,
etc.) and chaos will ensue. You can simply put a return; after the
call to requestDispatcher.forward(). I'm specifically looking at the
forward() call at line 109.

6. I'd recommend that you use an array of java.io.File objects as the
parameter to your overlay() method, but that's more of a matter of
taste than anything that will affect your program. You could also use
a set of InputStreams and writing the individual audio files to the
disk manually. I'm not sure that would improve anything other than a
bit of a performance gain. It would simplify your code, which is
always a nice thing to do. Feel free to ignore this entire comment, as
it shouldn't change anything about the correctness of your code.

7. You are allocating enormous byte buffers to read-in the audio clips
in their entirety. Is that strictly necessary? Also, you are
truncating long values to int values. For your testing, I assume that
you are never exceeding Integer.MAX_VALUE, but you could be surprised
by something like that. I realize this is toy code but if every
dissertation would include decent code, the world would be a better place.

8. You are doing a lot of manipulations across many buffers that could
probably be combined into fewer operations: reading bytes, packing
bytes, summing integers, unpacking bytes, then re-encoding as an audio
clip.

9. Your overlay() method should probably take the name of the target
file as a parameter. That way, the caller will know where the file is
going. Then, provide the same file name to the finish() method. That
way, the target file name is only specified in a single place, and you
can change it whenever you want (like if you want to make this thing
work with multiple users, it needs no further modification if the
doPost method chooses its own unique target file name for each request).

10. In your finish() method, you should buffer the reads and writes to
improve performance. Feel free to use a BufferedInputStream to read
the file, or you could just use your own byte[] buffer. Processing
files one byte 

destroySubcontext failing with NameNotFoudException

2014-05-15 Thread N, Ravikiran
Hi all,

I trying to understand under what conditions destroySubContext fails in 
tomcat..? I'm trying to destroy Context which I had created, because of which 
I'm unable to createContext the next time I start the service.  My code is 
below :

private Context srvCtx;
public void init(ServletConfig servletconfig) throws ServletException {
Context initCtx = new InitialContext();
srvCtx = initCtx.createSubcontext(myapp);
}

public void destroy() {
try
{
if (srvCtx != null)
{

srvCtx.destroySubcontext(GS_CTX_NAME);
srvCtx.close();
}
}
catch(NamingException e)
{
log_.error(new 
LogQueueMessageStructure(Couldn't unbind the context,3016),e);
}
}

What is wrong with my code and also how can I debug this issue..? Please help 
me out..!!

Regards,
Ravikiran N




Session fixation Tomcat 7

2014-05-15 Thread Akash Jain
Hi,

I am trying to resolve session fixation issue with tomcat 7.0.52

We have a Spring MVC application running on it, and the Auth method is
provided by another application which writes cookie, and we use the cookie
value to check whether the user is valid or not.

My application URL patterns are
/ - Home page
/login - Redirect to another application to ask user to authenticate
/myaccess/user*** -- All authenticated URL's

Context path=
 docBase=myapplication
 sessionCookieName=mycookiename
 sessionCookieDomain=application.mydomain.com
 sessionCookiePath=/

As I cannot use org.apache.catalina.authenticator.FormAuthenticator here.

How can i prevent the session fixation ?

Thanks.


Re: Tomcat and Chunked Transfer-Encoding

2014-05-15 Thread Walter . Heestermans
Hi,

We still have this issue open. The problem is happening from time to time. 
I have some wireshark logging. can this help you to further investigate?

Walter




From:   Konstantin Kolinko knst.koli...@gmail.com
To: Tomcat Users List users@tomcat.apache.org, 
Date:   03/02/2014 19:58
Subject:Re: Tomcat and Chunked Transfer-Encoding



2014-02-03 Mark Thomas ma...@apache.org:
 On 03/02/2014 12:46, walter.heesterm...@toyota-europe.com wrote:
 I can't reproduce it with simple web application, it happens in one of 
our
 applications, SDL WorldServer application which we bought for
 translations. Even there the issue is random.

1. When response mixups happen, the first thing I would recommend is
to set the following system property (you can add it to
catalina.properties file):

apache.catalina.connector.RECYCLE_FACADES=true

Documentation:
http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Security

That will make your configuration more secure (at price of some
performance) and will raise the chances that meddling with
requests/response objects outside of their lifecycle would not go
unnoticed.

Then look for any odd messages in the log files. E.g. attempts to write to 
a
closed stream, or an IllegalStateException, etc

A known culprit is javax.imageio.ImageIO API
http://wiki.apache.org/tomcat/FAQ/KnownIssues#ImageIOIssues

So far it looks like an application issue, as Mark mentioned.

2. The convention on this mailing list is to do not top-post.
http://tomcat.apache.org/lists.html#tomcat-users
- 6.

3. What connector implementation are you using?

HTTP/AJP?
BIO/NIO/APR?

I guess that you use HTTP and are behind an HTTP proxy.

4. Do you use any Asynchronous IO, Comet, WebSockets (e.g. via
Atmosphere framework)?

5. In your traffic snippet,
does that HTML response match the request, or a previous request?

What generates those scrollTo  script fragments?

6. Note that you can configure AccessLogValve to log your thread name 
(%I),
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html

Best regards,
Konstantin Kolinko

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






This e-mail may contain confidential information.
If you are not an addressee or otherwise authorised to receive this message, 
you should not use, copy, disclose or take any action based on this e-mail. 
If you have received this e-mail in error, please inform the sender promptly 
and delete this message and any attachments immediately.