Re: best practice for temporary file

2018-07-17 Thread James Finnall
Thank you!

Had some problems but I was able to research the issues and find a
solution to what I was doing wrong.  I did not have a "/cdn/ROOT"
directory, mine is "/webapps/ROOT".  The Resource section needs to be
with-in the Context section and not after it.  My original context.xml
file only had two lines.  I had to use two different file paths, since
the application path (/opt/tomcat/..." is different from the client
path (/temp/...).

Once I had the issues corrected it worked great.  Thank you, again.
James

On Tue, 2018-07-17 at 10:36 -0400, Chris Cheshire wrote:
> 
> James, this can be done using something like the following
> configuration in your META-INF/context.xml (I use tomcat 8.5)
> 
> 
>    className="org.apache.catalina.webresources.DirResourceSet"
> base="${catalina.base}/cdn/ROOT/images"
> webAppMount="/images" />
> 
> 
> I use this to serve files at /images because they are dynamic content
> and not part of the war itself. Make sure the directory specified by
> "base" has read and write permission by the tomcat user at the OS
> level and then you can serve files with a uri starting with /images/.
> 
> HTH
> 
> Chris
> 
> On Tue, Jul 17, 2018 at 10:21 AM James Finnall 
> wrote:
> > 
> > 
> > 
> > Hello all,
> > 
> > What is the best practice under Tomcat to create a data file and
> > then
> > allow the client to download it?
> > 
> > So far all my attempts have failed.  If the Java app can write it
> > then
> > the client can not download, if client can download then the Java
> > app
> > can not write it.
> > 
> > Does Tomcat have a provision to create a directory that be shared
> > by
> > both the app and the client?
> > 
> > 
> > Thank you for your consideration,
> > James
> > 
> > 
> > -
> > 
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org

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



Java licensing

2018-07-17 Thread Jeffrey Beckstrom
How will Oracle's new licensing of Java affect Tomcat?

Jeffrey Beckstrom
Lead Database Administrator
Information Technology Department
Greater Cleveland Regional Transit Authority
1240 W. 6th Street
Cleveland, Ohio 44113



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

RE: 21 second pause that randomly happens

2018-07-17 Thread charlie arehart
Going back to David's original note, you wrote, " We have a customer who is 
experiencing a random, 21 second pause when using out Tomcat based application 
server. We believe this may be during a TCP connect and timeout. Logging 
indicates the pause happens before the request makes it to our back end."

Can you clarify what you mean by the "back end" here? 

Since you say it's a pause "when using" Tomcat, I can't tell if you're saying 
Tomcat IS the backend, or instead if the request hangs WHILE running in Tomcat 
but doesn't reach some other "backend" that the Tomcat-based app should then 
talk to. You did refer in a later note to a "backend agent log", so I'm 
inclined to think it's the latter.

In that case, it seems you are wondering (in one note) whether the request 
might be hung up in the connector (getting TO Tomcat). 

But do you know for sure whether the request is actually running IN Tomcat? You 
could use any of various JVM or Tomcat monitoring tools to know a) if the 
request reaches Tomcat, b) if it is hanging while running there, and then c) 
just WHAT the request is hanging and waiting for (which could well be that 
"other backend" the app needs to talk to). 

But before elaborating on approaches, I wanted to ask what you may or may not 
know in regard to the above, first. :-)

/charlie 



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



Re: best practice for temporary file

2018-07-17 Thread Chris Cheshire
James, this can be done using something like the following
configuration in your META-INF/context.xml (I use tomcat 8.5)


  


I use this to serve files at /images because they are dynamic content
and not part of the war itself. Make sure the directory specified by
"base" has read and write permission by the tomcat user at the OS
level and then you can serve files with a uri starting with /images/.

HTH

Chris

On Tue, Jul 17, 2018 at 10:21 AM James Finnall  wrote:
>
> Hello all,
>
> What is the best practice under Tomcat to create a data file and then
> allow the client to download it?
>
> So far all my attempts have failed.  If the Java app can write it then
> the client can not download, if client can download then the Java app
> can not write it.
>
> Does Tomcat have a provision to create a directory that be shared by
> both the app and the client?
>
>
> Thank you for your consideration,
> James
>
>
> -
> 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: 21 second pause that randomly happens

2018-07-17 Thread tomcat

Some additional comments in the text below.

But as a general comment : neither tomcat nor your application seem to log any error. This 
suggest that when a connection is established by the client, and it sends a request to 
tomcat on that conection, it does get processed without error (and apparently without an 
extraordinary long delay). If there was a problem at the tomcat level either reading the 
request, or processing it, or sending the response to the wire (from the tomcat point of 
view), then you would see errors in those logs.

