RE: Tomcat 8.x JvmOptions parameter length restrictions?

2016-08-29 Thread Mekkelsen Madden, Steve
Yes, thanks folks.  It does appear to be some syntax validation Notepad++ is 
doing with .bat files.  If you create a test.bat and add 1100 characters and 
save it, from the entire line would be selected in blue.  If you put REM in 
front of the characters, then position 1025 and forward are in blue.  Not sure 
the significant of it but that's what my testing turned out.  At least there 
are no hard fast limits restricting jvm options to 1024 characters only, which 
is what I was hoping was the case.

Regards,

Steve Mekkelsen Madden  |  Systems Engineer Fellow / DBA / Certified Scrum 
Master  | GCS | PMF Operations Support  | Pegasystems Inc.
Office: (617) 866.6023 | Mobile: (828) 729.9948 | Email: 
steve.mekkelsen.mad...@pega.com | www.pega.com


-Original Message-
From: Terence M. Bandoian [mailto:tere...@tmbsw.com] 
Sent: Monday, August 29, 2016 10:48 PM
To: Tomcat Users List 
Subject: Re: Tomcat 8.x JvmOptions parameter length restrictions?

On 8/29/2016 8:34 AM, Mekkelsen Madden, Steve wrote:
> I've setup Tomcat 8.5.3 as a Windows Service (configured the service.bat 
> file) and everything appears to be working fine.  I'm trying to find out if 
> there are any restrictions to the overall length of the parameters which can 
> be used in the service.bat for --JvmOptions " " ^ line.  This isn't specific 
> to Tomcat 8.5.3 as I saw the same in 8.0.x versions as well.  So it may just 
> be NotePad++ doing something funky.
>
> What I'm seeing when using NotePad++, is at column 1024 the text looks 
> fine.  But for 16 characters after that, the text appears in light 
> blue and the remaining line looks okay.  I can't tell if there is a 
> setting in NotePad++ that is simply identifying the first 1024 
> characters or if the validate for the service.bat file is catching 
> something I should be aware of.  Since this email is text only, it is 
> hard to show it, so I've taken a screen shot and pasted it here: 
> https://postimg.org/image/gv29etcdf/
>
> I don't have any good way to verify if all the parameters did in fact load 
> properly, so reaching out to others to see if they have the same issue and/or 
> know how to resolve it.
>
> Thanks,
> Steve Mekkelsen Madden
>


The Tomcat Service Manager GUI may be used to set Tomcat system properties.  
The Tomcat 32-bit/64-bit Windows Service Installer creates a shortcut to the 
GUI in the Windows start menu named "Configure Tomcat".  The executable for the 
service manager GUI is located in the Tomcat bin directory and named 
Tomcatw.exe.  It is also included in the 32-bit and 64-bit Windows zip 
downloads.

In addition, system properties may be set in catalina.properties which is 
located in the Tomcat conf directory.

Hope that helps.

-Terence Bandoian
  http://www.tmbsw.com/


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



Re: Tomcat 8.x JvmOptions parameter length restrictions?

2016-08-29 Thread Terence M. Bandoian

On 8/29/2016 8:34 AM, Mekkelsen Madden, Steve wrote:

I've setup Tomcat 8.5.3 as a Windows Service (configured the service.bat file) and 
everything appears to be working fine.  I'm trying to find out if there are any 
restrictions to the overall length of the parameters which can be used in the service.bat 
for --JvmOptions " " ^ line.  This isn't specific to Tomcat 8.5.3 as I saw the 
same in 8.0.x versions as well.  So it may just be NotePad++ doing something funky.

What I'm seeing when using NotePad++, is at column 1024 the text looks fine.  
But for 16 characters after that, the text appears in light blue and the 
remaining line looks okay.  I can't tell if there is a setting in NotePad++ 
that is simply identifying the first 1024 characters or if the validate for the 
service.bat file is catching something I should be aware of.  Since this email 
is text only, it is hard to show it, so I've taken a screen shot and pasted it 
here: https://postimg.org/image/gv29etcdf/

I don't have any good way to verify if all the parameters did in fact load 
properly, so reaching out to others to see if they have the same issue and/or 
know how to resolve it.

Thanks,
Steve Mekkelsen Madden




