Re: Embedded vs Standalone Tomcat

2020-10-18 Thread Igal Sapir
Amit,

On Fri, Oct 16, 2020 at 8:32 AM Amit Pande  wrote:

> My apologies in advance if this has been already discussed in the group. I
> am looking for experiences of the community, any nitpicks, etc.
>
> Currently we are using standalone Tomcat version (9.x) to host a web
> applications which are essentially hosting REST APIs.
> We plan to move to micro services model where each web application
> (logical unit of related APIs) will be hosted as a different process.
>
> With this mind, I wanted to evaluate the embedded version of Tomcat.
>

The code for both is the same.  The part that we refer to as "Embedded"
Tomcat contains most of the implementation.  The "Standalone" simply adds a
wrapper around the "Embedded" code that allows you to easily run Tomcat
using configuration files, startup scripts, service installers, etc.


>   1.  Is there any guidance around when to use what?
>

If you have a standard deployment then use "Standalone".

If you deploy a different application and Tomcat is used as a component in
it, you can consider adding the wrapper and launch code yourself, using the
"Embedded" version.

If you plan to write a wrapper for "Embedded" that will do exactly what the
"Standalone" version does then you will likely spend much resources for no
reason, possibly introducing bugs during the process.


>   2.  Are there any feature disparities between standalone Tomcat and
> embedded version? We have fairly extended Tomcat classes for use cases like
> automatic certificate renewal, not having to mention is plain-text password
> in server.xml for key stores, hooking in custom security provider (for
> FIPS) for Tomcat JVM. etc. So we ideally wouldn't want to lose any of such
> capabilities when we move to the embedded version.
>

Same code, I don't see any reason to believe that something would not work
as long as the wrapper code that you add to launch the "Embedded" code
knows how to utilize those.


>   3.  Currently, we have written a Windows SCM service wrapper and manage
> our Tomcat JVM via that (on Windows). Would there be any issue with
> embedded Tomcat if we want to have SCM service wrapper?
>

Same as above.


>   4.  How is the upgrade process different for embedded version?
> Currently, we ship Tomcat with our product and have a well-defined process
> to upgrade Tomcat even with older versions of our product deployed in
> customers' environment.
>

Very similar process - you will have to update the Tomcat JARs and restart
the service.  As always you will have to check and test that no breaking
changes were made in the newer version, though those are rather rare IMO.


>   5.  Externalizing the configuration (like we can do that via web.xml,
> server.xml, context.xml) - any issues, limitations here?
>

You can set the "Embedded" Tomcat to use the web.xml.  If you want to use
server.xml and context.xml then you should really revisit question/answer
1) above.


>   6.  Any differences with resource usages (e.g. heap)?
>

Nope.  It's still a JVM.  If you use the same JVM args for both then you
should expect similar results.

HTH,

Igal



>
> Any help is greatly appreciated.
>
> Thanks,
> Amit
>
>


Java debugger can't find JSP source code

2020-10-18 Thread Igal Sapir
I am setting a breakpoint in a JSP file and it breaks as expected when I
connect with jdb.  But when I try to show the source code near the
breakpoint, I get an error message.

1) I am using the default webapps/ROOT/index.jsp that ships with Tomcat.

2) I have set the init-params suppressSmap=false and dumpSmap=true, and can
see the file index_jsp.class, index_jsp.class.smap [1], and index_jsp.java
in work/Catalina/localhost/ROOT/org/apache/jsp.

3) I run Tomcat with the VM options:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

4) I connect to Tomcat at port 8000 with jdb, trying to specify the
sourcepath:
jdb -attach localhost:8000 -sourcepath
webapps/ROOT:work/Catalina/localhost/ROOT

5) I set a breakpoint with JDB:
stop at org.apache.jsp.index_jsp:16

6) I call localhost:8080 and hit the breakpoint:
Breakpoint hit: "thread=http-nio-8080-exec-1",
org.apache.jsp.index_jsp._jspService(), line=16 bci=157

7) I run the list command, which I expect to show me the source code from
index.jsp near the breakpoint, but I get an error message:
Source file not found: index.jsp

I have tried every path I could think of but to no avail.  What am I
missing?

Thank you,

Igal

[1] $ cat work/Catalina/localhost/ROOT/org/apache/jsp/index_jsp.class.smap
SMAP
index_jsp.java
JSP
*S JSP
*F
+ 0 index.jsp
index.jsp
*L
16,2:115
19,7:118
25,5:125
30:130,3
31,7:133
38:140,3
39:143
40,4:144,3
44:156
45,2:157,3
47,3:163
50:166,3
51,9:169
60,3:178,3
63,19:187
82,2:206,3
84,4:212
88,2:216,3
90,4:222
94:226,3
95,18:229
113:247,3
114:250
115,4:251,3
119,5:263
124,2:268,3
126,6:274
132:280,3
133,7:283
140:290,5
141,2:295
143:297,3
144,2:300
146:302,3
147,2:305
149,2:307,3
151:313
152:314,3
153,12:317
165,4:329,3
169,7:341
176,4:348,3
180,7:360
187,3:367,3
190,8:376
198,2:384,3
200,9:390
209,2:399,3
211:405
212:406,3
213,5:409
218:414,3
219,5:417
*E


Re: Request for Help

2020-07-30 Thread Igal Sapir
On Wed, Jul 29, 2020 at 8:54 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Mohan,
>
> On 7/29/20 10:32, Mohan T wrote:
> > This is build using cruise control .  We have a similar
> > environment wherein this deliverable is working fine without any
> > error. We too k the deliverable from the working environment and
> > moved to the new environment and started the tomcat.
> Do you know if your build process "pre-compiles" JSP files into .class
> files? Have you upgraded Tomcat to a new version since it was working?
>
> Tomcat periodically upgrades the JDT compiler shipped with Tomcat and
> it may not always be backward-compatible with previously-pre-compiled
> JSP files.
>
> If this is the issue -- and I'm not claiming for sure that it is --
> then a re-build of your web application using the compiler shipped
> with the newer version of Tomcat should fix your issue.
>

I wonder also if it's possible that you have two different JAR files with
two different versions of JDT on the classpath?

If that's the case then one version is loaded, but when it tries to call
the method that it expects to have, the other version is found and the
method is not there.

Igal



>
> - -chris
>
> > -Original Message- From: James Moliere
> >  Sent: Wednesday, July 29, 2020 7:53 PM To:
> > Tomcat Users List  Subject: Re: Request
> > for Help
> >
> > Is the war file being built with maven? ...gradle?  ...or using
> > Eclipse?
> >
> > James
> >
> > On Tue, Jul 28, 2020 at 9:34 PM Mohan T  wrote:
> >
> >> Dear All,
> >>
> >>
> >>
> >> In one of the  environments we are using apache-tomcat-8.5.35.
> >>
> >>
> >>
> >> On server start we are getting this exception
> >>
> >> org.apache.catalina.core 28-Jul-2020 13:46:13.407 SEVERE
> >> [localhost-startStop-1]
> >> org.apache.catalina.core.StandardContext.loadOnStartup Servlet
> >> [RVW_Banner] in web application [/security] threw load()
> >> exception
> >>
> >> java.lang.NoSuchMethodError:org.eclipse.jdt.internal.compiler.Compile
> r.(Lorg/eclipse/jdt/internal/compiler/env/INameEnvironment;Lorg/ec
> lipse/jdt/internal/compiler/IErrorHandlingPolicy;Lorg/eclipse/jdt/intern
> al/compiler/impl/CompilerOptions;Lorg/eclipse/jdt/internal/compiler/ICom
> pilerRequestor;Lorg/eclipse/jdt/internal/compiler/IProblemFactory;)V
> >>
> >>
> at
> >> org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java
> :
> >>
> >>
> 480)
> >>
> >> Any inputs to overcome this could help us in this.
> >>
> >> Thanks
> >>
> >> Mohan
> >>
> >>
> >>
> >> DISCLAIMER: This communication contains information which is
> >> confidential and the copyright of Ramco Systems Ltd, its
> >> subsidiaries or a third party ("Ramco"). This email may also
> >> contain legally privileged information. Confidentiality and legal
> >> privilege attached to this communication are not waived or lost
> >> by reason of mistaken delivery to you.This email is intended to
> >> be read or used by the addressee only. If you are not the
> >> intended recipient, any use, distribution, disclosure or copying
> >> of this email is strictly prohibited without the express written
> >> approval of Ramco. Please delete and destroy all copies and email
> >> Ramco at le...@ramco.com immediately. Any views expressed in this
> >> communication are those of the individual sender, except where
> >> the sender specifically states them to be the views of Ramco.
> >> Except as required by law, Ramco does not represent, warrant
> >> and/or guarantee that the integrity of this communication has
> >> been maintained nor that the communication is free of errors,
> >> virus, interception or interference. If you do not wish to
> >> receive such communications, please forward this communication to
> >> market...@ramco.com and express your wish not to receive such
> >> communications henceforth.
> >>
> >
> >
> > -- ---v---v---v---v---v---v---v--- James Moliere
> > james.moli...@j2.com ---v---v---v---v---v---v---v---
> >
> > --
> >
> >
> > This email, its contents and attachments contain information from
> > J2 Global, Inc. and/or its affiliates which may be privileged,
> > confidential or otherwise protected from disclosure. The
> > information is intended to be for the addressee(s) only. If you are
> > not an addressee, any disclosure, copy, distribution or use of the
> > contents of this message is prohibited. If you have received this
> > email in error, please notify the sender by reply email and delete
> > the original message and any copies.
> >
> > DISCLAIMER: This communication contains information which is
> > confidential and the copyright of Ramco Systems Ltd, its
> > subsidiaries or a third party (“Ramco”). This email may also
> > contain legally privileged information. Confidentiality and legal
> > privilege attached to this communication are not waived or lost by
> > reason of mistaken delivery to you.This email is intended to be
> > read or used by the addressee 

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

2020-07-30 Thread Igal Sapir
Hans,

On Tue, Jul 28, 2020 at 5:51 AM Hans Schou  wrote:

>
>
> > Fra: Christopher Schultz 
>
> > Seems like it would be kind of awesome to have a feature like //PS//
> which would dump-out the service as a .BAT file, like:
>
> >  C:> tomcat9w.exe //PS//my-service-name
>
> Yes, that would be great.
> And with JAVA_HOME also.
>
> Right now I have solved my upgrade task with a script which can only
> upgrade from Tomcat 8.5 to 9.0
> As I can not see from command line which tomcat are being used, I had to
> look that up first.
> Then I also have to check if the instance is running Java 8 or Java 11.
> I run tomcat8w.exe to get and set Java options and memory usage.
>
> Here is the script:
>
> IF [%1] == [] (
> ECHO Error
> EXIT /B
> )
> SET INSTANCE=%1
> SET JAVA_HOME=D:\Java\jdk1.8
> rem SET JAVA_HOME=D:\Java\jdk11
> SET CATALINA_HOME=D:\Apache\tomcat-8.5
> SET CATALINA_BASE=D:\tomcat\%INSTANCE%
> %CATALINA_HOME%\bin\tomcat8w.exe //ES//%INSTANCE%
> PAUSE
> "C:\Program Files (x86)\Notepad++\notepad++.exe"
> %CATALINA_BASE%\conf\server.xml
> PAUSE
> NET STOP %INSTANCE%
> CALL %CATALINA_HOME%\bin\service remove %INSTANCE%
> SET CATALINA_HOME=D:\Apache\tomcat-9.0
> CALL %CATALINA_HOME%\bin\service install %INSTANCE%
> %CATALINA_HOME%\bin\tomcat9.exe //US//%INSTANCE% ^
>  --Startup auto ^
>  --DisplayName "Apache Tomcat 9.0 %INSTANCE%" ^
>  --Description "Tomcat 9.0 %CATALINA_BASE% %CATALINA_HOME%"
> PAUSE
> NET START %INSTANCE%
> %CATALINA_HOME%\bin\tomcat9w.exe //ES//%INSTANCE%
>
>
You should be able to set the Java Options with service.bat.  There is an
Environment variable called JvmArgs [1] which is appended to JvmOptions and
allows you to add different Java Options, e.g. set it like so before
calling `service.bat install`:

set "JvmArgs=-Dsome.property=SomeValue;-XX:+HeapDumpOnOutOfMemoryError"

For the heap size set the JvmMs and JvmMx environment variables.

Igal

[1] https://github.com/apache/tomcat/blob/master/bin/service.bat#L228



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


Re: Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
On Thu, Jul 30, 2020 at 12:30 PM Igal Sapir  wrote:

> On Thu, Jul 30, 2020 at 12:25 PM Igal Sapir  wrote:
>
>> Mark,
>>
>> On Thu, Jul 30, 2020 at 12:21 PM Igal Sapir  wrote:
>>
>>> Mark,
>>>
>>> On Thu, Jul 30, 2020 at 12:14 PM Mark Thomas  wrote:
>>>
>>>> On July 30, 2020 5:49:41 PM UTC, Igal Sapir  wrote:
>>>> >Hello,
>>>> >
>>>> >I have the following in web.xml:
>>>> >
>>>> >  - A servlet named Lucee, mapped to by URI pattern "*.cfm"
>>>> >  - A default servlet from Tomcat, with init-param listings=true
>>>> >  - A welcome-file of "index.cfm"
>>>> >
>>>> >My expectation is that for a request to a given directory, if a file
>>>> >named
>>>> >index.cfm exists then it would be passed to the Lucee servlet, and if
>>>> >not,
>>>> >the Directory Listings will be displayed.
>>>> >
>>>> >Instead, requests to a given directory are forwarded to Lucee, which
>>>> >return
>>>> >a 404.
>>>> >
>>>> >Is it possible to configure Tomcat so that it would check if the file
>>>> >exists before matching the URI pattern of the welcome file?  This (as
>>>> >all
>>>> >Directory Listings, I would hope) is for a Development setup so it's OK
>>>> >if
>>>> >the check adds a few more microseconds to the request.
>>>> >
>>>> >Thanks,
>>>> >
>>>> >Igal
>>>>
>>>> Look at the resourceOnlyServlets attribute on Context.
>>>>
>>>
>>> Calling context.getResourceOnlyServlets() returns "jsp".
>>>
>>> Should I set it explicitly to something else?
>>>
>>
>> I see the JavaDoc comment.  I will add the CFMLServlet and try it out.
>>
>
> Calling context.getResourceOnlyServlets("CFMLServlet") solves the issue.
>

I meant setResourceOnlyServlets("CFMLServlet") obviously ;)

Igal


>
> Brilliant!  Thanks Mark and Chris,
>
> Igal
>
>


Re: Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
Mark,

On Thu, Jul 30, 2020 at 12:21 PM Igal Sapir  wrote:

> Mark,
>
> On Thu, Jul 30, 2020 at 12:14 PM Mark Thomas  wrote:
>
>> On July 30, 2020 5:49:41 PM UTC, Igal Sapir  wrote:
>> >Hello,
>> >
>> >I have the following in web.xml:
>> >
>> >  - A servlet named Lucee, mapped to by URI pattern "*.cfm"
>> >  - A default servlet from Tomcat, with init-param listings=true
>> >  - A welcome-file of "index.cfm"
>> >
>> >My expectation is that for a request to a given directory, if a file
>> >named
>> >index.cfm exists then it would be passed to the Lucee servlet, and if
>> >not,
>> >the Directory Listings will be displayed.
>> >
>> >Instead, requests to a given directory are forwarded to Lucee, which
>> >return
>> >a 404.
>> >
>> >Is it possible to configure Tomcat so that it would check if the file
>> >exists before matching the URI pattern of the welcome file?  This (as
>> >all
>> >Directory Listings, I would hope) is for a Development setup so it's OK
>> >if
>> >the check adds a few more microseconds to the request.
>> >
>> >Thanks,
>> >
>> >Igal
>>
>> Look at the resourceOnlyServlets attribute on Context.
>>
>
> Calling context.getResourceOnlyServlets() returns "jsp".
>
> Should I set it explicitly to something else?
>