(Such as "client broke connection" or "timeout while reading request" or 
similar).

This all suggests that the problem is indeed down either at the TCP/socket level on the 
tomcat server, or even at some other intermediate agent level.
If the socket Tomcat is using is a java socket, then it is at the JVM level that you need 
to look for logging capabilities. If it is a "Tomcat native" socket, then it would be at 
that level (because that is native code, not java).
(Otherwise said : tomcat will never be aware of, or have access to data related to, TCP 
packet transmission/retransmission issues; and even less your application)



On 16.07.2018 20:48, David Cleary wrote:

On 16.07.2018 16:35, David Cleary wrote:

2018-07-16 15:55 GMT+03:00 David Cleary :

We have a customer who is experiencing a random, 21 second pause when using out

Tomcat

based application server. We believe this may be during a TCP connect and 
timeout. Logging
indicates the pause happens before the request makes it to our back end.



Logging where then ?


Sorry for any formatting issues. I have a digest subscription which doesn't 
lend well to interactivity.

Clients are running on Windows machines. Server is running on AWS and Linux. 
There is a cloud firewall in between (pfSense). Do not have the details if they 
are running the cloud version available on AWS.

Client logging shows this:

[18/05/16@12:12:48.822+1000] P-006760 T-002372 1 4GL REVTrying 
Connection
[18/05/16@12:13:09.925+1000] P-006760 T-002372 1 4GL REVConnect 
Complete 21102
[18/05/16@12:13:09.925+1000] P-006760 T-002372 1 4GL REVWARNING: 
LONG CONNECTION


From the point of view of the client (low-level), the TCP connection is with the 
front-end firewall/load balancer. The firewall has a separate TCP connection with the 
back-end server, and copies packets between these two connections, changing 
addresses/ports as required.
I do not know the client, and I guess tht it is possible that these "connection" messages 
relate to the logical connection with the application, rather than purely the TCP level.

But it sounds somewhat unlikely.
Do you have any way to re-configure this (for testing) in such a way that the client would 
bypass the firewall/load-balancer and connect directly to your application server ?

(and see if the issue happens also then)



[18/05/16@12:13:09.925+1000] P-006760 T-002372 1 4GL REV
A4DC513EA548E24508E1E90AA9EA61DD9386DDB475AD.clintons connected 21102

Localhost access log shows this

localhost_access_log.2018-05-16.txt:10.255.11.250 - - [16/May/2018:12:13:16 +1000] 
"POST /apsv?CONNHDL=A4DC513EA548E24508E1E90AA9EA61DD9386DDB475AD.clintons HTT 
P/1.1" 200 253 1



The access log line is written when the request is in effect terminated (processed) and 
the result has already been sent to the wire (that is e.g. how it can log the size of the 
response).  I think that if you look at that Access Log in the documentation, you will 
find tat you can log additional details, such as how much time it took to process the 
request e.g.

But so far, that does not seem to be relavant to the problem at hand.


And our back end agent log shows this:

clintons.agent.log:[18/05/16@12:13:16.294+1000] P-019364 T-2819262208 2 AS-19 
AS Application Server connected with connection id: 
A4DC513EA548E24508E1E90AA9EA61 DD9386DDB475AD.clintons. (8358)
clintons.agent.log:[18/05/16@12:13:16.299+1000] P-019364 T-3688318720 2 AS-19 
AS Application Server disconnected with connection id: 
A4DC513EA548E24508E1E90AA9E A61DD9386DDB475AD.clintons. (8359)



So again, no problem visible at that level.


Customer had some weird reconnection logic that was part of their application. 
After removing the code so the logical connection would be kept open, we saw 
this pause happen on a standard request. I do not know how long this logical 
connection was idle before running. I also do not know if Tomcat closed the 
underlying socket either due to resources or a keep-alive timeout. I was hoping 
logging could tell me when Tomcat binds to an incoming socket and releases it. 
I was hoping to show in the above example, as far as Tomcat is concerned, the 
21 second delay happened outside of the server. Scouring the source code and 
trying some experimentation, it does not appear there is logging available at 
the socket level.

   It mostly happens

when we create an initial logical connection, but we 

best practice for temporary file

2018-07-17 Thread James Finnall
Hello all,

What is the best practice under Tomcat to create a data file and then
allow the client to download it?

So far all my attempts have failed.  If the Java app can write it then
the client can not download, if client can download then the Java app
can not write it.

Does Tomcat have a provision to create a directory that be shared by
both the app and the client?


Thank you for your consideration,
James


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