Re: AsyncServlets in tomcat

2022-02-08 Thread Johan Compagner
On Tue, 8 Feb 2022 at 18:20, Deshmukh, Kedar  wrote:

>
> I would like to understand, how many concurrent AsyncServlets tomcat can
> handle ?
>
>
wouldn't that be completely dependent on what resources (hardware) you give
your tomcat?


-- 
Johan Compagner
Servoy


Re: javax.servlet vs jakarta.servlet?

2021-12-28 Thread Johan Compagner
i think the whole point was that they had to break with the "javax" naming
because oracle doesn't allow that outside it stuff.

not sure if Tomcat 10 would be allowed to just have both classes/interfaces
for compatibility

Also this would be a big hurdle moving forwards (and not sure if everything
is really an interface and if there are no concrete classes in the spec)

But for tomcat 10 and maybe for tomcat 11 this would be a good migration
path that it would just run both of them just as easy.

But anyway we kind of have this

Apache Tomcat® - Apache Tomcat Migration Tool for Jakarta EE Software
Downloads <https://tomcat.apache.org/download-migration.cgi>

or:

"Applications that run on Tomcat 9 and earlier will not run on Tomcat 10
without changes. Java EE based applications designed for Tomcat 9 and
earlier may be placed in the $CATALINA_BASE/webapps-javaee directory and
Tomcat will automatically convert them to Jakarta EE and copy them to the
webapps directory. This conversion is performed using the Apache Tomcat
migration tool for Jakarta EE tool
<https://github.com/apache/tomcat-jakartaee-migration> which is also
available as a separate download
<https://tomcat.apache.org/download-migration.cgi> for off-line use."

but i agree a bit with your sentiment, this is a major break, its kind of a
new spec (they versioned it 4.0 to 5.0 but it kind of just a 1.0 again,
starting over)

So i also do think that the maintenance window of Tomcat 9 will be quite
long, but tomcat versions are supported for quite some time, 8.5 is still
supported and the first release was beginning of 2014.
Tomcat 9 was 3 years later or so, so i guess it will be supported maybe
even close to 2030...




On Tue, 28 Dec 2021 at 16:00, Michael B Allen  wrote:

> On Tue, Dec 28, 2021 at 3:29 AM Johan Compagner 
> wrote:
> >
> > Will that really work?
>
> No.
>
> Clearly I'm not paying attention because after reading surprisingly
> little information about this fundamental incompatibility and
> downloading and trying Tomcat 10, there is no way to use a
> javax.servlet library or application with a jakarta.servlet app server
> like Tomcat 10. So now I REALLY want to know if people actually use
> Tomcat 10 and what the release policy will be going forward for Tomcat
> 9. Is Tomcat 9 going to be maintained separately with security fixes
> and such?
>
> There must be thousands of libraries and applications that cannot be
> converted for various reasons. Even active open source projects are
> probably going to punt on this. Think about how many github projects
> there are with one guy using it for some thing at work and so he
> doesn't want to make up some screwy build process that creates two
> jars. This basically guarantees that people will be using Tomcat 9 for
> many years.
>
> Also, correct me if I'm wrong but it seems to me that the two
> interfaces should easily coexist. The Servlet interface is just that -
> an interface. So just create an implementation of javax.servlet that
> uses the jakarta.servlet code as it's implementation. In many cases
> the code could literally be like:
>
>   package javax.servlet.http;
>
>   public class HttpServletRequestWrapper extends
> jakarta.servlet.http.ServletRequestWrapper implements
> HttpServletRequest
>   {
> // nothing to see here
>   }
>
> The only code that might be different is details about sessions or
> something that jakarta.servlet wants to do a little differently. But
> in that case, the ability of OOP to override methods to selectively
> change some behavior can be utilized well here. Unless something in
> jakarta.servlet changes that fundamentally breaks compatibility with
> javax.servlet, code using javax.servlet shouldn't know the difference.
> And if something does change that breaks backward compatibility, that
> would be a slightly frightening change in policy regarding backward
> compatibility of Java code in general since just about any piece of
> Java code written in literally the last 20 years will run on the
> latest platform with only minor tweaks.
>
> The effort required for every product and project in the universe to
> create a build process that generates two jars is massive compared to
> the effort that would be required for Tomcat to support both
> javax.servlet and jakarta.servlet even if it were difficult to do for
> some reason I'm not seeing.
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


Re: javax.servlet vs jakarta.servlet?

2021-12-28 Thread Johan Compagner
Will that really work?

tomcat 10 internally really expects jakarta.xxx now right?
so if you have a class MyServlet extends javax.Servlet
i don't think tomcat 10 will do anything with that (if that is not
converted first through the migration tool)

I have a feeling that you really can't mix, but i can be wrong

johan



On Tue, 28 Dec 2021 at 01:35, Michael B Allen  wrote:

> Hello Tomcat Users,
>
> Does anyone have a sense of how many people are using the jakarta.servlet
> API?
>
> I have a product that includes some classes that use javax.servlet and
> I'm trying to figure out how to support people who want to use
> jakarta.servlet. I plan to install Tomcat 10 momentarily but I assume
> one just has to add whatever javax.servlet jar to make Tomcat 10 work
> with a javax.servlet lib or app?
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


Re: Log4j 2.15.0 and Tomcat 9.0.56

2021-12-20 Thread Johan Compagner
ement.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
> at sun.rmi.transport.Transport$1.run(Transport.java:200)
> at sun.rmi.transport.Transport$1.run(Transport.java:197)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
>
>
> --
> Daniela Morais
> Software Engineer
> danielammorais.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


Re: Are we able to deploy the same WAR to Tomcat 9 and 10?

2021-02-05 Thread Johan Compagner
>
> > for me building it from maven is fine, but most of our customers  dont
> code
> > java or use mvn so are there plans to really make releases of it? so you
> > can just download the shaded jar?
>
> https://downloads.apache.org/tomcat/jakartaee-migration/
>
> It has been formally released. Just not announced - mainly because it
> needs a a bunch of website updates like the creation of the download
> page. I'll see if I can make some progress on that.
>
>
ah because i was just looking at github i was just checking:

Releases · apache/tomcat-jakartaee-migration (github.com)
<https://github.com/apache/tomcat-jakartaee-migration/releases>
<https://github.com/apache/tomcat-jakartaee-migration/releases>;)

We did a first small test and the tool seem to work

-- 
Johan Compagner
Servoy


Re: Are we able to deploy the same WAR to Tomcat 9 and 10?

2021-02-05 Thread Johan Compagner
>
>
>
> > And then I don't care too much about if it goes from javax.servlet to
> > jakarta.servlet or the other way around.. I just want to support both
> > deployments. That our customers can dump in the generated war by our
> > tooling in any tomcat version (8,9 or 10) and it just works.
>
> There has been talk of integrating the migration tool into Tomcat 10 so
> if you drop in a Java EE 8 app it automagically converts it to Jakarta
> EE 9 before starting it.
>
> I'm guessing you'd prefer this to having to provide separate Java EE and
> Jakarta EE versions (even if all you had to do to create the Jakarta EE
> version was run it through the migration tool).
>
> On a related topic, it would be helpful to know if the migration tool
> successfully converts your app.
>

yes i have been reading it up, so our customers could just use the
migration app if they really want the WAR (that our tool generates) to
deploy on 10
We don't use many fancy things like very "new" servlet or jsp things its
quite basic servlets and filters + websocket stuff that also run fine under
tomcat 8..

But i will do some test how that migration tool work.

for me building it from maven is fine, but most of our customers  dont code
java or use mvn so are there plans to really make releases of it? so you
can just download the shaded jar?

-- 
Johan Compagner
Servoy


Are we able to deploy the same WAR to Tomcat 9 and 10?

2021-02-05 Thread Johan Compagner
Hi,

I already now get the first support request that our application doesn't
run under Tomcat 10.

So just want to get straight how this is going to work in the future.

i see there is a migration tool, but that is for now quite useless for us
because we also need to support Tomcat 9 or 8..

We are a tool/framework vendor we don't control what our users do, they can
still be on what ever servlet container they are on. (we only require the
websocket implementation so that makes certain stuff the minimum)

Is there or will there be a way that we can drop in a jar that is just a
"redirect/wrapper"?

And then I don't care too much about if it goes from javax.servlet to
jakarta.servlet or the other way around.. I just want to support both
deployments. That our customers can dump in the generated war by our
tooling in any tomcat version (8,9 or 10) and it just works.


-- 
Johan Compagner
Servoy


Re: what is the exact order of filters?

2021-01-18 Thread Johan Compagner
> You need to read section 8.2.3 of the servlet specificaiton
>
> 
> If the order in which the listeners, servlets, filters are invoked is
> important to an application then a deployment descriptor must be used.
> Also, if necessary, the ordering element defined above can be used. As
> described above, when using annotations to define the listeners,
> servlets and filters, the order in which they are invoked is unspecified.
> 
>
> Entries in the global web.xml files will be added after those from the
> application web.xml
>
>
yes thats what i was testing also
But where are then annotations coming in?
I can't find that.
And i mean together with a web.xml in conf and a web.xml in web-inf where
there are also definitions of filters and mappings..

It seems to me that it is:

WEB-INF/web.xml (these do have order between them)
annotations (unordered)
conf/web.xml (these do have order between them)

or is that just an tomcat implementation? that other containers don't
really have to follow?


what is the exact order of filters?

2021-01-15 Thread Johan Compagner
Hi
here we have a case: 51754 – Tomcat7 filters from conf/web.xml are applied
after filters defined in WEB-INF/web.xml (apache.org)
<https://bz.apache.org/bugzilla/show_bug.cgi?id=51754>

that already says that the conf/web.xml are later then WEB-INF/web.xml

is it so that the order is something like


WEB-INF/web.xml
annotations based once
conf/web.xml

?

I am also not sure what the spec says about this mix

-- 
Johan Compagner
Servoy


Re: Should Tomcat 10 enable response compression by default?

2020-06-10 Thread Johan Compagner
isn't that compression only working when the browser request for it?
So there are buggy browsers that do request it but can't handle it?

i would say that an opt-out is then also fine..


On Wed, 10 Jun 2020 at 08:28, Martin Grigorov  wrote:

> On Tue, Jun 9, 2020 at 11:26 PM Manuel Dominguez Sarmiento  >
> wrote:
>
> > I would not change this default. GZIP (or other kinds) of response
> > compression are better addressed as servlet filters. Having the Tomcat
> > feature is good, but IMHO it should only be enabled by those who need it.
> >
> > At least in our case we have our own code to deal with this, considering
> > proxying, CDN, buggy browsers, etc.
> >
>
> I think the same - it should be opt-in feature.
>
> My 2c.
>
> Martin
>
>
> >
> > *Manuel Dominguez Sarmiento*
> >
> > On 09/06/2020 17:20, Mark Thomas wrote:
> > > Hi all,
> > >
> > > An enhancement has been opened to enable response compression by
> default:
> > > https://bz.apache.org/bugzilla/show_bug.cgi?id=64431
> > >
> > > In short, the proposal is to change the default for the Connector's
> > > compression attribute from "off" to "on".
> > >
> > > This would be for Tomcat 10 onwards only.
> > >
> > > The following would be unchanged:
> > > - compressibleMimeType
> > > - compressionMinSize
> > > - noCompressionStrongETag
> > >
> > > It would be helpful to know what the range of views of the user
> > > community are on this proposal.
> > >
> > > So, thoughts?
> > >
> > > Mark
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > >
> >
> >
>


-- 
Johan Compagner
Servoy


Re: Proposal: Note on web site that Tomcat 10 is a milestone-release

2020-03-04 Thread Johan Compagner
>
>
> > Or for now generate 2 build artifacts? (as long as it is really just the
> > package rename)
> >
>
> Hm, no. I just tested locally Tomcat 10.0.1 with Apache Wicket (9.x,
> master). Nothing more.
> Tomcat 10.0.x is not production ready so it is too early to do anything
> about Jakarta APIs in Wicket.
> First we need to release Wicket 9.0.0 (with Javax APIs) and then we can
> start thinking about Jakarta APIs.
>
>
yes exactly, so many frameworks are going to do that (wait)
So not release any artifacts that use the new jakarta api's
So that means that for many people they can't start test or use Tomcat 10..
Because who is using plain servlet api only?
Any 3rd part dependency is your code  that uses some javax.servlet package
needs to make a special release..
This will take ages, not to mention will only be really done for the latest
releases of those packages (like Wicket 9)


Re: Proposal: Note on web site that Tomcat 10 is a milestone-release

2020-03-04 Thread Johan Compagner
Martin :)

exactly my point.. so Wicket now needs to have 2 branches right? that are
the same except for the package rename for a long time
(so kind of having 2 masters)

Or for now generate 2 build artifacts? (as long as it is really just the
package rename)

On Wed, 4 Mar 2020 at 09:14, Martin Grigorov  wrote:

> Hi Johan,
>
> On Mon, Mar 2, 2020 at 7:32 PM Johan Compagner 
> wrote:
>
> > And when you are at it, also mention there in big letters that they
> really
> > should read the release notes... This tomcat will not work with all the
> > major frameworks people use for quite some time...
> >
>
> If you still use Apache Wicket (and I bet you do! :-) ) I've tested it
> successfully on 10.0.0-M1 for you:
> https://twitter.com/mtgrigorov/status/1225359299570028546
>
> But I agree that this information should be emphasized in Tomcat docs!
> I'll update the website!
>
> Martin
>
>
> >
> > Op ma 2 mrt. 2020 18:23 schreef Christopher Schultz <
> > ch...@christopherschultz.net>:
> >
> > > -BEGIN PGP SIGNED MESSAGE-
> > > Hash: SHA256
> > >
> > > All,
> > >
> > > If you go to tomcat.apache.org right now, you'll see documentation and
> > > downloads for Tomcat 10. In the news section, it's shown as 10.0.0-M1
> > > so that might be an indication that it's not a "normal" release.
> > >
> > > Anyone going to the site and not reading the (current) top-item of
> > > news might think that Tomcat 10 is the current best version to
> download.
> > >
> > > I propose the following:
> > >
> > > 1. Add a [beta] (or similar) badge to the [Tomcat 10] download and
> > > [Tomcat 10.0] documentation links.
> > >
> > > 2. On the "which version" page, add a [beta] (or similar) badge to the
> > > Tomcat 10 release
> > >
> > > 3. On the Tomcat 10 downloads page, in the summary section, add a very
> > > prominent statement that says Tomcat 10 is in [beta] or similar. I
> > > might even use a large font and/or red or some other
> > > attention-grabbing text color.
> > >
> > > 4. Similar to [3] above, but on the Tomcat 10 documentation page
> > > introduction.
> > >
> > > WDYT?
> > >
> > > - -chris
> > > -BEGIN PGP SIGNATURE-
> > > Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> > >
> > > iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl5dQOkACgkQHPApP6U8
> > > pFglHA//XKKCS260Hvx+gA5YshiPYOpKS7FOG/bDzef9Y+JqMpuFMrOt/7d2AG2/
> > > X7GqQ57mJ+aew5p+nncXWV5yXd3fGyhPCeDsdF5pNc3K87dYs0MZCt/5nB9D2mJK
> > > 3uoRQjQscwo2pBuozpBViw19HoeoEjQGWHWrs60LTckODDQj1IcT6zZUgckGkMaP
> > > sPu1x+kra+5psKWtK91S6KOERoYQ13gNhIAIlEgCavLzwOoyz3El5/9iXne2rP/w
> > > tePV+1e9r7ltF6WBJtA72xMAS1mXvK+bW1Wpm/5dMicpnRF04vaOUlZularWgbvO
> > > 8p67YCJ3keaVtKcfDVHxSUVUUbjroWX9beoOnTDujw6zUapoKzibtU9EEyEOQXIW
> > > C946ZhyPjS6I+liRHGQHKkQgBMUpHC+WGmasC5RW6+hySJCTjp6TGKlr5vuDk0th
> > > OtcuHgzaOoqqVjYOZwArQi96c0l5/RW/6wxseunvK5n8TzP/l3F5jP627dUodsWV
> > > B1qQfP3aePMGaTnRDuookTBoS1FLANc2Fc0m6hpTJmVkgcrYSFo4vmlljSGUCSkB
> > > rUzY10W3rLu467ipcoFEzMGgVmM0cO29qk35JqPj0DtZa5BbFQTQa95iERxnRx45
> > > izIC7Nz5+UUdjdcoMhIVMdq/oA1TC++MXpRMOoYlOpnOf7hT+yo=
> > > =nLsr
> > > -END PGP SIGNATURE-
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > >
> > >
> >
>