I see the JavaDoc comment.  I will add the CFMLServlet and try it out.

Thanks!

Igal


>
> Thank you,
>
> Igal
>
>
>
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
On Thu, Jul 30, 2020 at 12:25 PM Igal Sapir  wrote:

> Mark,
>
> On Thu, Jul 30, 2020 at 12:21 PM Igal Sapir  wrote:
>
>> Mark,
>>
>> On Thu, Jul 30, 2020 at 12:14 PM Mark Thomas  wrote:
>>
>>> On July 30, 2020 5:49:41 PM UTC, Igal Sapir  wrote:
>>> >Hello,
>>> >
>>> >I have the following in web.xml:
>>> >
>>> >  - A servlet named Lucee, mapped to by URI pattern "*.cfm"
>>> >  - A default servlet from Tomcat, with init-param listings=true
>>> >  - A welcome-file of "index.cfm"
>>> >
>>> >My expectation is that for a request to a given directory, if a file
>>> >named
>>> >index.cfm exists then it would be passed to the Lucee servlet, and if
>>> >not,
>>> >the Directory Listings will be displayed.
>>> >
>>> >Instead, requests to a given directory are forwarded to Lucee, which
>>> >return
>>> >a 404.
>>> >
>>> >Is it possible to configure Tomcat so that it would check if the file
>>> >exists before matching the URI pattern of the welcome file?  This (as
>>> >all
>>> >Directory Listings, I would hope) is for a Development setup so it's OK
>>> >if
>>> >the check adds a few more microseconds to the request.
>>> >
>>> >Thanks,
>>> >
>>> >Igal
>>>
>>> Look at the resourceOnlyServlets attribute on Context.
>>>
>>
>> Calling context.getResourceOnlyServlets() returns "jsp".
>>
>> Should I set it explicitly to something else?
>>
>
> I see the JavaDoc comment.  I will add the CFMLServlet and try it out.
>

Calling context.getResourceOnlyServlets("CFMLServlet") solves the issue.

Brilliant!  Thanks Mark and Chris,

Igal


Re: Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
Mark,

On Thu, Jul 30, 2020 at 12:14 PM Mark Thomas  wrote:

> On July 30, 2020 5:49:41 PM UTC, Igal Sapir  wrote:
> >Hello,
> >
> >I have the following in web.xml:
> >
> >  - A servlet named Lucee, mapped to by URI pattern "*.cfm"
> >  - A default servlet from Tomcat, with init-param listings=true
> >  - A welcome-file of "index.cfm"
> >
> >My expectation is that for a request to a given directory, if a file
> >named
> >index.cfm exists then it would be passed to the Lucee servlet, and if
> >not,
> >the Directory Listings will be displayed.
> >
> >Instead, requests to a given directory are forwarded to Lucee, which
> >return
> >a 404.
> >
> >Is it possible to configure Tomcat so that it would check if the file
> >exists before matching the URI pattern of the welcome file?  This (as
> >all
> >Directory Listings, I would hope) is for a Development setup so it's OK
> >if
> >the check adds a few more microseconds to the request.
> >
> >Thanks,
> >
> >Igal
>
> Look at the resourceOnlyServlets attribute on Context.
>

Calling context.getResourceOnlyServlets() returns "jsp".

Should I set it explicitly to something else?

Thank you,

Igal



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


Re: Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
Chris,

On Thu, Jul 30, 2020 at 11:20 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

>
> On 7/30/20 13:49, Igal Sapir wrote:
> > Hello,
> >
> > I have the following in web.xml:
> >
> > - A servlet named Lucee, mapped to by URI pattern "*.cfm" - A
> > default servlet from Tomcat, with init-param listings=true - A
> > welcome-file of "index.cfm"
> >
> > My expectation is that for a request to a given directory, if a
> > file named index.cfm exists then it would be passed to the Lucee
> > servlet, and if not, the Directory Listings will be displayed.
>
> This is what I would expect as well. I believe this is how httpd
> works, for example. I believe the default welcome-file list includes
> index.jsp and that's how the JSP servlet is invoked. So this really
> should be working.
>

That's what I thought.  I wonder if Lucee should do something differently
here?  But then again I expect Lucee to never see this request in the first
place.


>
> > Instead, requests to a given directory are forwarded to Lucee,
> > which return a 404.
>
> So Lucee sees a request to /foo/bar instead of /foo/bar/index.cfm?
>
> What does the original request look like -- what is the URL being
> requested by the user-agent?
>

I have the following file structure:

$ tree /test/LuceeDebugWebapp/webapp/
/test/LuceeDebugWebapp/webapp/
├── dir
│   └── hello.txt
├── index.cfm

The dir subdirectory does not have a welcome page, so I'm using Google
Chrome to go to http://localhost:48080/dir/ and expecting to see a
directory listing with hello.txt.  Instead I get a 404 from Lucee, and in
the error message the statement:

  Page /dir/index.cfm [/test/LuceeDebugWebapp/webapp/dir/index.cfm] not
found

curl calls show the same:

calling / or /index.cfm returns the expected 200 OK as expected

$ curl -I http://localhost:48080/
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Content-Length: 5774
Date: Thu, 30 Jul 2020 19:14:32 GMT

$ curl -I http://localhost:48080/index.cfm
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Content-Length: 5774
Date: Thu, 30 Jul 2020 19:14:40 GMT

calling /dir without a trailing slash returns a 302 to /dir/ as expected

$ curl -I http://localhost:48080/dir
HTTP/1.1 302
Location: /dir/
Transfer-Encoding: chunked
Date: Thu, 30 Jul 2020 19:12:36 GMT

calling /dir/ returns a 404 -- NOT EXPECTED

$ curl -I http://localhost:48080/dir/
HTTP/1.1 404
Content-Type: text/html;charset=UTF-8
Content-Length: 6875
Date: Thu, 30 Jul 2020 19:13:27 GMT


>
> Can you post your exact config?
>

Effective web.xml pasted below [1]


>
> > Is it possible to configure Tomcat so that it would check if the
> > file exists before matching the URI pattern of the welcome file?
>
> ??
>
> > This (as all Directory Listings, I would hope) is for a
> > Development setup so it's OK if the check adds a few more
> > microseconds to the request.
>
> Resources can be configured to cache file-check misses (I think!), so
> it would be pretty fast if you needed it to be.
>

Awesome, though I would not expose directory listings in a non-dev
environment.

Here are a few more details on this specific setup, even though I've seen
this with standard Tomcat deployments, and can set up one for sanity check:

- This is an Embedded Tomcat
- I point to web.xml with context.setAltDDName()
- I call tomcat.setAddDefaultWebXmlToWebapp(false) to prevent the unneeded
loading of JSP etc

Also, if this seems to be a bug then I'd be happy to look deeper into it
and solve it.  I just thought that maybe I was doing something wrong.

Thank you,

Igal

[1]
INFO: Effective web.xml:

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_4_0.xsd;
 version="4.0"
 metadata-complete="true">

  
default

org.apache.catalina.servlets.DefaultServlet

  listings
  true


  debug
  0

1
  
  
CFMLServlet
lucee.loader.servlet.CFMLServlet
1
  
  
RESTServlet
lucee.loader.servlet.RestServlet
2
  

  
CFMLServlet
*.cfm
  
  
CFMLServlet
*.cfc
  
  
RESTServlet
%2Frest%2F*
  
  
default
%2F
  

  


  

  

index.cfm
index.html
index.htm
  

  UTF-8
  UTF-8



>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8jD1QACgkQHPApP6U8
> pFjfWBAAj10KspESQkhIcfOKAdFFTHrXbyxmFH6PBlvqusaZ2e/TTpf69wxN8Evp
> f2x2VNuUaE58LLKQGusey0V1a0lGtETHVAcZWiZeY57yiWV9AYkdW88LJY4aXGyr
> TZE5PT12VT

Can Directory Listing and Welcome File List coexist?

2020-07-30 Thread Igal Sapir
Hello,

I have the following in web.xml:

  - A servlet named Lucee, mapped to by URI pattern "*.cfm"
  - A default servlet from Tomcat, with init-param listings=true
  - A welcome-file of "index.cfm"

My expectation is that for a request to a given directory, if a file named
index.cfm exists then it would be passed to the Lucee servlet, and if not,
the Directory Listings will be displayed.

Instead, requests to a given directory are forwarded to Lucee, which return
a 404.

Is it possible to configure Tomcat so that it would check if the file
exists before matching the URI pattern of the welcome file?  This (as all
Directory Listings, I would hope) is for a Development setup so it's OK if
the check adds a few more microseconds to the request.

Thanks,

Igal


Re: Let's Encrypt with Tomcat?

2019-12-26 Thread Igal Sapir
James,

On Thu, Dec 26, 2019 at 4:49 PM James H. H. Lampert <
jam...@touchtonecorp.com> wrote:

> We have a Tomcat (8.5.40) server running on an Amazon EC2 instance,
> currently using a Java Keystore for the SSL support.
>
> We would like to be able to use Let's Encrypt, but I've learned that
> Let's Encrypt and Tomcat don't get along all that well together. The
> best I've found so far are article at:
>
> <
> https://medium.com/@raupach/how-to-install-lets-encrypt-with-tomcat-3db8a469e3d2
> >
>
> and this thread in the Let's Encrypt community forum:
>
> <
> https://community.letsencrypt.org/t/how-can-i-automate-renewals-with-tomcat/81423
> >
>
> Does anybody here have any experience with situations like this? Does
> anybody here have any suggestions? Or, as another alternative, does
> anybody here know of some Amazon AWS product that could front-end a
> single-box, non-load-balanced Tomcat server, and use Amazon's free
> "Public Certificates"? (I've already posted that last to the relevant
> Amazon forum.)
>

You should check out Chris' presentations on the topic.  He outlines a very
efficient process.  There is probably more materials out there, but a quick
search brings up the video [1] and slides [2] from his presentation at
ApacheCon earlier this year, as well as his shell script for automating the
process.

Igal

[1] https://www.youtube.com/watch?v=BWUjvmJgSeE
[2]

https://people.apache.org/~schultz/ApacheCon%20NA%202019/Let's%20Encrypt%20Apache%20Tomcat.pdf
[3]
https://people.apache.org/~schultz/ApacheCon%20NA%202019/lets-encrypt-renew.sh






>
> James H. H. Lampert
> Touchtone Corporation
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Profiler for Tomcat

2019-08-27 Thread Igal Sapir
YourKit Java Profiler [1] is really great in my opinion.

Igal
[1] https://www.yourkit.com/java/profiler/


On Tue, Aug 27, 2019 at 5:12 PM calder  wrote:

> YourKit, AppDynamics, Mission Control, JProfiler, New Relic, ...
>
>
> On Tuesday, August 27, 2019, Michael Duffy  wrote:
>
> > I have searched for a good profiler for Tomcat with little success.
> >
> > I am looking for an application that will profile internal memory and
> > bandwidth utilized (data transfer rates from Tomcat).
> >
> > Any help would be greatly appreciated.
> >
> > Thx!
> >
>


Re: Build Dependencies

2019-04-15 Thread Igal Sapir
Chris,

On Mon, Apr 15, 2019 at 7:52 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Igal,
>
> On 4/14/19 13:23, Igal Sapir wrote:
> > John,
> >
> > On Sun, Apr 14, 2019 at 6:50 AM John Dale 
> > wrote:
> >
> >> Hi Mark;
> >>
> >> Do you have an artifact depicting the dependencies in Tomcat?
> >> I'd like to start building, debugging, and helping-out, but I
> >> just like using Ant and using manual methods for dependencies at
> >> compile time.
> >>
> >> Do I have a chance?
> >>
> >
> > I recommend reviewing the build.xml file along with
> > build.properties.default.  They contain everything you need
> > including dependency downloads, IDE skeletons, etc.
>
> Or just:
> http://tomcat.apache.org/tomcat-9.0-doc/building.html
>
>
Sure, but from my experience the source always reveals more, and more
accurately.  The doc is probably a better starting point though.


> > Also, in the future please rename the subject line when replying in
> > an announcement thread.
>
> No! Don't do that, either. It doesn't break the thread. Instead, send
> a new message to the list.
>

It actually did for me (using Google Mail), but yes, a new thread is the
right way to go, especially since the new message is not related to the
announcement in any way.

Igal


>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAly0mpkACgkQHPApP6U8
> pFiLVA//UdQC2WkxcmuSJQUsifzFr2DC+Ge56dJuZbqBOCxmFnwl2a4dWBC1yc/Y
> WBiV2qH3O1YvtKPgILlhz54777TW2rTjH94Wfzmd9PXGOkhR3VE9LLUReQIcUdr8
> K1C7UNxUnnXQRq6zzcj6v8v1+HZoYtCONt8cIhOaBF3cUIrx4EGTX/+ju72aY2S9
> tI3dylbBbPMdaVAkbSMkwJn6Cx8YUoe+fTJxKpqMj/WLYb6D1FkMbhc7diz4CclI
> NuIqZxxgy/egBd2ZzTeJy6YabD+TsWzdOhtX3WXltgozyfBPxZikxoyiA8WyKvm2
> 1PbHBHjX4qCmcPrtnOKFGLKq6MqfktILKRl14kLk3VtNpSxYfs58N/ijQiiGB68E
> PR3nT+OLz/FiJeR49VmZmEO2GYjzlI3Vv8sUDWBTIhni/mfUAO6LwRsufvPLn4jH
> IjNwEX7LEkmsDTRnMKLWAvbgh7o/KWeUDnpEmZOulYRoumFtdBjk0jdSz73W7wNN
> lhDsqx0nMjvHKYLokVMGLeROMo4RPvw82T20Ny54zAGK/tx/Gkrcf9ULADw11t5O
> w7KgxLlhq/IUZ8xV9qhBGMSL61VIKJV8rmLoX2lBg/ySbYfpQcHXmdreAEIsAro4
> f8o0dERwywu+F8IfDGVUK6Vq8BlBEHtpy/bYjrNu0eBMnNg3YEI=
> =DVWR
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Build Dependencies

2019-04-14 Thread Igal Sapir
John,

On Sun, Apr 14, 2019 at 6:50 AM John Dale  wrote:

> Hi Mark;
>
> Do you have an artifact depicting the dependencies in Tomcat?  I'd
> like to start building, debugging, and helping-out, but I just like
> using Ant and using manual methods for dependencies at compile time.
>
> Do I have a chance?
>

I recommend reviewing the build.xml file along with
build.properties.default.  They contain everything you need including
dependency downloads, IDE skeletons, etc.

Also, in the future please rename the subject line when replying in an
announcement thread.

Best,

Igal


Re: Tomcat Usage

2019-03-21 Thread Igal Sapir

Lucas,

On 3/21/2019 6:57 AM, Lucas Bovetto wrote:

Hello,

I whould like to get a support to a problem that has been happening.
I have scenario that my tomcat stay in 100% cpu usage even though no 
one access, and when it happening nobody can accesses tomcat.