The Tomcat Service Manager GUI may be used to set Tomcat system 
properties.  The Tomcat 32-bit/64-bit Windows Service Installer creates 
a shortcut to the GUI in the Windows start menu named "Configure 
Tomcat".  The executable for the service manager GUI is located in the 
Tomcat bin directory and named Tomcatw.exe.  It is also 
included in the 32-bit and 64-bit Windows zip downloads.


In addition, system properties may be set in catalina.properties which 
is located in the Tomcat conf directory.


Hope that helps.

-Terence Bandoian
 http://www.tmbsw.com/


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



Re: Tomcat 8 doesn't listen in https

2016-08-29 Thread Hardibo Pierre-Jean

It was memory heap problems i added more memory in /etc/default/tomcat8


Le 29/08/2016 à 23:38, James H. H. Lampert a écrit :

"It doesn't work" is not very informative.
What does not work ?
What do the Tomcat logfiles say about the problem ?


Does NETSTAT (or WRKTCPSTS, for IBM Midrange Systems, or other tools 
on other systems) tell you the port actually opened?


Do any of the log files tell you that it didn't, and/or give a reason 
why?


One thing did jump out at me: in


I don't see any "keystoreFile" clauses, or the APR equivalent; my 
understanding is that for an HTTPS port to open, Tomcat needs to be 
able to find a keystore of some sort.


--
JHHL


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



--

Hardibo Pierre-Jean

Développeur web 



Housing and reading internal resources using Tomcat 8.5.4 and JDK 1.8

2016-08-29 Thread Doug Gschwind
Hello everyone,

I have a file xyz.txt that is specific to my web application which needs to
be located by my web application, and I wish to find that resource via
getClass().ClassLoader().getResource("xyz.txt") at runtime. The xyz.txt
file has no relation to any particular Java class in our application. This
resource is used internally by the application and should not be served
directly by the container to inbound HTTP requests, therefore I have it
located in the WEB-INF/properties directory of my web app deployment.
However, the getResource("xyz.txt") method returns null, even though my
xyz.txt file is certainly where it is expected to be found.

Where should I place this file ideally, and given that file exists in that
location, what is the parameter value I need to pass to getResource() so it
returns a non-null value?

Thanks, Doug


Re: Tomcat 8 doesn't listen in https

2016-08-29 Thread James H. H. Lampert

"It doesn't work" is not very informative.
What does not work ?
What do the Tomcat logfiles say about the problem ?


Does NETSTAT (or WRKTCPSTS, for IBM Midrange Systems, or other tools on 
other systems) tell you the port actually opened?


Do any of the log files tell you that it didn't, and/or give a reason why?

One thing did jump out at me: in


I don't see any "keystoreFile" clauses, or the APR equivalent; my 
understanding is that for an HTTPS port to open, Tomcat needs to be able 
to find a keystore of some sort.


--
JHHL


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



Re: Tomcat 8 doesn't listen in https

2016-08-29 Thread tomcat

On 29.08.2016 23:07, Hardibo Pierre-Jean wrote:

Hello !

i get this connector for tomcat 8 to listen in port 8443 :

 

but it doesn't work (it works on http) you can see at https://www.hardibopj.com 
(iptables
redirect 443 to 8443)



"It doesn't work" is not very informative.
What does not work ?
What do the Tomcat logfiles say about the problem ?




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



Tomcat 8 doesn't listen in https

2016-08-29 Thread Hardibo Pierre-Jean

Hello !

i get this connector for tomcat 8 to listen in port 8443 :



but it doesn't work (it works on http) you can see at 
https://www.hardibopj.com (iptables redirect 443 to 8443)


Thanks for your help !
--

Hardibo Pierre-Jean

Développeur web 



RE: Trouble setting TOMCAT_USER

2016-08-29 Thread Jorge Alfonso
My Apologies again 

-Original Message-
From: André Warnier (tomcat) [mailto:a...@ice-sa.com] 
Sent: Monday, August 29, 2016 4:28 PM
To: users@tomcat.apache.org
Subject: Re: Trouble setting TOMCAT_USER

Jorge,
1) don't top-post

On 29.08.2016 21:50, Jorge Alfonso wrote:
> In order to setup the users for Tomcat you have to edit the file
>
> tomcat-users.xml
>
> 
>   
>
>
>
>
> 
> 
>
> Once the users are set, and you could have set several users depending 
> your need, shutdown and startup again your Tomcat and you would be 
> able to see it running for your user and managing it.
>

