Re: Apache Tomcat 8.5.4 question

2016-08-27 Thread Johanes Soetanto
On 27 Aug 2016 10:43 pm, "Christopher Schultz" 
wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Jorge,
>
> On 8/26/16 10:26 PM, Jorge Alfonso wrote:
> > Dear Sirs
> >
> > I configured and started Tomcat Server on Windows 2008-R12 Server.
> >
> > Compiled and deployed a Java Vaadin Web application that I just
> > started to program 2 months ago. My experience with Vaadin is only
> > 2 months and the Tomcat Server only 2 days. I am a newbie learning
> > Java, Vaadin and Tomcat, but willing to investigate and learn
> >
> > The application starts just fine and runs the login and executes
> > the main menu all the time, it does not matter how many sessions or
> > where from, remote systems or localhost.
> >
> > The only session or execution that allows running options from the
> > Menu is the first one. all the other sessions are not getting
> > displayed the forms and the information.

Have the application been tested on other Tomcat version? E.g. 7.x
You may want to change log configuration to find what happened when you try
to access the form etc since Vaadin allows you to debug your application on
some IDE.

>
> So, the main menu works for everyone, but the other stuff only works
> properly for the first user to login? What if that user logs out, then
> logs back in again? Does it work again for that user, or is it
> literally the *first session* that works, and none others work?
>
> > I have investigated this behavior on Google and Apache but
> > unfortunately there is nothing that I can use to properly guide my
> > efforts.
> >
> > I need to isolate if this could be a parameter or configuration
> > missing in Tomcat or this is a Vaadin Framework problem with
> > session handling or the like.
> >
> > I do not want to overwhelm you initially with configuration in
> > Tomcat, logs or console file, unless you want me to submit them
>
> I have no personal experience with Vaadin, so I'm probably going to
> ask a lot of dumb questions.
>
> First of all, have you personally written code to access the
> HttpSession? Can you give us an example?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXwYsPAAoJEBzwKT+lPKRYwdkQAJ0lhlINZr22nxT6h0l4LGvT
> gS8Gs7iDzRTc6w1UpfXbFUn5i/mf9EddjTa0t5/iBlVaXDUqLv3nCi05rXsfSZPX
> In/cqwGjeMQ8J3+DuAbNMd7gF2TaVAmgmdIMi1rQJ77IGbA0Y7Ntd5CFTDRh57XK
> k0/ZoeBI9+y3iCp1lhJ25YQ+g9785nahFeadPoz8tEIQbDerAGDL+C7Y9Bj7hQMc
> IOn65hs2pS2DB5KBAbQKrgIE0BibKGhrdrXsVUDGSvzjVh5CGnxLoManvNbPiZpm
> 4a/T1BN4Cv/LU8sLHtLCkxOZ6CPvRWyI7ZQOLX+gNehnuiw7eDBhSfM2McUHFSdW
> Dz6XCG0d1g8PAYyRMZnmCQY/h9UGk8QdGpvWjyeFvU9ntFcV/5d0nPVflI1/p+4S
> TL1o0edPt0x9+D0ftyZjFjw0r/THRFM/ntZ4C72lJ5Puwy41tMrnTGjjAMi7PZEY
> aATXBL1kYM+A5QIXGrOLm0/vNhIj5Em3sUDMmKmOshaOj0jF8ZMW6RwxqQ+YNyqV
> yug7sIlAPLllZhMkYiaK4+JjWMLy/5tTeB0Nf4NGx0CgF1C3m/NoFjoZ2OdT0p7w
> urrcFbnjngKbwlXjAMc2Ao4be3UVGseVq4B4EIxK+hu9oxO7vfCJqf1sWPqCkk9e
> 8U01oYnwEKn9tXKdIO72
> =7LxQ
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


How to properly map a filter in tomcat embedded

2016-08-27 Thread John D. Ament
Hi,

I have this pretty straight forward case of starting an instance of tomcat
and bringing in a filter.

Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
File base = new File(".");
Context ctx = tomcat.addContext("", base.getAbsolutePath());
String filterName = "Default";
FilterDef filterDef = new FilterDef();
filterDef.setFilterName(filterName);
filterDef.setFilterClass(DefaultFilter.class.getName());
ctx.addFilterDef(filterDef);

FilterMap mapping = new FilterMap();
mapping.setFilterName(filterName);
mapping.addURLPattern("/*");
ctx.addFilterMap(mapping);
tomcat.start();
tomcat.getServer().await();
Thread.sleep(6);