Configuration:
O.S: Windows Server 2008
Tomcat: 8.5
Japa Options:
-XX:+UseParNewGC
-XX:+OptimizeStringConcat
-XX:NewSize=1G
-XX:+CMSParallelRemarkEnabled
-XX:+UnlockDiagnosticVMOptions
-XX:-DisableExplicitGC
-XX:SoftRefLRUPolicyMSPerMB=1
-XX:SurvivorRatio=20
-Djava.awt.headless=true
-Djava.net.preferIPv4Stack=true
-XX:MaxPermSize=512m
-XX:+UseTLAB
-XX:MaxTenuringThreshold=0


We need more information before we can help:

What version of Java are you using?

Can you issue a Thread Dump?

How much RAM does the Tomcat process take when the issue happens?  How 
much physical RAM does the machine have?


Did you set all of these -XX options after research and conclusion that 
they are optimal for your setup or did you just copy and paste them from 
a random post?


For example, if you are running Java 8 then the MaxPermSize is ignored 
because PermGen was replaced with MetaSpace.  You also set explicitly 
the NewSize and the SurvivorRatio and at first glance, without knowing 
anything about your setup, the values don't seem right to me.



Igal




Att,


--

*Lucas Henrique Bovetto*

*Gerente de Desenvolvimento*

_

*_Imagem inline 2_*

*_www.mkdata.com.br _*

*Av. Campos Sales, 420 – Jd. Girassol***

*Americana – 13465-590 – SP***

*(19) 3407-7447*


Imagem inline 3

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


Re: Number of tomcat downloads

2019-02-05 Thread Igal Sapir
On Tue, Feb 5, 2019 at 6:35 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Leon,
>
> On 2/5/19 05:35, Leon Rosenberg wrote:
> > A little background on the original question: we have some legal
> > issues with a client, among other things, he claims that our code
> > isn't documented well, because he run checkstyle on it, and it
> > showed 6000 errors. My argumentation was that default checkstyle
> > settings aren't telling anything about code quality (unless agreed
> > upon upfront). I run checkstyle with default settings on tomcat
> > code base and it showed 85.412 errors using sun code checks (yes,
> > those from 1996). Most of them are like:
> >
> > AbstractFramedStreamSourceChannel reamSourceChannel,AbstractAjpClientStreamSinkChannel>
> >
> >
> this line produces multiple warnings, for example ',' not followed by a
> > whitespace and such.
> >
> > if(attachments == null) - if not followed by a whitespace etc.
> >
> > Hence if such a mature product like tomcat (with 10.000.000
> > installations) contains 85412 errors and is considered well
> > documented, he is using the wrong tool for the task.
>
> LOL try running checkstyle or SpotBugs against WebLogic and see what
> happens.
>

Yep.  That's quite a ridiculous claim by that client.

When it comes to FOSS, though, I always remind complaining clients that
they can get their money back ;)

Best,

Igal


Re: Number of tomcat downloads

2019-02-05 Thread Igal Sapir
Chris,

On Tue, Feb 5, 2019 at 6:32 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Igal,
>
> On 2/4/19 23:52, Igal Sapir wrote:
> > 
> > On that note, should we add Google Analytics to the new site?
>
> Hard pass, thank you very much.
>

I didn't necessarily mean that it has to be GA, even though I mentioned it
by name as it's the most popular tool out there - it was more like saying
"Xerox" instead of "Copier", or "Kleenex" instead of "Tissue".

It can be any tool, including the one you suggested in the other email, but
anyway, as Mark pointed out this decision might be made at a higher level.

Best,

Igal


Re: Number of tomcat downloads

2019-02-04 Thread Igal Sapir
On Mon, Feb 4, 2019 at 3:58 PM Leon Rosenberg 
wrote:

> Hi,
>
> I vaguely remember Marc naming some figures for number of tomcat downloads
> sofar, but I couldn't find anything in the state of the cat slides.
> I checked on the website, but all I found was this:
>
> " Tomcat has been downloaded more than 10 million times: assuming even a 1%
> production adoption rate results in more than 10 installations. "
> But this is from 2014 and I assume there should be a better number by now.
>

I don't think that it is tracked ATM, unless INFRA aggregates the web
server logs and records the metrics somewhere.

On that note, should we add Google Analytics to the new site?  Obviously it
will only give us information moving forward, but it can be interesting.


>
> Anyone? Asking for a friend ;-)
>

LOL 

Best,

Igal


Re: Proper way to set up tomcat 8.5 (autostart and service setup)

2019-01-08 Thread Igal Sapir
On Tue, Jan 8, 2019 at 9:58 AM John Dale  wrote:

> I'm using init.d and a custom script complete with single command
> deploy using git hooks.
>
> git push  master pushes, builds, and  bounces Tomcat. I like
> it very much .. building and deploying can be such a pain.
>
> Is systemd something that is available on debian wheezy?
>

It can be enabled on "Wheezy" (Debian 7, c. 2013, these names only add to
the confusion, I had to look it up), but that was the last Debian version
to use init.d.  Debian 8 (Jessie) already came with systemd in 2015 [1].

Is init.d going out of style?
>

Yes, for the better part of 5 years now.


> I've been using it since .. I can't even remember.  1998 maybe on Fedora?
>

That might be the issue ;)

Igal

[1] https://en.wikipedia.org/wiki/Debian_version_history#Debian_7_(Wheezy)




>
>
> On 1/8/19, John Larsen  wrote:
> > I simply tie systemd with the init script. Our servers host around 20-30
> > tomcat instances. I found it easier do it this way.
> >
> >
> > John Larsen
> >
> >
> >
> > On Tue, Jan 8, 2019 at 10:26 AM Igal Sapir  wrote:
> >
> >> On Tue, Jan 8, 2019 at 9:08 AM John Larsen 
> >> wrote:
> >>
> >> > Setup an init script.
> >> >
> >>
> >> On modern Linux systems you should really use systemd instead of the old
> >> init scripts.
> >>
> >> I've written in the past a script that can be used as a systemd
> template,
> >> so it allowed for multiple services to be run on different ports with
> >> different settings.  I can't find it easily ATM though.
> >>
> >> I think that it'd be good if Tomcat came with such a script so that it's
> >> easy to install as a systemd service.
> >>
> >> Igal
> >>
> >>
> >> > This is similar to how I do it.
> >> > https://gist.github.com/katesclau/0ff6e41fd698e94eb43c
> >> >
> >> > John Larsen
> >> >
> >> >
> >> >
> >> > On Tue, Jan 8, 2019 at 10:01 AM Joel Saunders <
> joel.saund...@zones.com>
> >> > wrote:
> >> >
> >> > > All,
> >> > >
> >> > >
> >> > >
> >> > > I just installed Tomcat 8.5 on RedHat.
> >> > >
> >> > >
> >> > >
> >> > > The previous tomcat6 install was setup so that I could use the linux
> >> > > service command to start and stop.
> >> > >
> >> > >   I’d like to take that feature away from the tomcat6
> >> install
> >> > > and add it for the new tomcat85 install.
> >> > >
> >> > >
> >> > >
> >> > > I’d also like for tomcat85 to be able to autostart upon reboots.
> >> > >
> >> > >
> >> > >
> >> > > Lastly, I’d like the logs to go to /var/log/tomcat8 if possible.
> >> > >
> >> > >
> >> > >
> >> > > Can anyone point me to the correct way to accomplish these
> >> requirements?
> >> > >
> >> > >
> >> > >
> >> > > Thanks in advance for your cooperation.
> >> > >
> >> > >
> >> > >
> >> > > … Joel
> >> > >
> >> > >
> >> > >
> >> > > *JOEL SAUNDERS*
> >> > >
> >> > >
> >> > >
> >> > > SR. DBA/ARCHITECT, MANAGED SERVICES | Zones, Inc.
> >> > >
> >> > > W: 518-652-4089| C: 518-265-0771
> >> > > joel.saund...@zones.com | zones.com <https://nfrastructure.com/>
> >> > >
> >> > > <http://zones.com/>
> >> > >
> >> > >
> >> > >
> >> > > <https://www.facebook.com/nfrastructure/>
> >> > > <https://www.linkedin.com/company/nfrastructure/>
> >> > > <https://twitter.com/nfrastructure>
> >> > > <https://www.youtube.com/user/nfrastructure1992>
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Proper way to set up tomcat 8.5 (autostart and service setup)

2019-01-08 Thread Igal Sapir
On Tue, Jan 8, 2019 at 9:39 AM John Larsen  wrote:

> I simply tie systemd with the init script. Our servers host around 20-30
> tomcat instances. I found it easier do it this way.
>

It's easier for you because you're more familiar with the init scripts, but
tying a modern system into an older one just to make it easy is a hack IMO,
and while it can be OK under some circumstances when maintaining an older
system, I would advise strongly against that when setting up a new system.

Igal


>
>
> John Larsen
>
>
>
> On Tue, Jan 8, 2019 at 10:26 AM Igal Sapir  wrote:
>
> > On Tue, Jan 8, 2019 at 9:08 AM John Larsen 
> > wrote:
> >
> > > Setup an init script.
> > >
> >
> > On modern Linux systems you should really use systemd instead of the old
> > init scripts.
> >
> > I've written in the past a script that can be used as a systemd template,
> > so it allowed for multiple services to be run on different ports with
> > different settings.  I can't find it easily ATM though.
> >
> > I think that it'd be good if Tomcat came with such a script so that it's
> > easy to install as a systemd service.
> >
> > Igal
> >
> >
> > > This is similar to how I do it.
> > > https://gist.github.com/katesclau/0ff6e41fd698e94eb43c
> > >
> > > John Larsen
> > >
> > >
> > >
> > > On Tue, Jan 8, 2019 at 10:01 AM Joel Saunders  >
> > > wrote:
> > >
> > > > All,
> > > >
> > > >
> > > >
> > > > I just installed Tomcat 8.5 on RedHat.
> > > >
> > > >
> > > >
> > > > The previous tomcat6 install was setup so that I could use the linux
> > > > service command to start and stop.
> > > >
> > > >   I’d like to take that feature away from the tomcat6
> > install
> > > > and add it for the new tomcat85 install.
> > > >
> > > >
> > > >
> > > > I’d also like for tomcat85 to be able to autostart upon reboots.
> > > >
> > > >
> > > >
> > > > Lastly, I’d like the logs to go to /var/log/tomcat8 if possible.
> > > >
> > > >
> > > >
> > > > Can anyone point me to the correct way to accomplish these
> > requirements?
> > > >
> > > >
> > > >
> > > > Thanks in advance for your cooperation.
> > > >
> > > >
> > > >
> > > > … Joel
> > > >
> > > >
> > > >
> > > > *JOEL SAUNDERS*
> > > >
> > > >
> > > >
> > > > SR. DBA/ARCHITECT, MANAGED SERVICES | Zones, Inc.
> > > >
> > > > W: 518-652-4089| C: 518-265-0771
> > > > joel.saund...@zones.com | zones.com <https://nfrastructure.com/>
> > > >
> > > > <http://zones.com/>
> > > >
> > > >
> > > >
> > > > <https://www.facebook.com/nfrastructure/>
> > > > <https://www.linkedin.com/company/nfrastructure/>
> > > > <https://twitter.com/nfrastructure>
> > > > <https://www.youtube.com/user/nfrastructure1992>
> > > >
> > > >
> > > >
> > >
> >
>


Re: Proper way to set up tomcat 8.5 (autostart and service setup)

2019-01-08 Thread Igal Sapir
On Tue, Jan 8, 2019 at 9:08 AM John Larsen  wrote:

> Setup an init script.
>

On modern Linux systems you should really use systemd instead of the old
init scripts.

I've written in the past a script that can be used as a systemd template,
so it allowed for multiple services to be run on different ports with
different settings.  I can't find it easily ATM though.

I think that it'd be good if Tomcat came with such a script so that it's
easy to install as a systemd service.

Igal


> This is similar to how I do it.
> https://gist.github.com/katesclau/0ff6e41fd698e94eb43c
>
> John Larsen
>
>
>
> On Tue, Jan 8, 2019 at 10:01 AM Joel Saunders 
> wrote:
>
> > All,
> >
> >
> >
> > I just installed Tomcat 8.5 on RedHat.
> >
> >
> >
> > The previous tomcat6 install was setup so that I could use the linux
> > service command to start and stop.
> >
> >   I’d like to take that feature away from the tomcat6 install
> > and add it for the new tomcat85 install.
> >
> >
> >
> > I’d also like for tomcat85 to be able to autostart upon reboots.
> >
> >
> >
> > Lastly, I’d like the logs to go to /var/log/tomcat8 if possible.
> >
> >
> >
> > Can anyone point me to the correct way to accomplish these requirements?
> >
> >
> >
> > Thanks in advance for your cooperation.
> >
> >
> >
> > … Joel
> >
> >
> >
> > *JOEL SAUNDERS*
> >
> >
> >
> > SR. DBA/ARCHITECT, MANAGED SERVICES | Zones, Inc.
> >
> > W: 518-652-4089| C: 518-265-0771
> > joel.saund...@zones.com | zones.com 
> >
> > 
> >
> >
> >
> > 
> > 
> > 
> > 
> >
> >
> >
>


Re: Tomcat 9.0.14 Windows service slow to stop

2019-01-08 Thread Igal Sapir
On Tue, Jan 8, 2019 at 7:45 AM Rémy Maucherat  wrote:

> On Tue, Jan 8, 2019 at 4:25 PM Jean-Pascal Houde 
> wrote:
>
> > "Catalina-utility-1" prio=1 tid=15 WAITING
> >
>

Is DestroyJavaVM supposed to be the only non-daemon thread at that point?

Thanks,

Igal


>
> Ok, so the new default for the utility thread is non daemon so you should
> have your fix there. Is nothing calling Server.destroy then ? Normally it
> should (Catalina.stop does it) and the utility executor will get shutdown
> then.
>
> Rémy
>


Re: Tomcat 9.0.14 Windows service slow to stop

2019-01-07 Thread Igal Sapir
On Mon, Jan 7, 2019 at 8:57 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Steve,
>
> On 1/7/19 19:47, Steve Demy wrote:
> > This sounds similar to:
> >
> > http://mail-archives.apache.org/mod_mbox/tomcat-dev/201812.mbox/ajax/%
> 3Cbug-63041-78%40https.bz.apache.org%2Fbugzilla%2F%3E
> 
> >
> >
> and,
> > http://mail-archives.apache.org/mod_mbox/tomcat-users/201812.mbox/ajax
> /%3CDEB74971-2714-401F-9428-25EE0ECC6D11%40shaw.ca%3E
> 
> >
> >  I’m not fluent in Tomcat, but it appears something changed in the
> > catalina.sh script of 9.0.14 that changed the stop/start
> > behaviour.
>
> Certainly nothing in catalina.sh affects Windows Services. Even
> catalina.bat is ignored for Windows Services.
>

+1


> Your issue is that Tomcat's scripts (well, actually, some 3rd-party
> scripts, actually) can't manage to stop Tomcat. Jean-Pascal's problem
> is that his shutdown is taking 60sec when he thinks it shouldn't take
> that long.
>

I've seen this happen when an application, or a 3rd-party library starts a
non-daemon thread and it is not stopped prior to the shutdown attempt.  I
think that there is a 60 second timeout because I've also noticed about
that same time frame when it happens.


>
> Jean-Pascal, what do the Tomcat logs say? There should be something
> like catalina.out or stdout.log or something like that.
>