-- 
Johan Compagner
Servoy


Re: Proposal: Note on web site that Tomcat 10 is a milestone-release

2020-03-02 Thread Johan Compagner
And when you are at it, also mention there in big letters that they really
should read the release notes... This tomcat will not work with all the
major frameworks people use for quite some time...

Op ma 2 mrt. 2020 18:23 schreef Christopher Schultz <
ch...@christopherschultz.net>:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> If you go to tomcat.apache.org right now, you'll see documentation and
> downloads for Tomcat 10. In the news section, it's shown as 10.0.0-M1
> so that might be an indication that it's not a "normal" release.
>
> Anyone going to the site and not reading the (current) top-item of
> news might think that Tomcat 10 is the current best version to download.
>
> I propose the following:
>
> 1. Add a [beta] (or similar) badge to the [Tomcat 10] download and
> [Tomcat 10.0] documentation links.
>
> 2. On the "which version" page, add a [beta] (or similar) badge to the
> Tomcat 10 release
>
> 3. On the Tomcat 10 downloads page, in the summary section, add a very
> prominent statement that says Tomcat 10 is in [beta] or similar. I
> might even use a large font and/or red or some other
> attention-grabbing text color.
>
> 4. Similar to [3] above, but on the Tomcat 10 documentation page
> introduction.
>
> WDYT?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl5dQOkACgkQHPApP6U8
> pFglHA//XKKCS260Hvx+gA5YshiPYOpKS7FOG/bDzef9Y+JqMpuFMrOt/7d2AG2/
> X7GqQ57mJ+aew5p+nncXWV5yXd3fGyhPCeDsdF5pNc3K87dYs0MZCt/5nB9D2mJK
> 3uoRQjQscwo2pBuozpBViw19HoeoEjQGWHWrs60LTckODDQj1IcT6zZUgckGkMaP
> sPu1x+kra+5psKWtK91S6KOERoYQ13gNhIAIlEgCavLzwOoyz3El5/9iXne2rP/w
> tePV+1e9r7ltF6WBJtA72xMAS1mXvK+bW1Wpm/5dMicpnRF04vaOUlZularWgbvO
> 8p67YCJ3keaVtKcfDVHxSUVUUbjroWX9beoOnTDujw6zUapoKzibtU9EEyEOQXIW
> C946ZhyPjS6I+liRHGQHKkQgBMUpHC+WGmasC5RW6+hySJCTjp6TGKlr5vuDk0th
> OtcuHgzaOoqqVjYOZwArQi96c0l5/RW/6wxseunvK5n8TzP/l3F5jP627dUodsWV
> B1qQfP3aePMGaTnRDuookTBoS1FLANc2Fc0m6hpTJmVkgcrYSFo4vmlljSGUCSkB
> rUzY10W3rLu467ipcoFEzMGgVmM0cO29qk35JqPj0DtZa5BbFQTQa95iERxnRx45
> izIC7Nz5+UUdjdcoMhIVMdq/oA1TC++MXpRMOoYlOpnOf7hT+yo=
> =nLsr
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Dates on Linux vs. Windows - Resolved

2020-01-08 Thread Johan Compagner
So you moved once the database to a different timezone (that had say that 6
hour difference)
then the behavior is correct...

Its very weird but that is default behavior of the normal datetime columns
that are created if you move stuff around the database somehow remembers at
what timezone the datetime was inserted and will convert the millis
accordingly..

Its the same as if you have different clients connecting to the same
database over different timezones they will al see the same date as a
string (so the formatted date) instead of really having the same millis
after 1970 utc.
I always find this very very weird.
But i guess this is the difference between database types "timestamp with
timezone" and "timestamp"

So moving the database or moving the client (app server) with existing data
is very tricky.


On Wed, 8 Jan 2020 at 06:05, Jerry Malcolm  wrote:

> First of all, a big thank you to everyone who responded to this one.  I
> doubt I'd have figured it out for days without your guidance and help.
>
> And the winner is the JVM timezone.  But the problem was NOT that
> the JVM wasn't set to US Central time.  The problem was that it WAS set
> to US Central, apparently inherited from the Linux OS TZ.  There was no
> parameter on the tomcat java command that set the timezone.  So I added
> one and set it to America/Chicago.  No change.  But since it appeared we
> were already double-dipping and converting from GMT to central twice
> (i.e. subtracting an additional 6 hours), I figured ok tell the JVM
> to stay in GMT and not do any conversions.  So now, the database returns
> Central time dates and times, but JVM no longer thinks it needs to
> convert again to 'more central'.
>
> This is about as convoluted and ugly as it gets.  And I don't make any
> claims of thinking I can give a rational explanation for why it works
> this way.  But it's on to fight a battle on another hill now.
>
> Just to summarize for anybody who comes along with a similar problem
> I original set the timezone of mySQL RDS instance to Central time when I
> created it months back (unchangable after it's set).  I set my Linux
> timezone to Central as well in order to make my log files have entries
> with the correct timestamps.  But as I described earlier, changing the
> OS timezone made the JVM also go to Central as well.  But the JVM
> apparently assumed the database was in GMT so it subtracted 6 more hours
> off the already-central time from the db.  I guess the real error was
> not initially leaving the MySQL RDS in GMT.  But since that's not
> changeable without recreating a whole new RDS instance, the next option
> is what I did with the jvm.   Makes total sense, right???  :-)
>
> Thanks again.
>
> Jerry
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


Re: Jakarta EE 9

2019-10-28 Thread Johan Compagner
On Mon, 28 Oct 2019 at 14:13, Rémy Maucherat  wrote:

> On Mon, Oct 28, 2019 at 1:46 PM Johan Compagner 
> wrote:
>
> > Hi
> >
> >
> >
> > On Mon, 28 Oct 2019 at 13:15, Mark Thomas  wrote:
> >
> > > Hi all,
> > >
> > > A frequent topic of discussion at ApacheCon EU was Jakarta EE 9. For
> > those
> > > of you who aren't familiar with Jakarta EE the key points are:
> > >
> > > - Oracle have donated Java EE to Eclipse
> > > - Eclipse have released Jakarta EE 8 which is essentially identical to
> > > Java EE 8
> > > - Oracle have refused to allow changes to the APIs in the javax
> namespace
> > > - The Jakarta EE community seem to be reaching consensus on releasing
> > > Jakarta EE 9 which will rename all the Java packages from javax.* to
> > > jakarta.*
> > >
> > >
> >
> > what does this rename really mean?
> >
> > import javax.servlet.http.HttpSession;
> > import javax.websocket.Session;
> >
> > those are renamed?
> > If that is yes that would mean pretty much everything will break?
> >
>
> https://eclipse-foundation.blog/2019/05/03/jakarta-ee-java-trademarks/
> I thought everyone knew about this. We were supposed to have a session on
> this rename at ApacheCon EU, but unfortunately it didn't happen.
>
> Rémy
>


phh this is really horrible, one more reason to kind of hate Oracle..
this will split up a huge thing... So  for example if you make Tomcat 10 to
only have "jakarta.xxx"
so all the existing code will not work on that anymore. then that tomcat
will be for a long time in its own small corner..

We will not be able to use that for years to come.. because we have no
control over what people are really using
We still target java 8 (and that will also be the case for the coming years
i am afraid)

johan



-- 
Johan Compagner
Servoy


Re: Jakarta EE 9

2019-10-28 Thread Johan Compagner
Hi



On Mon, 28 Oct 2019 at 13:15, Mark Thomas  wrote:

> Hi all,
>
> A frequent topic of discussion at ApacheCon EU was Jakarta EE 9. For those
> of you who aren't familiar with Jakarta EE the key points are:
>
> - Oracle have donated Java EE to Eclipse
> - Eclipse have released Jakarta EE 8 which is essentially identical to
> Java EE 8
> - Oracle have refused to allow changes to the APIs in the javax namespace
> - The Jakarta EE community seem to be reaching consensus on releasing
> Jakarta EE 9 which will rename all the Java packages from javax.* to
> jakarta.*
>
>

what does this rename really mean?

import javax.servlet.http.HttpSession;
import javax.websocket.Session;

those are renamed?
If that is yes that would mean pretty much everything will break?


Re: is it logical that WsBaseFrame/WsServerFrame calls WsSession.onclose that results in a call to the client again?

2019-08-27 Thread Johan Compagner
>
>
> > As far as i can understand it should not try to send a close message at
> > that point, because the close did already happen from the client side..
> > I guess if onclose was called programatically from the server side then
> it
> > is logical.
>
> RFC 6455, section 5.5.1
>
> Close is a two-stage process and closing the TCP connection is the
> server's responsibility.
>
> Looks like you have a non-spec compliant client.
>
>
But that is just a browser that gets an other url loaded (i think kind of
reload/refresh)
how can that be a 2 way thing?
If i close a tab or i force reload the tab then yes i can get that the
browser can send a close request to the server
But it has to wait for it? I can't believe that many browsers do that?
What if the latency is a few hundred millis?


-- 
Johan Compagner
Servoy


is it logical that WsBaseFrame/WsServerFrame calls WsSession.onclose that results in a call to the client again?

2019-08-26 Thread Johan Compagner
Hi,

Daemon Thread [http-nio-8080-exec-4] (Suspended (breakpoint at line 84
in EditorEndpoint))

owns: Object  (id=16796)

owns: NioEndpoint$NioSocketWrapper  (id=16797)

EditorEndpoint.onError(Throwable) line: 84

NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
not available [native method]

NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62

DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43

Method.invoke(Object, Object...) line: 567

PojoEndpointServer(PojoEndpointBase).onError(Session, Throwable) line: 133

WsSession.sendCloseMessage(CloseReason) line: 619

WsSession.onClose(CloseReason) line: 526

WsFrameServer(WsFrameBase).processDataControl() line: 348

WsFrameServer(WsFrameBase).processData() line: 290

WsFrameServer(WsFrameBase).processInputBuffer() line: 130

WsFrameServer.onDataAvailable() line: 70

WsHttpUpgradeHandler.upgradeDispatch(SocketEvent) line: 148

UpgradeProcessorInternal.dispatch(SocketEvent) line: 54


UpgradeProcessorInternal(AbstractProcessorLight).process(SocketWrapperBase,
SocketEvent) line: 53

AbstractProtocol$ConnectionHandler.process(SocketWrapperBase,
SocketEvent) line: 789

NioEndpoint$SocketProcessor.doRun() line: 1437

NioEndpoint$SocketProcessor(SocketProcessorBase).run() line: 49

ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)
line: 1128

ThreadPoolExecutor$Worker.run() line: 628

TaskThread$WrappingRunnable.run() line: 61

TaskThread(Thread).run() line: 835



That is a stack that we encounter which i find quite strange
it seems to me that WsFrameBase.processDataControl

does a wsSession.onClose(new CloseReason(Util.getCloseCode(code), reason));

when it gets an op_code close

that sounds reasonably but the problem is WsSession will call when it was
in a open state an sendCloseMessage:

if (state == State.OPEN) { state = State.OUTPUT_CLOSED;
sendCloseMessage(closeReason);


problem is it is closed so this will result in a exception (broken pipe
stuff) when that is called

As far as i can understand it should not try to send a close message at
that point, because the close did already happen from the client side..
I guess if onclose was called programatically from the server side then it
is logical.


-- 
Johan Compagner
Servoy


Re: Tomcat 9.0.8 asynchronous websocket issue

2019-03-01 Thread Johan Compagner
On Thu, 28 Feb 2019 at 21:29, Austin Bookhart <
austin.bookh...@hannonhill.com> wrote:

> Hi,
>
> I have a question regarding an asynchronous websocket implementation
> we have in our application. We have run into issues where on a rare
> occasion the websocket endpoint will become unusable due to what seems
> to be a thread holding onto resources and not releasing them. Below is
> the main structure of our endpoint. Some parts have been removed or
> commented out, but it gets the basic structure across.
>
> We call "sendMessageToUser" in order to send a message to a client's
> browser. The issue that we have seen is if we breakpoint at the line
> that waits for the future to resolve, "future.get()", and reload the
> current client's browser, the endpoint becomes unusable where no
>

The code below is very weird code to me, but i guess this is just to show
it?
Because if i look at the doc of the Async.sendText()
Then the get() of the Future should throw an exception on connections
errors.
But in your case it just never resolves?




> messages can be sent or received any longer. Only a restart resolves
> the issue. We wanted to find out if our implementation of the
> asynchronous remote and future setup is correct or if there is a more
> appropriate use of the API?
>
> Appreciate any help you can provide.
> Thanks,
> Austin
>
> @ServerEndpoint(value = "/websocket", configurator =
> GetHttpSessionConfigurator.class)
> public class WebSocketEndpoint
> {
> private static final Map clients =
> Collections.synchronizedMap(new HashMap());
> private static Future future = null;
>
> public static void sendMessageToUser(String username,
> WebSocketMessage message)
> {
> synchronized (clients)
> {
> clients.keySet().stream()
> .filter(client ->
> username.equals(clients.get(client).username))
> .forEach(client -> sendMessage(client, message));
> }
> }
>
> private static synchronized void sendMessage(Session client,
> WebSocketMessage message)
> {
> try
> {
> if (future == null)
> LOG.debug("Sending very first WebSocket message");
> else
> {
> // Before we send the next message, we have to wait
> for the previous message to complete
> LOG.debug("Waiting until last WebSocket message is being
> sent");
> future.get();
>
> LOG.debug("Last WebSocket message is not longer being
> sent. Sending a new message.");
> }
>
>
> // Send the message and store the Future for the next call
> future =
> client.getAsyncRemote().sendText(message.getJSONObject().toString());
> }
> catch (Exception e)
> {
> LOG.debug("An error occurred when sending a web socket
> message to client " + client, e);
> }
> }
>
> @OnOpen
> public void onOpen(Session client, EndpointConfig config)
> {
> //Construct SessionDetails information
> clients.put(client, new SessionDetails(..));
> }
>
> @OnClose
> public void onClose(Session client)
> {
> clients.remove(client);
> }
> }
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


A few questions over the websocket configuratior checkOrigin method

2019-02-22 Thread Johan Compagner
https://docs.oracle.com/javaee/7/api/javax/websocket/server/ServerEndpointConfig.Configurator.html#checkOrigin-java.lang.String-

first it says

" The platform default implementation of this method makes a check of the
validity of the Origin header sent along with the opening handshake
following the recommendation at: Sending the Server's Opening Handshake
<http://tools.ietf.org/html/rfc6455#section-4.2>. "

As far as we can test the websocket is always allowed. So what does tomcat
do? I see the default implementation does just
getContainerDefaultConfigurator
https://github.com/eclipse-ee4j/websocket-api/blob/master/api/server/src/main/java/javax/websocket/server/ServerEndpointConfig.java#L155

and what is the default configurator?

Also what i find weird about that message, but i guess nothing tomcat can
really do about is the single param that you get..
What if we always want to allow if the origin and the host itself are the
same
But we only get the origin. So we have to have a configured list? Problem
is that that is not so easy todo because our application can be deployed
under many different domains by our customers.

So i guess we can test it in the modifyHandshake but what should we do if
we test the host and the origin? but should we then throw an exception?

-- 
Johan Compagner
Servoy


Re: request.getContextPath() behind a proxy (apache/nginx)

2019-02-05 Thread Johan Compagner
On Tue, 5 Feb 2019 at 11:34, Jäkel, Guido  wrote:

> >On 05/02/2019 08:23, Johan Compagner wrote:
> >> problem is that our customers are doing this.
> >> also they can have 1 tomcat with a few webapps that they want to map
> under
> >> different domains
> >>
> >> so that would mean for them starting 3 different tomcats under 3
> different
> >> ports and configure all that
> >> thats not always something they want to do.
> >> So i guess the only way for me is to have some kind of setting (per
> context)
> >
> >They would be better configuring Tomcat with virtual hosts and having
> >three ROOT webapps.
> >
> >Mark
>
> Dear Johan,
>
> as Christopher and Mark wrote: If possible in any way, please avoid to
> handle it via rewriting on a reverse proxy and prefer to set up the Tomcat
> to serve the application on the same domain and context path as used
> "outside" in front of the proxy.
>
> If you real can't avoid, you have to do a forward rewriting of the used
> header (e.g. hostname) and/or URL pattern in the one hand, but also a
> complex backward rewriting of the answer! You have to back-rewrite parts of
> the answer header (Cookies, Locations, Links, ...) and the embedded URLs in
> the content of different MIME types (HTML, CSS, javascript, JSON, ...). As
> a consequence, you have either to forbid compression of the returned body
> or (even more complex) decompress/modify/recompress it on the fly.
>
> Sometimes, I simply can't avoid because we need to have an application
> available on two "addresses" while migration or something similar. And if
> the application itself can't be run in two instances I know no other way.
> But's it a real burden every time.
>
>
>
yeah i think we will document that if they want to have a reverse proxy in
front of it that maps it on root (very likely)
then they also should map the WAR on root in the tomcat behind that
And if they have multiply wars they should try to use virtual hosting on
tomcat as Mark described
As a last resort i think i will add a configuration param (per context)
where they can override it


-- 
Johan Compagner
Servoy


Re: request.getContextPath() behind a proxy (apache/nginx)

2019-02-05 Thread Johan Compagner
problem is that our customers are doing this.
also they can have 1 tomcat with a few webapps that they want to map under
different domains

so that would mean for them starting 3 different tomcats under 3 different
ports and configure all that
thats not always something they want to do.
So i guess the only way for me is to have some kind of setting (per context)


On Mon, 4 Feb 2019 at 22:40, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Johan,
>
> On 2/4/19 07:09, Johan Compagner wrote:
> > There are many older post for this on stackoverflow and so on
> > https://stackoverflow.com/questions/10050550/why-does-getcontextpath-u
> nder-a-proxy-return-the-internal-path-inside-httpserv
> <https://stackoverflow.com/questions/10050550/why-does-getcontextpath-under-a-proxy-return-the-internal-path-inside-httpserv>
> >
> >  but i wonder what the latest state of that is, we have a lot of
> > proxy settings for host and scheme But is there something (a
> > header) that a proxy can set so that Tomcat returns the right
> > context path on that getContextPath() call?
>
> This is #49 on the list of "why you shouldn't be munging context paths
> within a reverse-proxy".
>
> > Or are there headers that we have to check manually?
> >
> > If this is not the case then i guess the only way to fix this is to
> > make it a configuration in our product something like
> >
> > String context = settings.getProperty("context.path",
> > request.getContextPath());
> >
> > (get the context from the settings if not there use the default
> > value which is from the request)
> >
> > So the problem is mostly because of virtual hosts i guess
> >
> > where
> >
> > Proxy / is mapped to AppServer /Webapp1
>
> How about "don't do that"?
>
> If you want to host your application on /, then host it on / and not
> /Webapp1.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlxYsWIACgkQHPApP6U8
> pFhOeA//SmTil/dDz1ewySksqKiI83WjEtkrJ7/1xcaISkrU+t42bMOx8sLS/SOh
> VX2O/c0hlLuDy5YfaBClZgd7qLHmy3a5xcLpazUtw9CFZuJD+UTahxlK2AwysOzd
> +ns0qlRJEOZrxAxCfJpJ6yUZ9DppbKSHd8fd+XopIiRQyqJ3pWJtCZ61B3zJC7Ln
> Vxo7Qpk/1qQht8XhgRdkh1EOB+sJRziowcchu/t0xtpQNVH47czwVC4LpyX9wp43
> jMhlfVfwqjNAtgNsvm8YE3zfr8DUw3Q7hxwRk5EzGrRbq8RAoDEFri8F/9RB
> zhI+8tPi73JxYaz8/8MzIxGY2A0La6A2P/qCNjNYAoXy0tlzsN0MgUIvXjgnaRJl
> bRWwFlpqrOPqRkS7PvBa98rFiXzbC/Ef6uE68hTK7XrV/Ki9Pm4uJ+hbSdurHz7c
> KkKwgMmcpJ6nc80lOaXxtviuXbTrcxY1rGivhRiHr1nemRZkxwMzybf0nynhMtaa
> nuGFdKC/KGk25FM6xZEVzUuYLX7NV57GWPZcFkmcvfd87gRLwdmti+5vVGMIvC8z
> HYMDd4ArfkY3JYOeIlVc76mpTfCWPcFfN6U30G+dVwFEYUqGxOtRM6QY2OFbtpMW
> Ah8/FKULkBMCoD2AV0JJvTXz9PZ/v0bYPaitKRrPQZrlyp1CJ5M=
> =uP57
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Johan Compagner
Servoy


request.getContextPath() behind a proxy (apache/nginx)

2019-02-04 Thread Johan Compagner
There are many older post for this on stackoverflow and so on
https://stackoverflow.com/questions/10050550/why-does-getcontextpath-under-a-proxy-return-the-internal-path-inside-httpserv

but i wonder what the latest state of that is, we have a lot of proxy
settings for host and scheme
But is there something (a header) that a proxy can set so that Tomcat
returns the right context path on that getContextPath() call?

Or are there headers that we have to check manually?

If this is not the case then i guess the only way to fix this is to make it
a configuration in our product
something like

String context = settings.getProperty("context.path",
request.getContextPath());

(get the context from the settings if not there use the default value which
is from the request)

So the problem is mostly because of virtual hosts i guess

where

Proxy / is mapped to AppServer /Webapp1


-- 
Johan Compagner
Servoy


Re: insufficient memory for the Java Runtime Environment to continue

2018-12-22 Thread Johan Compagner
If you use large heaps you should use G1 garbage collector
And if you use that then I would set the min and Max to the same values

*-server -Xms13G -Xmx13G **-XX:+UseG1GC*


*To fully initialize the memory at once (g1 will figure it into compartments)*


Op za 22 dec. 2018 13:35 schreef Dhaval Jaiswal  I am facing issue of crashing JAVA process and log files attached for the
> same.
>
> Server total RAM is 16 GB.
>
> catalina.sh having following setting.
> export JAVA_MEM_OPTS="-Xms1g -Xmx15g -XX:MaxPermSize=1536m"
>
> Can some one help where could be the problem? Which threads are consuming
> memory. How can i get rid out of this issue.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


Re: Tomcat not scanning WEB-INF/Tmp

2018-11-30 Thread Johan Compagner
Why are you writing stuff in the web app folder?
Problem with this is that the WAR doesn't even need to be extracted
depending on configuration.

I would always try to avoid this and use java's own tmp folder mechanism
for a writeable folder
Does the servlet spec also not have something like this? That you can ask
for a "work" folder?


On Fri, 30 Nov 2018 at 11:07,  wrote:

>
>
> Hi,
>
> I have a problem in the start phase of Apache
> Tomcat/7.0.90
> Inside the folder WEB-INF I have a subfolder called Tmp
> (application/WEB-INF/Tmp) where sometimes I put a lot of files and
> folders (more then 100.000) and after 24h I clean this folder.
> But if in
> the meantime I need to restart the application, the restart time
> increases a lot (more then 1h) because it scans this Tmp folder
> Do you
> know a way to prevent the Tomcat from scanning the WEB-INF/Tmp
> folder?
>
> Thanks
>
>
>
> Con OpenStar hai Giga, SMS e i minuti che vuoi da 4,99€ al mese, per
> sempre. Cambi gratis quando e come vuoi e in più hai 10€ di credito omaggio
> e 6 mesi di INFINTY! http://tisca.li/myopen
>
>

-- 
Johan Compagner
Servoy


Re: Tomcat 9 does not work with Java 11

2018-11-26 Thread Johan Compagner
Do you have a commercial license with Oracle so that you can use oracle's
Java 11?

Because if you just download it from oracle's site, you can't use it at all
in a production system..

But the 2 (open or Oracle) should be quite identical from Java 11 on..

Op ma 26 nov. 2018 19:52 schreef Andi Meister
 I guess the JDK that I used is not OpenJDK but Oracle JDK? That's not the
> same isn't it?
>
> There is a pre-story to that. Maybe there is the reason?!
> On this server there was installed: JRE 1.6 and Tomcat 7 - running for
> years.
> Now there is an update planned to Java 11 and I have to check if it runs.
>
> First, I installed the JDK 11 additionally and pointed the Java-location in
> Tomcat 7 configuration app to the new /bin/server/jvm.dll.
>
> Same error as now.
>
> Then I uninstalled Tomcat 7 and JRE 6. Then installed Tomcat 9.
> Error...
>
> Ralf
>
>
> Am Mo., 26. Nov. 2018 um 18:34 Uhr schrieb Mark Thomas :
>
> > Tomcat 9.0.13 windows installer, Open JDK 11.0.1 and Window server 2008
> > R2 work first time for me on a clean install.
> >
> > This doesn't look like a Tomcat issue at this point.
> >
> > Mark
> >
> >
> >
> > On 26/11/2018 17:04, Andi Meister wrote:
> > > more detailled:
> > > 9.0.13 Core:
> > >
> > >- zip
> > ><
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.zip
> > >
> > >(pgp
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.zip.asc
> > >,
> > >sha512
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.zip.sha512
> > >)
> > >
> > >- tar.gz
> > ><
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.tar.gz
> > >
> > >(pgp
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.tar.gz.asc
> > >,
> > >sha512
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.tar.gz.sha512
> > >)
> > >
> > >- 32-bit Windows zip
> > ><
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x86.zip
> > >
> > >(pgp
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x86.zip.asc
> > >,
> > >sha512
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x86.zip.sha512
> > >)
> > >
> > >- 64-bit Windows zip
> > ><
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x64.zip
> > >
> > >(pgp
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x64.zip.asc
> > >,
> > >sha512
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13-windows-x64.zip.sha512
> > >)
> > >
> > >- 32-bit/64-bit Windows Service Installer
> > ><
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.exe
> > >
> > >(pgp
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.exe.asc
> > >,
> > >sha512
> > ><
> >
> https://www.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.exe.sha512
> > >)
> > > this one
> > >
> > >
> > > Am Mo., 26. Nov. 2018 um 18:02 Uhr schrieb Andi Meister <
> > > blackpum...@googlemail.com>:
> > >
> > >> Hi Chris,
> > >>
> > >> this one:
> > >> 32-bit/64-bit Windows Service Installer
> > >> <
> >
> https://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.exe
> > >
> > >>
> > >> Ralf
> > >>
> > >>
> > >> Am Mo., 26. Nov. 2018 um 16:52 Uhr schrieb Christopher Schultz <
> > >> ch...@christopherschultz.net>:
> > >>
> > > Ralf,
> > >
> > > On 11/26/18 10:39, Andi Meister wrote:
> > > Hi,
> > >
> > >
> > > I downloaded and installed Java 11 from here:
> > >
> > >
> > https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloa
> > > ds-5066655.html
> > > <
> >
> https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html
> > >
> > >
> > >
> > >
> > > Then I downloaded and installed Tomcat 9 Windows service
> > > executable.
> > >
> > >
> > > During installation I was asked for the path to JRE.
> > >
> > > Java 11 does not contain a JRE anymore, so I pointed to the Java 11
> > > root directory.
> > >
> > > The installer was fine with that.
> > >
> > >
> > > But when I finally start Tomcat service, it does NOT run.
> > >
> > > In commons_deamon.log I see this error message:
> > >
> > >
> > > [2018-11-26 13:36:39] [info]  [ 3732] Running 'Tomcat9' Service...
> > >
> > > [2018-11-26 13:36:39] [info]  [ 4776] Starting service...
> > >
> > > [2018-11-26 13:36:39] [error] [ 4776] The specified procedure could
> > > not be found.
> > >
> > > [2018-11-26 13:36:39] 

Re: javax.websocket.Session.getRequestParameterMap() encoding

2018-11-22 Thread Johan Compagner
Op do 22 nov. 2018 22:05 schreef Mark Thomas  On 22/11/2018 16:06, Johan Compagner wrote
> >
> > problem is how do we do that in a websocket scenario?
>
> Several options:
> - configure the connector
> - use a filter before the request reached the WebSocket filter
>


We can't do a Tomcat only version. We don't control deployment, we only can
generate the war file and configure in the web.xml in the war or in code.

But can you add a filler to the same websocket url (let's say /websocket)
And then quickly set the encoding on that request before it upgrades it to
a websocket?



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


javax.websocket.Session.getRequestParameterMap() encoding

2018-11-22 Thread Johan Compagner
Hi,

If we send have a value that is utf8 url encoded to the websocket:

H%C3%BCnenberg

then somehow tomcat just encodes that using i think "ISO-8859-1"

if we are in a filter or servlet we just do:

request.setCharacterEncoding("UTF8");

and then ask for the parameter map then everything is fine it will be
decoded correctly to Hünenberg

problem is how do we do that in a websocket scenario?

the session object of a WebSocket doesn't have anything for that as far as
i can see
the same goes for ServerEndpointConfig.Configurator using
the modifyHandshake method..



-- 
Johan Compagner
Servoy


Re: [OT] Oracle Java 11 discussion?

2018-10-18 Thread Johan Compagner
>
>
> > There is no jre at all any more also from openjdk
>
> There is little difference between a JRE and a JDK. One just comes
> with a compiler.
>

not really,
until java 10 we had also desktop integration

like java -jar assignments and jnlp association for starting a webstart
application

so for windows it really integrated also into the registry.

but thats pretty much all gone now, maybe if you pay oracle?


> > Java on the desktop is really dead now (and we have quite a few
> > customers using that through webstart)
>
> Webstart is also dead. But let's be honest, Java on the desktop was
> never really alive in the first place.


Not for us!
we have a lot of customers that all use our webstart client to run there
own created applications in it..

Those users are end users like crm systems and so on. Not developers

Besides that also a lot of companies have i think in house stuff that run
like that.

Yes applets are dead for a long time, but Webstart applications are fine
and is a good way to get desktop applications that are auto updateable
But thats pretty much killed now
The weird thing is people say now use jlink that is the replacement for
it.. Huh?? what??


Re: Error Regarding RFC 7230 and RC 3986

2018-10-18 Thread Johan Compagner
On Thu, 18 Oct 2018 at 13:38, Mark Thomas  wrote:

> On 18/10/18 12:17, Johan Compagner wrote:
> > how is the browser to blame for "
> > defaultMessageType=true=en_US=[key:label.edit]"
> >
> > that url is not generated by a browser but by some software that uses a
> > browser...
>
> Browsers these days try to be helpful and show the user the un-encoded
> URI in the address bar but send the encoded version to the server.
>
>
If this is really the case that you have a webpage where we have a href
with the right url (so the above url is encoded)
and when you click on it, the browser loads it (and i guess that should be
fine then)

But then in the browser you see the un-encoded version (as a bove) and when
you do then a refresh it goes wrong?
That would be bad...
That something the browser really needs to fix...
So yes if the browser really sets the un-encoded version in the url bar
that would be quite annoying
(bookmarking it and so on)


Re: Error Regarding RFC 7230 and RC 3986

2018-10-18 Thread Johan Compagner
how is the browser to blame for "
defaultMessageType=true=en_US=[key:label.edit]"

that url is not generated by a browser but by some software that uses a
browser...


On Thu, 18 Oct 2018 at 12:55, M. Manna  wrote:

> Thanks a bunch Mark.
>
> "The correct fix is to ensure that the user agents are sending
> specification compliant requests." - Do you mean at browser level ? If so,
> is there any specific browser/update we can use? We've checked a few
> browsers so far (Firefox, Edge, Chrome) and none of them seem to have this
> option (or we might've missed it).
>
> We are using relaxedQueryChars for now - but would like to understand the
> fix you've proposed above.
>
> On Thu, 18 Oct 2018 at 10:39, Mark Thomas  wrote:
>
> > On 18/10/18 09:52, M. Manna wrote:
> > > Hello,
> > >
> > > We received in error in our application after we have upgraded to
> 8.5.34
> > >
> > > INFO: Error parsing HTTP request header
> > > Note: further occurrences of HTTP header parsing errors will be logged
> at
> > > DEBUG level.
> > > java.lang.IllegalArgumentException: Invalid character found in the
> > request
> > > target. The valid characters are defined in RFC 7230 and RFC 3986
> > >
> > >
> > > The URI we have for this problem has the following param (did work with
> > > 8.5.28)
> > >
> > > defaultMessageType=true=en_US=[key:label.edit]
> > >
> > > The issue is the action parameter value. Could someone help me
> understand
> > > the following?
> > >
> > > 1) Since the issue didn't happen for 8.5.28 - this means some CVE has
> > > triggered this change to be in place. I am just trying to confirm if
> this
> > > is CVE-2016-681 ? If not, could you please let me know which one that
> is?
> >
> > The change in request parsing was prompted by CVE-2016-6816. There
> > wasn't a specific attack that prompted this particular change.
> > CVE-2016-6816 was caused by not parsing the request line as per the
> > spec. Therefore, to reduce the risk of future vulnerabilities, we have
> > been tightening up the parsing of the request line.
> >
> > > 2) Apart from refactoring code, is there any recommended corrective
> > action?
> >
> > The correct fix is to ensure that the user agents are sending
> > specification compliant requests.
> >
> > The work-around is to use relaxedPathChars and/or relaxedQueryChars on
> > the Connector.
> >
> > Mark
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>


-- 
Johan Compagner
Servoy


Re: [OT] Oracle Java 11 discussion?

2018-10-17 Thread Johan Compagner
Op wo 17 okt. 2018 18:29 schreef Berneburg, Cris J. - US <
cberneb...@caci.com>:

>
>
> 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.
>

Java 11 I guess will be picked up by the package managers in Linux I guess
(like yum).

And if you look how they did it now with java 8 based on openjdk, then you
have the option to o install only the runtime or development package (and a
lot others, they split it up more)


>
>


Re: [OT] Oracle Java 11 discussion?

2018-10-15 Thread Johan Compagner
Op ma 15 okt. 2018 20:37 schreef Mark Thomas :

>
>
> 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.
>

Isnt that already the case?

You can't download any installer of java 11 from Oracle that can be used in
production, only for development and demos

There is no jre at all any more also from openjdk

And open jdk doesnt have an installer at all, so it is all up to the
package managers to get it (rpm/yum) so good luck on Windows with that
(There is really just unzipping and setting paths you're self)

Java on the desktop is really dead now (and we have quite a few customers
using that through webstart)

Johan


>


Re: Java 11 support in Apache Tomcat 9.0

2018-09-26 Thread Johan Compagner
but if you talk about a jlink thing isn't it then the idea that it it
includes it all so including tomcat and maybe even the webapp that you want
to run on it?


On Wed, 26 Sep 2018 at 16:19, Shailendra Kumar Verma <
shailendra.kumar.ve...@convergys.com> wrote:

> Okay, so we have to provide root of jdk11 install when prompted at time of
> installation.
>
> Since JDK includes compiler and PCI compliance does not allow it. What if
> we install custom runtime using "jlink" instead of "full JDK11? Will Apache
> Tomcat gets install if we give path of jlink installed custom runtime that
> includes jvm.dll?
>
> Thanks,
> Shailendra
>
>
> -Original Message-
> From: Mark Thomas 
> Sent: Wednesday, September 26, 2018 7:36 PM
> To: users@tomcat.apache.org
> Subject: Re: Java 11 support in Apache Tomcat 9.0
>
> ***CAUTION: This email originated from outside of the organization. Do not
> open attachments or click links unless you recognize sender and know
> content is safe.*** Forward suspicious email to suspici...@convergys.com
> ___
>
> Tomcat already supports Java 11 and has done for some time.
>
> You need to point the installer to the root of the jdk-11 install.
>
> If you install the Orcale JDK, the installer will find it via the
> registry. If you use OpenJDK you'll need to select the root of the install
> (a.k.a. JAVA_HOME) yourself.
>
> Mark
>
>
>
> On 26/09/2018 08:01, Shailendra Kumar Verma wrote:
> > Johan,
> >
> > That's what I am saying. All we have now, jvm.dll that comes under
> jdk-11\bin\server\jvm.dll. No JRE is released from Java 11 now.
> >
> > Thanks,
> > Shailendra
> >
> > -Original Message-
> > From: Johan Compagner 
> > Sent: Wednesday, September 26, 2018 5:28 PM
> > To: Tomcat Users List 
> > Subject: Re: Java 11 support in Apache Tomcat 9.0
> >
> > ***CAUTION: This email originated from outside of the organization. Do
> > not open attachments or click links unless you recognize sender and
> > know content is safe.*** Forward suspicious email to
> > suspici...@convergys.com
> > ___
> >
> > Just wondering how do you get a JRE?
> > oracle doesnt provide one anymore (and the JDK that you can download
> > can only really be used for development and nothing else)
> >
> > so are you using the open source JDK?
> >
> >
> > On Wed, 26 Sep 2018 at 13:40, Shailendra Kumar Verma <
> shailendra.kumar.ve...@convergys.com> wrote:
> >
> >> Hello,
> >>
> >> When we run Tomcat 9.0.12 installer, it prompts to provide JRE location.
> >> Since Java 11 LTS release yesterday does NOT have any JRE installer
> >> separately, all it has server JVM embedded in it under
> .
> >> If I give this path where jvm.dll located under server folder, it
> >> does not recognize.
> >>
> >> Whats' the plan for Java 11 for Apache Tomcat 9.0?
> >>
> >> Thanks,
> >> Shailendra
> >>
> >> NOTICE: The information contained in this electronic mail
> >> transmission is intended by Convergys Corporation for the use of the
> >> named individual or entity to which it is directed and may contain
> >> information that is privileged or otherwise confidential. If you have
> >> received this electronic mail transmission in error, please delete it
> >> from your system without copying or forwarding it, and notify the
> >> sender of the error by reply email or by telephone (collect), so that
> >> the sender's address records can be corrected.
> >>
> >
> >
> > --
> > Johan Compagner
> > Servoy
> > NOTICE: The information contained in this electronic mail transmission
> is intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential. If you have received this electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply email
> or by telephone (collect), so that the sender's address records can be
> corrected.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
>
> -
>

Re: Java 11 support in Apache Tomcat 9.0

2018-09-26 Thread Johan Compagner
Just wondering how do you get a JRE?
oracle doesnt provide one anymore (and the JDK that you can download can
only really be used for development and nothing else)

so are you using the open source JDK?


On Wed, 26 Sep 2018 at 13:40, Shailendra Kumar Verma <
shailendra.kumar.ve...@convergys.com> wrote:

> Hello,
>
> When we run Tomcat 9.0.12 installer, it prompts to provide JRE location.
> Since Java 11 LTS release yesterday does NOT have any JRE installer
> separately, all it has server JVM embedded in it under .
> If I give this path where jvm.dll located under server folder, it does not
> recognize.
>
> Whats' the plan for Java 11 for Apache Tomcat 9.0?
>
> Thanks,
> Shailendra
>
> NOTICE: The information contained in this electronic mail transmission is
> intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential. If you have received this electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply email
> or by telephone (collect), so that the sender's address records can be
> corrected.
>


-- 
Johan Compagner
Servoy


Re: websocket endpoints not released

2018-09-05 Thread Johan Compagner
Not for me.. websockets are tied to the instance.. and that instance is on
the Dom window which is there 1 per tab.

Op wo 5 sep. 2018 13:52 schreef Louis Zipes :

> Same behavior with Internet Explorer?  I know that in general, Chrome tabs
> act as the same session if you open more than one (at least with my
> application running on Tomcat)
>
> -Original Message-
> From: Johan Compagner [mailto:jcompag...@servoy.com]
> Sent: Wednesday, September 05, 2018 3:42 AM
> To: Tomcat Users List
> Subject: Re: websocket endpoints not released
>
> - - - external message, proceed with caution - - -
>
>
> If a user refreshes the browser then the current ws is always closed and a
> new one is opened
>
> Op za 1 sep. 2018 02:38 schreef Alex O'Ree :
>
> > I ran into a strange issue today. Running tomcat 8.5 with a websocket
> > endpoint + some javascript to wire up a browser to the socket. All works
> as
> > normal, however sometimes if the user refreshes the browser, it seems as
> if
> > second web socket is opened by the browser. This leads to the user seeing
> > duplicate messages which can be confusing. I do have code on the page for
> > navigation links to close the socket but i'm thinking i haven't handled
> all
> > cases. My assumption was that a full browser reload would trigger any
> open
> > websockets to close, but apparently they don't (at least with chrome).
> Has
> > anyone else ran into a similar issue?
> >
> ---
> CONFIDENTIALITY NOTICE: This message is for intended addressee(s) only and
> may contain information that is confidential, proprietary or exempt from
> disclosure. If you are not the intended recipient, please contact the
> sender immediately. Unauthorized use or distribution is prohibited and may
> be unlawful.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: websocket endpoints not released

2018-09-05 Thread Johan Compagner
If a user refreshes the browser then the current ws is always closed and a
new one is opened

Op za 1 sep. 2018 02:38 schreef Alex O'Ree :

> I ran into a strange issue today. Running tomcat 8.5 with a websocket
> endpoint + some javascript to wire up a browser to the socket. All works as
> normal, however sometimes if the user refreshes the browser, it seems as if
> second web socket is opened by the browser. This leads to the user seeing
> duplicate messages which can be confusing. I do have code on the page for
> navigation links to close the socket but i'm thinking i haven't handled all
> cases. My assumption was that a full browser reload would trigger any open
> websockets to close, but apparently they don't (at least with chrome). Has
> anyone else ran into a similar issue?
>


Re: JFileChooser not working

2018-07-03 Thread Johan Compagner
Are you expecting that an application running on tomcat on a server will
display the awt/swing components on a client?

How is that code downloaded to the client? Webstart?
What does the client start or load?

But this is not really a tomcat question..

Op di 3 jul. 2018 21:04 schreef James Finnall :

> Hello All,
>
> Developed application that works locally on XAMPP using JFileChooser
> (awt and swing).  I build the .war file, code sign it with jarsigner,
> and deploy to Tomcat server.  The server expands it out and it
> functions until it hits the JFileChooser section and then nothing.  No
> dialog appears for the client to allow the created file to be
> downloaded.  Maybe security?  That is why I setup to do code signing
> thinking it would allow the operation if signed.
>
> Any thoughts here would be greatly appreciated.
> James Finnall
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


using the deploy task in the newer versions of Tomcat are failing for the most part..

2018-06-16 Thread Johan Compagner
Hi,

this discussion was already done more on this list, but i wanted to pin
point it a bit more because i do think tomcat should fix this (or in tomcat
or do pre emptive authentication in the deploy task (allow this at least))

currently in a new version of Tomcat it is very hard to deploy large war
files because if you just do deploy you will get:

 [echo] Tests FAILED OR ERROR caught when deploying/testing solution
test_ngSelenium_listview_tableview: java.io.IOException: Error writing
request body to server
 [undeploy] FAIL - No context exists named
[test_ngSelenium_listview_tableview]



This you get at least for the first deploy that you try.
i did notice that the second one did work after that, just ignoring in a
try/catch that first one
So though lets get the very small sample.war (5kb:
https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/) and deploy that
one first:

but then i get this one:

java.net.HttpRetryException: cannot retry due to server
authentication, in streaming mode


more people are having that:
https://stackoverflow.com/questions/45809257/ant-re-deploy-on-tomcat-8-5-failed-java-net-httpretryexception-cannot-retry-d

i guess i could try/catch that again an hope that it somehow does remember
to send the user/pw upfront the next time..

But i did see that deploy taks also has localWar support.. So used that
because i can do that everything is on the same server. But for people that
runs tomcat somewhere else this wont help.

I think developers of tomcat should really look into these problems,
Maybe just fixing the deploy hook to add an attribute
"preEmptiveAuthentication" to set that to true. Then all these problems are
gone. Because all these problems are because you git an url that need
authentication when directly doing a put ...
And the latest tomcats behaves differently if the contents is small or big.
But both don't work anymore...



-- 
Johan Compagner
Servoy


Re: Tomcat/9.0.8 - Can't deploy war of 104MB

2018-05-26 Thread Johan Compagner
Op za 26 mei 2018 01:53 schreef Christopher Schultz <
ch...@christopherschultz.net>:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Johan,
>
> On 5/25/18 10:12 AM, Johan Compagner wrote:
> > On Thu, 24 May 2018 at 22:01, Arnold Morein <arnie.mor...@me.com>
> > wrote:
> >
> >> There are no errors in catalina.out when this occurs.
> >>
> >> Yes, via the manager UI I can deploy the WAR, but that doesn't
> >> help me in our automated scripts.
> >>
> >> It does appear to be on the Ant side of things though. Does
> >> chunking need to be turned on in Manager (or does that setting
> >> enable it)?
> >>
> >> Or does Ant need to support chunking?
> >>
> >
> >
> > i see you use username/password is that basic authentication? and
> > is that basic authenthication pre emptive?
> >
> > Because that could be a bit problem, if you send a very big file to
> > a server that then first replies that you need to authenticate You
> > should use pre emptivie, so send the username/password right away
> > with the first request
>
> I haven't read the code, but any upload task that accepts
> username+password and doesn't send those credentials on the first try
> would be fairly silly. I'm almost certain that the authentication
> information is sent with the first request.
>



Then it will fall with the latest tomcats. Not sure when this did change
but in our product and in our docs for our customers we now say the same.
You need to first hit a simple page (like main index) and then use that
client to do the real upload. Or do pre emtive

Because tomcat swallows it or something like that and returns something
else (a different code)



> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsIoe4ACgkQHPApP6U8
> pFi6Ug//dlh1e2wAhwZ5tqwffs7Z7wFDPqZKpCd6NULziWWZTno+eglpj3XQl2gc
> YDFFBkXaobsRW+N073Gk+5u0UDFEHxDda+HECHGzTEoq/Ss88dCSLWdX/yihw62S
> 467SC7U9GiWagNxuerj9EDxizwAtVyTBbnv2uueHvhIwMHY4ha9A5AD756mkm1eC
> S9n7gbFyT/NFyG8Smyn5jC14B12VSBG0+43CfV8bbMzYV4mCOo2SMN1FDu6rS3/K
> eDBR//yIj5Fxg4qln2LmcxBPZdJD/de5IyuQSK/q2g7NXvFLD/NwZL8sBv6ICpS6
> mtE8925deH5rHo7Dcm30R4UozAuAVcLret8EbkdHUpI87Dbw0OQiKI/fosTz7e1A
> 2Hszxz6XMNzVrGqhi2tZdpLEUrTv1l43FhVlafgh2C4oen5Uv9Sm7BLDXOyUjJBN
> +lDYC6kJRxEFZ7oL5V/o5N9xIESl5VOYBcpxgPImhYfeX1WEzyycZrhfWD64VX9o
> 2+w8Uzi80tYzqY+CdMswQgLvRkhjUhuhY49C9Mhk3yEBmpGSf94UyYHRgu5FBPCM
> XUOeVCLifs7rX2kKEz3G6zvdj+Crsez9b9M9u7S4iqYwWoeHcAYouRlJIKewJeU+
> 2iu2EUSRWhaWhvFyRsRCS3GEwIa0iyEFa2LNH+BXLXPnNPa5814=
> =Ex/m
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat/9.0.8 - Can't deploy war of 104MB

2018-05-25 Thread Johan Compagner
On Thu, 24 May 2018 at 22:01, Arnold Morein  wrote:

> There are no errors in catalina.out when this occurs.
>
> Yes, via the manager UI I can deploy the WAR, but that doesn't help me in
> our automated scripts.
>
> It does appear to be on the Ant side of things though. Does chunking need
> to be turned on in Manager (or does that setting enable it)?
>
> Or does Ant need to support chunking?
>


i see you use username/password is that basic authentication?
and is that basic authenthication pre emptive?

 Because that could be a bit problem, if you send a very big file to a
server that then first replies that you need to authenticate
You should use pre emptivie, so send the username/password right away with
the first request


Re: x-forwarded-X stuff and websockets

2018-04-26 Thread Johan Compagner
>
>
>
> Are you sure the L7 load balancer can handle HTTP upgrade? Looking at
> the Amazon docs you want an "Application load balancer" rather than a
> "Classic load balancer"
>
> My guess is that the load balancer is removing one or more of the
> headers Tomcat depends on to identify the request as a WebSocket
> request. Can you use tcpdump to capture a request that returns a 404?
> Looking at that trace should point us in the right direction.
>
> Mark
>


thx mark

thats very likely it.

https://aws.amazon.com/elasticloadbalancing/details/#compare

weird thing is websockets are working with classic tcp/layer 4 ...
I guess that is kind of logical because everything is just send as is...

and the the http/https layer 7 one of classes really doesn't support it
correctly

And ALB doesnt support smtp and other ports that we need (At least that is
what is told to me)

And in the end we also need sticky session support and so (what only an
http or application load balancer supports)
so we have here an very annoying problem that any solution we pick will not
support all features that we need...


-- 
Johan Compagner
Servoy


x-forwarded-X stuff and websockets

2018-04-26 Thread Johan Compagner
Hi,

We have a tomcat on an amazon service with for now a ELB L4 (tcp
loadbalancer, with ssl offloading) before it

That works for the most part just fine, except we don't know that we are in
ssl mode or not
Our application have support for that to look at the x-forwarded-proto
header (and some other fallbacks) to see what is really the scheme the end
users uses

So we switch to a ELB L7 load balancer which is the http load balancer that
will add those x-forwarded-proto for us. And yes i checked they are on all
the reques tthen.

This seems to work for all kind of connections to servlets/files/filters
and so on except websockets
Suddenly if we switch that on then all the websocket connections are
returning 404 (i see that in the browser and in the tomcat access log)
Can't find any other thing in the log files that would give me a clue what
is happening

Does anybody has an idea why suddenly the http upgrade stuff to websockets
(wss protocol) are suddenly seen as 404/NOT_FOUND ?


-- 
Johan Compagner
Servoy


Re: tomcat 8.5.28

2018-03-02 Thread Johan Compagner
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port
8080
sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-port
8443

then you can save the iptables so they stick after reboot:

sudo service iptables save


On 2 March 2018 at 15:08, Cheltenham, Chris <ccheltenham-...@philasd.org>
wrote:

> Hello,
>
>
>
> Has anyone set up tomcat as a non-root use?
>
>
>
> I have set it up successfully however, I have to bound the non-root user
> to port 8443.
>
>
>
> What is the best way to reroute 8443 through 443?
>
> There are several options.
>
> Everything is set up at send to port 443 so I need to reroute 8443 in and
> out of 443
>
>
>
> CentOS 7 by the way –
>
>
>
>
>
> ===
>
> Thank You;
>
> Chris Cheltenham
> Technology Services
> The School District of Philadelphia
>
> Work # 215-400-5025
> Cell # 215-301-6571
>



-- 
Johan Compagner
Servoy


Re: Tool to analyze the core/heap dump

2018-02-05 Thread Johan Compagner
Jvisualvm that ships with java8 or yourkit (you can evaluate for some time)

Op 5 feb. 2018 19:43 schreef "D, Dwarakesh (External)" <
dwarakes...@xerox.com>:

> Hello,
>
> Good Day!
>
> We have core and heap dump files generated from tomcat in our Solaris
> server. Is there any best tool to analyze those logs, please suggest on
> this.
>
> Thanks,
> Dwarakesh
>
>


Re: Is tomcat 8.5.24 uses thread pool by default.

2018-02-05 Thread Johan Compagner
If that is the case then the problem is also that you don't clean up the
threadlocals..
That is a problem by itself, you should always after a request have cleanup
all your threadlocals

On 5 February 2018 at 15:36, Shiva Kumar K R <shiv...@securelyshare.com>
wrote:

> Hi,
>
> Component details:
> Tomcat = 8.5.24
> Java = 1.8
> OS = Ubuntu 16.04 LTS
>
> Is above tomcat uses thread pool to process requests out of the box without
> any explicit configuration of thread pool.
>
> I faced an issue while using threadlocal which was returning data stored in
> previous request instead of current request.
>
> Thank You,
> Shiva Kumar K R
>



-- 
Johan Compagner
Servoy


RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat 6?

2017-12-23 Thread Johan Compagner
Op 23 dec. 2017 09:27 schreef "Johan Compagner" <jcompag...@servoy.com>:



Op 22 dec. 2017 21:02 schreef "Eric Robinson" <eric.robin...@psmnv.com>:

>
> More heap or more native memory?
>

With the exact same Xms and Xmx settings, I get vastly different resident
and virtual image sizes from the Linux ps command.


 tomcatA: jdk1.8.0_152, res: 694312, virt: 5045084
 tomcatB: jdk1.6.0_21, res: 332840, virt: 3922656




And b is also tomcat8 right?
Can you make that also tomcat8 but keep java8?


I mean A is java8 and tomcat8.. so make a C that is tomcat6 and java8




--Eric



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


RE: Is it Normal for Tomcat 8 to Use 20-80% More Memory Than Tomcat 6?

2017-12-23 Thread Johan Compagner
Op 22 dec. 2017 21:02 schreef "Eric Robinson" :

>
> More heap or more native memory?
>

With the exact same Xms and Xmx settings, I get vastly different resident
and virtual image sizes from the Linux ps command.


 tomcatA: jdk1.8.0_152, res: 694312, virt: 5045084
 tomcatB: jdk1.6.0_21, res: 332840, virt: 3922656




And b is also tomcat8 right?
Can you make that also tomcat8 but keep java8?



--Eric



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


Re: SSL connectors

2017-12-06 Thread Johan Compagner
On 1 December 2017 at 16:44, Mark Thomas  wrote:

> On 01/12/17 14:57, Chris Cheshire wrote:
> > I see in the changelog for 8.5.24
> >
> > 60762: Add the ability to make changes to the TLS configuration of a
> > connector at runtime without having to restart the Connector. (markt)
> >
> > Does this mean we can now update SSL certificates without bouncing the
> > connector?
>
> Yes, via one of the following methods on the endpoint:
>
> reloadSslHostConfig(String hostName)
> reloadSslHostConfigs()
>
>
>
now it would be nice if tomcat just had a build in file scanner that  calls
those method for use without doing anything else then change the file on
disk ;)


Re: Context class loader of worker thread got null (using parallelStream)

2017-11-30 Thread Johan Compagner
Why do you depend on the context classloader inside that?

Op 1 dec. 2017 04:41 schreef "Xueheng Wu" <x...@thoughtworks.com>:

> Johan, thanks a lot.
>
> This way could be a huge project, because parallelStream is used
> everywhere.
> Maybe we got wrong usage from the beginning.
>
>
> > On 30 Nov 2017, at 19:23, Johan Compagner <jcompag...@servoy.com> wrote:
> >
> > I think tomcat has nothing todo with this.
> >
> > This is the Threadpool that parallelStream() uses. So this is a problem
> of the streaming api of java
> > The threadpool needs to set the context classloader on its created
> threads..
> > So you need to use i think your own ThreadPool, i think that is doable:
> >
> > https://stackoverflow.com/questions/21163108/custom-
> thread-pool-in-java-8-parallel-stream/22269778#22269778 <
> https://stackoverflow.com/questions/21163108/custom-thread-pool-in-java-8-
> parallel-stream/22269778#22269778>
> >
> > On 30 November 2017 at 03:31, Xueheng Wu <x...@thoughtworks.com  x...@thoughtworks.com>> wrote:
> > Hi,
> >   I met a strange error these days, and need help.
> >
> >   Our application is running on Tomcat 8.5.11 (windows 10 64bit)with
> JRE 1.8.0_121.
> >
> >   In the application, we use parallelStream to do some logic, like
> this:
> >
> >
> >   There are many steps in the logic, and some of them use togglz,
> then we got error.
> >
> >   After checking togglz’s code, I found that it calls
> “Thread.currentThread().getContextClassLoader()” every times calling
> togglz.
> >
> >
> >   Then I print out context class loader when calling togglz, like
> this:
> >
> >
> >   And I find a strange thing. Only execute thread has context class
> loader, worker thread created by parallelStream got null for class loader.
> >
> >
> >
> >   But when it start as an springboot application, all threads has
> context class loader:
> >
> >
> >
> >   So please tell me why class loader got null and how to avoid it.
> >
> > Best regards.
> >
> >
> >
> > --
> > Johan Compagner
> > Servoy
>
>


Re: Context class loader of worker thread got null (using parallelStream)

2017-11-30 Thread Johan Compagner
I think tomcat has nothing todo with this.

This is the Threadpool that parallelStream() uses. So this is a problem of
the streaming api of java
The threadpool needs to set the context classloader on its created threads..
So you need to use i think your own ThreadPool, i think that is doable:

https://stackoverflow.com/questions/21163108/custom-thread-pool-in-java-8-parallel-stream/22269778#22269778

On 30 November 2017 at 03:31, Xueheng Wu <x...@thoughtworks.com> wrote:

> Hi,
> I met a strange error these days, and need help.
> Our application is running on Tomcat 8.5.11 (windows 10 64bit)with
> JRE 1.8.0_121.
> In the application, we use parallelStream to do some logic, like this:
> There are many steps in the logic, and some of them use togglz, then we
> got error.
>
> After checking togglz’s code, I found that it calls
> “Thread.currentThread().getContextClassLoader()” every times calling
> togglz.
>
> Then I print out context class loader when calling togglz, like this:
> And I find a strange thing. Only *execute thread* has context class
> loader, *worker thread *created by parallelStream got *null* for class
> loader.
> But when it start as an springboot application, all threads has context
> class loader:
> So please tell me why class loader got null and how to avoid it.
> Best regards.
>



-- 
Johan Compagner
Servoy


Re: Am I reinventing the wheel to get letsencrypt certs for Tomcat

2017-10-30 Thread Johan Compagner
>
>
> How about this?
>
> http://tomcat.apache.org/presentations.html
>
> Search for "Let's Encrypt".
>
> I haven't wired this into Tomcat 8.5 and Tomcat 9.0's capability to
> re-load a keystore yet. I'm not sure there is JMX support for that,
> yet, so that would be a prerequisite IMO.
>
> -



Thx, you are doing almost the same as my (why do you use the keytool, you
can use the p12file (openssl output file) directly right?
(at least i do that)

But using that jmx proxy servlet is a good one, will see if that works for
me.

The only thing left then is that  "certbot-auto renew" should really give
me some feedback that it really did renew
Else i constantly generate the  p12file for tomcat and start/stop the
connector
Maybe i can monitor the pem file that certbot will be touching if something
did renew somehow.


-- 
Johan Compagner
Servoy


Re: Am I reinventing the wheel to get letsencrypt certs for Tomcat

2017-10-27 Thread Johan Compagner
On 27 October 2017 at 15:05, Don Flinn  wrote:

> Hi Andre,
>
> I have looked and it may be my ignorance but I didn't find any that seemed
> to fit.  I'll look more closely at the available letsencrypt clients.
>
> With letsencrypt you first have to authenticate, i.e. show you own the
> site, by letsencrypt logging into your site, e.g. Tomcat and checking a
> token.  Then the Java program can get the letsencrypt certificate.  There
> are two different addresses Tomcat on AWS and the node, which is running
> the Java program.
>
> I've set Tomcat to listen on port 80 and put the directory structure they
> want in Tomcat ROOT.  The Java program, running on my node, gets the
> letsencrypt authentication token and ftp's it to Tomcat
> ROOT/.well-known/acme-challenge, which is the directory structure they
> expect. letsencryt then authenticates the token which is in Tomcat, by
> retrieving it . The program lets letsencrypt know when the ftp is done  The
> Java program then retrieves the certificate from letsencrypt, puts it in a
> keystore, ftp's the keystore to AWS in the directory in which I've set
> Tomcat to look for the keystore.  It's all done from the one Java program,
> which I can run from my node.  I have yet to incorporate programically
> inserting the certificate into the keystore.  All the other steps are
> working.  It needs testing and doing the update of the certificate, which
> is pretty much the same steps as already programmed.
>
> Don
>



i just set this up a few day ago

But all the current scripts out there are working for the most part
Also running tomcat at root is not a good idea you can just use ip tables
for that:

sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port
8080
sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-port
8443

so when tomcat is running on port 8080 and 8440 with iptables you route
those port also to 80/443

so no need to change anything in tomcat

besides that i just use certbot-auto

wget https://dl.eff.org/certbot-auto
sudo chmod a+x certbot-auto

sudo ./certbot-auto --debug -v --server
https://acme-v01.api.letsencrypt.org/directory certonly -d your.domain.com


you have to have a ROOT webapp in tomcat for this and with certbot you just
point to that tomcat/webapps/ROOT dir

and the certificates are there.


then the only thing todo left is to convert it and place it in the right
folder (and i guess the first time you have to change also the owner/group
because that file will be root:root)


sudo openssl pkcs12 -export -out tomcat/conf/bundle.pfx -inkey
/etc/letsencrypt/live/your.domain.com/privkey.pem
 -in /etc/letsencrypt/live/
your.domain.com/cert.pem  -certfile
/etc/letsencrypt/live/your.domain.com/chain.pem
 -password pass:apassword


and you have your first certificate in a format tomcat/java understand


then only a crontab under root:


#!/bin/sh
/home/ec2-user/certbot-auto renew
openssl pkcs12 -export -out /tomcat/conf/bundle.pfx -inkey
/etc/letsencrypt/live/your.domain.com/privkey.pem
 -in /etc/letsencrypt/live/
your.domain.com/cert.pem  -certfile
/etc/letsencrypt/live//your.domain.com/chain.pem
 -password pass:apassword


and you are done


The only thing that i need to investigate is to only call the openssl in
the cron tab when the certbot did renew and then also restart tomcat (as
long as tomcat doesn't auto pick it up)


Re: Tomcat 7.0: compression="on" or compression="force" running on Java 1.8.0_151 causes content encoding errors in browsers

2017-10-26 Thread Johan Compagner
They (oracle) first introduced this in Java9..
Its something that they don't expect that certain things are reused/cached
i believe

Now they backported that same bug also to java 8,
i think they already fixed it for the next java8 version:

https://bugs.openjdk.java.net/browse/JDK-8189789



On 26 October 2017 at 16:19, Jörg Schubert <jschub...@cebacus.de> wrote:

> Am 26.10.2017 um 15:36 schrieb Jörg Schubert:
>
>>
>> Hello,
>>
>> We have a very stange problem. Since updating java 8 to build 151
>> (x86-64), tomcat is producing illegal compressed responses - sometimes.
>> Firefox and Chrome are complaining about content encoding errors. Firefox
>> error message is: an invalid or unknown form of compression was used.
>>
>> Tested with tomcat 7.0.56 ant tomcat 7.0.82 on debian stretch and ubuntu
>> artful. The debian system is running on openvz kernel 2.6.32-46-pve (system
>> locale en_US.UTF-8). Ubuntu is running kernel 4.13.0-16 with locale
>> de_DE.UTF-8.
>>
>> Tomcat's manager,docs and demo pages are working.
>> A lot of pages of Psi-Probe <https://github.com/psi-probe/psi-probe>
>> (Version 2.3.0 and current HEAD) are failing.
>> Also failing is a webservice result redirected over
>> org.apache.camel.component.servlet.CamelHttpTransportServlet from apache
>> camel 2.20.
>>
>> Going back to oracle jdk 1.8.0_144 or openjdk 1.8.0_141 resolves that
>> issue.
>>
>> A tcpdump of a failed Psi-Probe page is attached. My knowledge about HTTP
>> ist limited. Could anyone take a look at it?
>>
>>
>> Thank You and with best regards,
>>
>> Joerg
>>
>>
>> --
>> *
>> Jörg Schubert
>> cebacus Ingenieurgesellschaft mbH
>> Friedgartenstr. 50-52
>> 32429 Minden, Germany
>>
>> Phone: +49-(0571)-9561953
>> Fax: +49-(0571)-9561929
>> e-mail:jschub...@cebacus.de
>> *
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>
> Some additional information:
>
> - No problems  with Tomcat 8.5.23 using standard connector with
> compression="on".
>
> - Problem occurs on Tomcat7 with standard connector, ssl connector and
> http11nio
>
>
>


-- 
Johan Compagner
Servoy


is tomcat monitoring the keystore file?

2017-10-26 Thread Johan Compagner
Hi,

now with LetsCrypt its easy (and free) to get https up and running even if
you just use tomcat
But the problem is those certificate must be renewed every 3 months
This is easy to do in a crontab script (that does the renew and makes a
java keystore again)
So i can generate the pfx constantly just fine

But does tomcat monitor that file for changes and will it then use the new
one without restarting the whole server?


-- 
Johan Compagner
Servoy


Re: jre leak prevention

2017-09-01 Thread Johan Compagner
On 1 September 2017 at 11:10, Mark Thomas <ma...@apache.org> wrote:

> On 01/09/17 10:03, Johan Compagner wrote:
> > Hi,
> >
> > i got reports that running jasper reports is suddenly a lot slower when
> > deployed..
> > (compared what he uses in developer)
> > Running a report was 0-2 seconds in its developer but at least 10 seconds
> > when running deployed.
> >
> > We tracked it down, in developer the listener:
> >
> >  > />
> >
> >
> >
> >
> > was not in the server.xml and at deploy it is a standard latest tomcat
> > install which enables that by default
> >
> > If i look at this, i wonder which part makes it much slower
> > https://tomcat.apache.org/tomcat-8.0-doc/config/
> listeners.html#JRE_Memory_Leak_Prevention_Listener_-_
> org.apache.catalina.core.JreMemoryLeakPreventionListener
>
> You can disable each protection individually so you should be able to
> answer that question yourself. (And the answer would be very interesting.)
>


We tested it and the winner is:



i had my bets on the xmlParsingProtection but that wasn't it...


jre leak prevention

2017-09-01 Thread Johan Compagner
Hi,

i got reports that running jasper reports is suddenly a lot slower when
deployed..
(compared what he uses in developer)
Running a report was 0-2 seconds in its developer but at least 10 seconds
when running deployed.

We tracked it down, in developer the listener:






was not in the server.xml and at deploy it is a standard latest tomcat
install which enables that by default

If i look at this, i wonder which part makes it much slower
https://tomcat.apache.org/tomcat-8.0-doc/config/listeners.html#JRE_Memory_Leak_Prevention_Listener_-_org.apache.catalina.core.JreMemoryLeakPreventionListener



-- 
Johan Compagner
Servoy


Re: parallel deployment and websockets

2017-05-31 Thread Johan Compagner
On 31 May 2017 at 10:11, Mark Thomas  wrote:

>
> >>
> >>
> > would a feature request be accepted for this that there can be a cookie
> set
> > where that "load balancer" would also look at?
> > and that  cookie always make sure that it goes to the context it started
> > from as long as that context is there?
>
> Maybe.
>
> What is the use case? Why can't a new WebSocket connection be created to
> the new version of the web application?
>

because it looses then state.
Like i said below, our application is a statefull application but we use
websocket what was previously ajax request to push back and forward changes
to server and client
(so a data change on the server is pushed right away to the client)

We have our own session tracking over the websocket url:

wss://domain/websocketendpoint/sessionuuidparam

the first time that sessionuuidparam is null but then we push that value to
the client and store it in the session storage (so that tab in the browser)
and if we do a refresh or a reconnect then we send that session uuid to the
server and the server will connect that new websocket endpoint to our
"session" object

So a new context would not find that session object because i guess that is
a fully new classloader/application deploy...
so we lost the session.
In the ajax version this would not happen because that is all pure async
http request to the server with a http session object..



>
> > Because it is quite annoying that it is tied to a jsessionid of a
> > HttpSession that should then be created and kept alive for the whole
> > websocket session..
> >
> > i can do something like this:
> >
> > https://stackoverflow.com/questions/17936440/accessing-httpsession-from-
> httpservletrequest-in-a-web-socket-serverendpoint
> >
> > but isn't that kind of doing something that shouldn't be done? Like
> keeping
> > a reference to a http session?
> >
> > Even if i do the above then still i need to "touch" the session on every
> > websocket request to keep it alive
> > Or set the max idle time out to -1 so it never by itself invalidates()
> > And then when i know the websocket session is really gone i will call
> > invalidate() on it myself..
>
> If you are invalidating the HTTP session once the WebSocket connection
> closes, why keep the session alive in the first place?
>


No we wouldn't close it on the websocket connection close, but on the
timeout of the Session object that is behind that connection
And if before the time out happens a new websocket connection is coming in
(with the above url) then we quickly re attach the session object to that
new endpoint and it will go on

only after a while if there is no new websocket being setup, we invalidate
the session object (and then we could also invalidate the http session that
we stored)


So in the end this is just kind of the same as http sessions in tomcat...
but then real session support over multiply request for websockets
And we don't use a cookie but purely have the id always in the url because
this way multiply tabs in the browser are always independent of each other.

So it would be nice if tomcat would have versioning support for websockets
under the hood...
Like a setting that we could turn on and then when an upgrade happens
tomcat auto sends a cookie which it reuses to connect to the right context
version

johan


Re: parallel deployment and websockets

2017-05-31 Thread Johan Compagner
>
>
> It depends. If the URL in the HTTP UPGRADE request includes the session
> ID, and that session ID is still valid in ##1, then the WebSocket
> request will be handled by ##1.
>
> Mark
>
>
would a feature request be accepted for this that there can be a cookie set
where that "load balancer" would also look at?
and that  cookie always make sure that it goes to the context it started
from as long as that context is there?

Because it is quite annoying that it is tied to a jsessionid of a
HttpSession that should then be created and kept alive for the whole
websocket session..

i can do something like this:

https://stackoverflow.com/questions/17936440/accessing-httpsession-from-httpservletrequest-in-a-web-socket-serverendpoint

but isn't that kind of doing something that shouldn't be done? Like keeping
a reference to a http session?

Even if i do the above then still i need to "touch" the session on every
websocket request to keep it alive
Or set the max idle time out to -1 so it never by itself invalidates()
And then when i know the websocket session is really gone i will call
invalidate() on it myself..

But this is all quite cumbersome

We just have state there is no way around it, but the communication between
server and client is after the first startup completely over websocket
(just like ajax before)

For example it would be nice if tomcat did this just under the hood. if
tomcat upgrades a http request to a websocket then it will also just push a
small cookie on it to know which context version it was on...

johan


Re: parallel deployment and websockets

2017-05-30 Thread Johan Compagner
>
> > But now i have websockets, if i connect to ##1 first and i have the end
> > point there
> > Then i add a ##2 version of the context
> > then i guess a new user that opens a websocket will go to ##2
> > but if the existing user does a refresh in the browser then it will also
> > suddenly go to ##2 i guess?
>
> It depends. If the URL in the HTTP UPGRADE request includes the session
> ID, and that session ID is still valid in ##1, then the WebSocket
> request will be handled by ##1.
>


ah so for this to work we need to force a http session to be created?
so the cookie is set and the http session is there?
problem is a bit that all communication is then going through the websocket
so the session could even just timeout, because we don't hit it anymore

i do see when creating a websocket, request.getSession(false) is called
(multiply times by the way, a lot goes wrong when you have a breakpoint on
that method, but thats another story)
but it isn't when it is just alive. So  do i need to call something every
time on the incomming() call in the endpoint to keep the http session
alive..

johan


parallel deployment and websockets

2017-05-30 Thread Johan Compagner
Hi,

if i read this:

http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Parallel_deployment

then i see it will go to the "old" version of a war based on session
information
i guess this is jsessionid?

So a refresh in the browser or another request with the jsessionid will go
to the version it started with i guess?

But now i have websockets, if i connect to ##1 first and i have the end
point there
Then i add a ##2 version of the context
then i guess a new user that opens a websocket will go to ##2
but if the existing user does a refresh in the browser then it will also
suddenly go to ##2 i guess?

(we have session info over the websocket url like a jsessionid... but that
will not map in the other later version of the context i guess)

-- 
Johan Compagner
Servoy


what could this mean if there are many many http threads in this state?

2017-04-11 Thread Johan Compagner
Thread: http-443-72, state: RUNNABLE, total cpu time: 5583984.375ms, total
user time: 5451312.5ms
  java.net.SocketInputStream.socketRead0(Native Method)
  java.net.SocketInputStream.socketRead(Unknown Source)
  java.net.SocketInputStream.read(Unknown Source)
  java.net.SocketInputStream.read(Unknown Source)
  sun.security.ssl.InputRecord.readFully(Unknown Source)
  sun.security.ssl.InputRecord.read(Unknown Source)
  sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
  sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
  sun.security.ssl.AppInputStream.read(Unknown Source)

org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:733)

org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:364)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:814)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  java.lang.Thread.run(Unknown Source)

it seems that there is an incomming request right?
That is not really a thread just in a a waiting state?
that should be something like this:

Thread: http-443-70, state: WAITING, total cpu time: 7274093.75ms, total
user time: 7110015.625ms
  java.lang.Object.wait(Native Method)
  java.lang.Object.wait(Unknown Source)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:458)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:484)
  java.lang.Thread.run(Unknown Source)


or could the above be a keep alive thing? so the browser keeps the
connection alive for a while to reuse?


-- 
Johan Compagner
Servoy


Re: [ANN] Apache Tomcat 8.5.4 available

2016-07-14 Thread Johan Compagner
>
>
> This is the first stable release of the 8.5.x branch. Tomcat 8.x users
> should now use 8.5.x releases in preference to 8.0.x releases.
>
>
i thought 8.5.3 was the first stable release ;)