My filter's pretty boring, but here it is

public class DefaultFilter implements Filter{
@Override
public void init(FilterConfig filterConfig) throws ServletException {

}

@Override
public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse, FilterChain filterChain) throws IOException,
ServletException {
servletResponse.getWriter().println("Hello, world!");
}

@Override
public void destroy() {

}
}

When starting this up (Just running in a plain JUnit test), the container
is running however making requests to localhost:8080/ just result in
404's.  I'd expect my filter to handle those requests.

When using a servlet, its perfectly fine.

I tried it on both 8.5.4 and 8.0.30.

Any ideas?

John


cookie-related regression in Tomcat 8.5?

2016-08-27 Thread Mike Wertheim
I've found a difference in behavior between Tomcat 8.0.33 and Tomcat 8.5.4.

Here's the setup...

I have some Tomcat servers behind an F5 load balancer.  There are two
top-level domains (which I'll call domain1.com and domain2.com) pointing to
the load balancer.  In addition, there is a separate server running PHP.
There is a top-level domain (which I'll call domain3.com) that points to
the PHP server.  So www.domain3.com goes to the PHP server.  But we use DNS
to point a subdomain of domain3.com (let's call it sub.domain3.com) which
points to the Tomcat servers via the load balancer.

The Java app that's running on Tomcat sets some cookies.  The cookie's
domain is set by doing something like cookie.setDomain(domain), where
"domain" is based on the value of request.getServerName().

The bug that Tomcat 8.5.4 exhibits is: Chrome and Safari refuse to set the
cookie when the site is accessed via http://sub.domain3.com.

The cookies work fine in each of the following scenarios:
- It works fine when the Tomcat version is 8.0.33
- It works fine with Firefox
- It works fine when the site is accessed by either domain1.com or
domain2.com

The failure only happens with the combination of: Tomcat 8.5.4, the browser
is Chrome or Safari, and the site is accessed via http://sub.domain3.com.

This all happens using regular (non-SSL) http.

I've attached server.xml and context.xml.







WEB-INF/web.xml
${catalina.base}/conf/web.xml








  
  
  
  

  
  



  

  
  
  







  
  

  
  
		
  

  


-
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-27 Thread Mark Thomas
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. 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.

Mark

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



Re: How to set a virtual directory mapping

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

Fung,

On 8/26/16 12:58 AM, Fung wrote:
> How to set a virtual directory that I can map a virtual path in my 
> web-app to local physical path.
> 
> OS:window 7 Tomcat version:7.057

So you want a physical path like D:\public\files to map-into your URL
space like http://example.com/myapp/files?

Try something like this in your META-INF/context.xml file:


  ...


Ref: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
(search for "aliases").

If/when you upgrade to Tomcat 8, you'll want to replace "aliases" with
something like this:


  
 
  
  ...


Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXwY8LAAoJEBzwKT+lPKRYL3QQAJSkTW7VfreoTCCKvSW7zsUo
/Z4afgsKZzNFt+ALnfGiDy/XpROelq02gy6Ai2rn73+gHc/tD38HVPzfNPyxQFeS
lhyFDPX9Lr5wPzbhLfm3WIthT5iS5E8s7ixsECnSRkYymYWWk34BSq3NJpHH0vuO
NmXgZ8VX/sbnN2l7+FrrVXdCmqqS9lOOV8UMGX1TRZzJhuZYrWQtDbrCR3WHcz7+
lN79aFrwM/SBM1eenYB8srx+vwC2GuKISH/5c0DC0UwycxxtCux/Uwvxo62IXmcW
Ee8ZQnxU/2ZmqwBTfjqaOHwLoR0VzuoTjL67uyV4mSoEqw6zqs3aRIH2Iw2Iuuvk
B2NWUtC6+sPuGlGKhOgIgwJbOMWpw6SpeivJ4cQxeOKeAQhKzBQEEuqNcT92yEFy
bbvwFzxgRJd7MEN0Ggit1tLrFLjHx9tlwbDNIbSjsDiQghVYr012beb6CgB7yBFV
KfEJkCCod4MJZqQuUTOke86PwaC6rV1Ep5wjxzsVMktqxh+Pp76q9/TujNsgMo5Q
wRwHEVuVFSCz1k2NxJgeryqlsOQanHZhFdYJU+SNzWYn9/hvBgQDoxByG7h0GYbT
R9PGtY8hOM/3vAAukOTn/IA0TBGXmcg0yc+gJFZPhZ/UB2cGQhKQoSJBQEv1Ga4g
3Y+E7NeZ9xsanoV8PPpy
=QSdB
-END PGP SIGNATURE-

-
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-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

CC'ing markt, since he's both Tomcat PMC and INFRA.

On 8/26/16 10:01 AM, chensut...@xmholder.com wrote:
> 
> 在 2016-11-12 之前,我离开办公室。
> 
> 我在6/8至11/12离开办公室,如有特急的可以联系林小姐 l...@xmholder.com,带来不 便请谅解!
> 
> 
> 注意: 这是对您消息的自动答复  "Re: Custom Authentication in Tomcat 8.5.4 using
> JDK 1.8.0_92?" 发送日期 2016/8/26 20:07:53.
> 
> 此通知是此用户离开期间您将收到的唯一通知。 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

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

?

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

iQIcBAEBCAAGBQJXwYweAAoJEBzwKT+lPKRYsBkP/2vbn2fjsAcmx2zBMk1AzUUY
jQjCFV+rw/UHt1I5icHTZ71OT4fbUnp4tYERiIhKmP7Z1QgI6Z6lpNhx+E1eBHRh
8dM/oYr3pXkdzlmdZwIn/9GTHsrJgao9kRWduejVdPrlUHnnMPsxa0x+uil3YiB5
x6zBpwF+MIniEhcj1+T7Z/epgaTkJeA07PXoPaurACpxBbQ7MnqeqoIy+YH+LrP7
33km/O3W05H1eC+M9EA8/R15n3VPGQbW/5CZrWrghRqrT56l4zNmpx4SDESI4zOw
iZeFfKeXndOgFx5pLNS1EBBC7m6vcGKw3ZN04NZ6szickbP2Xim1I30buik/MEnE
q141tT4Td2SUW6wkY7RUGKRt4D5ZATre6XR2Qs6JE9aE5oq3o0kkUuy27KqetqWD
Y2gjCIohxfKVY/SvAKVwOL4B3vdvRD8fYCtAcpJ7gkjEWe5hiYf+b4OtMeONh07G
2f4QacI6MUBIKY7WM+C2yoE5wvx3rzhtFfSJ93PG41LRJS86+OQKs/A63jde4nki
W9STW1WQTneJ+dx164R2UCJwwj9SQM+H/586oYzXCQL60IBWp+Rfm7Hc9JIYV64O
HlqwB2Yis7lK/fMB0mXX0XGRwexu1kU+cyP87enDLp3BCU5PQHgjPNxN1E91tpGi
Cfh+ZwH72849hIR62UCJ
=PCBS
-END PGP SIGNATURE-

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



Re: Apache Tomcat 8.5.4 question

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

Jorge,

On 8/26/16 10:26 PM, Jorge Alfonso wrote:
> Dear Sirs
> 
> I configured and started Tomcat Server on Windows 2008-R12 Server.
> 
> Compiled and deployed a Java Vaadin Web application that I just
> started to program 2 months ago. My experience with Vaadin is only
> 2 months and the Tomcat Server only 2 days. I am a newbie learning
> Java, Vaadin and Tomcat, but willing to investigate and learn
> 
> The application starts just fine and runs the login and executes
> the main menu all the time, it does not matter how many sessions or
> where from, remote systems or localhost.
> 
> The only session or execution that allows running options from the
> Menu is the first one. all the other sessions are not getting
> displayed the forms and the information.

So, the main menu works for everyone, but the other stuff only works
properly for the first user to login? What if that user logs out, then
logs back in again? Does it work again for that user, or is it
literally the *first session* that works, and none others work?

> I have investigated this behavior on Google and Apache but
> unfortunately there is nothing that I can use to properly guide my
> efforts.
> 
> I need to isolate if this could be a parameter or configuration
> missing in Tomcat or this is a Vaadin Framework problem with
> session handling or the like.
> 
> I do not want to overwhelm you initially with configuration in
> Tomcat, logs or console file, unless you want me to submit them

I have no personal experience with Vaadin, so I'm probably going to
ask a lot of dumb questions.

First of all, have you personally written code to access the
HttpSession? Can you give us an example?

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

iQIcBAEBCAAGBQJXwYsPAAoJEBzwKT+lPKRYwdkQAJ0lhlINZr22nxT6h0l4LGvT
gS8Gs7iDzRTc6w1UpfXbFUn5i/mf9EddjTa0t5/iBlVaXDUqLv3nCi05rXsfSZPX
In/cqwGjeMQ8J3+DuAbNMd7gF2TaVAmgmdIMi1rQJ77IGbA0Y7Ntd5CFTDRh57XK
k0/ZoeBI9+y3iCp1lhJ25YQ+g9785nahFeadPoz8tEIQbDerAGDL+C7Y9Bj7hQMc
IOn65hs2pS2DB5KBAbQKrgIE0BibKGhrdrXsVUDGSvzjVh5CGnxLoManvNbPiZpm
4a/T1BN4Cv/LU8sLHtLCkxOZ6CPvRWyI7ZQOLX+gNehnuiw7eDBhSfM2McUHFSdW
Dz6XCG0d1g8PAYyRMZnmCQY/h9UGk8QdGpvWjyeFvU9ntFcV/5d0nPVflI1/p+4S
TL1o0edPt0x9+D0ftyZjFjw0r/THRFM/ntZ4C72lJ5Puwy41tMrnTGjjAMi7PZEY
aATXBL1kYM+A5QIXGrOLm0/vNhIj5Em3sUDMmKmOshaOj0jF8ZMW6RwxqQ+YNyqV
yug7sIlAPLllZhMkYiaK4+JjWMLy/5tTeB0Nf4NGx0CgF1C3m/NoFjoZ2OdT0p7w
urrcFbnjngKbwlXjAMc2Ao4be3UVGseVq4B4EIxK+hu9oxO7vfCJqf1sWPqCkk9e
8U01oYnwEKn9tXKdIO72
=7LxQ
-END PGP SIGNATURE-

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



Re: Create new MySQL connections if read-only status is detected - AWS RDS failover

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

David,

On 8/26/16 2:45 PM, David Day wrote:
>> How, in general, would you test to see if the database is in
>> read-only mode?
>> 
>> - -chris
> 
> This is what I'm hoping to learn, and perhaps is a question better
> for a MySQL list.
> 
> I've found settings to add such as 'autoReconnect' and 
> 'failOverReadOnly' for more classic cases using multiple MySQL
> servers to connect.  In my case, there is only one url, where AWS
> changes the CNAME record of the url after a failover.  This may
> still be a solution, to simply retry the same url until a limit
> reached, or the connection is no longer read-only.

I think AWS/RDS is a better resource, here... this seems like it
should have been a solved problem already.

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

iQIcBAEBCAAGBQJXwYptAAoJEBzwKT+lPKRYClUQAJ4LcY9cQvk72kRFwpvy+Y84
nH2vCzAkjPEzvr36UqvESGSP35Jf18wIHN1llBnDWzF0WCaaz9iIybpThN3Uv4nd
1hTGgqmrpyICFWYZM5A9MwhTCATFyyXa8o7MxUAWsZ2Kxxp5VAAYGVF8s1+CmpbL
NiMOXdzlCLjfTN3ZaEaVIbI89Ihp9ljZ4DP/7Tr2lQjSaIM6QgDf4/ia8/VLSqcJ
BNB+KLPy4X/GfG/jnH3FAB+Zt9gje/wmeGCW/lWwXTTQM3UQpLB3xwTFArCwt8Mb
FX7HR4MbEWKNBXvMtcEf62nbrY/yLEMpJS3PsjV5rhmDH4Rm7rNF/BGIs7P39GXu
eKDuX5nv4gOMHmFX33PPmIALY4GJBX9vBVreW+ggol7qt1EMXgBw4/NpXjZEw+3K
484LX9l7NnKn4MUkb+fO2AME22EYeWW6OUZHefn20BUsSH4PbOJO1fMkeE6WBXqv
WU2AJaVtDxaaCDoFIZW+0uzfFCryHA3Ws2mfqDTy9XcfF7KS8gn+BL9pczdELFc2
bptCqw1kWgquyC6YCxWPcGHiiVpOfaXsHoYsTYJwB8N9UBOQ+7mmYrzfXyow20PL
SdDVf7cz5VDlnwriO7upecA7D2Gf5EUI0hUfn5RJ+hC2NDmz3KBNXGcJukEcGCO5
n+hQ1XdjHEGN833mYmep
=27ht
-END PGP SIGNATURE-

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