+1

Another thing I would try is to look at a thread dump.

Igal


>
> - -chris
>
> >> On Jan 7, 2019, at 3:38 PM, Jean-Pascal Houde 
> >> wrote:
> >>
> >> Hello,
> >>
> >> I'm having a problem that seems to occur only since Tomcat
> >> 9.0.14. I'm using Tomcat installed as a service on a Windows 2012
> >> R2 server. The service starts normally, but stopping it from the
> >> Windows Services window takes a long time (about a minute). This
> >> happens even with no web application deployed on the server. I've
> >> tried downgrading to 9.0.13 and 9.0.12 and both version stops
> >> normally, under 1-2 seconds.
> >>
> >> Here is what I am doing: 1. Download Tomcat Windows 64-bit zip 2.
> >> Install service using "service install tomcat9" 3. Open Windows
> >> "Services" control panel 3. Start Tomcat9 service -> very fast 4.
> >> Stop Tomcat9 service -> gets stuck on "stopping service..." for
> >> around a minute.
> >>
> >> This is what the commons-daemon log file shows: [2019-01-07
> >> 18:27:21] [info]  [ 7500] Commons Daemon procrun (1.1.0.0 64-bit)
> >> started [2019-01-07 18:27:21] [info]  [ 7500] Running 'tomcat9'
> >> Service... [2019-01-07 18:27:21] [info]  [ 3904] Starting
> >> service... [2019-01-07 18:27:22] [info]  [ 3904] Service started
> >> in 1190 ms. [2019-01-07 18:27:23] [info]  [ 9796] Stopping
> >> service... [2019-01-07 18:27:24] [info]  [ 9796] Service stop
> >> thread completed. [2019-01-07 18:28:24] [info]  [ 7500] Run
> >> service finished. [2019-01-07 18:28:24] [info]  [ 7500] Commons
> >> Daemon procrun finished
> >>
> >> You can see the full minute between the initial "Stopping
> >> services..." and the finish of the stopping process. Other log
> >> files don't show anything suspicious.
> >>
> >> Anyone seeing the same issue with this version?
> >>
> >> Thanks,
> >>
> >>
> >> Jean-Pascal Houde
> >>
> >>
> >> -
> >>
> >>
> 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/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlw0LcEACgkQHPApP6U8
> pFgfsg//Yv9k+Lqnn/nH2Pd2iahEJnPRZVRUeg2bRFQGlpwRURApBzup8646UsFE
> zo9zxfJuuw2L/jea7rfZaXJaXay6nhaJ/h5+RPfq1CExNLjcK/3GjJwmZxSUqJxl
> PtNtpjsJr8lD3OXMzu9sqr26Zj3AtPbAqpJFr1A9LGlflpIi5ohqzVkpA3h2knEH
> luxjEbsD5uaG7YlQdzal76a81RBN0glBUvdgP1dPsgXKscMdYkoIzNYL7G5TniAx
> 3Jsilp0oWYfDEJ0oFRmUAjN++jq4QefMZHow3QUEU8xZ8L47JQv6ZlmkSbqPndH0
> /kdrUA9Cv82lN0czBz2u+KmKduot7tc+KEqS+RJD8Pkj9Jy7FOLCu9klLXk3LXFG
> M22XPJdwnIDQeVnjJKxjiUhetFjOCSzH3FyL/VuxAsO4qsCqSgiW/RRrU+FdLYfs
> OQPjOzGISu/9lwZ+M7yPJ1XzCoBbpVE1iHf0R5vuI0H922oXRu0dyx/IKnEpbGrv
> GY6zRrte4AtLO0oMXeDxWH/iC9xgRn+B4oy8Gd3RY9l6A1vLeT41flCSjAvtSkeU
> AE5N4iJp39mGJ/iUpWa7C5tzwbV1syv1weC4BzHVl5+W+YBBlv6x/HJX2Zc9dsMO
> okn6tCEuKFnSCqc4N4IdocolkISqObVe35RYioYHxBStMDr5dpU=
> =xtqK
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: 

Re: [OT] Happy New Year

2018-12-31 Thread Igal Sapir

On 12/31/2018 8:38 AM, Leon Rosenberg wrote:

I wish a happy and sound new year to all of the tomcat family!
See, Hear and Read all of you next year!


Happy New Year everyone!

Igal



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



Re: [ANN] New committer: Woonsan Ko

2018-12-24 Thread Igal Sapir

W00t w00t!  Congrats Woonsan :)

Igal

On 12/19/2018 6:05 PM, Woonsan Ko wrote:


Thank you very much for the warm welcomes!
I have watched many volunteering hearts here, helping each other in
this community, for years. This community has been my biggest input
source from which I have learned how to grow ourselves together, in
positive, collaborative, collective, inclusive, sustainable ways.
I will do my best where I can help to keep the health of our heartbeats.

Kind regards,

Woonsan Ko

On Wed, Dec 19, 2018 at 6:56 PM Mark Thomas  wrote:

On behalf of the Tomcat committers I am pleased to announce that
Woonsan Ko (woonsan) has been voted in as a new Tomcat committer.

Please join me in welcoming him.

Kind regards,

Mark

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


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



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



Re: Number of Web Applications in one Tomcat: THANKS!

2018-11-01 Thread Igal Sapir
Chris,

On Thu, Nov 1, 2018 at 10:13 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

>
> On 11/1/18 12:06, Igal Sapir wrote:
> > On Thu, Nov 1, 2018 at 7:39 AM André Warnier (tomcat)
> >  wrote:
> >
> >> On 01.11.2018 14:51, Christopher Schultz wrote:
> >>> We assign each dev a number and each application a number. Each
> >>> pair of dev+app yields an actual port number. This works great
> >>> in development so nobody ever steps on anyone's toes. In other
> >>> environments (test, prod, etc.) there is only ever one "dev
> >>> number" and that's "the deployer".
>  
> >
> > This new feature from BZ 61171 might make life easier for
> > deployments of such setups: Add port offset attribute (portOffset?)
> > to Server configuration
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=61171
>
> Yup. We don't happen to use that feature, but that's just because we
> baked everything into our deployment scripts back in 2003. :)
>

Right, given the fact that it was only added to dev a few hours ago
(r1845482) I don't expect anyone to be using it yet ;)

I like your idea of `port = dev + app`.  In development, I often find
myself disabling the AJP and SHUTDOWN ports to avoid binding conflicts.  In
production, one of the organizations for which I provide support has about
200 different applications, with deployment scripts that sets the different
ports and map the web server accordingly.

Come 9.0.13 the new portOffset feature can make such deployment a little
easier.

Best,

Igal


Re: Number of Web Applications in one Tomcat: THANKS!

2018-11-01 Thread Igal Sapir
On Thu, Nov 1, 2018 at 7:39 AM André Warnier (tomcat)  wrote:

> On 01.11.2018 14:51, Christopher Schultz wrote:
> > We assign each dev a number and each application a number. Each pair
> > of dev+app yields an actual port number. This works great in
> > development so nobody ever steps on anyone's toes. In other
> > environments (test, prod, etc.) there is only ever one "dev number"
> > and that's "the deployer".
>
> I don't know if this is original or a system that is aready well-known in
> this industry,
> but that sounds like a really clever idea to me. Our own context is bit
> different, but I'm
> sure there is a way for us to re-use this.
>

+1

This new feature from BZ 61171 might make like easier for deployments of
such setups:
Add port offset attribute (portOffset?) to Server configuration
https://bz.apache.org/bugzilla/show_bug.cgi?id=61171

Igal


Re: Number of Web Applications in one Tomcat

2018-10-29 Thread Igal Sapir

Tarek,

On 10/29/2018 2:04 AM, Leon Rosenberg wrote:
Clearly one webapp per tomcat. Makes everything easier. Also, if your 
apps aren't really tiny, the memory overhead of tomcat is minimal 
compared to the advantages.


+1

On 10/29/2018 6:39 AM, Christopher Schultz wrote:

I usually deploy one webapp per JVM/tomcat instance. I do this so that
a problem in one webapp doesn't take-down the others. It's as simple
as that. The other benefits are being able to service that one JVM
without taking down N webapps -- just one, and also being able to run
under different JVMs, system libraries, etc. without having to test
each application for compatibility.


+1

Also, if you end up with a much larger heap because you put a bunch of 
applications together, then you can run into longer GC cycles (can 
happen even with concurrent garbage collectors).  When you have a Full 
GC, all of your applications' threads stop, and if it takes long enough, 
i.e. more than a fraction of a second, the lack of responsiveness of the 
applications will become noticeable.


The whole is greater than the sum of its parts, just that in this case 
"greater" is a bad thing.


Igal


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



Re: Tomcat embedded with Apache Solr

2018-10-26 Thread Igal Sapir
Chris,

On Sat, Oct 13, 2018 at 6:41 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> I've posted a question to the Solr mailing list[1] about why Jetty is
> being used instead of Tomcat, and it seems that it's just "always the
> way it's been" for the most part.
>
> These seems to be some interest in moving from their existing model
> (Jetty launches, then hosts Solr as a web application) to an embedded
> model where a Solr-agent launches and then launches the app server
> (e.g. tc) hosting itself.
>
> Is anyone familiar enough with Solr to whip-up a quick-and-dirty POC
> for Tomcat-embedded-hosting-Solr?
>

The last time I used Solr was about 10 years ago.  The Solr API seemed so
cumbersome that I opted to embed Apache Lucene directly in my application.

And ever since Elasticsearch was launched there was very little incentive
to use Solr, as it provided similar functionality (and nowadays arguably
better), with a much simpler UI/API.

Woonsan's PoC looks very close to getting the job done, possibly missing
some Solr config setting or something like that.


> I'd like to make the case that Tomcat isn't some big, bad heavy
> monster that should be avoided for some other product. There appears
> to be soe unfounded hatred[4] going around.
>
> The Solr team seems especially conscious of runtime memory footprint,
> and they don't have any use for JSP, Websocket, or anything fancy.
> They just want to pump bytes back and forth to their basic
> servlet-based service.
>

I have seen stuff like that years ago in the Railo project (Lucee's
predecessor), where some users made similar claims and insisted on using
Jetty.  I was never able to confirm those claims in my tests, and most
Lucee users run it in Tomcat nowadays.


> Can anyone chime-in on that thread referenced below with some thoughts
> on how Solr might be able to use Tomcat-embedded as a platform for soe
> future version?
>

I would argue that they should have a container-agnostic configuration.
They should really let the end users the freedom to choose their servlet
container.

Best,

Igal


>
> Also see [2] and [3].
>
> Thanks,
> - -chris
>
> [1]
> https://lists.apache.org/thread.html/69c3a6ef96d99aa79d5ab15b23e1eb75d8f
> 32b0709fa14cc7cdded91@%3Cdev.lucene.apache.org%3E
> [2] https://issues.apache.org/jira/browse/SOLR-6733
> [3] https://issues.apache.org/jira/browse/SOLR-6734 ??
> [4]
> https://lists.apache.org/thread.html/c5786fd956d6d9029ddacc5af18147d098d
> 5a8675ebda78db14c10f1@%3Cdev.lucene.apache.org%3E
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlvCnsMACgkQHPApP6U8
> pFiqwA/+PbcFqOUhXacAzRwzBGtK0WELMHrr1QCkPYWw1D6yxgNq2kKya6jWh9XK
> +EFb1ZkaYDFunseLsXdLw6pN7fkxPjLRUVFLUr+57csGKR8nH+Y36uaKXErKG1TD
> w1PHOIjZkNfN1i5x3aouqZVGwxbqB41HZeXYDmaknNX5yhZGoZQlgLkH8DXZRj4H
> qLMIY2WV3q0tUz/9mVi4Lvtvejr01KUiALYxurwxJI9rToLdOEv3qIOk2+sNy5b7
> P8G2eUgMtA7vdXQ+sajXV+KptKkzcNHwehgX0YxYsV56tkaVgWkg6d63KZj11qgm
> xWzUpdiGYXXVTFfEPSEVSu3psqBGIHDvv234PMGs2A+sqM8kaynJkbQsJJ7fu9Co
> oA7clrptZbyGqVB4ASAxWC+PXeuycGnMFplZRfRXagmcmkChxli+Y2MqFekdKHO6
> VF6ExuzK7gg3ogZ1R+4sHYYW/KBTSaS+OVHXjJvTppATQbsnAGkZ5/93zTdlnbMh
> Ua9WOICaOats7XDcDhgpSmClL5SdOWQ+THCeT5hrnI7CttefihdPp4fqrDOPJ0O+
> fhcVv1J80GJIIPq2g48MzmxQoT08tKxomM9EeZbApnV9ptQxz6RgLAYYGryYUqjn
> 7v3Aoc6YS6WWEicZ6iR1j3AD5mE/kV0/GxZ8L52MPyVb4gvhiVU=
> =/itJ
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat embedded with Apache Solr

2018-10-26 Thread Igal Sapir
Woonsan,

On Fri, Oct 26, 2018 at 2:54 PM Woonsan Ko  wrote:

> Not sure if it helps, but I've spent some hours to test it out for my
> curiosity. Embedding tomcat v9 with an example servlet is simple
> enough, but it's not working yet with fully initialized Solr:
> - https://github.com/woonsan/solr-tomcat
>

I noticed that you extend Tomcat [1] in order to avoid initializing the
default servlets.  You may have already seen that, but I wanted to point
out that in the next version of Tomcat it can be done by passing false
to setAddDefaultWebXmlToWebapp()
[2].

Best,

Igal

[1]
https://github.com/woonsan/solr-tomcat/blob/master/server/src/main/java/com/github/woonsan/solr/server/tomcat/launch/Main.java#L103
[2] https://github.com/apache/tomcat/commit/0222ce9




> I'm not there yet to understand the reasons and have fixes.
> Let me know if you have any suggestions.
>
> Cheers,
>
> Woonsan
>
> On Fri, Oct 19, 2018 at 9:09 AM Shawn Heisey  wrote:
> >
> > On 10/18/2018 8:55 AM, Christopher Schultz wrote:
> > > Actually, my goal was to convince the Solr team that switching from
> > > Jetty to Tomcat was (a) possible and (b) possibly attractive.
> >
> > Over on lucene-dev, I had said that I removed jetty from solr's ivy
> > config and found only two classes with errors in eclipse.
> >
> > Turns out this was because I hadn't removed jetty from the *lucene* ivy
> > config, so most of the jetty jars were actually still referenced in the
> > eclipse build path.
> >
> > When I remove jetty from ALL ivy configs, there are 335 compile errors,
> > across many more classes.  Some of those are on the Lucene side, where I
> > have less concern.  The part of Lucene that utilizes Jetty is not used
> > in Solr.
> >
> > As I expected, a lot of the errors are in test code, but some of them
> > are in code that's not for tests.
> >
> > If you really want to see us switch to Tomcat, we'll need help fixing
> > those errors ... switching the code over to generic APIs (servlet and
> > native Java) where possible, and to Tomcat where necessary.  I would not
> > expect the Tomcat community to actually do the work -- just provide
> > expert guidance.  Although if anyone was interested in volunteering, I
> > wouldn't turn away the help!
> >
> > Thanks,
> > Shawn
> >
> >
> > -
> > 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: [EXTERNAL] Re: Tomcat custom location for configuration

2018-10-26 Thread Igal Sapir
Amit,

On Fri, Oct 26, 2018 at 9:45 AM Amit Pande  wrote:

> Thank you once again, Chris and Mark!
>
>
> https://tomcat.apache.org/tomcat-9.0-doc/introduction.html#CATALINA_HOME_and_CATALINA_BASE
>
> Was able to meet our requirement of moving Tomcat configuration to a
> custom location using a different CATALINA_BASE.
>

Great!


> The "-config" option will be cleaned up in next Tomcat release(s), right?
>

It will probably be removed in a future version, yes.  That's what Chris
meant in writing:

My vote would be to deprecate it immediately and remove it completely
>> in Tomcat 10.
>>
>
Best,

Igal


Thanks,
> Amit
>
> On 10/4/18, 12:15 PM, "Christopher Schultz" 
> wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Amit,
>
> On 10/4/18 12:17, Amit Pande wrote:
> > Thanks! I will take a detailed relook at using CATALINA_BASE and
> > keep you posted.
> >
> >
> > Also, since the "-config" option is there since 4.0.x time till
> > now, would it be safe to assume that this option won't be
> > deprecated since some users (admittedly not too many) might
> > actually be using it? If it's going to stay, do you feel it's worth
> > documenting (till the time it isn't actually deprecated with some
> > alternate)?
> >
> > I agree while not desirable at the moment, using "-config" solves
> > our problem. So, we might have to use this as last fallback
> > option.
>
> It sounds like this feature barely works and probably doesn't work in
> many situations.
>
> My vote would be to deprecate it immediately and remove it completely
> in Tomcat 10.
>
> I'm sorry, but I don't think I understand why you cannot use
> CATALINA_BASE as "usual" in your situation.
>
> - -chris
>
> > On 10/4/18, 8:38 AM, "Mark Thomas"  wrote:
> >
> > On 03/10/18 17:18, Amit Pande wrote:
> >> Thank you so much, Mark!
> >>
> >> In our case, the server.xml contains some information which is
> >> generated run time (pre-config before Tomcat is started) like the
> >> paths to key store and trust store, cipher suites, etc.
> >>
> >> Also, we have an active-passive cluster setup in which only the
> >> currently active node has the access to a shared disk which has
> >> all our product configuration data including the key store,
> >> trust store files needed in server.xml.
> >>
> >> We have a requirement to share the configuration across both the
> >> nodes of the cluster to avoid keeping duplicate copies of
> >> configuration (server.xml). And since some of the server.xml
> >> configuration is generated runtime, it isn’t trivial in our case
> >> to keep these copies in sync.
> >>
> >> This is the prime reason to have a shared Tomcat configuration.
> >> We may also want, in future, to spawn and additional instance of
> >> Tomcat with re-usable configuration (except adjusting the port
> >> numbers ).
> >>
> >> The not-so-elegant choice we might have is to move the entire
> >> Tomcat installation to this cluster aware shared storage but
> >> defeats the purpose of having a shared disk for configuration
> >> data and not the binaries.
> >>
> >> What alternates should we explore?
> >
> > You could look at using separate CATALINA_HOME and CATALINA_BASE.
> > See
> >
>
> >
> >  Whether have the web applications on the node or the shared
> > storage is arguable either way. If you want it on the node, just
> > use an absolute path that points to someone on the node for
> > appBase.
> >
> > Mark
> >
> > -
> >
> >
> 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/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu2SrwACgkQHPApP6U8
> pFjlHw/+OZ8FgsTCHvzIIAYBRdAQ+If0M3Q7Wpp7w/tqUYjbHgERPBiof2arPft5
> ir2tfUh11M0YiUvTPXfzzq7BHe5sXsDQHTxLimN1gq6+WOlZVd3k//giFQUmcwsK
> RZtKUQUnGWUsjJ/n7z4rWna+gdleukWQ0k7qgbRR/dAiaAUd2mRfy4LgKpHvTVex
> y6SXSmcGZ963vzPuZurMIyfPY2iUxb7Y1dbC8Pv7J0vAWhw1we08t33oMJa3Pcp4
> vgV2Ylc6nwyw4LpFcTdNOzWaLIKBwJ4zwv2rQW9Tp8zhiU6O5BfVmzP3Zo04K18x
> z1Zvw9mhOISIWn0vE+k6WxU/t17UVKYonPUBwJ0JelVNBE/tGsCSwiHK67gBhs0F
> K/+QN8+625TDcUmxYtTMdXQVel/ZvWCrdVZKCJlM3uHSsSySoPhkQU+gCt9PExx9
> YIgxzzViI3NiIkeobf8VmBMtZKaYWLWa6+eSoVVmj8UA7Glj5/tvT8o1AXDerYEk
> 

HTTP2 vs. HTTP 1.1 Performance Demo

2018-10-18 Thread Igal Sapir
I published a video that shows the performance benefits of HTTP/2 vs 
HTTP/1.1


To see just the demo, skip to 1:39 - https://youtu.be/jhqrRT4fvOA?t=99

To watch from the beginning where there is some more information about 
the h2 protocol, visit https://youtu.be/jhqrRT4fvOA


h/t Jean-Frederic Clere and Simone Bordet for inspiring the demo

Best,

Igal



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



Re: [OT] Oracle Java 11 discussion?

2018-10-17 Thread Igal Sapir
Cris,

On Wed, Oct 17, 2018 at 9:28 AM Berneburg, Cris J. - US 
wrote:

> Thanks Mark
>
> mt> The argument for a JRE vs a JDK is that the JDK includes
> mt> a compiler. The only reason Tomcat can run on a JRE and
> mt> still support JSPs (which require compilation) is that
> mt> Tomcat includes a Java compiler. I don't think the
> mt> security argument holds much water.
>
> I had not thought of that, and you're right (literally technically
> speaking).
>
> RAMBLE: However, if I try to look at it from a point of view of a large
> bureaucracy, of which I am largely ignorant, I would not be surprised if
> there is a policy against dev kits and IDE's on production servers for
> security sake.  Tomcat (whisper: with built-in compiler) is approved, but
> is the JDK allowed?  Guess I can ask.  Yeah, it's potentially a
> "distinction without a difference".  Well, unless there are other tools in
> the JDK that can pose security risks in addition to the Java compiler.
>

As Mark pointed out Jasper compiles JSP into Java bytecode and it has been
like that for years.  Every other popular web technology works in a similar
way, be it ASP.NET, PHP, NodeJS, etc. so I really don't think that that's
an issue.

There is only a security vulnerability if a bad actor can inject code, or
upload malicious source code that will be compiled by your application, but
again, that has been the case since the beginning so deploying over JDK
doesn't change that.

I'm sure that there is a way to build OpenJDK without the javac component,
or at least it can be achieved with minor changes if needed.

Igal

p.s. So happy to see that you finally moved from Tomcat 6 to 8.5.  Perhaps
you can share that experience in a separate thread and let others know if
you ran into any major problems during that process.




>
> mt> OpenJDK is very close to the Oracle JDK these days. I
> mt> regularly run Tomcat's unit tests with the latest OpenJDK
> mt> and have yet to find an issue that is OpenJDK specific.
> mt>
> mt> Tomcat runs happily (and is supported) on a JRE.
> mt>
> mt> If the JRE has passed the Java TCK then Tomcat should run
> mt> on it. I don't think there is an official Tomcat position
> mt> but my expectation is if a Tomcat bug (as opposed to a
> mt> Java bug) appears when running on any Java implementation
> mt> that has passed the TCK then the Tomcat team would treat
> mt> that as a Tomcat bug and fix it.
>
> All good to know.
>
> cjb> I am imagining spending all my time being taken up by
> cjb> Java upgrades with subsequent builds, regression testing,
> cjb> red tape, and deployments
>
> mt> I'd plan to stick to the LTS releases.
>
> Meh, not my call.  Whatever the Powers That Be decide for the production
> environment, I'll probably match that in dev.  If they decide LT$ is the
> way to go, using the JDK will cost nothing for my dev environment anyway.
> But if OpenJDK and frequent updates are selected ... phooey.
>
> --
> Cris Berneburg
> CACI Lead Software Engineer
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: [OT] Oracle Java 11 discussion?

2018-10-15 Thread Igal Sapir

On 10/15/2018 11:37 AM, Mark Thomas wrote:

On 15/10/18 18:53, Berneburg, Cris J. - US wrote:

Hi Folks

What has anyone been thinking about the upcoming Oracle Java 11 release / 
support stuff?  Frankly,  I'm confused by it all and am still trying to wrap my 
brain around it.  I have concerns about the potential implications for my 
little project, and also wonder about Tomcat at large.

No JRE - huh?  How do we run Java apps w/o a Java runtime?  Wouldn't installing 
a JDK in production be kind of a security issue?  I can imagine security 
departments not being thrilled about that.  Does Tomcat support being run on an 
OpenJRE?

The argument for a JRE vs a JDK is that the JDK includes a compiler. The
only reason Tomcat can run on a JRE and still support JSPs (which
require compilation) is that Tomcat includes a Java compiler. I don't
think the security argument holds much water.

OpenJDK is very close to the Oracle JDK these days. I regularly run
Tomcat's unit tests with the latest OpenJDK and have yet to find an
issue that is OpenJDK specific.


I asked Gil Tene about this a couple of weeks ago.  Gil is a co-founder 
of Azul Systems, an OpenJDK committer, and on the Executive Committee of 
the JCP.  My understanding from him is that there is no JDK development 
outside of the OpenJDK.  The Oracle developers that work on the JDK 
commit directly to OpenJDK.  Oracle might add some other things when 
they package their edition of the JDK for distribution, but the JDK 
itself is the same one from OpenJDK.


The main problem with the rapid release cycle and six month support is 
that due to late adoption, many of the bugs in a given Java release are 
only discovered after more than six months of the release date.  That 
means that the free support will end while bugs and vulnerabilities are 
being discovered, forcing many organizations to pay for support.


Azul Systems provide their own packaging of the OpenJDK, under the name 
Azul Zulu [1].  They offer a longer support than the Oracle one, and add 
a Medium Term Support period.  I've been planning to test it out but 
haven't gotten a chance to do so yet.



Tomcat runs happily (and is supported) on a JRE.

If the JRE has passed the Java TCK then Tomcat should run on it. I don't
think there is an official Tomcat position but my expectation is if a
Tomcat bug (as opposed to a Java bug) appears when running on any Java
implementation that has passed the TCK then the Tomcat team would treat
that as a Tomcat bug and fix it. The caveat is that any such fix is a
lot easier if we have access to that particular version of Java and a
platform to run it on.


Are there any implications for Tomcat?

Not directly. Jakarta EE will need to make a decision about minimum Java
versions and the like for the next round of spec updates. I expect
they'll settle on Java 11 but that discussion hasn't really started yet.

I'd be more concerned that Oracle are starting to charge for production
usage. That alone would be enough for me to switch to OpenJDK.

I haven't yet got around to installing a Java 11 GA release. I'm still
using one of the final EA releases. I'm currently intending to only
install OpenJDK for Java 11 onwards. I'm not expecting this to cause me
any issues.


+1




I am imagining spending all my time being taken up by Java upgrades with 
subsequent builds, regression testing, red tape, and deployments, without 
delivering any actual new value to our customer.  :-\

I'd plan to stick to the LTS releases.


+1

Igal

[1] https://www.azul.com/downloads/zulu/


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



Re: Request for a technical review

2018-10-12 Thread Igal Sapir

On 10/12/2018 11:23 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mallory,

On 10/12/18 13:23, Mallory Mooney wrote:

I definitely appreciate everyone's willingness to help out!

Here is the link to the GDoc:
https://docs.google.com/document/d/1fudlXj055nnPd-1lUoAXIS2ge8qNI56_jgUhHgKczFE/edit?usp=sharing
  Requesting access will still be needed, but I can grant that ASAP.
I want to make sure I can attribute comments/suggestions to
specific people, so I know who to thank, and who to follow up with
if I need more clarification on a specific comment. Plus, it makes
the IT department happy.

What, no GitHub PRs? ;)


+1

Is that going to be publicly available or is it a 
proprietary/private/commercial guide?



Igal


- -chris


On Thu, Oct 11, 2018 at 9:53 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

Mark,

On 10/10/18 6:00 PM, Mark Thomas wrote:

On 10/10/18 17:44, Mallory Mooney wrote:

Hi all,

I work for Datadog and am writing a guide about monitoring
Tomcat (with or without Datadog). I'd love to get some
feedback on the technical content. The project maintainers
we reached out to recommended we post a request here.

Would anyone be up for that? I can send the post link to
someone directly.

Appreciate your help and time!

Why not post the link here so the community can review the
document?

+1

There are many active community members who have an interest in
monitoring. I'm sure you'll get lots of feedback.

-chris

-



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/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlvA5qUACgkQHPApP6U8
pFjPDg/+NNmp2sdTXhuPD2cXJTtBGXGMoOLost629AJF2R5ddG79a685TDPENn6B
NVPInUppI6U42RgK9hYs6/3JNpHfMIDay8HC7zaErAiu4wBHowI3yFckofYJjUwD
Wcd2Wzo+eBDZrf2PgwqiBr41nw7kbkeEAQcGeBVce7RL/+3r8Fz7FG++P5Bguu7d
0N9S7y6leD3AdkX1o+JC9hQ6/AP2F8rZc8sws57Q2dpeV5QtK+8Pf2qOQpd6fskB
RDK4RQ1f4nLeAZgQ6BibUkwOQj6Fw7jPBHKGIfm6m5MOHvROkRTMV+fX3oLAd/dG
3S1aW/9x8WIbKgYShR9ixxca5QuBNICC/tt9/oTYNj3XPbZLalMmMgOZ/cJcNI+R
kORA8ehwACeP/hIb/aLztze5g8FqyPslM95VPH/TWqgQXxe7bgU5fb6nUF/aCa87
RC/JXjZ/TZwMM+9xw1PQGH8aXqVGoku4Q/cbwXa4ctqklMKdGzlYRjY7TVjrqyec
ZMdFMgDb76wmDg2luD2g7jUmJJVdAtYiGXIidt5k8EtvymK6Nq/sEwj1SApV5jhT
PGdViui42IeL6IIwKY9gbuihL4btm0we9OXeeVc6fn99lySvsI8JZVgIQJzNmWEX
axmPUrQZI9iIr8qC9tufcuZOxwHpgCjYPIpM4IsR4/vlZv2VpQc=
=j6GH
-END PGP SIGNATURE-

-
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: Security Alerts Email Subscription

2018-10-10 Thread Igal Sapir

Pradeep,

On 10/10/2018 11:03 AM, Goutam, Pradeep wrote:

Hello Team

Is there a mailing list for subscription to just the security alerts for Apache 
HTTP and Tomcat Server, If there is one can you please send it to me.


You should subscribe to the Announce mailing list:
http://tomcat.apache.org/lists.html#tomcat-announce

Igal


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



Re: TC 8.5 cachingAllowed=false ramifications [and potential Resource CacheSelector specification]?

2018-10-09 Thread Igal Sapir

On 10/9/2018 11:03 AM, Berneburg, Cris J. - US wrote:

Mark

cjb> SPECIFIC: The Excel files are [...] accessed only
cjb> once.  They don't need to be cached.  Is it
cjb> possible to declare only the Excel reports output
cjb> folder as non-cache-able but leave the (default)
cjb> context cache setting as-is so everything else
cjb> can be cached in the default way?  That is, set
cjb> up the Excel report output folder as a separate
cjb> "resource" with an independent cache setting?
cjb> Right now the Excel folder is embedded in the app
cjb> file system: TC/webapps/app/excel.