Re: Locky Attack

2016-05-02 Thread Johan Compagner
How did they get in?
what security hole was used there?


On 2 May 2016 at 15:18, Thess Bermudez <thessbermu...@gmail.com> wrote:

> Hi,
>
> Has anyone been attacked by a ransomware named Locky? Our company was hit
> with the encryption of the js files running in our Apache Tomcat 7.0. Good
> thing that we have daily app backups that made us not give in to the
> "ransom" requirement. We also reinstalled everything in our server..
> Databases are intact but the corrupted/encrypted webapp files were replaced
> by files with .locky extension.
>
> Would appreciate if anyone can share similar experience and how you've
> dealt with it.
>
> Thank you,
>
> Thess
>



-- 
Johan Compagner
Servoy


Re: WebEx meeting rescheduled: Introducing Apache Tomcat 8.5

2016-04-01 Thread Johan Compagner
Thx for sharing

the thing i am most interessted in is http/2 and how to really use that now
We had a discussion before that if you really want to use the
grouping/bundling feature
you need to do that in some kind of filter.

But i guess you can't really do that in 8.5 because that api you need to
use to add files (to make a group) is i guess Servlet spec 4.0?

I guess inside a webapp you really can only use http/2 inside it when
programming against tomcat api?

johan


On 1 April 2016 at 11:12, Mark Thomas <ma...@apache.org> wrote:

> Sorry for the delay. It is now available:
>
> https://www.youtube.com/watch?v=kBJCIpPLWm0
>




-- 
Johan Compagner
Servoy


Re: WebEx meeting rescheduled: Introducing Apache Tomcat 8.5

2016-03-30 Thread Johan Compagner
I guess i have to wait for the youtube:

 Support Not Available
Your version of Cisco WebEx does not support Windows 10. If you want to use
WebEx on Windows 10, contact your administrator for more information.



On 25 March 2016 at 23:13, Mark Thomas <messen...@webex.com> wrote:

> Hello,
> Mark Thomas changed the time for this WebEx meeting.
>
> *Introducing Apache Tomcat 8.5*
> Wednesday, 30 March 2016
> 20:00  |  GMT Summer Time (London, GMT+01:00)  |  1 hr
>
> *Join WebEx meeting*
> <https://pivotal.webex.com/pivotal/j.php?MTID=m539c2bcd3a7c2c48a28a87bfb71d8302>
> Meeting number: 645 574 764
>
> Add this meeting
> <https://pivotal.webex.com/pivotal/j.php?MTID=mc2f05eecbb3d8288cc8086fa8940c472>
> to your calendar. (Cannot add from mobile devices.)
>
> Can't join the meeting? Contact support.
> <https://pivotal.webex.com/pivotal/mc>
>
> IMPORTANT NOTICE: Please note that this WebEx service allows audio and
> other information sent during the session to be recorded, which may be
> discoverable in a legal matter. By joining this session, you automatically
> consent to such recordings. If you do not consent to being recorded,
> discuss your concerns with the host or do not join the session.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>



