Is there a limit to mod_jk?

2019-04-24 Thread John Larsen
Hello,

Is there a limit to the number of workers instances mod_jk can handle?

I currently have 38 tomcat instances running on a machine. I have had up to
75 in the past, but this machine I keep getting bind exception errors but
lsof -i :port comes up empty when that particular tomcat is offline.

Im at loss as to what is causing it. Usually bind exceptions is when
another java process is running on the same port - but not the case here.
Even if i shutdown apache where mod_jk isnt being used tells me this is
really unrelated to mod_jk

mod_jk.log:
[Thu Apr 25 04:14:07.458 2019] [30178:139932601325312] [error]
ajp_service::jk_ajp_common.c (2796): (w314) connecting to tomcat failed
(rc=-3, errors=2, client_errors=0).
[Thu Apr 25 04:14:07.458 2019] [30178:139932601325312] [info]
jk_handler::mod_jk.c (2991): Service error=-3 for worker=w314

I tried updating mod_jk to 1.2.46


John Larsen


Re: Using custom Configurator with WebSockets

2019-04-24 Thread Christopher Dodunski
Thanks Mark, you've made it clear that annotating the interface is not an
option.

Converting my server endpoint from annotation based to programmatic is not
a problem, nor is implementing ServerApplicationConfig to configure what
were previously @ServerEndpoint elements: value, encoders, decoders,
configurator.

What is not clear is how this will solve the problem of Tomcat not
accepting an interface as an endpoint.  Afterall, the programmatic
approach still employs Configurator.getEndpointInstance(), and this is
where I came unstuck with annotations.

Below is the beginnings of my custom ServerApplicationConfig implementation.



public class CustomServerAppConfig implements ServerApplicationConfig {

@Override
public Set getEndpointConfigs(Set> endpointClasses) {
Set result = new HashSet<>();
for (Class epClass : endpointClasses) {
if (epClass.equals(MyEndpointInterface.class)) {
ServerEndpointConfig sec =
ServerEndpointConfig.Builder.create(epClass,
"/websocket").build();
result.add(sec);
}
}
return result;
}

@Override
public Set> getAnnotatedEndpointClasses(Set> scanned) {
return Collections.emptySet();
}
}


Regards,

Chris.


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



Re: Memory Usage

2019-04-24 Thread Mark Thomas
On 24/04/2019 21:46, Simon Funnell wrote:
> Hi,
> 
> I am looking at running a small ecommerce site with about 40-80 users at a
> time on a virtual private server with 4 cores and 1GB of memory, I am
> planning on running apache james, mysql and tomcat on this instance. My
> question is will 256MB maximum heap memory with say 50 threads be enough to
> handle the load without any out of memory errors?

No idea.

I've seen apps with 6GB heap fail with OOME with only 5 concurrent users
and other apps serve 1000s of users with a few hundred MB.

It all depends on the app and we can't see you code. Load testing and
profiling are strongly recommended.

Mark

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



Memory Usage

2019-04-24 Thread Simon Funnell
Hi,

I am looking at running a small ecommerce site with about 40-80 users at a
time on a virtual private server with 4 cores and 1GB of memory, I am
planning on running apache james, mysql and tomcat on this instance. My
question is will 256MB maximum heap memory with say 50 threads be enough to
handle the load without any out of memory errors?

Thanks.


Re: no temp directory creation wanted when embedding Tomcat

2019-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Garret,