mt> At the moment, no. No reason why we couldn't extend
mt> the resources implementation and either add a few
mt> more options (based on path and/or filename and/or
mt> mime-type and/or whatever). Where we draw the line
mt> between 'standard' options and what requires a
mt> custom CacheSelector (ideas for better name welcome)
mt> is open to debate. Something for an enhancement request?

A bare-minimum approach that might work could be a new Resources attribute 
"cacheNotFoundResults" (default=true).

However... [LONG]

Something more robust might meet community needs better, depending on what 
folks require, rather than a one-off fix.  Need to specify what the cache 
implementation applies to.  By folder?  By file type?  What other folks want?  
I vote for an implementation by folder.


I think that a "url-pattern" would be a good choice.  That way we can 
reuse code and users will not have to learn a new "setting" as it is 
already a familiar concept.


Igal



How to implement?  Move all caching specifications to a new CacheHandler class 
that the Resource references.

The 8.5 Resources docs list these attributes: allowLinking, cacheMaxSize, 
cacheObjectMaxSize, cacheTtl, cachingAllowed, className, trackLockedFiles (is 
tLF cache-related?).

The decoupled specs of Resources(a) and Cache(b) would start with:

a. Resources: allowLinking, className, trackLockedFiles, cacheMaxSize(D), 
cacheObjectMaxSize(D), cacheTtl(D), CacheSelector(new).

- (D): cacheMaxSize, cacheObjectMaxSize, cacheTtl would be deprecated but 
remain in existing TC implementations (7, 8, 9) to maintain 
backwards-compatibility.  New versions of TC (10+) would not support those 
options.

- CacheSelector would default to the default cache implementation if not specified.  Specifying an 
empty string "" would equate to "none" (no caching), or maybe a no-op canned 
class of CacheNone could be selected.

b. Cache: cacheMaxSize, cacheObjectMaxSize, cacheTtl, 
cacheNotFoundResults(new), cachedFolder(new).

- We could remove the prefix of "cache" to avoid the Smurf syndrome since it 
applies to cache anyway.
- cachingAllowed would be removed since that would be the Cache implementation 
class itself.
- cachedFolder would default to the app deployment folder.

The default cache handler CacheHandlerDefault class manages the cache for the 
app deploy folder(s) by default without changing the TC config.  You could 
specify a canned or custom cache handler at any depth for a different cache 
implementation for a specific folder set that would override the default.  That 
is, a bunch of folders would have the default cache handler by default, but a 
special (sub)folder could have a different cache implementation.

Questions / Observations:
- How to specify different cache handlers for different folders?
- What are the implications of having multiple caches?
- A cache chain or hierarchy? (override)
- Multiple CacheSelector's allowed per resource?
- One cache handler per resource?
- Nested or split Resources with one cache per sub-resource to in effect have 
multiple cache handlers?
- Cache by folder couples the TC context config to the application folder 
structure.

Meh, sounds rather complex, and my brain is tired.  :-\

--
Cris Berneburg
CACI Lead Software Engineer


-
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: ApacheCon NA is in just under 3 weeks

2018-09-22 Thread Igal Sapir
ApacheCon NA 2018 attendees,




I should be there Sunday, the night before the conference starts, at around
19:00-ish local time.  If anyone wants to get together for a beer or
something, I'd be happy to buy the first round (limit first 50 people to
show up).

Igal


Re: How to Disable JSP in Embedded Tomcat

2018-09-22 Thread Igal Sapir
On Sat, Sep 22, 2018 at 2:10 AM Mark Thomas  wrote:

>
> On 22/09/2018 01:11, Igal Sapir wrote:
> > Mark,
> >
> > On Fri, Sep 21, 2018 at 12:54 AM Mark Thomas  wrote:
> >
> >> On 21/09/18 05:57, Igal Sapir wrote:
> >>> I want to embed Tomcat in a simple application that does not use JSP,
> and
> >>> that sets the default servlet's listings initParam to true.
> >>>
> >>> When I use the StandardContext, Tomcat.initWebappDefaults() [1] is
> called
> >>> and adds the default servlet and the JSP servlet.  I would like to
> >> prevent
> >>> that, but hopefully without having to rewrite the whole Tomcat class
> nor
> >> to
> >>> subclass it.
> >>>
> >>> Further, when I try to override a setting in WEB-INF/web.xml, e.g. to
> >>> specify init-param of "listings" with value "true" for the servlet
> >>> "default", I get an error that "default" is not unique, but in a
> regular
> >>> Tomcat deployment that works just fine.
> >>>
> >>> Is there an easy way to override Tomcat.initWebappDefaults() or to
> >> prevent
> >>> it from being called?
> >>
> >> There are a couple few options.
> >>
> >> Sub-classing looks to be the simplest.
> >>
> >> You can use addContext() rather than addWebapp() but then you become
> >> responsible for all of the configuration. If the app is simple, this
> >> shouldn't be too much effort.
> >>
> >
> > The app is simple, but it is for use by other developers who may use
> their
> > own web.xml files, so I think that sub-classing would be much easier and
> > that's what I did.
> >
> > While searching for a solution prior to asking on the mailing list, I
> > noticed that quite a few users were looking for a simple solution of
> using
> > addWebapp() without setting up the default servlets.  What do you think
> > about adding a System Property that will allow to opt-out of
> > initWebappDefaults() and set the DefaultWebXml to null so that the
> web.xml
> > files will be parsed?
>
> I have a huge dislike for using system properties for configuration. A
> setter on the Tomcat class would be fine.
>

Even better.  I'll add that.

https://bz.apache.org/bugzilla/show_bug.cgi?id=62755


>
> > I am thinking of a property name
> > org.apache.catalina.startup.INIT_WEBAPP_DEFAULTS [default true], or
> > org.apache.catalina.startup.DISABLE_WEBAPP_DEFAULTS [default false].
> >
> > Alternatively, we can add the sub-classing implementation that I used
> (with
> > the proper ASF license headers, of course).  The code is pasted below in
> > case anyone else needs such an implementation.
> >
> > I can add either solution myself if approved.
>
> I can imagine different users wanting to do various different things
> here. I am wondering if there is a better way of handling this. The
> tricky part is that we want to offer lots of flexibility in what is a
> potentially complex area while keeping usage really simple.
>

True, but currently the reasonable defaults are always added and there is
no simple way to undo them, so allowing the user to opt-out of the defaults
will let him/her start from scratch and add only the required
configurations.

Igal


Re: How to Disable JSP in Embedded Tomcat

2018-09-21 Thread Igal Sapir
On Fri, Sep 21, 2018 at 5:11 PM Igal Sapir  wrote:

> Mark,
>
> On Fri, Sep 21, 2018 at 12:54 AM Mark Thomas  wrote:
>
>> On 21/09/18 05:57, Igal Sapir wrote:
>> > I want to embed Tomcat in a simple application that does not use JSP,
>> and
>> > that sets the default servlet's listings initParam to true.
>> >
>> > When I use the StandardContext, Tomcat.initWebappDefaults() [1] is
>> called
>> > and adds the default servlet and the JSP servlet.  I would like to
>> prevent
>> > that, but hopefully without having to rewrite the whole Tomcat class
>> nor to
>> > subclass it.
>> >
>> > Further, when I try to override a setting in WEB-INF/web.xml, e.g. to
>> > specify init-param of "listings" with value "true" for the servlet
>> > "default", I get an error that "default" is not unique, but in a regular
>> > Tomcat deployment that works just fine.
>> >
>> > Is there an easy way to override Tomcat.initWebappDefaults() or to
>> prevent
>> > it from being called?
>>
>> There are a couple few options.
>>
>> Sub-classing looks to be the simplest.
>>
>> You can use addContext() rather than addWebapp() but then you become
>> responsible for all of the configuration. If the app is simple, this
>> shouldn't be too much effort.
>>
>
> The app is simple, but it is for use by other developers who may use their
> own web.xml files, so I think that sub-classing would be much easier and
> that's what I did.
>
> While searching for a solution prior to asking on the mailing list, I
> noticed that quite a few users were looking for a simple solution of using
> addWebapp() without setting up the default servlets.  What do you think
> about adding a System Property that will allow to opt-out of
> initWebappDefaults() and set the DefaultWebXml to null so that the web.xml
> files will be parsed?
>
> I am thinking of a property name
> org.apache.catalina.startup.INIT_WEBAPP_DEFAULTS [default true], or
> org.apache.catalina.startup.DISABLE_WEBAPP_DEFAULTS [default false].
>
> Alternatively, we can add the sub-classing implementation that I used
> (with the proper ASF license headers, of course).  The code is pasted below
> in case anyone else needs such an implementation.
>

Actually, the code that I pasted below doesn't seem to play well with JSP
so I guess it's not quite ready.  When I tried to add a simple JSP file I
get an NPE:

JspFactory.getDefaultFactory() returns null

java.lang.NullPointerException
org.apache.jasper.compiler.Validator$ValidateVisitor.(Validator.java:524)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1856)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:224)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:385)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:346)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:383)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)




>
> I can add either solution myself if approved.
>
> Thank you,
>
> Igal
>
> /**
>  * This class extends Tomcat to override the default functionality which
> registers the default and JSP servlets, and
>  * prevents the parsing of the Web Application Deployment Descriptors
> web.xml.
>  *
>  * Using this class therefore enables the parsing of the web.xml files,
> and does not add any defaults beyond them.
>  *
>  * @author Igal Sapir
>  */
> public class TomcatRunner extends Tomcat {
>
> /**
>  * Tomcat.addWebapp() sets DefaultWebXml to a non-null value to
> prevent the parsing of the web.xml file(s).
>  * Here we want to parse those files, so after calling the super
> method we set that value to null.
>  *
>  * @param host The host in which the context will be deployed
>  * @param contextPath The context mapping to use, "" for root context.
>  * @param docBase Base directory for the context, for static files.
>  *  Must exist, relative to the server home
>  * @param config Custom context configurator helper
>  * @return the deployed context
>  * @see #addWebapp(String, String)
>  */
> public Context addWebapp(Host host, String contextPath, String
> docBase, LifecycleListener config) {
>
> Context ctx = super.addWebapp(host, contextPath, docBase, config);
&

Re: How to Disable JSP in Embedded Tomcat

2018-09-21 Thread Igal Sapir
Mark,

On Fri, Sep 21, 2018 at 12:54 AM Mark Thomas  wrote:

> On 21/09/18 05:57, Igal Sapir wrote:
> > I want to embed Tomcat in a simple application that does not use JSP, and
> > that sets the default servlet's listings initParam to true.
> >
> > When I use the StandardContext, Tomcat.initWebappDefaults() [1] is called
> > and adds the default servlet and the JSP servlet.  I would like to
> prevent
> > that, but hopefully without having to rewrite the whole Tomcat class nor
> to
> > subclass it.
> >
> > Further, when I try to override a setting in WEB-INF/web.xml, e.g. to
> > specify init-param of "listings" with value "true" for the servlet
> > "default", I get an error that "default" is not unique, but in a regular
> > Tomcat deployment that works just fine.
> >
> > Is there an easy way to override Tomcat.initWebappDefaults() or to
> prevent
> > it from being called?
>
> There are a couple few options.
>
> Sub-classing looks to be the simplest.
>
> You can use addContext() rather than addWebapp() but then you become
> responsible for all of the configuration. If the app is simple, this
> shouldn't be too much effort.
>

The app is simple, but it is for use by other developers who may use their
own web.xml files, so I think that sub-classing would be much easier and
that's what I did.

While searching for a solution prior to asking on the mailing list, I
noticed that quite a few users were looking for a simple solution of using
addWebapp() without setting up the default servlets.  What do you think
about adding a System Property that will allow to opt-out of
initWebappDefaults() and set the DefaultWebXml to null so that the web.xml
files will be parsed?

I am thinking of a property name
org.apache.catalina.startup.INIT_WEBAPP_DEFAULTS [default true], or
org.apache.catalina.startup.DISABLE_WEBAPP_DEFAULTS [default false].

Alternatively, we can add the sub-classing implementation that I used (with
the proper ASF license headers, of course).  The code is pasted below in
case anyone else needs such an implementation.

I can add either solution myself if approved.

Thank you,

Igal

/**
 * This class extends Tomcat to override the default functionality which
registers the default and JSP servlets, and
 * prevents the parsing of the Web Application Deployment Descriptors
web.xml.
 *
 * Using this class therefore enables the parsing of the web.xml files, and
does not add any defaults beyond them.
 *
 * @author Igal Sapir
 */
public class TomcatRunner extends Tomcat {

/**
 * Tomcat.addWebapp() sets DefaultWebXml to a non-null value to prevent
the parsing of the web.xml file(s).
 * Here we want to parse those files, so after calling the super method
we set that value to null.
 *
 * @param host The host in which the context will be deployed
 * @param contextPath The context mapping to use, "" for root context.
 * @param docBase Base directory for the context, for static files.
 *  Must exist, relative to the server home
 * @param config Custom context configurator helper
 * @return the deployed context
 * @see #addWebapp(String, String)
 */
public Context addWebapp(Host host, String contextPath, String docBase,
LifecycleListener config) {

Context ctx = super.addWebapp(host, contextPath, docBase, config);
((ContextConfig) config).setDefaultWebXml(null);

return ctx;
}

/**
 * Returns a listener that does nothing, as opposed to the default one
in Tomcat which always
 * adds the default servlet and the JSP servlet with the rules that are
set in the defautl web.xml
 * @return a listener that does nothing.
 */
@Override
public LifecycleListener getDefaultWebXmlListener() {
// noop
return event -> {};
}

}


Re: Connection refused: connect

2018-09-21 Thread Igal Sapir

On 9/21/2018 12:45 PM, André Warnier (tomcat) wrote:

Hi.
Sorry, forget my answer below, I was probably talking nonsense here.
The stack trace that you show does not even mention any Tomcat class, 
so the "connect" mentioned below probably has nothing to do with the 
HTTP CONNECT method.
It looks like something in Eclipse itself, but since I do not know 
Eclipse (either), I don't have a clue.


On 21.09.2018 17:06, André Warnier (tomcat) wrote:

On 21.09.2018 10:54, Karen Goh wrote:

Hi,

I am repeatedly getting the following exceptions and am stuck here 
like forever.


Hope someone can tell me what's wrong with my tomcat server version: 
8.5.24 with Eclipse


java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown 
Source)

    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.(Unknown Source)
    at java.net.Socket.(Unknown Source)
    at
org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:148) 



    at java.lang.Thread.run(Unknown Source)


It looks to me like Eclipse is trying to connect to Tomcat but fails.  
If the connection is made over the network then a firewall might be 
playing a role here.  If it's all done locally then Tomcat is not 
listening on the host:port to which Eclipse is trying to connect.


Can you connect to that host:port with a browser?  e.g. 
http://localhost:8080/ ?


Igal


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



How to Disable JSP in Embedded Tomcat

2018-09-20 Thread Igal Sapir
I want to embed Tomcat in a simple application that does not use JSP, and
that sets the default servlet's listings initParam to true.

When I use the StandardContext, Tomcat.initWebappDefaults() [1] is called
and adds the default servlet and the JSP servlet.  I would like to prevent
that, but hopefully without having to rewrite the whole Tomcat class nor to
subclass it.

Further, when I try to override a setting in WEB-INF/web.xml, e.g. to
specify init-param of "listings" with value "true" for the servlet
"default", I get an error that "default" is not unique, but in a regular
Tomcat deployment that works just fine.