-- 
Johan Compagner
Servoy


Re: [ANN] Apache Tomcat 8.0.33 available

2016-03-29 Thread Johan Compagner
My bad, i somehow expected to sse .34 (and the date that is reported at the
top is quite some time ago) so i was mixed up.


Re: [ANN] Apache Tomcat 8.0.33 available

2016-03-29 Thread Johan Compagner
the change log is not updated yet.

On 25 March 2016 at 23:04, Mark Thomas <ma...@apache.org> wrote:

> Please refer to the change log for the complete list of changes:
> http://tomcat.apache.org/tomcat-8.0-doc/changelog.html
>




-- 
Johan Compagner
Servoy


Re: the new code in WebappClassLoaderBase.filter() is not working correctly with Rhino engine anymore

2016-03-25 Thread Johan Compagner
On 24 March 2016 at 20:36, Violeta Georgieva <miles...@gmail.com> wrote:

> Check this [1]
> Tomcat 8.0.33 just passed the vote [2]
>
> Regards,
> Violeta
>
>
> [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=58999
> [2] http://marc.info/?l=tomcat-dev=145883995817915=2
>


yes running .32
so thats the same thing we encounter.

good to know it is fixed.


-- 
Johan Compagner
Servoy


the new code in WebappClassLoaderBase.filter() is not working correctly with Rhino engine anymore

2016-03-24 Thread Johan Compagner
Hi,

we now get this exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: 3
   at java.lang.String.charAt(String.java:658)
   at
org.apache.catalina.loader.WebappClassLoaderBase.filter(WebappClassLoaderBase.java:2780)
   at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1253)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   at org.mozilla.javascript.Kit.classOrNull(Kit.java:89)
   at
org.mozilla.javascript.NativeJavaPackage.getPkgProperty(NativeJavaPackage.java:154)
   at
org.mozilla.javascript.NativeJavaPackage.get(NativeJavaPackage.java:111)
   at
org.mozilla.javascript.NativeJavaTopPackage.init(NativeJavaTopPackage.java:119)


that is because WebappClassLoaderBase.filter() is really changed in this
release and assumes:

  } else if (name.startsWith("org")) {
/* 3 == length("org") */
ch = name.charAt(3);

that when it gets "org" it can get the 4 the (position 3) char
That bombs out now

This is because NativeJavaPackage tries to load anything that it gets
through its get method so it does try "org" until it sees somethign that is
a class. (so org.xxx then org.xxx.Yyy will be seen as a class)

I guess that code could be written with a simple length check in that if
above
or write it a bit different and have something like:

 } else if (isClassName && name.startsWith("org.apache.")) {
  /* 11 == length("org.apache.") */
  if (name.startsWith("tomcat.jdbc.", 11)) {
  return false;
  }
  if (name.startsWith("el.", 11) ||
  name.startsWith("catalina.", 11) ||
  name.startsWith("jasper.", 11) ||
  name.startsWith("juli.", 11) ||
  name.startsWith("tomcat.", 11) ||
  name.startsWith("naming.", 11) ||
  name.startsWith("coyote.", 11)) {
  return true;
  }
  } else if (!isClassName && name.startsWith("org/apache/")) {
/* 11 == length("org/apache/") */
if (name.startsWith("tomcat/jdbc/", 11)) {
return false;
}
if (name.startsWith("el/", 11) ||
name.startsWith("catalina/", 11) ||
name.startsWith("jasper/", 11) ||
name.startsWith("juli/", 11) ||
name.startsWith("tomcat/", 11) ||
    name.startsWith("naming/", 11) ||
name.startsWith("coyote/", 11)) {
return true;
}
}

*that seems a bit shorter and should do the same.*

-- 
Johan Compagner
Servoy


Re: Time zone in all web application pages revert to UTC !

2016-03-22 Thread Johan Compagner
On 22 March 2016 at 07:40, Utkarsh Dave  wrote:

> Hi Users and Tomcat team,
>
> We are having this weird issue seen in all the web application pages where
> time gets changed to UTC after some days.
> As a workaround it works fine until Tomcat is restarted, but after some
> days time in UTC is seen again. This is regardless of any time/time zone
> configured on the server (IST/PST).
> We are on linux 6.6 (with ntp running) and use java 1.7.0.95.
> Need your thoughts on this? Let me know if you need further information
> If i write a new java class inside tomcat directory and print the output to
> one of the log files and display java.util.TimeZone.getDefault().getID().
> it will give correct result.
> Is some attribute within Tomcat or jsp that gets reset ?
>
>
>
Are you using in 1 of your web applications something like Pack200 ?

Because that one set the the default timezone to UTC  (and tries to set
it back but if you are using in in a multi threaded way then it will
eventually stick to UTC)

Ofcourse there can be other stuff that just does that, sets the default
time zone at one point..


Re: Today's Tomcat 9 HTTP/2 webinar is now available on YouTube

2015-11-25 Thread Johan Compagner
thx,

one question i have, is server push always code?
because for me it is
if this js file is hit (served by the default servlet of tomcat i guess).
also send in this set..

So its kind of a configuration, or should i just use a filter for that?


On 25 November 2015 at 00:11, Mark Thomas <ma...@apache.org> wrote:

> All,
>
> As promised, today's webinar "Apache Tomcat 9: HTTP/2 Quick Start" is
> now available on the Apache Tomcat YouTube channel:
>
> https://www.youtube.com/channel/UCpqpJ0-G1lYfUBQ6_36Au_g
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Johan Compagner
Servoy


Re: [PROPOSAL] Tomcat Webinar series

2015-11-13 Thread Johan Compagner
On 12 November 2015 at 23:29, Mark Thomas <ma...@apache.org> wrote:

> - HTTP/2 and Tomcat 9


i am also interested in something for this, especially how we can configure
it server side so that 1 request can send over a whole bunch of files at
onces (server pusht)


-- 
Johan Compagner
Servoy


Re: java deserialization vulnerability for Tomcat 7/8

