Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
More test info trying to isolate the problem:
Task:
  developing  web app project on eclipse 2019 version. main project
includes a dependent project (sub-project) on the same eclipse.

Run main app as java app:
  main app vm parameters include: -Dlog4j.configurationFile,
LogManager.getLogger() returns correct logger in main app as well as
sub-project code. meaning, Log4j2 messages can print as expected. no error.

Run web app on tomcat 9, 8 or 7:
For tomcat runtime classpath, eclipse requires to add the sub-project and
all the jars needed (include log4j2 jars), otherwise it complains with no
class found error. However, after log4j2 jars are added, it throws the
above " ERROR StatusLogger Unrecognized format specifier " errors. The web
app can run. Log4j2 messages can print in the main app codes. BUT, Logger
in the sub-project codes does not print messages because it has error.

The cause may be in tomcat or in log4j2, or even eclipse. Any idea?

thanks,
-aj



On Fri, May 8, 2020 at 11:21 AM AJ Chen  wrote:

> Hi Mark,
> I also use log4j2 in my web app. dev in eclipse, when adding the log4j2
> jars to tomcat 7,8, or 9 runtime, it has this problem, log4j2.xml is
> provided as VM parameter. Web app firsts instantiates log4j2, and then
> tries to config log4j2 again,  throwing the following error due to double
> class loading:
>
> ERROR StatusLogger Unrecognized format specifier [d]
> ERROR StatusLogger Unrecognized conversion specifier [d] starting at
> position 16 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [thread]
> ERROR StatusLogger Unrecognized conversion specifier [thread] starting at
> position 25 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [level]
> ERROR StatusLogger Unrecognized conversion specifier [level] starting at
> position 35 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [logger]
> ERROR StatusLogger Unrecognized conversion specifier [logger] starting at
> position 47 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [msg]
> ERROR StatusLogger Unrecognized conversion specifier [msg] starting at
> position 54 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [n]
> ERROR StatusLogger Unrecognized conversion specifier [n] starting at
> position 56 in conversion pattern.
> ERROR StatusLogger Reconfiguration failed: No configuration found for
> '18b4aac2' at 'null' in 'null'
>
> Please note there is problem in the simple log4j2.xml for testing, which
> can be loaded successfully when there is no double class loading.
>
> -aj
>
>
> On Thu, May 7, 2020 at 1:53 PM Mark Thomas  wrote:
>
>> On 07/05/2020 21:40, AJ Chen wrote:
>> > I use eclipse to develop web app for tomcat, Web app has a dependent
>> > project and so the dependent project and all jars are added on the
>> > classpath for tomcat runtime. Log4j works on tomcat 6. But after
>> upgrate to
>> > tomcat 9, log4j failed to start with the following error. Anyone has
>> seen
>> > similar problem? log4j2 also failed. Thanks.
>>
>> Note: log4j is no longer supported.
>>
>> How, exactly, is log4j configured? What JAR files and what configuration
>> files are where? Any other configuration?
>>
>> Mark
>>
>>
>> >
>> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
>> > assignable to a "org.apache.log4j.Appender" variable.
>> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
>> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object
>> of
>> > type
>> > log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
>> > [ParallelWebappClassLoader
>> >
>> > aj
>> >
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Mark,
I also use log4j2 in my web app. dev in eclipse, when adding the log4j2
jars to tomcat 7,8, or 9 runtime, it has this problem, log4j2.xml is
provided as VM parameter. Web app firsts instantiates log4j2, and then
tries to config log4j2 again,  throwing the following error due to double
class loading:

ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at
position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at
position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at
position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at
position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at
position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at
position 56 in conversion pattern.
ERROR StatusLogger Reconfiguration failed: No configuration found for
'18b4aac2' at 'null' in 'null'

Please note there is problem in the simple log4j2.xml for testing, which
can be loaded successfully when there is no double class loading.

-aj


On Thu, May 7, 2020 at 1:53 PM Mark Thomas  wrote:

> On 07/05/2020 21:40, AJ Chen wrote:
> > I use eclipse to develop web app for tomcat, Web app has a dependent
> > project and so the dependent project and all jars are added on the
> > classpath for tomcat runtime. Log4j works on tomcat 6. But after upgrate
> to
> > tomcat 9, log4j failed to start with the following error. Anyone has seen
> > similar problem? log4j2 also failed. Thanks.
>
> Note: log4j is no longer supported.
>
> How, exactly, is log4j configured? What JAR files and what configuration
> files are where? Any other configuration?
>
> Mark
>
>
> >
> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
> > assignable to a "org.apache.log4j.Appender" variable.
> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object
> of
> > type
> > log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > [ParallelWebappClassLoader
> >
> > aj
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Chris,
my web app META-INF/lib has log4j jar,  but CATALINA_BASE/lib does not have
log4j jar listed.
It should be double loading class issue. I need to find out how to exclude
the unwanted classloading.
-aj


On Thu, May 7, 2020 at 2:48 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 5/7/20 16:40, AJ Chen wrote:
> > I use eclipse to develop web app for tomcat, Web app has a
> > dependent project and so the dependent project and all jars are
> > added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> > But after upgrate to tomcat 9, log4j failed to start with the
> > following error. Anyone has seen similar problem? log4j2 also
> > failed. Thanks.
> >
> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> > not assignable to a "org.apache.log4j.Appender" variable.
> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> > object of type log4j:ERROR
> > "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > [ParallelWebappClassLoader
>
> Can I just say that the above is a masterpiece of diagnostic error
> messaging?
>
> I can already tell that you have a classloading issue, and it's almost
> certain that you have log4j.jar both in CATALINA_BASE/lib and your web
> application's META-INF/lib directory. Is that the case?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
> pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
> JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
> htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
> gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
> Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
> i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
> pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
> 2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
> JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
> 8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
> 3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
> =IVj+
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Luis, good blog for logging settings. thanks.
-aj


On Thu, May 7, 2020 at 11:42 PM Luis Rodríguez Fernández 
wrote:

> Hello AjChen,
>
> Here [1] you can find an example of how I configured log4j2 in tomcat 9.
> You can skip all the bla, bla, bla and go directly to the gitthub repo [2]
> and run the example to have a look at the configuration.
>
> Note: I've been running like this for a while in production, but I do think
> that I am going to come back to the default, beautiful and simple JULI :)
>
> Hope it helps,
>
> Luis
>
> [1]
>
> https://db-blog.web.cern.ch/blog/luis-rodriguez-fernandez/2019-03-keeping-your-logs-clean-apache-tomcat-9-log4j2-and-spring-boot
> [2] https://github.com/lurodrig/log4j2-in-tomcat/
>
> El jue., 7 may. 2020 a las 23:48, Christopher Schultz (<
> ch...@christopherschultz.net>) escribió:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> >
> > AJ,
> >
> > On 5/7/20 16:40, AJ Chen wrote:
> > > I use eclipse to develop web app for tomcat, Web app has a
> > > dependent project and so the dependent project and all jars are
> > > added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> > > But after upgrate to tomcat 9, log4j failed to start with the
> > > following error. Anyone has seen similar problem? log4j2 also
> > > failed. Thanks.
> > >
> > > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> > > not assignable to a "org.apache.log4j.Appender" variable.
> > > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> > > object of type log4j:ERROR
> > > "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > > [ParallelWebappClassLoader
> >
> > Can I just say that the above is a masterpiece of diagnostic error
> > messaging?
> >
> > I can already tell that you have a classloading issue, and it's almost
> > certain that you have log4j.jar both in CATALINA_BASE/lib and your web
> > application's META-INF/lib directory. Is that the case?
> >
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> >
> > iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
> > pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
> > JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
> > htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
> > gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
> > Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
> > i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
> > pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
> > 2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
> > JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
> > 8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
> > 3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
> > =IVj+
> > -END PGP SIGNATURE-
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>
> --
>
> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>
> - Samuel Beckett
>


log4j failed on tomcat9

2020-05-07 Thread AJ Chen
I use eclipse to develop web app for tomcat, Web app has a dependent
project and so the dependent project and all jars are added on the
classpath for tomcat runtime. Log4j works on tomcat 6. But after upgrate to
tomcat 9, log4j failed to start with the following error. Anyone has seen
similar problem? log4j2 also failed. Thanks.

log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object of
type
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
[ParallelWebappClassLoader

aj


Re: Losing session between calls from mobile phone

2020-05-04 Thread AJ Chen
Chris and Peter,
Yes,  after using HTTPS in every url, session does not get loss any more.
Thank you for spotting the cause.

-aj


On Sat, May 2, 2020 at 7:01 AM logo  wrote:

> AJ
>
> > Am 30.04.2020 um 22:22 schrieb AJ Chen :
> >
> > The session problem happens when testing without SSL.
> >
> Just a thought:
>
> If the session cookie has the secure flag it will not be sent on http
> requests. (That would fail your test above in any case!)
>
> Now if that happens during regular https usage, it could be that one
> requests redirects to http. That will remove the cookie and a new session
> will be generated. The next https-request will have new cookie and then you
> start from scratch.
>
>
> Could that be possible?
>
> Peter
>
>
> > I'll try to test with Tomcat session manager example app. Thanks, Chris.
> >
> > -aj
> >
> > On Wed, Apr 29, 2020 at 3:05 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA256
> >>
> >> AJ,
> >>
> >> On 4/29/20 13:46, AJ Chen wrote:
> >>> On Wed, Apr 29, 2020 at 10:28 AM Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
> >>> AJ,
> >>>
> >>> On 4/29/20 13:24, AJ Chen wrote:
> >>>>>> Chris, When i use my latest iphone 11 to access the web app,
> >>>>>> tomcat server generates new session every time. It's normal
> >>>>>> use, not private browsing.> I did not change any setting on
> >>>>>> tomcat regarding session, use default session tracking. Is
> >>>>>> there any setting that can enforce using previous session
> >>>>>> (i.e. track session)?  Can I save the previous SessionID and
> >>>>>> use it to get the session with this id explicitly?
> >>> AFAIK, Safari Mobile doesn't do anything weird.
> >>>
> >>> Are you always using TLS (HTTPS)?
> >>>
> >>> -chris
> >>>
> >>>>>> On Wed, Apr 29, 2020 at 10:13 AM Christopher Schultz <
> >>>>>> ch...@christopherschultz.net> wrote:
> >>>>>>
> >>>>>> AJ,
> >>>>>>
> >>>>>> On 4/28/20 16:13, AJ Chen wrote:
> >>>>>>>>> Andre, thanks for asking the questions. Yes, we try to
> >>>>>>>>> get understand the behaviors.
> >>>>>>>>>
> >>>>>>>>> We have seen iphone and other android phones, on
> >>>>>>>>> different carriers, from different networks, encounter
> >>>>>>>>> this problem - losing session. It does not seem there
> >>>>>>>>> is a pattern so far. Users use all kinds of phones.
> >>>>>>>>> Some of their phones experience this problem.
> >>>>>>
> >>>>>> Are any of them using "private browsing" or anything like
> >>>>>> that?
> >>>>>>
> >>>>>> Are you just using the standard Tomcat-generated JSESSIONID
> >>>>>> cookies?
> >>>>>>
> >>>>>> -chris
> >>>>>>
> >>>>>>>>> On Tue, Apr 28, 2020 at 12:08 PM André Warnier
> >>>>>>>>> (tomcat/perl)  wrote:
> >>>>>>>>>
> >>>>>>>>>> On 28.04.2020 18:28, AJ Chen wrote:
> >>>>>>>>>>> Thanks. Martin and Mark.
> >>>>>>>>>>>
> >>>>>>>>>>> I can recreate the problem: I compare two
> >>>>>>>>>>> different mobile phones. One phone can log in and
> >>>>>>>>>>> proceed. Server log shows the same session persists
> >>>>>>>>>>> (same sessionID upon different requests). The other
> >>>>>>>>>>> phone can log in, but upon next request, server log
> >>>>>>>>>>> show a new session is always created (new
> >>>>>>>>>>> sessionId).
> >>>>>>>>>>>
> >>>>>>>>>>> Since session tracking works on PC browser and
> >>>>>>>>>>> some mobile phone, the
> >>

Re: Losing session between calls from mobile phone

2020-04-30 Thread AJ Chen
The session problem happens when testing without SSL.

I'll try to test with Tomcat session manager example app. Thanks, Chris.

-aj

On Wed, Apr 29, 2020 at 3:05 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 4/29/20 13:46, AJ Chen wrote:
> > On Wed, Apr 29, 2020 at 10:28 AM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > AJ,
> >
> > On 4/29/20 13:24, AJ Chen wrote:
> >>>> Chris, When i use my latest iphone 11 to access the web app,
> >>>> tomcat server generates new session every time. It's normal
> >>>> use, not private browsing.> I did not change any setting on
> >>>> tomcat regarding session, use default session tracking. Is
> >>>> there any setting that can enforce using previous session
> >>>> (i.e. track session)?  Can I save the previous SessionID and
> >>>> use it to get the session with this id explicitly?
> > AFAIK, Safari Mobile doesn't do anything weird.
> >
> > Are you always using TLS (HTTPS)?
> >
> > -chris
> >
> >>>> On Wed, Apr 29, 2020 at 10:13 AM Christopher Schultz <
> >>>> ch...@christopherschultz.net> wrote:
> >>>>
> >>>> AJ,
> >>>>
> >>>> On 4/28/20 16:13, AJ Chen wrote:
> >>>>>>> Andre, thanks for asking the questions. Yes, we try to
> >>>>>>> get understand the behaviors.
> >>>>>>>
> >>>>>>> We have seen iphone and other android phones, on
> >>>>>>> different carriers, from different networks, encounter
> >>>>>>> this problem - losing session. It does not seem there
> >>>>>>> is a pattern so far. Users use all kinds of phones.
> >>>>>>> Some of their phones experience this problem.
> >>>>
> >>>> Are any of them using "private browsing" or anything like
> >>>> that?
> >>>>
> >>>> Are you just using the standard Tomcat-generated JSESSIONID
> >>>> cookies?
> >>>>
> >>>> -chris
> >>>>
> >>>>>>> On Tue, Apr 28, 2020 at 12:08 PM André Warnier
> >>>>>>> (tomcat/perl)  wrote:
> >>>>>>>
> >>>>>>>> On 28.04.2020 18:28, AJ Chen wrote:
> >>>>>>>>> Thanks. Martin and Mark.
> >>>>>>>>>
> >>>>>>>>> I can recreate the problem: I compare two
> >>>>>>>>> different mobile phones. One phone can log in and
> >>>>>>>>> proceed. Server log shows the same session persists
> >>>>>>>>> (same sessionID upon different requests). The other
> >>>>>>>>> phone can log in, but upon next request, server log
> >>>>>>>>> show a new session is always created (new
> >>>>>>>>> sessionId).
> >>>>>>>>>
> >>>>>>>>> Since session tracking works on PC browser and
> >>>>>>>>> some mobile phone, the
> >>>>>>>> proxy
> >>>>>>>>> (if any) in front of aws EC2 server should not be
> >>>>>>>>> the problem.
> >>>>>>>> Anything
> >>>>>>>>> else may be missing?
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> Asking just in case : - are the 2 phones on the same
> >>>>>>>> network carrier ? - are they the same brand, or at
> >>>>>>>> least OS ? - if you connect them both to the same
> >>>>>>>> local WiFi, do they still act differently ?
> >>>>>>>>
> >>>>>>>> Note : no idea if this makes any difference, but
> >>>>>>>> we're trying to find a reason why they act
> >>>>>>>> differently when using the same Internet application
> >>>>>>>> server, right ?
> >>>>>>>>
> >>>>>>>>> -aj
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Tue, Apr 28, 2020 at 12:30 AM Mark Thomas
> >>>>>>

Re: Losing session between calls from mobile phone

2020-04-29 Thread AJ Chen
server.xml is configured for HTTPS.

-aj

On Wed, Apr 29, 2020 at 10:28 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 4/29/20 13:24, AJ Chen wrote:
> > Chris, When i use my latest iphone 11 to access the web app, tomcat
> > server generates new session every time. It's normal use, not
> > private browsing.> I did not change any setting on tomcat regarding
> > session, use default session tracking. Is there any setting that
> > can enforce using previous session (i.e. track session)?  Can I
> > save the previous SessionID and use it to get the session with this
> > id explicitly?
> AFAIK, Safari Mobile doesn't do anything weird.
>
> Are you always using TLS (HTTPS)?
>
> - -chris
>
> > On Wed, Apr 29, 2020 at 10:13 AM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > AJ,
> >
> > On 4/28/20 16:13, AJ Chen wrote:
> >>>> Andre, thanks for asking the questions. Yes, we try to get
> >>>> understand the behaviors.
> >>>>
> >>>> We have seen iphone and other android phones, on different
> >>>> carriers, from different networks, encounter this problem -
> >>>> losing session. It does not seem there is a pattern so far.
> >>>> Users use all kinds of phones. Some of their phones
> >>>> experience this problem.
> >
> > Are any of them using "private browsing" or anything like that?
> >
> > Are you just using the standard Tomcat-generated JSESSIONID
> > cookies?
> >
> > -chris
> >
> >>>> On Tue, Apr 28, 2020 at 12:08 PM André Warnier (tomcat/perl)
> >>>>  wrote:
> >>>>
> >>>>> On 28.04.2020 18:28, AJ Chen wrote:
> >>>>>> Thanks. Martin and Mark.
> >>>>>>
> >>>>>> I can recreate the problem: I compare two different
> >>>>>> mobile phones. One phone can log in and proceed. Server
> >>>>>> log shows the same session persists (same sessionID upon
> >>>>>> different requests). The other phone can log in, but upon
> >>>>>> next request, server log show a new session is always
> >>>>>> created (new sessionId).
> >>>>>>
> >>>>>> Since session tracking works on PC browser and some
> >>>>>> mobile phone, the
> >>>>> proxy
> >>>>>> (if any) in front of aws EC2 server should not be the
> >>>>>> problem.
> >>>>> Anything
> >>>>>> else may be missing?
> >>>>>>
> >>>>>
> >>>>> Asking just in case : - are the 2 phones on the same
> >>>>> network carrier ? - are they the same brand, or at least OS
> >>>>> ? - if you connect them both to the same local WiFi, do
> >>>>> they still act differently ?
> >>>>>
> >>>>> Note : no idea if this makes any difference, but we're
> >>>>> trying to find a reason why they act differently when using
> >>>>> the same Internet application server, right ?
> >>>>>
> >>>>>> -aj
> >>>>>>
> >>>>>>
> >>>>>> On Tue, Apr 28, 2020 at 12:30 AM Mark Thomas
> >>>>>>  wrote:
> >>>>>>
> >>>>>>> On 28/04/2020 07:47, Martin Grigorov wrote:
> >>>>>>>> On Tue, Apr 28, 2020 at 9:11 AM AJ Chen
> >>>>>>>> 
> >>>>> wrote:
> >>>>>>>>
> >>>>>>>>> Anyway to fix it? thanks. -aj
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> First you need to investigate whether there is a
> >>>>>>>> proxy. Then what kind of proxy. Then where is its
> >>>>>>>> configuration. Then consult with its manual and see
> >>>>>>>> whether there is something wrong/missng.
> >>>>>>>
> >>>>>>> I'd recommend taking a step back.
> >>>>>>>
> >>>>>>> Guessing at what might be wrong and then trying to fix
> >>>>>>> the problem you have only guessed at is unlikely to
> >>>>>>> work.
> >>>>&g

Re: Losing session between calls from mobile phone

2020-04-29 Thread AJ Chen
Chris,
When i use my latest iphone 11 to access the web app, tomcat server
generates new session every time. It's normal use, not private browsing.

I did not change any setting on tomcat regarding session, use default
session tracking. Is there any setting that can enforce using
previous session (i.e. track session)?  Can I save the previous SessionID
and use it to get the session with this id explicitly?

-aj

On Wed, Apr 29, 2020 at 10:13 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 4/28/20 16:13, AJ Chen wrote:
> > Andre, thanks for asking the questions. Yes, we try to get
> > understand the behaviors.
> >
> > We have seen iphone and other android phones, on different
> > carriers, from different networks, encounter this problem - losing
> > session. It does not seem there is a pattern so far. Users use all
> > kinds of phones. Some of their phones experience this problem.
>
> Are any of them using "private browsing" or anything like that?
>
> Are you just using the standard Tomcat-generated JSESSIONID cookies?
>
> - -chris
>
> > On Tue, Apr 28, 2020 at 12:08 PM André Warnier (tomcat/perl)
> >  wrote:
> >
> >> On 28.04.2020 18:28, AJ Chen wrote:
> >>> Thanks. Martin and Mark.
> >>>
> >>> I can recreate the problem: I compare two different mobile
> >>> phones. One phone can log in and proceed. Server log shows the
> >>> same session persists (same sessionID upon different requests).
> >>> The other phone can log in, but upon next request, server log
> >>> show a new session is always created (new sessionId).
> >>>
> >>> Since session tracking works on PC browser and some mobile
> >>> phone, the
> >> proxy
> >>> (if any) in front of aws EC2 server should not be the problem.
> >> Anything
> >>> else may be missing?
> >>>
> >>
> >> Asking just in case : - are the 2 phones on the same network
> >> carrier ? - are they the same brand, or at least OS ? - if you
> >> connect them both to the same local WiFi, do they still act
> >> differently ?
> >>
> >> Note : no idea if this makes any difference, but we're trying to
> >> find a reason why they act differently when using the same
> >> Internet application server, right ?
> >>
> >>> -aj
> >>>
> >>>
> >>> On Tue, Apr 28, 2020 at 12:30 AM Mark Thomas 
> >>> wrote:
> >>>
> >>>> On 28/04/2020 07:47, Martin Grigorov wrote:
> >>>>> On Tue, Apr 28, 2020 at 9:11 AM AJ Chen
> >>>>> 
> >> wrote:
> >>>>>
> >>>>>> Anyway to fix it? thanks. -aj
> >>>>>>
> >>>>>
> >>>>> First you need to investigate whether there is a proxy.
> >>>>> Then what kind of proxy. Then where is its configuration.
> >>>>> Then consult with its manual and see whether there is
> >>>>> something wrong/missng.
> >>>>
> >>>> I'd recommend taking a step back.
> >>>>
> >>>> Guessing at what might be wrong and then trying to fix the
> >>>> problem you have only guessed at is unlikely to work.
> >>>>
> >>>> Can you recreate the problem? You can't tell if something is
> >>>> fixed if you can't recreate it.
> >>>>
> >>>> Once you recreate the problem then you can start to narrow it
> >>>> down. You need to track what is happening to the session ID.
> >>>> You'll probably need to add some information to the access
> >>>> log, possibly look at some raw network logs and/or look at
> >>>> HTTP headers on the client..
> >>>>
> >>>> Somewhere in all of the above you should find out where the
> >>>> session ID is getting dropped. Then you need to figure out
> >>>> why. Only then you know why this is happening can you start
> >>>> to think about a solution.
> >>>>
> >>>> Mark
> >>>>
> >>>>
> >>>>>
> >>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Mon, Apr 27, 2020 at 10:54 PM Martin Grigorov <
> >> mgrigo...@apache.org>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> Hi,
> >&g

Re: Losing session between calls from mobile phone

2020-04-28 Thread AJ Chen
Andre, thanks for asking the questions. Yes, we try to get understand the
behaviors.

We have seen iphone and other android phones, on different carriers, from
different networks, encounter this problem - losing session. It does not
seem there is a pattern so far. Users use all kinds of phones. Some of
their phones experience this problem.

-aj


On Tue, Apr 28, 2020 at 12:08 PM André Warnier (tomcat/perl) 
wrote:

> On 28.04.2020 18:28, AJ Chen wrote:
> > Thanks. Martin and Mark.
> >
> > I can recreate the problem: I compare two different mobile phones. One
> > phone can log in and proceed. Server log shows the same session persists
> > (same sessionID upon different requests). The other phone can log in, but
> > upon next request, server log show a new session is always created (new
> > sessionId).
> >
> > Since session tracking works on PC browser and some mobile phone, the
> proxy
> > (if any) in front of aws EC2 server should not be the problem.
> Anything
> > else may be missing?
> >
>
> Asking just in case :
> - are the 2 phones on the same network carrier ?
> - are they the same brand, or at least OS ?
> - if you connect them both to the same local WiFi, do they still act
> differently ?
>
> Note : no idea if this makes any difference, but we're trying to find a
> reason why they
> act differently when using the same Internet application server, right ?
>
> > -aj
> >
> >
> > On Tue, Apr 28, 2020 at 12:30 AM Mark Thomas  wrote:
> >
> >> On 28/04/2020 07:47, Martin Grigorov wrote:
> >>> On Tue, Apr 28, 2020 at 9:11 AM AJ Chen 
> wrote:
> >>>
> >>>> Anyway to fix it? thanks. -aj
> >>>>
> >>>
> >>> First you need to investigate whether there is a proxy.
> >>> Then what kind of proxy.
> >>> Then where is its configuration.
> >>> Then consult with its manual and see whether there is something
> >>> wrong/missng.
> >>
> >> I'd recommend taking a step back.
> >>
> >> Guessing at what might be wrong and then trying to fix the problem you
> >> have only guessed at is unlikely to work.
> >>
> >> Can you recreate the problem? You can't tell if something is fixed if
> >> you can't recreate it.
> >>
> >> Once you recreate the problem then you can start to narrow it down. You
> >> need to track what is happening to the session ID. You'll probably need
> >> to add some information to the access log, possibly look at some raw
> >> network logs and/or look at HTTP headers on the client..
> >>
> >> Somewhere in all of the above you should find out where the session ID
> >> is getting dropped. Then you need to figure out why. Only then you know
> >> why this is happening can you start to think about a solution.
> >>
> >> Mark
> >>
> >>
> >>>
> >>>
> >>>>
> >>>>
> >>>> On Mon, Apr 27, 2020 at 10:54 PM Martin Grigorov <
> mgrigo...@apache.org>
> >>>> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> On Tue, Apr 28, 2020 at 2:23 AM AJ Chen 
> >> wrote:
> >>>>>
> >>>>>> My web application using tomcat 6 can track user session (cookie by
> >>>>>> default) for mobile and PC users in dev environment. But when
> deployed
> >>>> on
> >>>>>> cloud server, it fails to track session for some mobile users.
> >> meaning,
> >>>>>> servlet always creates a new session upon user request.
> >>>>>>
> >>>>>> Any idea why this happens?
> >>>>>>
> >>>>>
> >>>>> Most probably there is a proxy in front of Tomcat in the cloud
> >>>> environment
> >>>>> which does not properly forward the JSESSIONID cookie.
> >>>>>
> >>>>> Martin
> >>>>>
> >>>>>
> >>>>>>
> >>>>>> aj
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>
> >>
> >> -
> >> 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: Losing session between calls from mobile phone

2020-04-28 Thread AJ Chen
Thanks. Martin and Mark.

I can recreate the problem: I compare two different mobile phones. One
phone can log in and proceed. Server log shows the same session persists
(same sessionID upon different requests). The other phone can log in, but
upon next request, server log show a new session is always created (new
sessionId).

Since session tracking works on PC browser and some mobile phone, the proxy
(if any) in front of aws EC2 server should not be the problem.Anything
else may be missing?

-aj


On Tue, Apr 28, 2020 at 12:30 AM Mark Thomas  wrote:

> On 28/04/2020 07:47, Martin Grigorov wrote:
> > On Tue, Apr 28, 2020 at 9:11 AM AJ Chen  wrote:
> >
> >> Anyway to fix it? thanks. -aj
> >>
> >
> > First you need to investigate whether there is a proxy.
> > Then what kind of proxy.
> > Then where is its configuration.
> > Then consult with its manual and see whether there is something
> > wrong/missng.
>
> I'd recommend taking a step back.
>
> Guessing at what might be wrong and then trying to fix the problem you
> have only guessed at is unlikely to work.
>
> Can you recreate the problem? You can't tell if something is fixed if
> you can't recreate it.
>
> Once you recreate the problem then you can start to narrow it down. You
> need to track what is happening to the session ID. You'll probably need
> to add some information to the access log, possibly look at some raw
> network logs and/or look at HTTP headers on the client..
>
> Somewhere in all of the above you should find out where the session ID
> is getting dropped. Then you need to figure out why. Only then you know
> why this is happening can you start to think about a solution.
>
> Mark
>
>
> >
> >
> >>
> >>
> >> On Mon, Apr 27, 2020 at 10:54 PM Martin Grigorov 
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> On Tue, Apr 28, 2020 at 2:23 AM AJ Chen 
> wrote:
> >>>
> >>>> My web application using tomcat 6 can track user session (cookie by
> >>>> default) for mobile and PC users in dev environment. But when deployed
> >> on
> >>>> cloud server, it fails to track session for some mobile users.
> meaning,
> >>>> servlet always creates a new session upon user request.
> >>>>
> >>>> Any idea why this happens?
> >>>>
> >>>
> >>> Most probably there is a proxy in front of Tomcat in the cloud
> >> environment
> >>> which does not properly forward the JSESSIONID cookie.
> >>>
> >>> Martin
> >>>
> >>>
> >>>>
> >>>> aj
> >>>>
> >>>
> >>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Losing session between calls from mobile phone

2020-04-28 Thread AJ Chen
Anyway to fix it? thanks. -aj


On Mon, Apr 27, 2020 at 10:54 PM Martin Grigorov 
wrote:

> Hi,
>
> On Tue, Apr 28, 2020 at 2:23 AM AJ Chen  wrote:
>
> > My web application using tomcat 6 can track user session (cookie by
> > default) for mobile and PC users in dev environment. But when deployed on
> > cloud server, it fails to track session for some mobile users. meaning,
> > servlet always creates a new session upon user request.
> >
> > Any idea why this happens?
> >
>
> Most probably there is a proxy in front of Tomcat in the cloud environment
> which does not properly forward the JSESSIONID cookie.
>
> Martin
>
>
> >
> > aj
> >
>


Losing session between calls from mobile phone

2020-04-27 Thread AJ Chen
My web application using tomcat 6 can track user session (cookie by
default) for mobile and PC users in dev environment. But when deployed on
cloud server, it fails to track session for some mobile users. meaning,
servlet always creates a new session upon user request.

Any idea why this happens?

aj