Is there an easy way to override Tomcat.initWebappDefaults() or to prevent
it from being called?

Thanks,

Igal

[1]
https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/startup/Tomcat.java#L918


Re: Fw: Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

2018-09-13 Thread Igal Sapir

Karen,

On 9/12/2018 11:15 PM, Igal Sapir wrote:

Karen,

On 9/12/2018 9:43 PM, Karen Goh wrote:
  Hi Igal, I think you are spot-on my problem. Tks.  Thanks to 
Burghard also for suggesting re-importing the project.


I just since corrected the directory address inside my run 
configuration as follows ;


-Dcatalina.base="C:\Program 
Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4" 
-Dcatalina.home="C:\Program 
Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4" 
-Dwtp.deploy="C:\Program 
Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4\webapps" 
-Djava.endorsed.dirs="C:\Program 
Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4\endorsed"


-agentlib:jdwp=transport=dt_socket,address=8006, server=y,suspend=n

Now, I am not sure what this address is referring to and I just can't 
find the explanation on the internet.
Cos what happened is that Tomcat is giving me errors all my ports are 
being used and so I have altered it as follows :


Tomcat admin port 8006
HTTP/1.1   8082
AJP/1.3 8010

Please let me know if address should be changed to 8006

Cos now I got this latest error :(


ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, 
TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports 
initialized [debugInit.c:750]


And I can't do make Tomcat switch to Debug mode even though I have 
followed what you guys have taught me the last time.


No.  "8006" is not a valid address, it's just the port.  If you want 
to use port 8006 on localhost then you need to use "localhost:8006".  
The -agentlib value therefore should be like so:


-agentlib:jdwp=transport=dt_socket,address=localhost:8006,server=y,suspend=n

But you might be better off using the environment variable

    JPDA_ADDRESS=localhost:8006


A small clarification/correction:

The environment variable above will work if you pass the `jpda` command 
to catalina.bat.  If you are not doing that then you need to specify the 
`-agentlib` argument explicitely.


Igal



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



Re: Fw: Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

2018-09-13 Thread Igal Sapir

Karen,

On 9/12/2018 9:43 PM, Karen Goh wrote:

  Hi Igal, I think you are spot-on my problem. Tks.  Thanks to Burghard also 
for suggesting re-importing the project.

I just since corrected the directory address inside my run configuration as 
follows ;

-Dcatalina.base="C:\Program Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4" 
-Dcatalina.home="C:\Program Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4" 
-Dwtp.deploy="C:\Program Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4\webapps" 
-Djava.endorsed.dirs="C:\Program Files\Apache\apache-tomcat-9.0.4-windows-x64\apache-tomcat-9.0.4\endorsed"

-agentlib:jdwp=transport=dt_socket,address=8006, server=y,suspend=n

Now, I am not sure what this address is referring to and I just can't find the 
explanation on the internet.
Cos what happened is that Tomcat is giving me errors all my ports are being 
used and so I have altered it as follows :

Tomcat admin port 8006
HTTP/1.1   8082
AJP/1.3 8010

Please let me know if address should be changed to 8006

Cos now I got this latest error :(


ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized 
[debugInit.c:750]

And I can't do make Tomcat switch to Debug mode even though I have followed 
what you guys have taught me the last time.


No.  "8006" is not a valid address, it's just the port.  If you want to use port 8006 on 
localhost then you need to use "localhost:8006".  The -agentlib value therefore should be 
like so:

-agentlib:jdwp=transport=dt_socket,address=localhost:8006,server=y,suspend=n

But you might be better off using the environment variable

JPDA_ADDRESS=localhost:8006

Since your other values are set to defaults.

HTH,

Igal



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



Re: Fw: Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

2018-09-12 Thread Igal Sapir
Karen,

On Mon, Sep 10, 2018 at 9:46 PM, Karen Goh 
wrote:

> Hi,
>
> I would like to add in further information about above problem and I hope
> someone can tell me the solution to make it work again.
>
> Please see image as per the latest error I am getting:
>
> https://ibb.co/eR1cep
>
> I'd also like to add that I have deleted the .project folder in Eclipse
> and so I am not sure if this has cause all the havoc I am experiencing now.
>

Is your runtime directory set correctly?

See for example the warning in the screenshot that you posted:
"Problem with directory C:\Prog...\Apache\apache-tomcat-8.0.27\lib EXISTS:
FALSE"



> Tks & rgds,
> Karen
>
> --- On Sun, 9/9/18, Karen Goh  wrote:
>
> > From: Karen Goh 
> > Subject: Error: Could not find or load main class
> org.apache.catalina.startup.Bootstrap
> > To: users@tomcat.apache.org
> > Date: Sunday, September 9, 2018, 1:08 PM
> > Hi,
> >
> > I would like to seek advice how to
> > tackle the above problem.
> >
> > What happened is that I changed my
> > Eclipse to Photon and when I imported my project into
> > workspace I was told that everything will be upgraded to
> > which I replied ok.
> >
> > After running my web app serveral
> > times, I sort of lost the steps to debug my app.
> >
> > And before I can test out my web app
> > further, the JVM configuration under run configuration is
> > all GONE
> >
> > The error message shown is : Error:
> > Could not find or load main class
> > org.apache.catalina.startup.Bootstrap
> >
> > My system setting :
> >
> > Tomcat with JDK 1.8.05
> > Tomcat 8.0 running on Eclipse Oxygen
> > with upgraded
> > workspace from Eclipse Photon
> > Windows 10
> >
> > I attempted the below URL solution but
> > it is still giving me the above error.
> >
> > https://stackoverflow.com/questions/29196994/run-configuration-missing-
> arguments-tab
> >
> > Please help me how to restore the JVM
> > configuration.
> >
> > Tks !
> >
> > Karen
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: ApacheCon NA is in just under 3 weeks

2018-09-11 Thread Igal Sapir

On 9/11/2018 2:30 PM, Mark Thomas wrote:

On 05/09/18 20:52, Igal Sapir wrote:

On 9/5/2018 8:22 AM, Christopher Schultz wrote:

On 9/5/18 06:40, Mark Thomas wrote:

All,

ApacheCon North America starts in Montréal in just under three
weeks. There are 2 days of Tomcat content starting on the Monday.
If you haven't registered, now would be a good time to do so ;)

The evening schedule is already looking pretty packed but Monday
evening has been set aside for project gatherings and there are
still rooms available.

Thoughts on booking a room for a Tomcat related session?

+1

+1

Booked. Monday evening 19.00 local time. Viger B.

Mark


Awesome!  I'm looking forward to it.

Igal


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



Re: ApacheCon NA is in just under 3 weeks

2018-09-05 Thread Igal Sapir

On 9/5/2018 8:22 AM, Christopher Schultz wrote:

On 9/5/18 06:40, Mark Thomas wrote:

All,

ApacheCon North America starts in Montréal in just under three
weeks. There are 2 days of Tomcat content starting on the Monday.
If you haven't registered, now would be a good time to do so ;)

The evening schedule is already looking pretty packed but Monday
evening has been set aside for project gatherings and there are
still rooms available.

Thoughts on booking a room for a Tomcat related session?

+1


+1



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



Re: Tutorial - How to Set Up Lucee in Tomcat

2018-09-05 Thread Igal Sapir

On 9/5/2018 8:25 AM, Christopher Schultz wrote:

Igal,

On 9/5/18 02:25, Igal @ Lucee.org wrote:

I published a blog post with an accompanying video tutorial about
setting up Lucee in Tomcat.

Seems like a great beginning for an ApacheCon presentation ;)


LOL.  Maybe next year ;)

Thanks though!  Looking forward to meeting in person in Montreal,

Igal

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



Re: [ANN] New committer: Igal Sapir

2018-07-15 Thread Igal Sapir

On 5/25/2018 4:50 PM, Christopher Schultz wrote:

On 5/24/18 3:09 PM, Mark Thomas wrote:

On behalf of the Tomcat committers I am pleased to announce that
Igal Sapir (isapir) has been voted in as a new Tomcat committer.

Please join me in welcoming him.

Welcome!

Now you have to come to ApacheCon so we can all meet you :)


I just registered for ApacheCon.  Very excited!


Igal


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



Re: Tomcat 5.5.17 migration to 6

2018-07-15 Thread Igal Sapir

On 7/14/2018 8:05 AM, calder wrote:

Why migrate to a version that is EOL (no doubt why you can't find docs) ?
https://tomcat.apache.org/tomcat-60-eol.html

If I were in the situation, I'd migrate to a more modern version, such as
8.5


Definitely! +1




On Saturday, July 14, 2018, David Babooram 
wrote:


Good morning

My intent is to migrate from 5.5.17 to 6 with the intent to upgrade to
6.0.48. , mainly due to a vulnerability notice.

I understand the changes listed from the Apache site wrt the migration.
but I have not gotten any steps on how to proceed.

Is there any proper documentation on how to proceed




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



Re: problem in starting tomcat

2018-06-27 Thread Igal Sapir

On 6/27/2018 10:53 AM, Coty Sutherland wrote:

On Wed, Jun 27, 2018 at 1:08 PM, Prateek  wrote:

Hi Chris,

By hardened, I meant that support for some FIPS non-complaint algos were
removed/disabled.

Thanks for confirming again that this is a clear problem with the JVM.

 From what you've given us this is a JVM problem and nothing that we can fix
for you. At this point, we're just trying to verify that you get the same
issue on a stable JVM as you do with the Java 11 Early Access release.


While the current version of Java is 10, as per the support roadmap at
http://www.oracle.com/technetwork/java/javase/eol-135779.html
the support for Java 10 ends within 6 months of end of support for Java
8.  We are trying to have our product ship with the version of Java, which
has support availability beyond these timelines.

I have tried running with Java 10 and hit the same issue.  I am not sure
about the Java 11.super-alpha that you were referring to.  Can you please
point me in that direction.

Please provide the hs_err_pid from a run with Java 10 so that we can verify
that the failure is the same.

On 6/27/2018 9:18 AM, Prateek wrote:

http://tomcat.apache.org/whichversion.html

The above link suggests that tomcat generally works with any Java early access 
builds and hence the attempt to run using JDK11 EA build.  Please suggest on 
the course of action that I should be taking.


I agree with Chris and Coty.

The statement that "Tomcat generally works with any Java version that 
complies with the minimum requirements" is correct, but that is based on 
the premise that the Java version does not have bugs that would prevent 
Tomcat from running.


The problem with EA/Alpha/Beta builds is that they are not well tested 
yet, and any "improvement" in the new version might introduce a new bug 
that will cause such an issue.


It is also possible that a bug was introduced in Java 9 or 10 and your 
specific set up triggers it while for most users there are no issues so 
it hasn't been reported or fixed yet.


Igal





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



Re: problem in starting tomcat

2018-06-26 Thread Igal Sapir

Prateek,

On 6/26/2018 9:27 AM, Prateek Yadav wrote:

Thanks for reply
  I already tested it for more than one machine so hardware problem can not
be a case.

On 6/25/2018 8:20 PM, Prateek wrote:

My configuration:
OS:REDHAT 7.5 (64 bit)
Tomcat: 8.5.31
Jdk- jdk-11(Early-Access)

When I am trying to start my server I got following error as:
A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x7fd4f206e28a, pid=2412, tid=2412
#
# JRE version:  (11.0+18) (build )
# 
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option PermSize; support 
was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support 
was removed in 8.0


You are running Java 11EA but your config settings seem to be circa Java 
7 (per PermSize warnings).


I second Chris' suggestion to use a well tested "release version" of the 
JVM, but at the very least you should try to remove all of the 
unnecessary config settings.



Igal


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



Re: [OT] creation of virtual directories

2018-06-13 Thread Igal Sapir

On 6/13/2018 9:06 AM, Christopher Schultz wrote:

The XML declaration () is always optional, but does provide
important information if it's different from the default.
Specifically, it tells the parser what version of XML is being used
(default: 1.0) and what character encoding is being used (default: UTF-8
).

I would say that it's probably best to include the XML declaration,
especially if the documents are expected to be read/written by humans.


Yep.  Makes sense.


Igal

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



Re: Tomcat Installation on Windows

2018-06-13 Thread Igal Sapir

Michael,

On 6/13/2018 3:58 AM, Lemke, Michael ST/HZA-ZIC2 wrote:

I've been struggling to come to grips with Tomcat installation on Windows 
Server but I couldn't really find a clear answer. This is what I want to 
achieve:

   *   Have one directory tree with all my webapps
   *   Have a tomcat installation somewhere different, like C:\Program Files
   *   run tomcat as a service
   *   be able to easily replace/update the tomcat installation
I could run the supplied installer and it created a working service. Editing 
server.xml I could make it use my intended webapps directory. So far so good 
(if I got that server.xml right) but now all lives in something like 
D:\apache-tomcat-9.0.6. Not good. The Windows service configuration has this 
path hard coded in its definition, the directory has files with installation 
specific configuration and some other live working directories also end up 
there.
Any suggestion how to do this right? So that I can easily upgrade this to say, 
tomcat 9.0.8?


You can use bin/service.bat [1] to install the service with the settings 
that you want.


Set your configuration settings in environment variables, e.g.

    set CATALINA_HOME=
    set JRE_HOME=

Then install the Windows service with

    service.bat install

If you want to update a previous installation then first uninstall the 
service with


    service.bat uninstall

Be sure to check the changelog for breaking changes first.


For now, I'd be happy with a single Tomcat service but to be able to have 
several (on different ports of course) would be a welcome bonus.


Use a different SERVICE_NAME and  a different CATALINA_BASE for each 
installation.  e.g.


    set CATALINA_BASE=

[1] https://github.com/apache/tomcat/blob/trunk/bin/service.bat#L17

Best,


Igal

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



Re: Can't Connect to Apache.org Network

2018-06-13 Thread Igal Sapir

Mark,

On 6/12/2018 11:13 PM, Mark Thomas wrote:


You were banned for > 100,000 page views in a 24 hour period. That is 
way more than any reasonably behaving client should be issuing.


I suspect you were pulling down one svn commit at a time. With the ASF 
repo, that is pretty much guaranteed to trigger the ban.


The command I was using (on Windows with MSYS2 git) was:
    git svn clone http://svn.apache.org/tomcat/trunk
And it was a long process until it failed, so you're probably right 
about the one-at-a-time.


See https://wiki.apache.org/general/GitAtApache for details of how to 
do this without triggering the ban.


This link is exactly what I was looking for.  Thanks!


I have removed the ban so you should be good to go.


I am still banned but my IP should change in a few hours so there's 
probably no need to bother with this.


Thank you,


Igal


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



Re: Can't Connect to Apache.org Network

2018-06-12 Thread Igal Sapir

On 6/12/2018 3:33 PM, Olaf Kock wrote:

On 12.06.2018 23:33, Igal Sapir wrote:
Perhaps it to revisit the thresholds that trigger warnings/bans. The 
Tomcat SVN repo might be much larger today than it was when those 
were last examined and set.


You might want to start at https://github.com/apache/tomcat instead of 
pulling down SVN commit by commit. If only for speed.
Unless you want to commit back to svn, that is. (well - I haven't 
checked if that git mirror contains the SVN metadata - you'd be lucky 
if it does)


Yes, I need to be able to commit back to SVN on the different branches 
(pulling only the trunk was manageable).


Thanks,


Igal

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



Re: Can't Connect to Apache.org Network

2018-06-12 Thread Igal Sapir

Update:

On 6/12/2018 11:55 AM, Igal Sapir wrote:


According to Mark in that thread [1], there is a daily threshold and 
if you exceed it you get a warning.  "If you trigger three warnings in 
a period" you get banned for a long term (weeks).


I did not see any warnings.  The process failed with "error: git-svn 
died of signal 11", and seeing no other messages I simply tried it 
again, and then again, making it "three times".


@Mark - is it possible to unban the IP or do I need to find a way to 
get a new IP address?
I should have a new IP address soon, so hopefully that part will be 
taken care of.


Perhaps it to revisit the thresholds that trigger warnings/bans. The 
Tomcat SVN repo might be much larger today than it was when those were 
last examined and set.


Also, a ban of a few days can be as effective as a few weeks, yet less 
intrusive in case of a false positive as happened here.


Thanks,

Igal


[1] https://issues.apache.org/jira/browse/INFRA-10509



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



Re: Can't Connect to Apache.org Network

2018-06-12 Thread Igal Sapir

On 6/12/2018 11:41 AM, Igal Sapir wrote:



The last thing I was trying to do was a complete SVN pull with 'git 
svn clone' of Tomcat, which failed mid-process with 'error: git-svn 
died of signal 11'.  A google search shows results with the title 
"[INFRA-10509] Can't connect to SVN - banned? - ASF ... - Apache 
issues" for https://issues.apache.org/jira/browse/INFRA-10509 but 
ironically I can view that page due to the issue described in this 
post (I will look it up through my cellular device).
OK, perhaps I should have checked that link above on my cell phone 
before sending the message (I had a typo there, should read [I can /not/ 
view that page].


According to Mark in that thread [1], there is a daily threshold and if 
you exceed it you get a warning.  "If you trigger three warnings in a 
period" you get banned for a long term (weeks).


I did not see any warnings.  The process failed with "error: git-svn 
died of signal 11", and seeing no other messages I simply tried it 
again, and then again, making it "three times".


@Mark - is it possible to unban the IP or do I need to find a way to get 
a new IP address?


Thanks,


Igal

[1] https://issues.apache.org/jira/browse/INFRA-10509


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



Can't Connect to Apache.org Network

2018-06-12 Thread Igal Sapir

Hi all,

I am experiencing a weird network issue and as of ~48 hours ago I can 
not connect to the Apache.org network.  I am connected via AT Fiber 
and spent half the day on the phone with them in vain.  Unfortunately it 
is not simple to get a new IP from AT (even though it is supposedly a 
dynamic address).


I have multiple machines with different operating systems and they all 
fail to connect (same outbound IP), so this is not an issue with my 
workstation.  When I try to connect from a different location (via a 
different ISP) I can connect with no issue.  The only solution I can 
think of ATM is to get a VPN service, but I rather find a more permanent 
solution.


The last thing I was trying to do was a complete SVN pull with 'git svn 
clone' of Tomcat, which failed mid-process with 'error: git-svn died of 
signal 11'.  A google search shows results with the title "[INFRA-10509] 
Can't connect to SVN - banned? - ASF ... - Apache issues" for 
https://issues.apache.org/jira/browse/INFRA-10509 but ironically I can 
view that page due to the issue described in this post (I will look it 
up through my cellular device).


Any ideas are welcomed.  I include a couple of TraceRoute samples 
below.  In the first one, to svn.apache.org, notice that hop 12 is the 
destination IP.  WEIRD.


> tracert svn.apache.org

Tracing route to svn.apache.org [209.188.14.144]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.254.254
  2 6 ms 7 ms 5 ms 
107-216-140-1.lightspeed.irvnca.sbcglobal.net [107.216.140.1]

  3 4 ms 3 ms 3 ms  64.148.105.186
  4 *    *    * Request timed out.
  5    12 ms 5 ms 6 ms  12.83.38.217
  6 6 ms 6 ms 6 ms  ggr2.la2ca.ip.att.net [12.122.128.101]
  7 *    *    * Request timed out.
  8 *    *    * Request timed out.
  9    25 ms    25 ms    25 ms PHOENIX-NAP.bear1.Phoenix1.Level3.net 
[4.14.71.174]

 10    25 ms    24 ms    25 ms  108.170.0.29
 11 *    *    * Request timed out.
 12    25 ms    25 ms    25 ms  209.188.14.144
 13 *    *    * Request timed out.
 14 *    *    * Request timed out.
 15 *    *    * Request timed out.
 16 *    *    * Request timed out.
 17 *    *    * Request timed out.
 18 *    *    * Request timed out.
 19 *    *    * Request timed out.
 20 *    *    * Request timed out.
 21 *    *    * Request timed out.
 22 *    *    * Request timed out.
 23 *    *    * Request timed out.
 24 *    *    * Request timed out.
 25 *    *    * Request timed out.
 26 *    *    * Request timed out.
 27 *    *    * Request timed out.
 28 *    *    * Request timed out.
 29 *    *    * Request timed out.
 30 *    *    * Request timed out.

Trace complete.

> tracert tomcat.apache.org

Tracing route to tomcat.apache.org [40.79.78.1]
over a maximum of 30 hops:

  1    <1 ms 1 ms 1 ms  192.168.254.254
  2 4 ms 4 ms 3 ms 
107-216-140-1.lightspeed.irvnca.sbcglobal.net [107.216.140.1]

  3 3 ms 4 ms 3 ms  64.148.105.186
  4 *    *    * Request timed out.
  5    11 ms    12 ms 9 ms  12.83.38.221
  6 6 ms 5 ms 5 ms  gar2.la2ca.ip.att.net [12.122.128.133]
  7 6 ms 5 ms 6 ms  12.245.156.22
  8    69 ms    69 ms    66 ms be-71-0.ibr02.lax03.ntwk.msn.net 
[104.44.8.108]

  9    66 ms    66 ms    66 ms be-3-0.ibr01.sn4.ntwk.msn.net [104.44.4.5]
 10    66 ms    65 ms    66 ms be-1-0.ibr02.sn4.ntwk.msn.net [104.44.4.204]
 11    65 ms    65 ms    65 ms be-6-0.ibr01.atb.ntwk.msn.net [104.44.4.46]
 12    65 ms    66 ms    66 ms be-1-0.ibr02.atb.ntwk.msn.net [104.44.4.39]
 13    66 ms    67 ms    66 ms be-6-0.ibr01.cnr01.bn6.ntwk.msn.net 
[104.44.4.48]

 14    66 ms    65 ms    65 ms ae103-0.icr04.bn6.ntwk.msn.net [104.44.10.8]
 15 *    *    * Request timed out.
 16 *    *    * Request timed out.
 17 *    *    * Request timed out.
 18 *    *    * Request timed out.
 19 *    *    * Request timed out.
 20 *    *    * Request timed out.
 21 *    *    * Request timed out.
 22 *    *    * Request timed out.
 23 *    *    * Request timed out.
 24 *    *    * Request timed out.
 25 *    *    * Request timed out.
 26 *    *    * Request timed out.
 27 *    *    * Request timed out.
 28 *    *    * Request timed out.
 29 *    *    * Request timed out.
 30 *    *    * Request timed out.

Trace complete.

Thank you,


Igal



Re: [ANN] New committer: Igal Sapir

2018-05-25 Thread Igal Sapir
Chris,

On Fri, May 25, 2018 at 4:50 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

>
> Welcome!
>
> Now you have to come to ApacheCon so we can all meet you :)
>
>
Thank you!  And thanks again for pointing out the invitation.

I am actually looking into coming to ApacheCon, or at least the two days of
TomcatCon which are the more important ones anyway.  I really hope I can
make it.

Best,


Igal


Re: question on different version of tomcat running on the same pc

2014-08-17 Thread Igal Sapir
Sure, as long as each instance listens on a unique IP:port combination.
 On Aug 16, 2014 11:25 PM, NEW IT newi...@gmail.com wrote:

 Hello experts,

 For development purpose, I wonder if I could install and run Tomcat 6
 and 7 the same time on my same development box?


 Thanks.

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




RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal Sapir
Write a simple ServletFilter
 On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:

 Good question.  I would like to have a servlet that would return to me the
 number of tomcat HTTP connections.  I know you can do this via a Linux
 console command.  But I would prefer to do it via a servlet.


 Thanks,

 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, July 31, 2014 11:10 AM
 To: Tomcat Users List
 Subject: Re: Programmatically retrieve number of tomcat connections

 On 31/07/2014 17:06, Campbell, Lance wrote:
  Tomcat 7
 
  Is there a way via a Java servlet to get the number of tomcat
 connections?

 Connections from what to what in what state?

 With or without non-Servlet API calls?

 Mark


 -
 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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal Sapir
Isn't Filter.doFilter() called once for each incoming http request?
On Jul 31, 2014 10:24 AM, Caldarale, Charles R chuck.caldar...@unisys.com
wrote:

  From: Igal @ getRailo.org [mailto:i...@getrailo.org]
  Subject: Re: Programmatically retrieve number of tomcat connections

  1) you create a class that implements the Filter interface and maintains
  the count in an AtomicLong object.

  2) you increment the AtomicLong before the call to chain.doFilter() and
  decrement it after that call.

 This has nothing to do with the number of connections.

  another way I can think of is to get all the threads in the JVM with
  Thread.getAllStackTraces(), loop over them, and check their names for
  example.

 Which also has little to do with the number of connections, especially
 when using NIO.

 You may be able to dig the number of connections out via an internal JMX
 call.  This is, of course, Tomcat specific, but avoids trying to invoke
 Tomcat's internal classes.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail and
 its attachments from all computers.


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




Re: Tomcat virtual host shows blank page

2014-07-24 Thread Igal Sapir
Check with view source on the blank page and see if you get anything there
On Jul 24, 2014 6:16 PM, Jordan Michaels jor...@viviotech.net wrote:

 Hi Arya,

 Are you using a web server like Apache in front of Tomcat, or are you
 hitting the Tomcat port directly? This will tell us if the problem is
 somewhere in your connector setup or not.

 Any clues in your catalina.out log file?

 Warm Regards,
 Jordan Michaels

 On 07/24/2014 06:03 PM, Arya Farzan wrote:

 Hello

 I also asked this on Stackoverflow but no one has commented or answered.

 I've been trying to configure tomcat for multiple domains and everything I
 have tried was unsuccessful.

 I added this to /etc/tomcat7/server.xml

 Host name=www.mysite.com appBase=webapps/mysite
  unpackWARs=true autoDeploy=true
Aliasmysite.com/Alias
 /Host

 and I created the folder /var/lib/tomcat7/webapps/mysite

 Whenever I go to my domain all I get is a blank page. What am I doing
 wrong
 here? I am running Debian 7


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




Re: Stop Tomcat8 Service Gracefully on Windows

2014-07-01 Thread Igal Sapir
)
  at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
 
 Locked ownable synchronizers:
  - None
 
  RMI TCP Accept-0 - Thread t@12
 java.lang.Thread.State: RUNNABLE
  at java.net.DualStackPlainSocketImpl.accept0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
  at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
  at java.net.PlainSocketImpl.accept(Unknown Source)
  - locked 30e97557 (a java.net.SocksSocketImpl)
  at java.net.ServerSocket.implAccept(Unknown Source)
  at java.net.ServerSocket.accept(Unknown Source)
  at
  sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unknown
  Source)
  at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
 
 Locked ownable synchronizers:
  - None
 
  AsyncFileHandlerWriter-550055638 - Thread t@11
 java.lang.Thread.State: TIMED_WAITING
  at sun.misc.Unsafe.park(Native Method)
  - parking to wait for 13656ae (a
  java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
  at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
  at
 
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown
  Source)
  at java.util.concurrent.LinkedBlockingDeque.pollFirst(Unknown Source)
  at java.util.concurrent.LinkedBlockingDeque.poll(Unknown Source)
  at
 
 org.apache.juli.AsyncFileHandler$LoggerThread.run(AsyncFileHandler.java:144)
 
 
 Locked ownable synchronizers:
  - None
 
  Attach Listener - Thread t@5
 java.lang.Thread.State: RUNNABLE
 
 Locked ownable synchronizers:
  - None
 
  Signal Dispatcher - Thread t@4
 java.lang.Thread.State: RUNNABLE
 
 Locked ownable synchronizers:
  - None
 
  Finalizer - Thread t@3
 java.lang.Thread.State: WAITING
  at java.lang.Object.wait(Native Method)
  - waiting on 1674ba21 (a java.lang.ref.ReferenceQueue$Lock)
  at java.lang.ref.ReferenceQueue.remove(Unknown Source)
  at java.lang.ref.ReferenceQueue.remove(Unknown Source)
  at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
 
 Locked ownable synchronizers:
  - None
 
  Reference Handler - Thread t@2
 java.lang.Thread.State: WAITING
  at java.lang.Object.wait(Native Method)
  - waiting on 4967d80b (a java.lang.ref.Reference$Lock)
  at java.lang.Object.wait(Object.java:503)
  at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
 
 Locked ownable synchronizers:
  - None
 
 
 
 
  On 6/30/2014 2:45 PM, Mark Thomas wrote:
  On 30/06/2014 22:40, Igal @ getRailo.org wrote:
  Does anyone know why Tomcat takes a full minute to stop?
  Tomcat doesn't. It takes a few seconds to stop. Your application might
  well take a full minute to stop. Try taking some thread dumps.
 
  Mark
 
 
  Is there a paid support for Tomcat?
 
 
 
  On 6/27/2014 8:29 PM, Igal @ getRailo.org wrote:
  And again there is a full minute between Service stop thread
  completed. and Run service finished., which doesn't look like a
  coincidence.
 
  [2014-06-27 20:24:14] [info]  [ 3156] Stopping service...
  [2014-06-27 20:24:15] [info]  [ 3156] Service stop thread completed.
  [2014-06-27 20:25:15] [info]  [ 2520] Run service finished.
  [2014-06-27 20:25:15] [info]  [ 2520] Commons Daemon procrun finished
  Can anyone shed some light on this?
 
 
  Igal
 
  On 6/27/2014 2:08 PM, Igal @ getRailo.org wrote:
  I installed Tomcat 8.09 on Windows 2008R2
 
  When trying to stop the service it takes a long time, and usually I
  get a prompt on the screen saying that there was an error.
 
  Windows Event Log did not show anything about this, but
  commons-daemon log shows:
 
  [2014-06-27 13:59:53] [info]  [ 5504] Commons Daemon procrun
  (1.0.15.0 64-bit) started
  [2014-06-27 13:59:53] [info]  [ 5504] Running 'Tomcat8' Service...
  [2014-06-27 13:59:53] [info]  [ 5176] Starting service...
  [2014-06-27 13:59:54] [info]  [ 5176] Service started in 1185 ms.
  *[2014-06-27 14:00:08] [info]  [ 3472] Stopping service...
  [2014-06-27 14:00:09] [info]  [ 3472] Service stop thread completed.
  [2014-06-27 14:01:09] [info]  [ 5504] Run service finished.
  [2014-06-27 14:01:09] [info]  [ 5504] Commons Daemon procrun
 finished*
  Why does it take a full minute from Service stop thread completed.
  where the stop command has yet to return, until Run service
  finished. when it actually does stop the service?
 
  Is there any way to speed that up?
 
  TIA
 
 
  --
  Igal Sapir
  Railo Core Developer
  http://getRailo.org/
  --
  Igal Sapir
  Railo Core Developer
  http://getRailo.org/
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org