2015-11-11 Thread Johan Compagner
On 11 November 2015 at 14:44, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Tomcat could potentially be
> used as an attack vector against a system by someone with write-access
> to the part of the filesystem where Tomcat stores its serialized session
> objects during a restart
>

if you already can do that... then i think there are other problems first ;)


-- 
Johan Compagner
Servoy


Re: java deserialization vulnerability for Tomcat 7/8

2015-11-11 Thread Johan Compagner
don't think tomcat by default ships with commons collections

But of course its not just commons collections its a more generic problem
that could be hit if there are more special classes that do special things
in deserialization.

i do think that tomcat by default (even the manager app or there jmx proxy
servlet) doesn't use java serialization to the outside world
And the jmx port should be default only accessible from localhost



On 11 November 2015 at 13:58, satish jupalli <jupal...@gmail.com> wrote:

> Hi,
>
> Would like to get your opinion on the java deserialization vulnerability
> issue for Tomcat. As Jboss seems to have been impacted with, is there a way
> to verify wether this vulnerability affects Tomcat as well?
>
> Regards
> SJ
>



-- 
Johan Compagner
Servoy


Re: is there already a case for web-fragment.xml in the war and then unpack=false option to not extract the war?

2015-10-09 Thread Johan Compagner
a case is created:

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



On 22 September 2015 at 11:37, Mark Thomas <ma...@apache.org> wrote:

> On 22/09/2015 10:25, Johan Compagner wrote:
> > Hi,
> >
> > when we have a webfragment in our war  to enable i think that absolute
> > ordering
> > we get this exception?:
>
> Tomcat version?
>
> Mark
>
>
> >
> > 21-Sep-2015 14:15:11.355 SEVERE [localhost-startStop-1]
> >
> org.apache.catalina.startup.ContextConfig.processServletContainerInitializers
> > Failed to process JAR found at URL [/post_install_test] for
> > ServletContainerInitializers for context with name [{1}]
> >  java.net.MalformedURLException: no !/ in spec
> >   at java.net.URL.(Unknown Source)
> >   at java.net.URL.(Unknown Source)
> >   at java.net.URL.(Unknown Source)
> >   at java.net.JarURLConnection.parseSpecs(Unknown Source)
> >   at java.net.JarURLConnection.(Unknown Source)
> >   at sun.net.www.protocol.jar.JarURLConnection.(Unknown Source)
> >   at sun.net.www.protocol.jar.Handler.openConnection(Unknown Source)
> >   at java.net.URL.openConnection(Unknown Source)
> >   at java.net.URL.openStream(Unknown Source)
> >   at
> org.apache.catalina.startup.WebappServiceLoader.parseConfigFile(WebappServiceLoader.java:156)
> >   at
> org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:113)
> >   at
> org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1597)
> >   at
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1125)
> >   at
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)
> >   at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
> >   at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> >   at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >   at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5069)
> >   at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> >   at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
> >   at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
> >   at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
> >   at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
> >   at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1704)
> >   at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)
> >   at java.util.concurrent.FutureTask.run(Unknown Source)
> >   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
> >   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> >   at java.lang.Thread.run(Unknown Source)
> > Caused by: java.lang.NullPointerException: no !/ in spec
> >   at sun.net.www.protocol.jar.Handler.parseAbsoluteSpec(Unknown
> Source)
> >   at sun.net.www.protocol.jar.Handler.parseURL(Unknown Source)
> >   ... 29 more
> >
> >
> > if we say to tomcat8 to not extract the war (unpack=false)
> >
> >
> > This is completely outside of the application itself because it is
> > trying to start it. when unpack is default (true) then it works fine.
> >
> >
> > so in our WEB-INF/web.xml we have:
> >
> >
> >   
> > servoy_ngclient
> >   
> >
> >
> >
> > and then in the WEB-INF/lib/ngclient.jar/META-INF/web-fragement.xml
> >
> >
> > http://java.sun.com/xml/ns/javaee;
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> > http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd; version="3.0">
> >   servoy_ngclient
> > 
> >
> >
> > If we remove that ordering and/or the web-fragement.xml then it starts
> > working again
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Johan Compagner
Servoy


is there already a case for web-fragment.xml in the war and then unpack=false option to not extract the war?

2015-09-22 Thread Johan Compagner
Hi,

when we have a webfragment in our war  to enable i think that absolute
ordering
we get this exception?:

21-Sep-2015 14:15:11.355 SEVERE [localhost-startStop-1]
org.apache.catalina.startup.ContextConfig.processServletContainerInitializers
Failed to process JAR found at URL [/post_install_test] for
ServletContainerInitializers for context with name [{1}]
 java.net.MalformedURLException: no !/ in spec
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.JarURLConnection.parseSpecs(Unknown Source)
at java.net.JarURLConnection.(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.(Unknown Source)
at sun.net.www.protocol.jar.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at 
org.apache.catalina.startup.WebappServiceLoader.parseConfigFile(WebappServiceLoader.java:156)
at 
org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:113)
at 
org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1597)
at 
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1125)
at 
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)
at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5069)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1704)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: no !/ in spec
at sun.net.www.protocol.jar.Handler.parseAbsoluteSpec(Unknown Source)
at sun.net.www.protocol.jar.Handler.parseURL(Unknown Source)
... 29 more


if we say to tomcat8 to not extract the war (unpack=false)


This is completely outside of the application itself because it is
trying to start it. when unpack is default (true) then it works fine.


so in our WEB-INF/web.xml we have:


  
servoy_ngclient
  



and then in the WEB-INF/lib/ngclient.jar/META-INF/web-fragement.xml


http://java.sun.com/xml/ns/javaee;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd; version="3.0">
servoy_ngclient



If we remove that ordering and/or the web-fragement.xml then it starts
working again


-- 
Johan Compagner
Servoy


Re: is there already a case for web-fragment.xml in the war and then unpack=false option to not extract the war?

2015-09-22 Thread Johan Compagner
just quickly tested it and 8.0.26 so the latest has this problem

On 22 September 2015 at 11:37, Mark Thomas <ma...@apache.org> wrote:

> On 22/09/2015 10:25, Johan Compagner wrote:
> > Hi,
> >
> > when we have a webfragment in our war  to enable i think that absolute
> > ordering
> > we get this exception?:
>
> Tomcat version?
>
> Mark
>
>
> >
> > 21-Sep-2015 14:15:11.355 SEVERE [localhost-startStop-1]
> >
> org.apache.catalina.startup.ContextConfig.processServletContainerInitializers
> > Failed to process JAR found at URL [/post_install_test] for
> > ServletContainerInitializers for context with name [{1}]
> >  java.net.MalformedURLException: no !/ in spec
> >   at java.net.URL.(Unknown Source)
> >   at java.net.URL.(Unknown Source)
> >   at java.net.URL.(Unknown Source)
> >   at java.net.JarURLConnection.parseSpecs(Unknown Source)
> >   at java.net.JarURLConnection.(Unknown Source)
> >   at sun.net.www.protocol.jar.JarURLConnection.(Unknown Source)
> >   at sun.net.www.protocol.jar.Handler.openConnection(Unknown Source)
> >   at java.net.URL.openConnection(Unknown Source)
> >   at java.net.URL.openStream(Unknown Source)
> >   at
> org.apache.catalina.startup.WebappServiceLoader.parseConfigFile(WebappServiceLoader.java:156)
> >   at
> org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:113)
> >   at
> org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1597)
> >   at
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1125)
> >   at
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)
> >   at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
> >   at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> >   at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >   at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5069)
> >   at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> >   at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
> >   at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
> >   at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
> >   at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
> >   at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1704)
> >   at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)
> >   at java.util.concurrent.FutureTask.run(Unknown Source)
> >   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
> >   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> >   at java.lang.Thread.run(Unknown Source)
> > Caused by: java.lang.NullPointerException: no !/ in spec
> >   at sun.net.www.protocol.jar.Handler.parseAbsoluteSpec(Unknown
> Source)
> >   at sun.net.www.protocol.jar.Handler.parseURL(Unknown Source)
> >   ... 29 more
> >
> >
> > if we say to tomcat8 to not extract the war (unpack=false)
> >
> >
> > This is completely outside of the application itself because it is
> > trying to start it. when unpack is default (true) then it works fine.
> >
> >
> > so in our WEB-INF/web.xml we have:
> >
> >
> >   
> > servoy_ngclient
> >   
> >
> >
> >
> > and then in the WEB-INF/lib/ngclient.jar/META-INF/web-fragement.xml
> >
> >
> > http://java.sun.com/xml/ns/javaee;
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> > http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd; version="3.0">
> >   servoy_ngclient
> > 
> >
> >
> > If we remove that ordering and/or the web-fragement.xml then it starts
> > working again
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Johan Compagner
Servoy


Re: Tomcat 7 (7.0.54) memory consuption is very high(3 times) than Tomcat 6 (6.0.28)

2015-03-24 Thread Johan Compagner


 I understand all that.  But the basic view, from a sysadmin's point of
 view is this :

 Tomcat 6(6.0.28)
 Virtual Memory: 6772 MB
 Resident Memory: 81 MB

 Tomcat 7(7.0.54)
 Virtual Memory: 6778 MB
 Resident Memory: 148 MB


what does that Resident exactly mean here?
i guess the total heap the java vm has taken after startup?

Because that could be quite logical, maybe tomcat 7 needs a lot more data
because of that annotation scanning
Doesn't it load in way more classes?
All that processing and then also maybe loading in up front way more
classes then before will mean that the heap (and none heap in this
scenario) is already way more loaded.

johan


Re: How to access Sessions outside of class

2014-10-28 Thread Johan Compagner


 I would like to be able to access my sessions from an external java class,
 however each time I do sessionList.getsize() it keeps coming back as 0, but
 there is an active sessions. Is there any way I can access the active
 sessions in tomcat from an external java class?

 Jason


What is an external java class? Is it in the same class loader? so it is
just part of the webapplication?
then the above approach should work fine


-- 
Johan Compagner
Servoy


Re: Embedded Tomcat

2014-10-15 Thread Johan Compagner
maybe you are interested in this one:

https://github.com/Servoy/servoy-eclipse-tomcat

thats also a osgi enabled tomcat (but the full tomcat) we use that one
right in eclipse, where other plugins just contribute filters and servlets


On 14 October 2014 23:56, Achim Nierbeck bcanh...@googlemail.com wrote:

 Hi

 I'm currently working on integrating embedded tomcat in the OPS4j Pax Web
 OSGi container as alternativ underlying web container. Right now I'm stuck
 on a certain point that is kind of hard to understand so I'm sure I'm doing
 something awfully wrong :)

 So here is what I'm struggling with.
 Using Tomcat 8 embedded core
 While the context is started I eventually end up at [1]
 This is the point I don't get cause I'd expect Servlets to be started at
 [2], but obviously the Servlets are already started at [1]. Therefore the
 ServletContainerInitializers are never called [3].

 Now my question, what am I doing wrong, as all servlets are registered as
 children.

 I'm very well aware that these questions might not really make a lot of
 sense, therefore you'll find the current implementation at [4].

 regards, Achim

 [1] -

 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5098

 [2] -

 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5229
 [3] -

 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5182
 [4] -

 https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java#L342


 --

 Apache Member
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer 
 Project Lead
 blog http://notizblog.nierbeck.de/
 Co-Author of Apache Karaf Cookbook http://bit.ly/1ps9rkS

 Software Architect / Project Manager / Scrum Master




-- 
Johan Compagner
Servoy


Re: Embedded Tomcat

2014-10-15 Thread Johan Compagner
yes we tried to go that way with whiteboard registration also (jetty is
shipped by default in eclipse also with that)
but that was way to hard to control and to really configure the way we want
so we decided to make tomcat a full osgi package itself.

On 15 October 2014 12:13, Achim Nierbeck bcanh...@googlemail.com wrote:

 Hi Johan,

 thanks for the pointer. To me it looks like it does have a different scope.
 Pax Web has been one of the first OSGi HttpService providers with
 additional support for Web Application Bundles (std. war with OSGi
 Manifest)
 This has been achieved so far very successfully with Jetty. Now we try to
 add additional Containers like Tomcat and Undertow.
 As for this Pax Web needs to be the one in control over registering
 Servlets etc. by either HttpService registration, Whiteboard registration
 or by using the bundle-extender approach.
 You could regard this to be a mediation layer between the OSGi Service
 Registry and the underlying web-container.

 regards, Achim


 2014-10-15 11:46 GMT+02:00 Johan Compagner jcompag...@servoy.com:

  maybe you are interested in this one:
 
  https://github.com/Servoy/servoy-eclipse-tomcat
 
  thats also a osgi enabled tomcat (but the full tomcat) we use that one
  right in eclipse, where other plugins just contribute filters and
 servlets
 
 
  On 14 October 2014 23:56, Achim Nierbeck bcanh...@googlemail.com
 wrote:
 
   Hi
  
   I'm currently working on integrating embedded tomcat in the OPS4j Pax
 Web
   OSGi container as alternativ underlying web container. Right now I'm
  stuck
   on a certain point that is kind of hard to understand so I'm sure I'm
  doing
   something awfully wrong :)
  
   So here is what I'm struggling with.
   Using Tomcat 8 embedded core
   While the context is started I eventually end up at [1]
   This is the point I don't get cause I'd expect Servlets to be started
 at
   [2], but obviously the Servlets are already started at [1]. Therefore
 the
   ServletContainerInitializers are never called [3].
  
   Now my question, what am I doing wrong, as all servlets are registered
 as
   children.
  
   I'm very well aware that these questions might not really make a lot of
   sense, therefore you'll find the current implementation at [4].
  
   regards, Achim
  
   [1] -
  
  
 
 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5098
  
   [2] -
  
  
 
 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5229
   [3] -
  
  
 
 https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/core/StandardContext.java#L5182
   [4] -
  
  
 
 https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java#L342
  
  
   --
  
   Apache Member
   Apache Karaf http://karaf.apache.org/ Committer  PMC
   OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/
 Committer
  
   Project Lead
   blog http://notizblog.nierbeck.de/
   Co-Author of Apache Karaf Cookbook http://bit.ly/1ps9rkS
  
   Software Architect / Project Manager / Scrum Master
  
 
 
 
  --
  Johan Compagner
  Servoy
 



 --

 Apache Member
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer 
 Project Lead
 blog http://notizblog.nierbeck.de/
 Co-Author of Apache Karaf Cookbook http://bit.ly/1ps9rkS

 Software Architect / Project Manager / Scrum Master




-- 
Johan Compagner
Servoy


Re: tomcat 8 depends on URL.setURLStreamHandlerFactory method

2014-10-02 Thread Johan Compagner
thx mark,

that seems to work, at least i do get further but i bomb into the next issue
that is in this code of StandardRoot

