-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Leigh,

On 5/1/14, 9:22 AM, L. HAYWARD wrote:
> On 30/04/14 23:39, Konstantin Kolinko wrote:
>> 2014-05-01 2:00 GMT+04:00 Hayward, Leigh
>> <lh...@student.le.ac.uk>:
>>> OK so I just spent an age trying to push my project to a
>>> GitHub repositry but I think i must just be too tired to use my
>>> brain correctly. Eventally gave up and just pasted my servlet
>>> into a file there. 
>>> https://github.com/Leighbee13/RUNTHIS/tree/master Let me know
>>> if this works!
>> 
>> An interesting servlet...
> 
> Yeah this is my first thing that I've made myself alone from start
> to finish so it's not good.

I haven't looked at the code, yet, but don't sell yourself short. You
are trying to do some interesting work (the audio stuff) and then slap
some plumbing around it to get it to work. This is uncharted territory
for you. It may be a mess, but having other people look at your code
is a good way to improve.

If I knew I could get a PhD by writing a servlet, I'd have done it a
long time ago :)

>> The problem is that the names of your temporary files are
>> constant ones.
>> 
>> So if several requests are coming at the same time. several
>> users' data will be written into the same file.
>> 
> 
> I am just writing this for a dissertation project so it's just
> handling 1 request right now, from me, in netbeans. So this error
> shouldn't be to do with multiple requests, right?
> 
> I did a test and used a random number generator to generate file
> names instead of a count and it gives me null pointer errors when
> trying to concatenate now.
> 
> When it was overwriting, if it couldn't find the file it needed it
> would just use the previously successfully uploaded file instead
> of nullpointer-ing. But why isn't the file correctly uploaded by
> the time the concatenate method try's to access it?

This might have to do with the error you are getting. See below.

> What does "java.lang.IllegalStateException: The resources may not
> be accessed if they are not currently started?" mean?

It sounds like your web application is restarting itself -- probably
due to modifications to the code. When Tomcat is configured to
auto-reload applications, you can trigger a re-load by re-compiling a
class. In something like NetBeans, that's probably trivial do to...
just save the file and it will probably re-compile and re-deploy.

Try not doing that when running your tests... it may solve a great
deal of your problems.

>> If a user hasn't completed downloading her file, and another
>> requests comes in,  the "finished.wav" file will be overwritten
>> with new data.
>> 
>> Best regards, Konstantin Kolinko
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> I screwed up the formatting for this email since I was being forced
> to use outlook at uni, but now I'm on a linux machine with
> thunderbird so it shouldn't happen again. The original question had
> a better explanation and the errors that I was getting.
> 
> It seemingly randomly works correctly (i.e. outputting the
> correctly manipulated audio file) but sometimes, the file from a
> previous run of the program is output instead, and I get one of
> these errors:
> 
> SEVERE [http-nio-8084-exec-30] 
> org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads
> The web application [/MyApp] is still processing a request that has
> yet to finish. This is very likely to create a memory leak. You can
> control the time allowed for requests to finish by using the
> unloadDelay attribute of the standard Context implementation.

You are definitely re-loading your web application. When this happens,
a new copy of the webapp is deployed and can handle requests with your
new code. If the old code is still actively running (i.e. still
processing a request), you can get .. confusing results.

You should take a thread dump [1] when this happens. It will tell you
what code is (still) executing. Make sure you do it before you make
another request to your web application.

> (n.b. i did use unloadDelay and it made no difference.)
> 
> and to me seemingly random numbers of these errors:
> 
> "SEVERE [http-nio-8084-exec-87] 
> org.apache.coyote.http11.AbstractHttp11Processor.process Error 
> processing request java.lang.IllegalStateException: The resources
> may not be accessed if they are not currently started?"

The web application has officially stopped, but some code is still
trying to operate within it. If you have a long-running request that
survives the re-start (as evidenced above), then you'll get weird
errors like this.

> These second errors are ungooglable. The only reference to them is
> on svn commits from tomcat devs.
> 
> The files always upload correctly to my filesystem, but something
> is going wrong when I try to access them in order to concatenate
> them.
> 
> It sometimes produces the wrong output but with no errors, but the 
> errors never occur when the expected output is created.

Good to know.

> I hope that makes sense. I've added my jsp, javascript and css to
> my github repositry to see if that helps!
> 
> https://github.com/Leighbee13/RUNTHIS/tree/master

I'll take a look at both sets of files. Hopefully it's not too much
code. Remember to thank the Tomcat community in your thesis
publication. ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTaoqzAAoJEBzwKT+lPKRYzJsQAMXWX5jJ+PUxlSagSa3bZkFQ
LaF8NYxacftGghKWW76jhYaPYp49lu4dW+kyshJI4KNGWbZXc8uD8L+u3QeyklJ1
FdcfaX3+M/ZZdcEsfl61BCDTCf0QBcdDLjM2T/agAklOu2sxPWf/R9QoGf/Icnzk
yJHwILsF3vyhfx0UysNm4rq1/ZLiSqOO2XsbCWUky0zClGE5IzbqRSWVGTn2gDRT
nTSWXEyEBPozyInGqbyZlJk460I9OD78l3OXdmxP/67fQx2rNUfC/tyKVHxU4TS5
lIw9F+cJyuZKXxT37MD75w3p8j0g135bhGTCHXvnLchoF3vExZAXi10oIkPHJWIy
0Po+oRgqGsLdW9iFomhh8DsPDIX1bgZRUlRgi78mE6Z61bKt0fJUKa8Ug1QqoQTH
IB16fOAhCCD3wwwAhPrcCfQnQrRgdxaaQiY6r2fQkHlDQ8WC9eQedBtECK+w5zdl
+eoK9qOKagsvfjQZ3N8qrusxfL7vx1hSLPoESkxvFXF2AqhCIKyvz4ut1RBckA0i
eviUXNXpiOJW099D+L3duw5X9QnYjPAIbm9eCZp2U2sfmaYVXyzNxzZjCdMt0hNJ
kXXy9TisVlfKl8MR9bUIewalAq+xWL1vSoV3VgrwNaTbWScc2p68schHxrDpYMTT
rjGN0Nca+fZJ5kr6ynmm
=z2Ts
-----END PGP SIGNATURE-----

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

Reply via email to