2) this has nothing to do with the user under which Tomcat is running.

>

Rebecca,

> -Original Message-
> From: Maxfield, Rebecca A [mailto:rmaxf...@providence.edu]
> Sent: Monday, August 29, 2016 2:20 PM
> To: users@tomcat.apache.org
> Subject: Trouble setting TOMCAT_USER
>
> Hi there!
>
> In order to resolve an issue with a Tomcat web app, I'm trying to run 
> Tomcat as a user other than the default user. Following other advice, 
> I looked in the conf file (/etc/tomcat/tomcat.conf) for TOMCAT_USER 
> and saw that it wasn't set; however, my efforts to set it haven't 
> seemed to result in any change.
>
> I wrote:
> TOMCAT_USER="myusername"
> which is the same syntax as the other variables in the file, JAVA_HOME 
> and so on. (Incidentally, these don't echo in the command line, but 
> Tomcat does seem to be running.) I then restarted, but a look at the 
> process list showed that it was still running as default user "tomcat" 
> rather than as myusername.
>
> What am I missing and how can I run Tomcat as another user?
>

You do not say so, but from the above it is a valid guess that you are
running tomcat under some flavor of Linux, and that you installed it from
the package provided by that Linux distribution.

Unfortunately, without more information, it is difficult to know how you are
really starting tomcat, and what influence that "TOMCAT_USER" line really
has in the big scheme of things.

Try to be more explicit and provide some details, such as which Linux, what
command you use to start/restart tomcat, what version of Tomcat that is,
etc..
We don't have a crystal ball here, so we don't know those things.



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


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



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



Re: Trouble setting TOMCAT_USER

2016-08-29 Thread tomcat

Jorge,
1) don't top-post

On 29.08.2016 21:50, Jorge Alfonso wrote:

In order to setup the users for Tomcat you have to edit the file

tomcat-users.xml


  
   
   
   
   
   


Once the users are set, and you could have set several users depending your
need, shutdown and startup again your Tomcat and you would be able to see it
running for your user and managing it.



2) this has nothing to do with the user under which Tomcat is running.





Rebecca,


-Original Message-
From: Maxfield, Rebecca A [mailto:rmaxf...@providence.edu]
Sent: Monday, August 29, 2016 2:20 PM
To: users@tomcat.apache.org
Subject: Trouble setting TOMCAT_USER

Hi there!

In order to resolve an issue with a Tomcat web app, I'm trying to run Tomcat
as a user other than the default user. Following other advice, I looked in
the conf file (/etc/tomcat/tomcat.conf) for TOMCAT_USER and saw that it
wasn't set; however, my efforts to set it haven't seemed to result in any
change.

I wrote:
TOMCAT_USER="myusername"
which is the same syntax as the other variables in the file, JAVA_HOME and
so on. (Incidentally, these don't echo in the command line, but Tomcat does
seem to be running.) I then restarted, but a look at the process list showed
that it was still running as default user "tomcat" rather than as
myusername.

What am I missing and how can I run Tomcat as another user?



You do not say so, but from the above it is a valid guess that you are running tomcat 
under some flavor of Linux, and that you installed it from the package provided by that 
Linux distribution.


Unfortunately, without more information, it is difficult to know how you are really 
starting tomcat, and what influence that "TOMCAT_USER" line really has in the big scheme 
of things.


Try to be more explicit and provide some details, such as which Linux, what command you 
use to start/restart tomcat, what version of Tomcat that is, etc..

We don't have a crystal ball here, so we don't know those things.




Thanks!


-
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: Trouble setting TOMCAT_USER

2016-08-29 Thread Maxfield, Rebecca A
OP here, I assumed (haven’t had a chance to try it yet) that the username I set 
TOMCAT_USER to would also have to be identified in tomcat-users.xml, but I take 
it from your response that that’s not correct.

I didn’t install tomcat on this server, but I think it was probably installed 
through yum.




On 8/29/16, 4:21 PM, "Caldarale, Charles R"  wrote:

>
>> From: Jorge Alfonso [mailto:jo...@qbex.com] 
>> Subject: RE: Trouble setting TOMCAT_USER
>
>> In order to setup the users for Tomcat you have to edit the file
>> tomcat-users.xml
>
> That has absolutely nothing to do with what the OP is asking about.  The 
>tomcat-users.xml file is the toy control for what users can be authenticated 
>and authorized by Tomcat, not what userid Tomcat runs under.
>
>Unfortunately, the OP is using a 3rd-party repackaged version of Tomcat, which 
>the Apache organization has neither control nor even knowledge of.  Whatever 
>startup mechanism that kicks off that particular Tomcat is specific to the 
>repackager, and the query will need to be submitted to whatevever support 
>organization that has.
>
> - 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: Trouble setting TOMCAT_USER

2016-08-29 Thread Jorge Alfonso
My Apologies

Just wanted to help 

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Monday, August 29, 2016 4:22 PM
To: Tomcat Users List
Cc: rmaxf...@providence.edu
Subject: RE: Trouble setting TOMCAT_USER


> From: Jorge Alfonso [mailto:jo...@qbex.com]
> Subject: RE: Trouble setting TOMCAT_USER

> In order to setup the users for Tomcat you have to edit the file 
> tomcat-users.xml

 That has absolutely nothing to do with what the OP is asking about.
The tomcat-users.xml file is the toy control for what users can be
authenticated and authorized by Tomcat, not what userid Tomcat runs under.

Unfortunately, the OP is using a 3rd-party repackaged version of Tomcat,
which the Apache organization has neither control nor even knowledge of.
Whatever startup mechanism that kicks off that particular Tomcat is specific
to the repackager, and the query will need to be submitted to whatevever
support organization that has.

 - 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



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



RE: Trouble setting TOMCAT_USER

2016-08-29 Thread Caldarale, Charles R

> From: Jorge Alfonso [mailto:jo...@qbex.com] 
> Subject: RE: Trouble setting TOMCAT_USER

> In order to setup the users for Tomcat you have to edit the file
> tomcat-users.xml

 That has absolutely nothing to do with what the OP is asking about.  The 
tomcat-users.xml file is the toy control for what users can be authenticated 
and authorized by Tomcat, not what userid Tomcat runs under.

Unfortunately, the OP is using a 3rd-party repackaged version of Tomcat, which 
the Apache organization has neither control nor even knowledge of.  Whatever 
startup mechanism that kicks off that particular Tomcat is specific to the 
repackager, and the query will need to be submitted to whatevever support 
organization that has.

 - 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: Trouble setting TOMCAT_USER

2016-08-29 Thread Jorge Alfonso
In order to setup the users for Tomcat you have to edit the file

tomcat-users.xml


 
  
  
  
  
  
 

Once the users are set, and you could have set several users depending your
need, shutdown and startup again your Tomcat and you would be able to see it
running for your user and managing it.


-Original Message-
From: Maxfield, Rebecca A [mailto:rmaxf...@providence.edu] 
Sent: Monday, August 29, 2016 2:20 PM
To: users@tomcat.apache.org
Subject: Trouble setting TOMCAT_USER

Hi there!

In order to resolve an issue with a Tomcat web app, I'm trying to run Tomcat
as a user other than the default user. Following other advice, I looked in
the conf file (/etc/tomcat/tomcat.conf) for TOMCAT_USER and saw that it
wasn't set; however, my efforts to set it haven't seemed to result in any
change.

I wrote:
TOMCAT_USER="myusername"
which is the same syntax as the other variables in the file, JAVA_HOME and
so on. (Incidentally, these don't echo in the command line, but Tomcat does
seem to be running.) I then restarted, but a look at the process list showed
that it was still running as default user "tomcat" rather than as
myusername.

What am I missing and how can I run Tomcat as another user?

Thanks!


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



Trouble setting TOMCAT_USER

2016-08-29 Thread Maxfield, Rebecca A
Hi there!

In order to resolve an issue with a Tomcat web app, I’m trying to run Tomcat as 
a user other than the default user. Following other advice, I looked in the 
conf file (/etc/tomcat/tomcat.conf) for TOMCAT_USER and saw that it wasn’t set; 
however, my efforts to set it haven’t seemed to result in any change.

I wrote:
TOMCAT_USER=“myusername”
which is the same syntax as the other variables in the file, JAVA_HOME and so 
on. (Incidentally, these don’t echo in the command line, but Tomcat does seem 
to be running.)
I then restarted, but a look at the process list showed that it was still 
running as default user “tomcat” rather than as myusername.