protected void startInternal() throws LifecycleException {
String docBase = context.getDocBase();

File f = new File(docBase);
if (!f.isAbsolute()) {
f = new File(((Host)context.getParent()).getAppBaseFile(),
f.getName());
}


The problem here is that docBase for us is not absolute, but is a relative,
(which is why there is a test there)
The problem is that f.getName() is used there. Because that only gives pack
the last part of the filename
So if the name was something like:

dir1/dir2

then only dir2 is returned and of course appbase (which is mostly
tomcat\webapps) + dir2 is not an actual dir

For us the doc base is: ../../plugins so it ends up in webapps\plugins
which is not correct it needs to go 2 dirs up..

So the current code only works for a docbase that is a single name that has
to be in the appbase folder.
I think it would be better to just use the docBase string as is instead of
using f.getName(), but there could be a reason that tomcat needs this ?

Johan


On 1 October 2014 20:44, Mark Thomas ma...@apache.org wrote:

 On 01/10/2014 16:59, Johan Compagner wrote:
  Hi,
 
  we have tomcat completely as an OSGI plugin project:
 
 
 https://github.com/Servoy/servoy-eclipse-tomcat/tree/master/org.apache.tomcat
 
  so that we can start it from our eclipse application and also dynamically
  add servlets and filters from all kinds of plugins (so everything is osgi
  based)
 
  Our app uses websockets quite heavily so  i thought lets update now to
 the
  latest 8 that has a lot of improvements in this area.
 
  Problem is that in StandardRoot
 
 
 https://apache.googlesource.com/tomcat/+/defeda9492a54194ea56e4a8220069608a7aa8f0/java/org/apache/catalina/webresources/StandardRoot.java
 
  there is a line:
 
  TomcatURLStreamHandlerFactory.register();
 
  in the internalInit
 
  this tries to call URL.setURLStreamHandlerFactory(this);
  in the constructor of that TomcatURLStreamHandlerFactory class
 
  but this is in eclipse or i guess in an osgi environment not really
 possible
  because that is already set so now it bombs out with factory al ready
 set
  error
 
  Is there any workaround for this or is there any way to improve tomcat 8
 so
  that it places nicer inside an osgi container like eclipse?

 You need to call the static disable() method before you start Tomcat.
 That will stop Tomcat trying to register the factory.

 If you want to be able to use WAR URLs (necessary to support web
 applications that are packaged as WARs and *not* unpacked) then you'll
 need to register the WarURLStreamHandler with whatever factory you have
 configured.

 Mark


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




-- 
Johan Compagner
Servoy


Re: [ANN] Apache Tomcat 8.0.14 available

2014-10-01 Thread Johan Compagner
On 1 October 2014 10:48, Mark Thomas ma...@apache.org wrote:

 Please refer to the change log for the complete list of changes:
 http://tomcat.apache.org/tomcat-8.0-doc/changelog.html


that one only goes to max .12 (at least at this time)


-- 
Johan Compagner
Servoy


tomcat 8 depends on URL.setURLStreamHandlerFactory method

2014-10-01 Thread Johan Compagner
Hi,

we have tomcat completely as an OSGI plugin project:

https://github.com/Servoy/servoy-eclipse-tomcat/tree/master/org.apache.tomcat

so that we can start it from our eclipse application and also dynamically
add servlets and filters from all kinds of plugins (so everything is osgi
based)

Our app uses websockets quite heavily so  i thought lets update now to the
latest 8 that has a lot of improvements in this area.

Problem is that in StandardRoot

https://apache.googlesource.com/tomcat/+/defeda9492a54194ea56e4a8220069608a7aa8f0/java/org/apache/catalina/webresources/StandardRoot.java

there is a line:

TomcatURLStreamHandlerFactory.register();

in the internalInit

this tries to call URL.setURLStreamHandlerFactory(this);
in the constructor of that TomcatURLStreamHandlerFactory class

but this is in eclipse or i guess in an osgi environment not really possible
because that is already set so now it bombs out with factory al ready set
error

Is there any workaround for this or is there any way to improve tomcat 8 so
that it places nicer inside an osgi container like eclipse?

Or am i really stuck at Tomat 7 for now (and quite some time to come )

-- 
Johan Compagner
Servoy


Re: the latest tomcat 7.0.50 has a problem when used through osgi (like eclipse)

2014-02-27 Thread Johan Compagner
i just tested this under 7.0.52 that should have the fix (from 51 on
according to the change log)

but its still this: (if i look into apache-tomcat-7.0.52-src.zip)

 private static String idFor(String url) {
URL id = ServletContext.class.getResource(resources/ + url);
if (id == null) {
id = ServletContext.class.getResource(jsp/resources/ + url);
}
return id.toExternalForm();
}


so it still fails for me.



On 22 January 2014 13:02, Mark Thomas ma...@apache.org wrote:

 On 22/01/2014 11:56, Johan Compagner wrote:
  this is because tomcat expects that the 2 jars servlet-api.jar and
  jsp-api.jar are in the same classloader

 https://issues.apache.org/bugzilla/show_bug.cgi?id=56016

 http://svn.us.apache.org/repos/asf/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

 Mark


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




-- 
Johan Compagner
Servoy


Re: the latest tomcat 7.0.50 has a problem when used through osgi (like eclipse)

2014-02-27 Thread Johan Compagner
i download here:

http://archive.apache.org/dist/tomcat/tomcat-7/

.50 and .52

i look into org.apache.tomcat.util.descriptor.DigesterFactory

those 2 files are for the piece that is wrong exactly the same for me:

private static String idFor(String url) {
URL id = ServletContext.class.getResource(resources/ + url);
if (id == null) {
id = ServletContext.class.getResource(jsp/resources/ + url);
}
return id.toExternalForm();
}

both have that, but it should be:

private static String idFor(String url) {
URL id = ServletContext.class.getResource(resources/ + url);
if (id == null) {
id = JspContext.class.getResource(resources/ + url);
}
return id.toExternalForm();
}


i need to patch this before it works for me (because we are running tomcat
also in a OSGI enviroment and then
jsp-api and servlet-api jars are not the same classloader

They are bundles of there own. So you can't load jsp related xml files
(from the jsp-api jar) through the ServletContext.class
the id == null for me

johan




On 27 February 2014 12:07, Mark Thomas ma...@apache.org wrote:

 On 27/02/2014 10:58, Johan Compagner wrote:
  i just tested this under 7.0.52 that should have the fix (from 51 on
  according to the change log)
 
  but its still this: (if i look into apache-tomcat-7.0.52-src.zip)

 Still what? The code you quote below is the code from 7.0.52 which is
 not the same as the code in 7.0.50. The 7.0.52 code is only looking at
 resources from the JAR that the ServletContext class is located in.

   private static String idFor(String url) {
  URL id = ServletContext.class.getResource(resources/ + url);
  if (id == null) {
  id = ServletContext.class.getResource(jsp/resources/ +
 url);
  }
  return id.toExternalForm();
  }
 
 
  so it still fails for me.

 How does it fail? Are you sure you are using 7.0.52?

 Mark


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




-- 
Johan Compagner
Servoy


can i have programatically access to the ServerContainer (websocket) in tomcat 7?

2014-02-27 Thread Johan Compagner
Like what is described here?

http://dev.eclipse.org/mhonarc/lists/jetty-dev/msg01999.html


 ServerContainer container =
(ServerContainer)context.getAttribute(javax.websocket.server.ServerContainer
);
try
{
container.addEndpoint(EchoSocket.class);


i need a way to add fully programatically a Websocket endpoint to the
context/container

i also can't use the ApplicationConfig because that one also needs to be
scanned by tomcat first
the classes are not in the web app. they are coming from osgi and are
provided by the system
So i need a way to add them on the fly to a context

this is what i just tried:

Catalina catalina = new Catalina();
catalina.setParentClassLoader(new
OSGIWebappClassLoader(TomcatStarter.class.getClassLoader()));
catalina.load();
 Service[] services = catalina.getServer().findServices();
for (Service service : services) {
Container[] containers = service.getContainer().findChildren();
 for (Container host : containers) {
Container[] contexts = host.findChildren();
for (Container container : contexts) {
 StandardContext sc = (StandardContext) container;
ServletContext context = sc.getServletContext();
 ServerContainer serverContainer =
(ServerContainer)context.getAttribute(javax.websocket.server.ServerContainer);
System.err.println(serverContainer);

But that attribute doesn't seem to be there at least at that time

Any body an idea?

(it doesn't have to be a standard servlet way, i can use the tomcat api
itself if needed)

johan
-- 
Johan Compagner
Servoy


Re: the latest tomcat 7.0.50 has a problem when used through osgi (like eclipse)

2014-02-27 Thread Johan Compagner
On 27 February 2014 15:16, Mark Thomas ma...@apache.org wrote:

 Sorry, I got confused about what changed between which 7.0.x and 8.0.x
 versions. There was a lot of rapid changes over a short period of time
 as folks reported different issues.

 The solution you propose is not acceptable as it causes other problems:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=56045

 The solution in 7.0.x (and released in 7.0.51) was to place all of the
 necessary schema in the Servlet JAR.

  i need to patch this before it works for me (because we are running
 tomcat
  also in a OSGI enviroment and then
  jsp-api and servlet-api jars are not the same classloader
 
  They are bundles of there own. So you can't load jsp related xml files
  (from the jsp-api jar) through the ServletContext.class
  the id == null for me

 What code path is trying to load JSP XML files from jsp-api.jar? Tomcat
 should be loading them all from servlet-api.jar


ahh

the servlet-api.jar that now ships with tomcat has now also a copy of the
same resources the jsp-api.jar also has
So the
  if (id == null) {
id = JspContext.class.getResource(resources/ + url);
  }

should never be hit anymore in a real tomcat install

The problem why i still have it is because i use a servlet-api bundle osgi
bundle not coming from tomcat.
(i would need to patch the manifest file to be able to use it as a real
osgi bundle in eclipse)

But i understand now that the fix was differently applied and why i still
had problems with it.

(tomcat kind of changed the standard, jsr api lib ;) )

johan




-- 
Johan Compagner
Servoy


Re: can i have programatically access to the ServerContainer (websocket) in tomcat 7?

2014-02-27 Thread Johan Compagner
thx,

On 27 February 2014 15:25, Mark Thomas ma...@apache.org wrote:


 You haven't started the Context so the attributes won't have been
 populated.

 Try adding a ContextListener to the context and use that to set up the
 endpoints using the programmatic API.

 Mark



I have it working for WebSocket endpoints yes. Those can be added at
anytime it seems on the fly

Problem is that i want to do the same for servlets and filters (then onces
that are annotated).. But the context is already initialized
so even call ServletContext.addFilter(Filter.class)
directly after Catalina.load(); (but before start()) will already result in:

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.IllegalStateException:
Filters can not be added to context /beans as the context has been
initialised
 at java.util.concurrent.FutureTask.report(Unknown Source)


or is it possible to do something directly on the StandardContext ?

johan





-- 
Johan Compagner
Servoy


Re: Tomcat 6.0.26 on Windows server - sessions are not expired

2014-02-03 Thread Johan Compagner
On 3 February 2014 09:30, Maor Yosef maoryo...@gmail.com wrote:

 2. You are right, it was my mistake, it causes OOM and not stack overflow,
 when we see high sessions count we get exceptions saying unable to create
 new native thread


do you use a 32 bit vm?

Because most of the time when i see this i ask the same question, and most
of the time that is then true
and they have specified quite a high heap size.
If you do that then the native part of the memory that a 32 bit process can
have is getting small


-- 
Johan Compagner
Servoy


Re: Deny Put Delete

2014-01-24 Thread Johan Compagner


 I've dealt with similar nonsensical compliance scans before, and
 my response was:

 You believe you can PUT or DELETE files on this installation?

 ** makes popcorn **

 Please proceed. I'll sit here and watch. Take your time.

 Morons. Bane of productive peoples' existence.

 Also, a special place in hell for the writers of these scanners...
 /rant
 --


Maybe even more stupid with this scanner could be that it only test for the
options request to see what it returns but does not do an actual test of it
really works?
Maybe i can have a server that only replies that it accepts a GET but
when i actually do fire a PUT or a DELETE the code does do something...

johan


Re: [OT] Out of memory exception - top posting

2014-01-24 Thread Johan Compagner
On 23 January 2014 20:08, André Warnier a...@ice-sa.com wrote:

 Ray Holme wrote:

 Doing anything as root conceals the errors. Tomcat is no exception and
 changing it to a real user makes your testing complete.


 Guys,
 I think that the rule (or should I say suggestion ?) on this list to *not*
 top-post is not working.
 Either people don't read the rules, or they do not understand the rule, or
 they just ignore it.


personally i don't like bottom posting, for me that reads way more annoying
But that is because i use gmail, and that one already nests it very nicely
and collapse all the bottom
So you read it already perfectly as if it was a bottom post.

So i really find all this in between and bottom post harder to read for
this list then any other list i used just because of that
i must scan way more through all the replies where the actual replies are

I don't mind for this list, so i do what others like to have, but i am very
happy that this is one of the few doing this...

-- 
Johan Compagner
Servoy


the latest tomcat 7.0.50 has a problem when used through osgi (like eclipse)

2014-01-22 Thread Johan Compagner
this is because tomcat expects that the 2 jars servlet-api.jar and
jsp-api.jar are in the same classloader

because org.apache.tomcat.util.descriptor.DigesterFactory has this method:

 private static String idFor(String url) {
URL id = ServletContext.class.getResource(resources/ + url);
if (id == null) {
id = ServletContext.class.getResource(jsp/resources/ + url);
}
return id.toExternalForm();
 }


thats kind of wrong, because ServletContext is in servlet-api but the
jsp/resources/ dir is in the jsp-api.jar
so ServletContext should not be used to get the jsp/resources from the
js-api.jar

i think the code should be something like

 private static String idFor(String url) {
URL id = ServletContext.class.getResource(resources/ + url);
if (id == null) {
id = JspContext.class.getResource(resources/ + url);
}
return id.toExternalForm();
 }


 So that at least the right classloader that also loads the JspContext is
used to get the jsp resources.



-- 
Johan Compagner
Servoy


Re: the latest tomcat 7.0.50 has a problem when used through osgi (like eclipse)

2014-01-22 Thread Johan Compagner
thx :)


On 22 January 2014 13:02, Mark Thomas ma...@apache.org wrote:

 On 22/01/2014 11:56, Johan Compagner wrote:
  this is because tomcat expects that the 2 jars servlet-api.jar and
  jsp-api.jar are in the same classloader

 https://issues.apache.org/bugzilla/show_bug.cgi?id=56016

 http://svn.us.apache.org/repos/asf/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

 Mark


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




-- 
Johan Compagner
Servoy


Re: serialization and newest tomcat

2014-01-13 Thread Johan Compagner


 IS THERE A WAY TO STOP WARNINGS AND TELL TOMCAT NOT TO SERIALIZE A BEAN?

 Right now, I have stopped warnings but caused other problems.


just don't add those beans to a session or if you do add them make sure
that they are in containers and that those fields are transient
then those fields (beans) are not serialized and they are null when they
are deserialized (so you need to refill them if they are needed)


-- 
Johan Compagner
Servoy


Re: Java to JavaScript RMI framework available.

2014-01-02 Thread Johan Compagner
does it also do the other way around?
So also having the endpoint on the server that has methods that can be
called from javascript in a very easy way?



On 31 December 2013 01:55, Igor Urisman igor.uris...@gmail.com wrote:

 Folks,

 I needed to write this for something I am working on and thought there
 might be a wider audience for it.
 Tomcat 8 supports standard compliant Websockets, which provide convenient
 asynchronous full-duplex
 server to client data transport. The framework I am offering builds on top
 of that a feature rich remote
 method invocation paradigm.  Please check it out.

 https://github.com/iurisman/FERMI
 Apache 2.0 license.

 Happy coding.
 Igor.




-- 
Johan Compagner
Servoy


Re: Accessing ServletContext from WebSocket endpoint

2013-12-07 Thread Johan Compagner
On 7 December 2013 04:48, Christopher Schultz
ch...@christopherschultz.netwrote:

   because i only see currently api to get the HttpSession and then
  through that the ServletContext, problem is that there is no http
  session..

 Aah... if there is no session, getHttpSession doesn't automatically
 create one(). Boo.



and can it create one?

if a browser does a ws: request that will be first just a http request i
guess that is then upgraded
But in that first request can cookies be send over? Because if a websocket
creates a http session then a jsessionid cookie must be set in the browser
 over the websocket request.
And that jsession cookie must then be used by also normal http request a
browser does to that server..

problem is that i don't want to create a session, i just want to
ServletContext to read some files.
So something like:

EndpointConfig.getUserProperties().put(ServletContext,request.get
Context());

That context can then just return an object which i need to cast and is
then up to the container to provide.

-- 
Johan Compagner
Servoy


Re: Accessing ServletContext from WebSocket endpoint

2013-12-06 Thread Johan Compagner
I ask the same question yes, but i still don't see a way to really do that
nicely through an EndpointConfig

So if somebody has a nice example that gets the Servletcontext that i then
can access in the websocket instance that would be nice
This example should be something different then what is given here:
http://stackoverflow.com/questions/17936440/accessing-httpsession-from-httpservletrequest-in-a-web-socket-socketendpoint

because i only see currently api to get the HttpSession and then through
that the ServletContext, problem is that there is no http session..



On 5 December 2013 21:18, Violeta Georgieva miles...@gmail.com wrote:

 Hi,


 2013/12/5 Enrico Olivelli eolive...@gmail.com
 
  Hi,
  is there a standard way to access ServletContext from a WebSocket
 ServerEndpoint ?

 Recently there was such discussion:

 http://markmail.org/message/pqkzatjastefxvd6?q=Tomcat+8+Websockets+configuration+list:org%2Eapache%2Etomcat%2Euser/

 Regards
 Violeta




-- 
Johan Compagner
Servoy


Re: Severe 7.0.47 startup performance regression

2013-12-05 Thread Johan Compagner


 Good.

 Remove the tomcat7-websocket.jar library if you do not need it.  This
 library (added in 7.0.47, a JSR-356 Java WebSocket 1.0 implementation)
 has a ServletContainerInitializer and thus forces Tomcat to perform
 annotation scanning.


Does anyone know why this wasn't done by using services? (SPI)
 So that we can directly point to a class that is the websocket or point to
a class that registers the websockets?

-- 
Johan Compagner
Servoy


  1   2   >