On 4/23/19 16:46, Garret Wilson wrote:
> On 4/22/2019 7:58 AM, Mark Thomas wrote:
>> On 21/04/2019 15:53, Garret Wilson wrote:
>>> … But now I realize Tomcat is creating this directory structur
>>> inside the "base dir" I specified:
>>> 
>>> tomcat.8080/work/Tomcat/localhost/ROOT
>>> 
>>> I don't need this directory. I don't want this directory
>>> created. How do I tell Tomcat not to create no danged
>>> directories?
>> The Servlet specification requires (see section 4.8.1 of the
>> Servlet 4.0 spec) that Tomcat provides a private temporary
>> directory for each servlet context (web application).
> 
> 
> I have have several reactions.
> 
> 1. The first is, OK, so the servlet spec requires that the servlet 
> container expose a temporary directory. Tomcat can't provide a
> temporary directory to the consumer unless it has a temporary
> directory, so it's reasonable that it creates one.
> 
> 2. But so far nothing has been stored in this directory, so it's 
> completely unused. I see also in the `Tomcat` class the comment,
> "lazy init for the temp dir - only when a JSP is compiled or get
> temp dir is called we need to create it. This will avoid the need
> for the baseDir". It sounds like you're lazily creating the JSP
> temporary directory, so why can't we do the same for the context
> temporary directory, which may never be used (and frankly probably
> won't be used in many applications)? But OK, that's a quibble; my
> other thoughts are more pressing.

Lazy-creation of the directory cannot be accomplished simply. This is
because there is no API call to get the temp directory that will be
used by the context. Or, rather, the API call is too generic. This is
how a web application should use a temporary directory from within
e.g. a servlet:

File tmpDir = (File)
getServletContext().getAttribute(ServletContext.TEMPDIR);
File myFile = new File(tmpDir, "my.file");
// Use myFile...

The only API call to intercept would be ServletContext.getAttribute,
and we'd have to look specifically for the TEMPDIR attribute key.

This can indeed be done, at varying levels of laziness (on the part of
either the Tomcat programmer, or by the code itself to delay as long
as possible).

> 4. But all this "temporary directory requirement" business is for 
> servlet containers. I started out just wanted to embed Tomcat to
> serve static files; I don't (yet? ever?) need a servlet container
> for this particular application. So how can I use Tomcat to serve
> static files without bringing in the requirements of a servlet
> container?

Tomcat is a servlet container. Just because you don't care to use it
as such doesn't mean that Tomcat should be re-architected.

> Maybe the answer is that Tomcat serves files by using a 
> static-file-serving servlet

It does.

> which in turn requires me to use Tomcat as a servlet container even
> for serving static files, which in turn requires me to have a
> temporary directory I don't want or need.

Yes, but I don't believe the DefaultServlet uses the temporary
directory for anything, here. (DefaultServlet does use the temp dir,
but it only uses it for PUT operations.)

> I suppose that's just the way it is. This is not so much a
> complaint as a desire to confirm I understand correctly how things
> stands. (OK, it's a teeny-tiny complaint, too.)

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzAiy8ACgkQHPApP6U8
pFgUvw/+Mo6JNYrffKTVnbphTN7H+nZ6w54s/XwUxduPyLiYR4w6OFKw1ISF3G89
+mFGxUA4P8dHjgptZdLXpWlJ/DxvGKrQ2dBOc9gs12GJKU9LTQyzAVfemRpYpzwC
eNcVtlrp1lRk6BloRLTjkegcB0wfoM+dL+aB7fznq8rF48cSnF+9DXakpltpCO8d
x2W2F8BqHkuzKpQVx8TIoMeN25eZmMSIVHgEQXC/I7r9/Xivi0Tj+iKj/6JUJzMF
e2J6SAFnQnQRJ2f+EMhHG4Mzc+avcZOwdNbEf2hf8vqly67ztqHWGe3DD/9dHix4
gg52Ynf8jlWS45kQGULUHbyLDUUJH4BcRNKVutEToB+dCcPR0Foqhh8HoAEP07yK
cNfuP8FbQf0n2h2lqFXIWBQeiK3Z3iwVhPi8d10gv4MgRyl3u0Bz5Y9N943ChfLn
rAalljDgbRUGAoNZqIV9xDEl+uBORlCd5F3sfzVeZVSoGbRCb+aTPdmiAQ4C2GSN
Z7pQrbIscLocdUW4Xz1/AMecKJbZtM1/ftLzJi6KKuuEwlyv63gnLoj7hRR28S53
XxcRSgiFuqPHl6oGYEBQyHBmMna33C3YNt9XmhUsiZXdqZAkouh+jiLhdiiATk5A
O45IF9wnK7kBb7J0Pd/jNStbapl7wLIzJCghpkhne4XP8Y6N/Ng=
=THOE
-END PGP SIGNATURE-

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



Re: ApacheTomcat - 8.0. 37: Files are not displaying in sorted order.

2019-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Rahul,

On 4/24/19 09:39, Rahul Ranjan wrote:
> I am facing an issue. I have a link 
> [*href="http://pacir.st.tmt.com/nosrw/data/cast/data/*] to "*CAST 
> Reports*" on my webpage, that redirects to the directory on my
> server "*/opt/app/pacir/nwpeb/data/cast/data/*" and shows entire
> files and folders of directory in browser. _* Code to redirect: *_ 
> href="http://pacir.st.tmt.com/nosrw/data/cast/data/; 
> onMouseOver="self.status = ''; return true" onMouseOut="self.status
> = ''; return true">CAST Reports  
> 
> 
> The issue is the files and folder is not showing in a sorted order.
> I am attaching you a screenshot for your reference.

The default servlet doesn't have any documentation to suggest how
things might be sorted by default, or that sorting is an option *at all*
.

> As I know by default Apache-Tomcat displays the files in a sorted
> order.

Does it?

> I don't know why it's behaving like that.
> 
> Please help me to know, why it's displaying in unsorted order?

FWIW, Tomcat 8.0.x has reached end-of-life[1]. The currently supported
versions of Tomcat are: 7.0.x, 8.5.x, 9.0.x.

There is a bug filed against Tomcat 7.0.x and 8.0.x which deals with thi
s:
https://bz.apache.org/bugzilla/show_bug.cgi?id=57287

It looks like it's been ignored for 4.5 years. Are you interested in
testing the existing patch to see if it works for you?

- -chris

[1] http://tomcat.apache.org/tomcat-80-eol.html
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzAh0wACgkQHPApP6U8
pFjQGg//bS9O8arJzOuSB8LticHouhtrjar0GBsrBZWehma5+doiH9zcQhircS9g
ZX4Yfe17/0aPZkP5fUjThQotZhi7HFzij0yaLf8UkamqmT/0XtPFDFLtofNikSKA
xBm19tfpEHqaIqyQ9oH5BOBLVlrbLdtVVshOs814nImd6KlC3lXxrmLJWtw0jcOn
8ttKqMDMJrp0tM6quZgan0bBrNzO1xv1hS2B7r1X9bWOuwjdtuFHHEXjYcSTTO+Y
Upx8w3NZpLwyuiunNgN+Ta0dSOZ58wQJfKqM6og58FONDmveDNqMhlD3ChfCcmRk
V3T6x70KIEZf6NrzYO7ZYJJrZv/FjNarHplxvEAm6B2rZ9z/4p2bx4r4pE0bs0Xc
mrqO2k3MmsC7XlzcyjnsT9GmHfWt+C6XZz8lhzfkB24EzyzZ/9KmgvT2acBUfXv3
NKDOiPaZxzRkoHrrUKLolR6WajDqdA2TuD96ifWFttTGgfesg1LuiKtGl1K9sLq2
tG+cGFiNMYHpTVUBDwHJK/JkRyjQIDxCsJaXOJBJvAdFKi0u7XX51o6it2AdsKnO
7loKEYx+Be8Bv+8uasr30EulUnkYRurG/k99i4AIzhpv1RFUh4CjahoLqLcuOXXl
HttOxP824LlxP0iXoJVwMBIUWPuIEPpiMNjB5t1FT1o9zlqd+kE=
=XA9B
-END PGP SIGNATURE-

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



Re: Fix for DBCP-518

2019-04-24 Thread Lazar Kirchev
Hello,

Any update on this?

Regards,
Lazar

On Tue, Apr 16, 2019 at 4:28 PM Lazar Kirchev 
wrote:

> Hello,
>
> Do you have any plans to get the fix for
> https://issues.apache.org/jira/browse/DBCP-518 in the Tomcat 8.5 clone of
> the Commons DBCP?
> The commits with the fix are
> https://github.com/apache/commons-dbcp/commit/81aea944160608838cb2d7cdfb0d9b6893a655d9,
>
> https://github.com/apache/commons-dbcp/commit/3449a42bbaeed0ff5b0d07998169ff2896bf45c7
> and
> https://github.com/apache/commons-dbcp/commit/91f7e267e61047614751763f6c5968a1ff65f82c
>
> Regards,
> Lazar
>


Re: It's possible run PHP on Tomcat 8 without use Quercus?

2019-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pablo,

On 4/23/19 15:55, Pablo Salazar wrote:
> Do you know if exist some GUIDE to configure Tomcat 8 for run php
> files???

There isn't any such guide published by the ASF, nor am I aware of any
particularly good guides to do such things.

My personal recommendation would be to use Apache httpd (or similar)
as a proxy for both Tomcat and the built-in bare-bones web server in PHP
.

- -chris

> -Original Message- From: Christopher Schultz
> [mailto:ch...@christopherschultz.net] Sent: martes, 23 de abril de
> 2019 09:15 a.m.
> 
> To: users@tomcat.apache.org Subject: Re: It's possible run PHP on
> Tomcat 8 without use Quercus?
> 
> Pablo,
> 
> On 4/23/19 08:44, Pablo Salazar wrote:
>> Hi,
> 
>> I am lookling for a solution to my problema.
> 
>> I have Tomcat 8 installet with Quercus for run PHP, but recently
>> I need load Imagick module for a new funcionality on my page, but
>> on the GUIDES of Imagick, it's needed to use php.ini of PHP
>> intsdallation, but Quercus don't have that file.
> 
>> I have insalled PHP on some folder (D: \PCSA\php) so into that
>> folder I have php.ini file, I configure the necesary lines fot
>> Imagick so, when I run pgp -i | findstr -i "imagick" the moduel
>> t's loaded, but when I run http://hostname:9095/phpinfo.php (that
>> file it's for phpinfo() function) the response it's for
>> configuration of Quercus, I mean, load PHP of Quercus, not
>> d:\PCSA\php.
> 
>> First question: How can I run PHP on Tomcat  8 without Quercus?
> 
> I'm certain the answer is "yes", but it might be easiest to use
> Quercus.
> 
> I'd never heard of Quercus before, but it's last release was back
> in 2014. I'm not sure you want to trust something that old.
> 
>> Second Question: How can I configure Quercus for load Imagick
>> module?
> 
> I think you'll want to ask that question in a Quercus forum instead
> of in a Tomcat forum.
> 
> -chris
> 
> -
>
> 
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
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzAeAMACgkQHPApP6U8
pFigPhAAwAW0AZhxEmrLiVLsedPhHv/D0E0gDWIZ86BR/B6Udz9Y8FfOnUri8vwg
XkfcSO5W9pPo2EdgNJ/MSUAk5VHvIuGPAKkM87zqCLp5nbbb2a8JQm/UPgUt50MB
OgDstkXgoszwFZQuYVhi/YsaPHWXC6h8iWMofl0s0xVSRyQj7r+wzue6j0LJH7PB
wCUbFBiR6SN9dWT4fK9ql1T0c3glN1pqUd9LlwhgUiuhLTrPr2AO/5GHvzAqJxbf
PU0VyI0vX1LNVowwuOYcQMzzs31I3IJTVLiiw4vZyjxowaRowOK6xBilUeaG+Y5Y
ctseetmPohZekWJk/ANJnT3mHmFHkmx2DjhN38lvhYa2ELOyyQG8UfnLp4K2/SN0
GdZiZGOYK8YvQPd3+/iJKiG8I9I+CxN8KXKs6MHZgWPAD4YWkvS+HJS5LtuW3J8N
OxLUt6uyJGPRDWO7PVxtXzKwTrMKJ03GS2Wg+a7bvbfpOeSX2j497LuvmKkRwOWM
fNbliP0Z4JwVOmokjgAC4fDGsaH+JHVbSLP0U8KVPRqA5eGqY29Kkcw/HxUY27h/
xciFwhvJHj/SsUvL5r/xzoHoL+7YiAhDzdQ8fsZiPdDP2s1J3MM/kkRCIMj3wiqD
4xThUaErSUhJlD9mUb/G3FwBW77GcjQNIsRs837sjCt/m4FKqKM=
=nAY2
-END PGP SIGNATURE-

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



Re: Problem in ApacheTomcat - 8.0. 37: Files are not displaying in sorted order.

2019-04-24 Thread tomcat

Hi.

1) this list strips most attachments. If you want to post an image, upload it to some 
shared site, and provide a link to it.
2) look at the Tomcat logfiles (usually in the directory {tomcat installation 
directory}/logs). If there is an error, it is certain that something in the logfile will 
tell you. If you do not understand what it says in the logfile, copy-and-paste the 
relevant portion here and ask for help.
3) you seem to imply that the code which displays the list of files, is part of a webapp 
which you wrote yourself.  Someone here /may/ be able (and willing) to help you debugging 
it, but not without actually seeing that code.
4) if all you want to do, is to allow the display of the list the files present in a 
directory, in alphabetical order, then you do not need special code to do that.  The 
standard "default servlet" already does that for you, if it is set up correctly.