What am I missing and how can I run Tomcat as another user?

Thanks!


Re: Tomcat 8.x JvmOptions parameter length restrictions?

2016-08-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Steve,

On 8/29/16 9:34 AM, Mekkelsen Madden, Steve wrote:
> I've setup Tomcat 8.5.3 as a Windows Service (configured the 
> service.bat file) and everything appears to be working fine.  I'm 
> trying to find out if there are any restrictions to the overall 
> length of the parameters which can be used in the service.bat for 
> --JvmOptions " " ^ line.  This isn't specific to Tomcat 8.5.3 as I 
> saw the same in 8.0.x versions as well.  So it may just be
> NotePad++ doing something funky.

This SO post[1] says that batch files truncate lines after 127 bytes,
but I'm fairly certain it's not the least bit true.

> What I'm seeing when using NotePad++, is at column 1024 the text 
> looks fine.  But for 16 characters after that, the text appears in 
> light blue and the remaining line looks okay.  I can't tell if
> there is a setting in NotePad++ that is simply identifying the
> first 1024 characters or if the validate for the service.bat file
> is catching something I should be aware of.  Since this email is
> text only, it is hard to show it, so I've taken a screen shot and
> pasted it here: https://postimg.org/image/gv29etcdf/

I wouldn't read too much into what Notepad++ tells you. If you are
worried about line length, feel free to build-up the value in an
environment variable and try that.

> I don't have any good way to verify if all the parameters did in
> fact load properly, so reaching out to others to see if they have
> the same issue and/or know how to resolve it.

The service.bat script just builds a Windows Service. Use
tomcat8w.exe[2] to check-out the options that were saved to the
registry. Use the //ES// switch to check it all out.

- -chris

[1]
http://stackoverflow.com/questions/1217134/file-size-and-line-length-lim
its-for-windows-batch-files
[2]
http://tomcat.apache.org/tomcat-8.5-doc/windows-service-howto.html#Tomca
t_monitor_application
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXxGnCAAoJEBzwKT+lPKRYjJkP+gMLiEjdMWvKZvAapDCOcelA
J+y8yA78KUWr5hP8bnL+KHxNOyfm8VPGPfIJPwrqd17OzcHFqBl/UnvvpzWi9Q+r
XXCAQMbP1h5UseFCP5SIAjmT163sEiBIMgU6MPCEBAAmGllrAv8N9LCFX1fxDbWJ
P2z6o4N9H9GvuIDIsY9G9N07fJYSQJSl6ZWYJa+ljcySKOPFyizkcnG3TD2ZJ5j6
Wyd5FFnaOXsgdiyk74OHVq/gxlOxqV4i6UpfAvQTQPnMTopPP8wHcR4oPHlG2q4y
zwBwJzd8Ehh2zmeenSHf3DKgRygYTtX1/pKQaIaaf5bXGqdl4KejAO8BpXZT0y0B
aACIEN8zYmeWCeFnG/d6ikudijgGc0VDqgjGQQoSl6smVenkaG9ym3Nhna9loUbn
gyavu4XJSc3gKIfhe9ojhY0bbWIUyessDGk0FZne0jP+Hc4Vyodo7EQ885673v0R
9Bf4EIxnHKyqPw+2DyDp9hhe7NZ+eq2SPvidut1PbxuEb9rf8T6d8xMmLCBAIoas
PJ13KX4J4EVbglZ913C6LRigZi95mQsqnRU7K8hQG7GAf+6ybv8Ztp5Zpo+dv+Ax
LqT0cgHbo5Juq/Ozh/nGM5LEPrkzdMkZvsr5aFbvQ75iOAA25IhbdExOooM7hw4e
qw1mHAv5WiRrv0iiruyC
=CehL
-END PGP SIGNATURE-

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



Re: cookie-related regression in Tomcat 8.5?

2016-08-29 Thread Mike Wertheim
I don't see any such errors in the logs.

Did cookie validation change between Tomcat 8.0 and Tomcat 8.5, or would
you expect them to behave identically?

On Mon, Aug 29, 2016 at 2:35 AM, Mark Thomas  wrote:

> On 29/08/2016 03:09, Mike Wertheim wrote:
> > I took a look using the LiveHttpHeaders Chrome extension.
> >
> > It's very simple.  Tomcat 8.0.33 is setting the Set-Cookie header in the
> > response, and Tomcat 8.5.4 is not setting the Set-Cookie header in the
> > response.
>
> Check the logs for errors. I suspect the cookie isn't being sent because
> it is failing validation.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Scanning jars with Manifest with tomcat-embed

2016-08-29 Thread Olivier Peyrusse
Hello everyone,

In my company, one of our Maven projects create a war that we usually
deploy in tomcat.
For debug purpose, we added a test class that instanciate an embed Tomcat
instance to run the application from an IDE (Intellij in my case).

Using tomcat-emded-core.8.5.4, at startup, it gives me a lot of warnings
like:
*Aug 29, 2016 11:22:57 AM org.apache.tomcat.util.scan.StandardJarScanner
scan*

*WARNING: Failed to scan
[file:/home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/jung-api-2.0.1.jar]
from classloader hierarchyjava.io.FileNotFoundException:
/home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/jung-api-2.0.1.jar
(No such file or directory)*

Given maven repository architecture, it is logical that the scanner can't
find the jar as we are looking for *jung-api *in* jung-graph-impl *folder
*.*
If I instead look in
*/home/olivier/maven/repo/net/sf/jung/jung-api/2.0.1/jung-api-2.0.1.jar,* I
correctly find the wanted jar.

After investigating the troubling jars and StandardJarScanner source code,
I discovered that *jung-graph-impl* includes a MANIFEST file with the
Class-Path attribute containing
*jung-api*, among others.
When this attribute is defined, the scanner reads the path of the jar
containing the MANIFEST, and uses it to get the jars mentionned in the
classpath.

*Jar file:
/home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/jung-api-2.0.1.jar*

*-> Jar path: /home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/*
*-> Looking for
/home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/jung-api-2.0.1.jar*

For Tomcat application (installed on a computer), this is fine as wars
shipped all their needed jars in WEB-INF/lib. Thus, the algo to look for
another jar is ok.
This is less ok when Tomcat is run from an IDE, where the classpath is made
from various locations.
Eg: /opt/java/jdk1.8.0_92/bin/java -Dfile.encoding=UTF-8
*-classpath
/opt/java/jdk1.8.0_92/jre/lib/charsets.jar:/opt/java/jdk1.8.0_92/jre/lib/deploy.jar:[...
many
jars]:/home/olivier/maven/repo/net/sf/jung/jung-graph-impl/2.0.1/jung-graph-impl-2.0.1.jar:/home/olivier/maven/repo/net/sf/jung/jung-api/2.0.1/jung-api-2.0.1.jar:[...
more jars]*
MyServer

Is this a bug or is there something wrong with my Tomcat config or the jars
I use ?

I attached to the ticket the main class of my application, to show how I
create my Tomcat instance.
tomcat-embed is imported in my project by requiring the following maven
dependency:
+- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:test
|  \- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:test

Thanks a lot for the help
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;

import org.apache.catalina.startup.Tomcat;

public class MyServer {

	public static final int DEFAULT_PORT = 8081;

	/**
	 * Creates a server running application.
	 * @param port port to use
	 * @param path path to static resources to serve
	 * @return a Tomcat instance (not running)
	 * @throws IOException if it fails to create a temporary directory for Tomcat
	 * @throws ServletException if it fails to create a webapp
	 */
	public static Tomcat createServer(final int port, final String path) throws IOException, ServletException {
		final Tomcat tomcat = new Tomcat();

		tomcat.setPort(port);
		final File base = createBaseDirectory();
		tomcat.setBaseDir(base.getAbsolutePath());
		tomcat.addWebapp("", getStaticResourceBasePath(path));

		System.out.printf("Creating a server on port %d with resources from %s%n", port, path);
		return tomcat;
	}

	public static void main(final String[] args) throws Exception {
		int port = DEFAULT_PORT;
		if (args != null && args.length >= 1) {
			port = Integer.parseInt(args[0]);
		}
		final String resourcePath = args != null && args.length >= 2 ? args[1] : "default/path/to/app";

		final Tomcat server = createServer(port, resourcePath);
		server.start();
		server.getServer().await();
	}

	/**
	 * Give the path to the base directory where tomcat will work.
	 * 
	 * We create a temporary folder because Tomcat will create temporary files in
	 * it and we don't want to pollute current folder.
	 * @return the base directory for tomcat.
	 * @throws IOException if we could not create the temporary directory.
	 */
	protected static File createBaseDirectory() throws IOException {
		final File base = File.createTempFile("tmp-", "");

		if (!base.delete()) {
			throw new IOException("Cannot (re)create base folder: " + base.getAbsolutePath());
		}

		if (!base.mkdir()) {
			throw new IOException("Cannot create base folder: " + base.getAbsolutePath());
		}
		return base;
	}

	/**
	 * Give the path to the static resources.
	 * 
	 * The resources are located under src/main/webapp/ as of Maven convention for webapps.
	 * The output of the gulp build is the subfolder build.
	 * @param resourcePath the 

Tomcat 8.x JvmOptions parameter length restrictions?

2016-08-29 Thread Mekkelsen Madden, Steve
I've setup Tomcat 8.5.3 as a Windows Service (configured the service.bat file) 
and everything appears to be working fine.  I'm trying to find out if there are 
any restrictions to the overall length of the parameters which can be used in 
the service.bat for --JvmOptions " " ^ line.  This isn't specific to Tomcat 
8.5.3 as I saw the same in 8.0.x versions as well.  So it may just be NotePad++ 
doing something funky.

What I'm seeing when using NotePad++, is at column 1024 the text looks fine.  
But for 16 characters after that, the text appears in light blue and the 
remaining line looks okay.  I can't tell if there is a setting in NotePad++ 
that is simply identifying the first 1024 characters or if the validate for the 
service.bat file is catching something I should be aware of.  Since this email 
is text only, it is hard to show it, so I've taken a screen shot and pasted it 
here: https://postimg.org/image/gv29etcdf/

I don't have any good way to verify if all the parameters did in fact load 
properly, so reaching out to others to see if they have the same issue and/or 
know how to resolve it.

Thanks,
Steve Mekkelsen Madden



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



Re: 自动: SuTing Chen 已离开办公室 (返回日期 2016-11-12)

2016-08-29 Thread Mark Thomas
On 29/08/2016 02:05, Christopher Schultz wrote:
> Mark,
> 
> On 8/27/16 2:13 PM, Mark Thomas wrote:
>> On 27/08/2016 13:48, Christopher Schultz wrote:
>>> All,
>>>
>>> CC'ing markt, since he's both Tomcat PMC and INFRA.
> 
>> 
> 
>>> This is an out-of-office reply. Isn't there a way to have the
>>> mailing list reject (or ignore) messages with the following SMTP
>>> headers?
>>>
>>> Auto-Submitted: auto-generated Auto-Submitted: auto-repllied
> 
>> The message was sent to you personally, not the mailing list.
> 
> In the headers of the original message, the "To" field says:
> 
> To: "Tomcat Users List" 
> 
> Other interesting headers are:
> 
> List-Help: 
> List-Unsubscribe: 
> List-Post: 
> List-Id: 
> Reply-To: "Tomcat Users List" 
> Delivered-To: mailing list users@tomcat.apache.org
> X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org
> Received: from mx2-lw-eu.apache.org ([10.40.0.8])
>   by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new,
> port 10024)
>   with ESMTP id YHQOnyUbgpPC for ;
>   Fri, 26 Aug 2016 14:02:41 + (UTC)
> 
> 
> I'm pretty sure that message came through the ASF mailing list.

Sorry. You are correct. I must have deleted it as spam.

>> You'd need to configure and appropriate filter on your client /
>> mail server depending on your personal config.
> 
>> These responses do occasionally make it to the list but not often 
>> enough (yet) that I've felt the need to do anything about it.
> 
> Ok.

We can reject all messages that contain a given header. I've added
"Auto-Submitted" to the list for the users mailing list and we'll see
what impact that has.

Mark

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



Re: cookie-related regression in Tomcat 8.5?

2016-08-29 Thread Mark Thomas
On 29/08/2016 03:09, Mike Wertheim wrote:
> I took a look using the LiveHttpHeaders Chrome extension.
> 
> It's very simple.  Tomcat 8.0.33 is setting the Set-Cookie header in the
> response, and Tomcat 8.5.4 is not setting the Set-Cookie header in the
> response.

Check the logs for errors. I suspect the cookie isn't being sent because
it is failing validation.

Mark

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