Example :
- create a directory under tomcat/webapps, named "listfiles"
- put some files there (under tomcat/webapps/listfiles/)
- create a subdirectory tomcat/webapps/listfiles/WEB-INF
- in that sub-directory, create a text file "web.xml" with this content :
--begin--

http://xmlns.jcp.org/xml/ns/javaee;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
  http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
  version="3.1"
  metadata-complete="true">


  directory list example

directory list example


default

org.apache.catalina.servlets.DefaultServlet

listings
true




default
/*



--end--

(omit the begin/end lines)
- make sure that all the above is accessible to the user-id which runs tomcat (under 
Linux, that should be "tomcat8")

- restart tomcat
- access the URL : http://(yourserver):8080 (or your tomcat listening 
port)/listfiles

There probably exists an even simpler way to do the above, but that's the first thing that 
I could think of.



On 24.04.2019 14:52, Rahul Ranjan wrote:

  Hi Team,

I am facing an issue which is related to ApacheTomcat-8.0.37. I wrote a
code to display the files/folder in browser. By default it should display
in alphabetically sorted order. But it's not showing.
I have migrated my code from Unix to Linux. In Unix system my code was
working fine. Can you please tell me what could be the problem?

I am attaching you a screenshot for reference. I will appreciate any help.
[image: image.png]
*Regards,*

[image: Lucida Technologies]

RAHUL RANJAN
C++ Developer | IBM
Mob   : 9570311276
Skype: rahulranjan.c...@gmail.com
[image: facebook] 
[image: linkedin] 




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



Re: no temp directory creation wanted when embedding Tomcat

2019-04-24 Thread Mark H. Wood
It seems to me that the problem may be, that you are trying to use
Tomcat but cut away most of its raison d'etre.  Asking Google for
"embedded web server java" will give you a lot of other possibilities
to explore, some of them extremely simple.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu


signature.asc
Description: PGP signature


ApacheTomcat - 8.0. 37: Files are not displaying in sorted order.

2019-04-24 Thread Rahul Ranjan
Hi Team,

I am facing an issue. I have a link
[*href="http://pacir.st.tmt.com/nosrw/data/cast/data/
*] to "*CAST Reports*" on my
webpage, that redirects to the directory on my server "
*/opt/app/pacir/nwpeb/data/cast/data/*" and shows entire files and folders
of directory in browser.

*Code to redirect: *

  
 
 http://pacir.st.tmt.com/nosrw/data/cast/data/;
onMouseOver="self.status = ''; return true" onMouseOut="self.status = '';
return true">CAST Reports
 



The issue is the files and folder is not showing in a sorted order. I am
attaching you a screenshot for your reference.

[image: image.png]

As I know by default Apache-Tomcat displays the files in a sorted order. I
don't know why it's behaving like that.

Please help me to know, why it's displaying in unsorted order?

*Regards,*

[image: Lucida Technologies]

RAHUL RANJAN
C++ Developer | IBM
Mob   : 9570311276
Skype: rahulranjan.c...@gmail.com
[image: facebook] 
[image: linkedin] 


Re: Cannot receive email from tomcat.apache.org

2019-04-24 Thread Mark Thomas
On 24/04/2019 07:27, Mark Thomas wrote:
> On 24/04/2019 02:10, Richard Huntrods wrote:
>> I have confirmed with my email provider that tomcat.apache.org does
>> indeed have nucleus.com on a blacklist. I can provide proof if needed,
>> but I do need to get nucleus.com REMOVED from this blacklist.
> 
> Please provide your proof - to users-ow...@tomcat.apache.org if you
> don't want to post it to a public list.

Your mail host is rejecting connections from the ASF mail server:

>From our logs:

:
208.65.246.133 does not like recipient.
Remote host said: 554 5.7.1 : Client
host rejected: cidr blacklist CPE abuse
Giving up on 208.65.246.133.

There is nothing we can do to fix this. The issue is entirely with your
mail provider.

Mark


> 
> Mark
> 
> 
>>
>> Thank you.
>>
>> -Richard
>>
>> On 4/23/2019 9:14 AM, Richard Huntrods wrote:
>>> I'm still not receiving any email from either
>>> 'users@tomcat.apache.org' or 'users-dig...@tomcat.apache.org' - not
>>> since the tomcat listserv server crash in early April.
>>>
>>> I asked my mail server provider to check their logs, and this is the
>>> reply I received yesterday:
>>>
 Hello Richard,

 I received a response from our email admin team this morning
 regarding your inquiry:
 There were no emails sent from users@tomcat.apache.org or
 users-dig...@tomcat.apache.org to our system between April 15 and
 April 18th.
 There was an email sent from huntr...@nucleus.com to
 users@tomcat.apache.org on
 Apr 17 14:28:59 EST.

 You may want to inquire with the people distributing this digest if
 they can send you a test message to determine what might be causing
 the non-delivery issue, as we are not even seeing it coming into our
 server at this time. 
>>>
>>> This seems odd as I know I saw messages on the archive from that time
>>> - so I should have received at least the digest.
>>>
>>> Since my provider is of little help, I have two questions for the
>>> tomcat.apache.org mailing list admins:
>>>
>>> 1. Is the digest still being emailed on a regular basis? I never was
>>> subscribed to 'users', only to 'users-digest'.
>>>
>>> 2. Could you check and see whether or not tomcat.apache.org has
>>> "blacklisted" the server 'nucleus.com'? This happened to me once
>>> before - a site blacklisted nucleus "because it looked suspicious".
>>> Nucleus.com is a Calgary Alberta Canada internet provider that has
>>> been in business since before 2000 (I've been a customer since early
>>> 2001) and is most certainly not 'suspicious'. They host many of the
>>> larger Calgary business accounts as well as consumer accounts. Their
>>> email servers are robust and secure.
>>>
>>> But - it could be the listserv my not recognize nucleus.com and
>>> therefore won't email to it.
>>>
>>> 3. Is there any way to reply directly to me at this email address from
>>> a 'tomcat.apache.org' mail address so we could test this?
>>>
>>> Thanks,
>>>
>>> -Richard
>>>
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>>
>> -
>> 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



Re: Problem in ApacheTomcat - 8.0. 37: Files are not displaying in sorted order.

2019-04-24 Thread Olaf Kock
On 24.04.19 14:52, Rahul Ranjan wrote:
> Hi Team,
>
> I am facing an issue which is related to ApacheTomcat-8.0.37. I wrote
> a code to display the files/folder in browser. By default it should
> display in alphabetically sorted order. But it's not showing.
> I have migrated my code from Unix to Linux. In Unix system my code was
> working fine. Can you please tell me what could be the problem? 
>
> I am attaching you a screenshot for reference. I will appreciate any
> help.

Note: Attachments are stripped by the mailing list software

As you're asking for code that's not related to tomcat (just happens to
run on it), I'd expect a place like stackoverflow.com to be a better
place for getting debugging help. But either way, here or there: If you
expect anyone to help you debugging your code, you'll need to provide
it. I'm assuming that you didn't attach your code as an image (because
why would you turn perfectly valid characters into a pixellated image?).

Olaf



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



Problem in ApacheTomcat - 8.0. 37: Files are not displaying in sorted order.

2019-04-24 Thread Rahul Ranjan
 Hi Team,

I am facing an issue which is related to ApacheTomcat-8.0.37. I wrote a
code to display the files/folder in browser. By default it should display
in alphabetically sorted order. But it's not showing.
I have migrated my code from Unix to Linux. In Unix system my code was
working fine. Can you please tell me what could be the problem?

I am attaching you a screenshot for reference. I will appreciate any help.
[image: image.png]
*Regards,*

[image: Lucida Technologies]

RAHUL RANJAN
C++ Developer | IBM
Mob   : 9570311276
Skype: rahulranjan.c...@gmail.com
[image: facebook] 
[image: linkedin] 


Apache httpd / tomcat AJP connector(s?)

2019-04-24 Thread tomcat

Hi.

This is somewhat of an arcane question and somewhat straddling httpd and tomcat, so if I'm 
on the wrong list for this, just let me know.


The question is : is there any particular reason why the combination mod_proxy + 
mod_proxy_ajp (in httpd), does not seem to follow the ProxyPreserveHost directive, when 
proxying something from httpd to tomcat ?


Re :
- http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypreservehost
quote : "When enabled, this option will pass the Host: line from the incoming request to 
the proxied host, instead of the hostname specified in the ProxyPass line."

- https://httpd.apache.org/docs/current/mod/mod_proxy_ajp.html
quote : "Note that usually no ProxyPassReverse directive is necessary. The AJP request 
includes the original host header given to the proxy, and the application server can be 
expected to generate self-referential headers relative to this host, so no rewriting is 
necessary."

- http://tomcat.apache.org/tomcat-8.5-doc/config/ajp.html#Proxy_Support

case :
Apache/2.4.25 (Debian)
Apache Tomcat/8.5.14 (Debian)
(on the same host "debx-dev")

(Note: the configuration listed below is fictitious, interpreted/anonymised/summarised for 
the sake of example. I may thus have committed some typo/error; but I hope it provides a 
clear enough idea).


# uname -a
Linux debx-dev 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 
GNU/Linux

On "debx-dev" :
/etc/hosts :
127.0.0.1 localhost myvhost.com mytomcathost.com

httpd config :
...

  Servername myvhost.com
...
ProxyPass /mypath ajp://mytomcathost.com:8009/mypath
ProxyPassReverse / ajp://mytomcathost.com:8009/
ProxyPreserveHost on
...


tomcat server.xml :

...

...

...
  
myvhost.com
mytomcathost.com
...


Request sent to httpd with URL like : http://myvhost.com/mypath
Received "Host" header in httpd :

Host: myvhost.com

Request proxied to tomcat according to above config.

Received "Host" header in tomcat :

Host: mytomcathost.com

?

- Setting "ProxyPreserveHost off" in httpd does not change the behaviour in any 
obvious way
- removing or modifying the "proxyName" attribute in the Connector does not change the 
content of the received Host header in any way (*); neither do the  directives 
inside the 


According to the documentation referenced above, I would expect that the Host header as 
received by tomcat would be


Host: myvhost.com

but that does not seem to be the case.

So is this a case of the documentation being wrong, or me misunderstanding it, or a 
feature in mod_proxy/mod_proxy_ajp, or a bug in mod_proxy/mod_proxy_ajp, or something else ?


(*) this may well be changing the result of request.getServerName() and 
request.getServerPort() methods in tomcat, and I have not tested that.

But the point here concerns the received "Host" header itself.

(**) I have not really tested this right now, but I believe that when using mod_proxy + 
mod_proxy_http, to proxy requests to tomcat over HTTP, the ProxyPreserveHost directive 
*does* change the request Host header content.
(It definitely does when the back-end system proxied-to is another Apache httpd instead of 
tomcat)


-

Note : in a more general sense, I would suggest this additionally :
(I am mentioning this here, just in case such options would be handled by mod_proxy_ajp 
rather than mod_proxy per se, and could be looked at at the same time as the main issue 
above).


In httpd, the "ProxyPass" directive admits a series of "options" such as
ProxyPass [path] !|url [key=value [key=value ...]] [nocanon] [interpolate] 
[noquery]
These have an effect on /this/ ProxyPass directive only (as opposed to /all/ ProxyPass 
directives).
The "ProxyPreserveHost" on the other hand seems "global" in effect, which seems to not 
allow doing this selectively, maybe depending on the request URI or the back-end host 
being proxied to.


It would seem more flexible (and clear) to implement the ProxyPreserveHost selectively, as 
one of the options of the ProxyPass directive, like e.g.


ProxyPass /mypath ajp://mytomcathost.com:8009/mypath preservehost=[on|off]

(It may even be possible to handle this in such a way as to "override" the global 
ProxyPreserveHost directive, so as to preserve backward configuration compatibility).


Thank you.



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



Re: Using custom Configurator with WebSockets

2019-04-24 Thread Mark Thomas
On 24/04/2019 07:16, Christopher Dodunski wrote:
> Hi Mark,
> 
> Looking at the Tapestry-IoC Registry code I notice that although it
> constructs a (plastic) service proxy object, it does cast it to its
> associated interface before making it available from the registry's
> getService() method.  So if I move the WebSocket annotations to my
> interface as previously thought, Tomcat should be getting back from the
> registry what it expects: an instance of the interface annotated with
> @ServerEndpoint.
> 
> Just wondering how this sits with your understanding of the WebSocket
> library.

It won't work. From the Java WebSockets specification:

4.1
@ServerEndpoint
This class level annotation signifies that the Java class it decorates
must be deployed by the implementation as a websocket server endpoint
and made available in the URI-space of the websocket implementation.
*The class must be public, concrete, and have a public no-args constructor.*

(my emphasis)

I don't see a way to do this with annotations. You are going to need to
do it programmatically.

The WebSocket examples that ship with Tomcat include several endpoints
configured this way. There are further examples in the unit tests.

Mark

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



Re: no temp directory creation wanted when embedding Tomcat

2019-04-24 Thread Mark Thomas
On 23/04/2019 21:46, Garret Wilson wrote:
> On 4/22/2019 7:58 AM, Mark Thomas wrote:
>> On 21/04/2019 15:53, Garret Wilson wrote:
>>> …
>>> But now I realize Tomcat is creating this directory structur inside the
>>> "base dir" I specified:
>>>
>>> tomcat.8080/work/Tomcat/localhost/ROOT
>>>
>>> I don't need this directory. I don't want this directory created. How do
>>> I tell Tomcat not to create no danged directories?
>> The Servlet specification requires (see section 4.8.1 of the Servlet 4.0
>> spec) that Tomcat provides a private temporary directory for each
>> servlet context (web application).
> 
> 
> I have have several reactions.
> 
> 1. The first is, OK, so the servlet spec requires that the servlet
> container expose a temporary directory. Tomcat can't provide a temporary
> directory to the consumer unless it has a temporary directory, so it's
> reasonable that it creates one.
> 
> 2. But so far nothing has been stored in this directory, so it's
> completely unused. I see also in the `Tomcat` class the comment, "lazy
> init for the temp dir - only when a JSP is compiled or get temp dir is
> called we need to create it. This will avoid the need for the baseDir".
> It sounds like you're lazily creating the JSP temporary directory, so
> why can't we do the same for the context temporary directory, which may
> never be used (and frankly probably won't be used in many applications)?
> But OK, that's a quibble; my other thoughts are more pressing.
> 
> 3. Since the temporary working directory is on a per-context basis, and
> I've only set the "basedir" for the entire `Tomcat` instance, Tomcat
> must be determining a default temporary directory for the context.
> Surely I'm allowed to explicitly specify a temporary directory on a
> per-context basis, but I sure can't find it. The `StandardContext` seems
> to equate the "temporary directory" with the "work directory". Are they
> really the same? If so, I suppose I can just call
> `((StandardContext)context).setWorkDir(String)`?
> 
> 
>> The best you can do is specify an absolute path that already exists for
>> the Context's work directory. It doesn't need to be writeable. If you
>> are using it for multiple web applications you probably don't want it to
>> be writeable.
> 
> 
> Ah, OK—I had read that response earlier, but didn't understand exactly
> what it meant until I investigated and wrote #2 above. So I guess I was
> right: I need to call`((StandardContext)context).setWorkDir(String)`.
> 
> 4. But all this "temporary directory requirement" business is for
> servlet containers. I started out just wanted to embed Tomcat to serve
> static files; I don't (yet? ever?) need a servlet container for this
> particular application. So how can I use Tomcat to serve static files
> without bringing in the requirements of a servlet container?
> 
> Maybe the answer is that Tomcat serves files by using a
> static-file-serving servlet, which in turn requires me to use Tomcat as
> a servlet container even for serving static files, which in turn
> requires me to have a temporary directory I don't want or need.
> 
> I suppose that's just the way it is. This is not so much a complaint as
> a desire to confirm I understand correctly how things stands. (OK, it's
> a teeny-tiny complaint, too.)

Your reasoning above is correct.

If you don't want the baggage associated with a Servlet container it
might be worth looking at what other solutions are available.

Mark

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



Re: Using custom Configurator with WebSockets

2019-04-24 Thread Christopher Dodunski
Hi Mark,

Looking at the Tapestry-IoC Registry code I notice that although it
constructs a (plastic) service proxy object, it does cast it to its
associated interface before making it available from the registry's
getService() method.  So if I move the WebSocket annotations to my
interface as previously thought, Tomcat should be getting back from the
registry what it expects: an instance of the interface annotated with
@ServerEndpoint.

Just wondering how this sits with your understanding of the WebSocket
library.

Regards,

Chris.


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



Re: Cannot receive email from tomcat.apache.org

2019-04-24 Thread Mark Thomas
On 24/04/2019 02:10, Richard Huntrods wrote:
> I have confirmed with my email provider that tomcat.apache.org does
> indeed have nucleus.com on a blacklist. I can provide proof if needed,
> but I do need to get nucleus.com REMOVED from this blacklist.

Please provide your proof - to users-ow...@tomcat.apache.org if you
don't want to post it to a public list.

Mark


> 
> Thank you.
> 
> -Richard
> 
> On 4/23/2019 9:14 AM, Richard Huntrods wrote:
>> I'm still not receiving any email from either
>> 'users@tomcat.apache.org' or 'users-dig...@tomcat.apache.org' - not
>> since the tomcat listserv server crash in early April.
>>
>> I asked my mail server provider to check their logs, and this is the
>> reply I received yesterday:
>>
>>> Hello Richard,
>>>
>>> I received a response from our email admin team this morning
>>> regarding your inquiry:
>>> There were no emails sent from users@tomcat.apache.org or
>>> users-dig...@tomcat.apache.org to our system between April 15 and
>>> April 18th.
>>> There was an email sent from huntr...@nucleus.com to
>>> users@tomcat.apache.org on
>>> Apr 17 14:28:59 EST.
>>>
>>> You may want to inquire with the people distributing this digest if
>>> they can send you a test message to determine what might be causing
>>> the non-delivery issue, as we are not even seeing it coming into our
>>> server at this time. 
>>
>> This seems odd as I know I saw messages on the archive from that time
>> - so I should have received at least the digest.
>>
>> Since my provider is of little help, I have two questions for the
>> tomcat.apache.org mailing list admins:
>>
>> 1. Is the digest still being emailed on a regular basis? I never was
>> subscribed to 'users', only to 'users-digest'.
>>
>> 2. Could you check and see whether or not tomcat.apache.org has
>> "blacklisted" the server 'nucleus.com'? This happened to me once
>> before - a site blacklisted nucleus "because it looked suspicious".
>> Nucleus.com is a Calgary Alberta Canada internet provider that has
>> been in business since before 2000 (I've been a customer since early
>> 2001) and is most certainly not 'suspicious'. They host many of the
>> larger Calgary business accounts as well as consumer accounts. Their
>> email servers are robust and secure.
>>
>> But - it could be the listserv my not recognize nucleus.com and
>> therefore won't email to it.
>>
>> 3. Is there any way to reply directly to me at this email address from
>> a 'tomcat.apache.org' mail address so we could test this?
>>
>> Thanks,
>>
>> -Richard
>>
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> 
> -
> 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