Resource Request - MySQL Data Pool

2019-03-25 Thread Richard Huntrods
 It's time to update my application to use "real" (i.e. current 
best practices) data connection pooling.


My application is Java Servlets, no beans, no JSP. Database is MySQL.

System etc. details:
Ubuntu live server 18.04.2, built March 6, 2019.

MySQL - latest installed via 'apt-get install mysql-server' after system 
build.


OpenJVM - 11? - again, latest version installed via 'apt-get install 
default-jdk' at same time.


Tomcat 8.5.39 - just updated the same day it came out.

This system has been running in production since the early 2001's. OS 
has changed over the years from Sun Solaris 8.x to Solaris 10.x and now 
to Ubuntu 18.04 (server). Java has been updated over the years as well, 
as has Tomcat and MySQL. Through all that the system works quite perfectly.


Except... there are occasional hangs that implicate the 'home grown' 
data connection pool.  I wrote this by hand (in Java) back in 2001 
because there was nothing much available back then. Since it kept 
working, I didn't have the time/inclination to change over the years.


But the latest connector (mysql-connector-java-8.0.15.jar, a.k.a. 
"com.mysql.cj.jdbc.Driver" is giving me some hiccups. I thought rather 
than trying to debug my own connection pool, it was time to switch over 
to a proper "modern" supported connection pooling system.


Which brings me to my question.

Would the community please weigh in on the BEST tutorials / documents 
regarding creating a Tomcat/MySQL database connection pool for Servlets 
(not JSP or beans) with some good code examples and server.xml examples?


I've already done some extensive internet searches, but when you are 
doing something for the first time it's hard to tell the difference 
between "really really good" and "blogger who has not really tried it".


Thanks very much in advance.

-Richard


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


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



RE: Access to server denied

2019-03-25 Thread Peter Henriques
Hi Luis,

Its alright. I have uninstalled tomcat on zos USS and will attempt to run an 
install using the tomcat JCL instead.

Thanks anyway.

Peter

-Original Message-
From: Luis Rodríguez Fernández [mailto:uo67...@gmail.com] 
Sent: 25 March 2019 12:55
To: Tomcat Users List 
Subject: Re: Access to server denied

Hello Peter,

I am bit confused: you get the forbidden error after a successful login in the 
third party product? Is that third party product installed in a different 
machine? Which product? Is any kind of SSO solution (keycloak, Microsoft ASDF, 
OpenAM...)? May I ask you to describe a bit your scenario, please?

Best regards,

Luis







El lun., 25 mar. 2019 a las 10:18, Peter Henriques (<
peter.henriq...@macro4.com>) escribió:

> Hello,
>
>
>
> I have successfully installed Tomcat 8.5.39 on z/OS 2.3 under USS. I 
> use the native IBM Java utility.  However I have to connect to a third 
> party product which presents a web front end with a username/password panel.
>
> This is the error I get when I connect zos23.intranet.XX.com:
> portnumber/app/#login:
>
>
>
> *HTTP Status 403 – Forbidden*
> --
>
> *Type* Status Report
>
> *Message* /App/
>
> *Description* The server understood the request but refuses to 
> authorize it.
> --
>
> *Apache Tomcat/8.5.39*
>
>
>
> Is this purely a permissions issue with RACF or is there an error with 
> my config with permissible usernames.
>
>
>
> Regards
>
>
>
> *Peter M Henriques*
>
> *Support Engineer – Mainframe Support Group*
>
> *D:* +44-1293-872072 | *T:* +44-1293-872000 | www.macro4.com
>
>
>
>    
>  
> 
>
>
>
> Registered office: The Orangery, Turners Hill Road, Worth, Crawley, 
> West Sussex, RH10 4SS
>
> Registered in England no: 00927588
>
>
>
> Please consider the environment and only print this email if you 
> really need to.
>
>
>
> This e-mail message has been scanned and cleared by Google Message 
> Security and the UNICOM Global security systems. This message is for 
> the named person's use only. If you receive this message in error, 
> please delete it and notify the sender.
>


-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett

-- 
This e-mail message has been scanned and cleared by Google Message Security 
and the UNICOM Global security systems. This message is for the named 
person's use only. If you receive this message in error, please delete it 
and notify the sender. 

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



RE: [EXTERNAL] Re: Could not find datasource: java:/comp/env/jdbc/TOPSDB when start Tomcat 9.0.13

2019-03-25 Thread Hua, Gary - Saint Louis, MO - Contractor
Olaf:

   Thanks for the input.I removed jdbc2_0-stdext.jar  and tomcat-dbcp.jar   
from /opt/TomCat/apache-tomcat-9.0.13/webapps/TOPS-WEB/WEB-INF/lib  and did 
some cleaning on /opt/TomCat/apache-tomcat-9.0.13/lib,   now that is my lib 
folder looks like:


atadmin@eagnmnmed1f45:/opt/TomCat/apache-tomcat-9.0.13/webapps/TOPS-WEB/WEB-INF/lib>ls
 -l
total 20648
-rwxrwxrwx 1 atadmin atadmin  433164 Dec 17 17:47   antlr-2.7.5H3.jar
-rwxrwxrwx 1 atadmin atadmin   16777 Dec 17 17:45   asm-attrs.jar
-rwxrwxrwx 1 atadmin atadmin   26360 Dec 17 17:45asm.jar
-rwxrwxrwx 1 atadmin atadmin  281998 Dec 17 17:45   cglib-2.1.jar
-rwxrwxrwx 1 atadmin atadmin 1196109 Dec 17 17:47   classes12.jar
-rwxrwxrwx 1 atadmin atadmin 4604132 Dec 17 17:45   
com.ibm.ws.webcontainer.jar
-rwxrwxrwx 1 atadmin atadmin  188671 Dec 17 17:47   commons-beanutils.jar
-rwxrwxrwx 1 atadmin atadmin  165119 Dec 17 17:45   commons-collections.jar
-rwxrwxrwx 1 atadmin atadmin  205318 Mar 19 11:20   commons-dbcp2-2.6.0.jar
-rwxrwxrwx 1 atadmin atadmin  168446 Dec 17 17:47   commons-digester.jar
-rwxrwxrwx 1 atadmin atadmin   70604 Dec 17 17:45   
commons-fileupload-1.3.3.jar
-rwxrwxrwx 1 atadmin atadmin  214788 Dec 17 17:45   commons-io-2.6.jar
-rwxrwxrwx 1 atadmin atadmin  207723 Dec 17 17:47   commons-lang-2.1.jar
-rwxrwxrwx 1 atadmin atadmin  315805 Dec 17 17:47   commons-lang3-3.1.jar
-rwxrwxrwx 1 atadmin atadmin   26388 Dec 17 17:47   commons-logging.jar
-rwxrwxrwx 1 atadmin atadmin   84462 Dec 17 17:47   commons-validator.jar
-rwxrwxrwx 1 atadmin atadmin  210432 Dec 17 17:45   displaytag-1.1.jar
-rwxrwxrwx 1 atadmin atadmin   12590 Dec 17 17:45   
displaytag-export-poi-1.1.jar
-rwxrwxrwx 1 atadmin atadmin  312509 Dec 17 17:45   dom4j-1.5.2.jar
-rwxrwxrwx 1 atadmin atadmin   47531 Dec 17 17:45   ehcache-1.1.jar
-rwxrwxrwx 1 atadmin atadmin 1925498 Dec 17 17:45   hibernate3.jar
-rwxrwxrwx 1 atadmin atadmin   65425 Dec 17 17:45   jakarta-oro.jar
-rwxrwxrwx 1 atadmin atadmin 1979523 Dec 17 17:41   javaee-api-8.0.jar
-rwxrwxrwx 1 atadmin atadmin  153115 Dec 17 17:45   jdom.jar
-rwxrwxrwx 1 atadmin atadmin  414240 Dec 17 16:29jstl-1.2.jar
-rwxrwxrwx 1 atadmin atadmin8812 Dec 17 17:45   jta.jar
-rwxrwxrwx 1 atadmin atadmin  367444 Dec 17 17:45   log4j.jar
-rwxrwxrwx 1 atadmin atadmin 3698857 Mar 15 15:32   ojdbc7.jar
-rwxrwxrwx 1 atadmin atadmin  105355 Dec 17 17:45   old_lcms-webtools.jar
-rwxrwxrwx 1 atadmin atadmin  795231 Dec 17 17:45   
poi-2.5-final-20040302.jar
-rwxrwxrwx 1 atadmin atadmin   55210 Dec 17 17:45   
poi-contrib-2.5-final-20040302.jar
-rwxrwxrwx 1 atadmin atadmin  188942 Dec 17 17:45   
poi-scratchpad-2.5-final-20040302.jar
-rwxrwxrwx 1 atadmin atadmin  475943 Dec 17 17:45   proxool-0.8.3.jar
-rwxrwxrwx 1 atadmin atadmin  543706 Dec 17 17:47   struts.jar
-rwxrwxrwx 1 atadmin atadmin  495271 Dec 17 17:47   Struts-Layout.jar
-rwxrwxrwx 1 atadmin atadmin   68046 Dec 17 17:47   struts-menu-2.4.3.jar
-rwxrwxrwx 1 atadmin atadmin   39427 Dec 17 17:47   taglibs-request.jar
-rwxrwxrwx 1 atadmin atadmin   44061 Dec 17 17:45   
USPS-Framework-1.0.8-alpha.jar
-rwxrwxrwx 1 atadmin atadmin  834966 Dec 17 17:45   xercesImpl.jar


atadmin@eagnmnmed1f45:/opt/TomCat/apache-tomcat-9.0.13/lib>ls -l
total 13308
-rwxrwxrwx 1 atadmin atadmin   12966 Nov  2 09:29   annotations-api.jar
-rwxrwxrwx 1 atadmin atadmin   54415 Nov  2 09:29   catalina-ant.jar
-rwxrwxrwx 1 atadmin atadmin  120721 Nov  2 09:29   catalina-ha.jar
-rwxrwxrwx 1 atadmin atadmin 1652907 Nov 15 10:49   catalina.jar
-rwxrwxrwx 1 atadmin atadmin 1653788 Nov  2 09:29
catalina.jar.20181115-1049
-rwxrwxrwx 1 atadmin atadmin   78634 Nov  2 09:29   catalina-storeconfig.jar
-rwxrwxrwx 1 atadmin atadmin  338876 Nov  2 09:29   catalina-tribes.jar
-rwxrwxrwx 1 atadmin atadmin 2769774 Nov  2 09:29   ecj-4.7.3a.jar
-rwxrwxrwx 1 atadmin atadmin   87515 Nov  2 09:29   el-api.jar
-rwxrwxrwx 1 atadmin atadmin  167490 Nov  2 09:29jasper-el.jar
-rwxrwxrwx 1 atadmin atadmin  557374 Nov  2 09:29   jasper.jar
-rwxrwxrwx 1 atadmin atadmin   27900 Nov  2 09:29jaspic-api.jar
-rwxrwxrwx 1 atadmin atadmin   63167 Nov  2 09:29   jsp-api.jar
-rwxrwxrwx 1 atadmin atadmin 3698857 Mar 12 17:51   ojdbc7.jar
-rwxrwxrwx 1 atadmin atadmin  282576 Nov  2 09:29   servlet-api.jar
-rwxrwxrwx 1 atadmin atadmin   11212 Nov  2 09:29   tomcat-api.jar
-rwxrwxrwx 1 atadmin atadmin  845744 Nov  2 09:29   tomcat-coyote.jar
-rwxrwxrwx 1 atadmin atadmin  307435 Mar 19 17:42   tomcat-dbcp-9.0.13.jar
-rwxrwxrwx 1 atadmin atadmin   65303 Nov  2 09:29   tomcat-i18n-es.jar
-rwxrwxrwx 1 atadmin atadmin   39235 Nov  2 09:29   tomcat-i18n-fr.jar
-rwxrwxrwx 1 atadmin atadmin   42125 Nov  2 09:29   tomcat-i18n-ja.jar
-rwxrwxrwx 1 atadmin atadmin   12166 Nov  2 09:29   

Re: Inefficient ValueExpressionLiteral.getValue()

2019-03-25 Thread Mark Thomas
On 25/03/2019 12:48, Mark Thomas wrote:
> On 25/03/2019 08:40, Thibault Kruse wrote:
>> On Wed, Mar 20, 2019 at 7:04 PM Mark Thomas  wrote:
>>>
>>> On 20/03/2019 05:13, Thibault Kruse wrote:
 Hi,

 when migrating from Tomcat7 to Tomcat8 for an application using javax-el
 expression evaluation on every request, we noticed a significant
 performance impact.
>>>
>>> Try the latest 8.5.x implementation.
>>
>> It is the same issue with
>> * org.apache.tomcat:tomcat-jasper-el:8.5.38
>> * org.apache.tomcat:tomcat-jasper-el:8.5.39
>> * org.apache.tomcat:tomcat-jasper-el:9.0.14.1
>>
>>> If you still see an issue, a simple test case that reproduces the issue
>>> would be appreciated.
>>
>> This example project demonstrates the issue with a naive benchmark (I
>> know JMH would be better):
>> https://github.com/tkruse/javax-getvalue-slowdown
> 
> Thanks. That helps clarify the situation.
> 
> I can see the difference (a factor of between 3 and 4) running that code
> with Tomcat 7.0.x and 9.0.x. I'll have a look with a profiler.

The profiler didn't highlight any obvious bottlenecks. There was one
possibility but that turned out to be more an artefact of enabling
profiling than a true bottleneck.



>> We can also try adding a custom ELResolver to the
>> CompositeELResolver which handles the simple coercion cases, though
>> that seems a bit more complex since class ELResolver has a lot of
>> methods to implement.

I think that is actually the way to go. If you create a CoerceToResolver
and place it at the start of the CompositeELResolver you should see much
better performance although not quite as fast as 7.0.x

A custom resolver isn't as much work as it looks. You should be able to
NO-OP / return null most (all? - I'd need to check the spec) the methods
apart from convertToType() which then calls ELSupport.coerceToType(null,
obj, type);

If anyone spots something with a profiler that I have missed and has a
proposed patch to improve the EL performance I'd be happy to look at it.

HTH,

Mark

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



Re: Access to server denied

2019-03-25 Thread Luis Rodríguez Fernández
Hello Peter,

I am bit confused: you get the forbidden error after a successful login in
the third party product? Is that third party product installed in a
different machine? Which product? Is any kind of SSO solution (keycloak,
Microsoft ASDF, OpenAM...)? May I ask you to describe a bit your scenario,
please?

Best regards,

Luis







El lun., 25 mar. 2019 a las 10:18, Peter Henriques (<
peter.henriq...@macro4.com>) escribió:

> Hello,
>
>
>
> I have successfully installed Tomcat 8.5.39 on z/OS 2.3 under USS. I use
> the native IBM Java utility.  However I have to connect to a third party
> product which presents a web front end with a username/password panel.
>
> This is the error I get when I connect zos23.intranet.XX.com:
> portnumber/app/#login:
>
>
>
> *HTTP Status 403 – Forbidden*
> --
>
> *Type* Status Report
>
> *Message* /App/
>
> *Description* The server understood the request but refuses to authorize
> it.
> --
>
> *Apache Tomcat/8.5.39*
>
>
>
> Is this purely a permissions issue with RACF or is there an error with my
> config with permissible usernames.
>
>
>
> Regards
>
>
>
> *Peter M Henriques*
>
> *Support Engineer – Mainframe Support Group*
>
> *D:* +44-1293-872072 | *T:* +44-1293-872000 | www.macro4.com
>
>
>
>    
>  
> 
>
>
>
> Registered office: The Orangery, Turners Hill Road, Worth, Crawley, West
> Sussex, RH10 4SS
>
> Registered in England no: 00927588
>
>
>
> Please consider the environment and only print this email if you really
> need to.
>
>
>
> This e-mail message has been scanned and cleared by Google Message
> Security and the UNICOM Global security systems. This message is for the
> named person's use only. If you receive this message in error, please
> delete it and notify the sender.
>


-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett


Re: Inefficient ValueExpressionLiteral.getValue()

2019-03-25 Thread Mark Thomas
On 25/03/2019 08:40, Thibault Kruse wrote:
> On Wed, Mar 20, 2019 at 7:04 PM Mark Thomas  wrote:
>>
>> On 20/03/2019 05:13, Thibault Kruse wrote:
>>> Hi,
>>>
>>> when migrating from Tomcat7 to Tomcat8 for an application using javax-el
>>> expression evaluation on every request, we noticed a significant
>>> performance impact.
>>
>> Try the latest 8.5.x implementation.
> 
> It is the same issue with
> * org.apache.tomcat:tomcat-jasper-el:8.5.38
> * org.apache.tomcat:tomcat-jasper-el:8.5.39
> * org.apache.tomcat:tomcat-jasper-el:9.0.14.1
> 
>> If you still see an issue, a simple test case that reproduces the issue
>> would be appreciated.
> 
> This example project demonstrates the issue with a naive benchmark (I
> know JMH would be better):
> https://github.com/tkruse/javax-getvalue-slowdown

Thanks. That helps clarify the situation.

I can see the difference (a factor of between 3 and 4) running that code
with Tomcat 7.0.x and 9.0.x. I'll have a look with a profiler.

I will note at this point that the work-around commented out in that
test case is not specification compliant. For example, null coerced to
String should result in "".

Mark


> 
> In
> https://github.com/tkruse/javax-getvalue-slowdown/blob/dd4fbab443c31ccf4f791bb8b873cfcb3ebefc1b/src/test/java/javax/el/demo/BenchmarkEl.java#L73
> it is possible to bypass the unnecessary code (unnecessary for our
> use-case and likely many other use-cases), and reduce the slowdown
> somewhat. We can also try adding a custom ELResolver to the
> CompositeELResolver which handles the simple coercion cases, though
> that seems a bit more complex since class ELResolver has a lot of
> methods to implement.
> 
> But ideally we want to keep having apache-el:7 performance, and we
> currently consider shading apache-el:7 to run our code on Tomcat8 with
> shaded apache-el:7 as additional library on the classpath. If there
> was a better way to avoid the performance hit (without using all
> JavaEE7 language features), that would be useful to know.
> 
> 
>> Finally, note that org.mortbay.jasper:apache-el:8.0.33 is not something
>> that has been released by the Tomcat project.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: [OT] Question about the longevity of Java ..

2019-03-25 Thread Leon Rosenberg
Hi John,

personally I do not believe that this will ever happen, but for the sake of
an argument lets assume someone finally builds the skynet and assigns to it
the task to calculate PI with most precision. The skynet then takes over
and diverts all resources in the universe to PI calculation (killing or
enslaving all humans in the process) and calculates happily forever.
In such a case it will most definitely come up with another means of
communication as http, which is outdated even by human standards.
This new communication protocol will be implemented by something, which can
be called TomCat by coincidence, but will more likely be called something
0x234abe456d.
So no, there is no place for tomcat in the future ai.

As for your second question, tomcat to java is nothing close to what java
is to C. Tomcat is one of trillions of programs written with the language,
albeit a very useful and successful one. If you want something to be to
java as java to c, that would be scala (or something new yet to arise).

regards
Leon


On Mon, Mar 25, 2019 at 9:25 AM John Dale  wrote:

> Greetings;
>
> Generally speaking, how would folks feel about an AI taking over
> programming roles (and eventually requirements authoring)?
>
> My deepest curiosity may be this - at some point in the future, will
> AI use Tomcat as we do now, and does Tomcat get embedded deeply into
> some AI subsystem as a wholly complete heuristic collection (note
> lower case collection)?
>
> Or, does the low-level hardware finally climb its way up to Java, the
> most expressive programming language known to mankind, and relegate
> .NET, PHP, etc to their proper statio in life?
>
> Additionally, as such, in the future, when you buy your new computer
> from Wal Mart, it is a matter of deciding which Java/Tomcat flavor you
> want to have; I game, I porn, I database, I quilt, I skype, I like
> turtles?
>
> Second to lastly, is Tomcat to Java as is Java to C?  Will C
> eventually harden to static state and service Java like a good wife?
> Like .. a really good wife?
>
> I think these issues presently concern users of Java.
>
> Note: I have a B.A. in Philosophy with a Computer Science Minor, an MS
> MIS with Concentration in Entrepreneurship.
>
> Lastly, if you are immune to contextually relevant humor, perhaps you
> should reconsider that US H1B.
>
> Sincerely,
>
> John Dale, MS MIS/Entrepreneurship
>
> PS: Have a great week everyone.  Think hard this week (that's what she
> said).
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


[SECURITY] CVE-2019-0199 Apache Tomcat HTTP/2 DoS

2019-03-25 Thread Mark Thomas
CVE-2019-0199 Apache Tomcat HTTP/2 DoS

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Tomcat 9.0.0.M1 to 9.0.14
Apache Tomcat 8.5.0 to 8.5.37

Description:
The HTTP/2 implementation accepted streams with excessive numbers of
SETTINGS frames and also permitted clients to keep streams open without
reading/writing request/response data. By keeping streams open for
requests that utilised the Servlet API's blocking I/O, clients were able
to cause server-side threads to block eventually leading to thread
exhaustion and a DoS.

Mitigation:
Users of affected versions should apply one of the following mitigations:
- Upgrade to Apache Tomcat 9.0.16 or later
  Note: Apache Tomcat 9.0.15 contains the necessary fixes but was not
released
- Upgrade to Apache Tomcat 8.5.38 or later

Credit:
The issue with excessive SETTINGS frames was reported by Michal Karm
Babacek from Red Hat, Inc. As a result of his report the Tomcat Security
team identified additional issues related to read/write timeouts.


References:
[1] http://tomcat.apache.org/security-9.html
[2] http://tomcat.apache.org/security-8.html

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



Access to server denied

2019-03-25 Thread Peter Henriques
Hello,

I have successfully installed Tomcat 8.5.39 on z/OS 2.3 under USS. I use the 
native IBM Java utility.  However I have to connect to a third party product 
which presents a web front end with a username/password panel.
This is the error I get when I connect 
zos23.intranet.XX.com:portnumber/app/#login:

HTTP Status 403 - Forbidden

Type Status Report
Message /App/
Description The server understood the request but refuses to authorize it.

Apache Tomcat/8.5.39

Is this purely a permissions issue with RACF or is there an error with my 
config with permissible usernames.

Regards

Peter M Henriques
Support Engineer - Mainframe Support Group
D: +44-1293-872072 | T: +44-1293-872000 | www.macro4.com

[cid:image001.png@01D4E2EB.B0AA26C0]   
[cid:image002.png@01D4E2EB.B0AA26C0]  
 [cid:image003.png@01D4E2EB.B0AA26C0]   
[cid:image004.png@01D4E2EB.B0AA26C0]   
[cid:image005.png@01D4E2EB.B0AA26C0] 


Registered office: The Orangery, Turners Hill Road, Worth, Crawley, West 
Sussex, RH10 4SS
Registered in England no: 00927588

Please consider the environment and only print this email if you really need to.


-- 
This e-mail message has been scanned and cleared by Google Message Security 
and the UNICOM Global security systems. This message is for the named 
person's use only. If you receive this message in error, please delete it 
and notify the sender. 


Re: Inefficient ValueExpressionLiteral.getValue()

2019-03-25 Thread Thibault Kruse
On Wed, Mar 20, 2019 at 7:04 PM Mark Thomas  wrote:
>
> On 20/03/2019 05:13, Thibault Kruse wrote:
> > Hi,
> >
> > when migrating from Tomcat7 to Tomcat8 for an application using javax-el
> > expression evaluation on every request, we noticed a significant
> > performance impact.
>
> Try the latest 8.5.x implementation.

It is the same issue with
* org.apache.tomcat:tomcat-jasper-el:8.5.38
* org.apache.tomcat:tomcat-jasper-el:8.5.39
* org.apache.tomcat:tomcat-jasper-el:9.0.14.1

> If you still see an issue, a simple test case that reproduces the issue
> would be appreciated.

This example project demonstrates the issue with a naive benchmark (I
know JMH would be better):
https://github.com/tkruse/javax-getvalue-slowdown

In
https://github.com/tkruse/javax-getvalue-slowdown/blob/dd4fbab443c31ccf4f791bb8b873cfcb3ebefc1b/src/test/java/javax/el/demo/BenchmarkEl.java#L73
it is possible to bypass the unnecessary code (unnecessary for our
use-case and likely many other use-cases), and reduce the slowdown
somewhat. We can also try adding a custom ELResolver to the
CompositeELResolver which handles the simple coercion cases, though
that seems a bit more complex since class ELResolver has a lot of
methods to implement.

But ideally we want to keep having apache-el:7 performance, and we
currently consider shading apache-el:7 to run our code on Tomcat8 with
shaded apache-el:7 as additional library on the classpath. If there
was a better way to avoid the performance hit (without using all
JavaEE7 language features), that would be useful to know.


> Finally, note that org.mortbay.jasper:apache-el:8.0.33 is not something
> that has been released by the Tomcat project.

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



Question about the longevity of Java ..

2019-03-25 Thread John Dale
Greetings;

Generally speaking, how would folks feel about an AI taking over
programming roles (and eventually requirements authoring)?

My deepest curiosity may be this - at some point in the future, will
AI use Tomcat as we do now, and does Tomcat get embedded deeply into
some AI subsystem as a wholly complete heuristic collection (note
lower case collection)?

Or, does the low-level hardware finally climb its way up to Java, the
most expressive programming language known to mankind, and relegate
.NET, PHP, etc to their proper statio in life?

Additionally, as such, in the future, when you buy your new computer
from Wal Mart, it is a matter of deciding which Java/Tomcat flavor you
want to have; I game, I porn, I database, I quilt, I skype, I like
turtles?

Second to lastly, is Tomcat to Java as is Java to C?  Will C
eventually harden to static state and service Java like a good wife?
Like .. a really good wife?

I think these issues presently concern users of Java.

Note: I have a B.A. in Philosophy with a Computer Science Minor, an MS
MIS with Concentration in Entrepreneurship.

Lastly, if you are immune to contextually relevant humor, perhaps you
should reconsider that US H1B.

Sincerely,

John Dale, MS MIS/Entrepreneurship

PS: Have a great week everyone.  Think hard this week (that's what she said).

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



Re: Could not find datasource: java:/comp/env/jdbc/TOPSDB when start Tomcat 9.0.13

2019-03-25 Thread Olaf Kock



On 25.03.19 03:41, Hua, Gary - Saint Louis, MO - Contractor wrote:
> Hi experts:
> 
> After I deployed my application TOPS to Tomcat server(9.0.13) 
> on Linux box,  and started the server,  I got the following error:
> 
> 
> 1537 [main] FATAL connection.DatasourceConnectionProvider  - Could not find 
> datasource: java:/comp/env/jdbc/TOPSDB
> java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp2.BasicDataSource 
> cannot be cast to javax.sql.DataSource
> at 
> org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java>
> ...
> 
> I have tried to put different version of tomcat-dbcp.jar   like 
> tomcat-dbcp-7.0.47.jar/ tomcat-dbcp-8.0.23.jar/ tomcat-dbcp-9.0.13.jar  into 
> /opt/TomCat/apache-tomcat-9.0.13/lib, but not the same error occurred.

One way or another, the last sentence most likely is the most relevant
information, and key to solving your problem: Whenever a Java class
can't be typecast to its legitimate superclass or interface, this is a
clear sign that the superclass or interface can be found twice on the
classpath.

The error message only contains the class name, not the classloader, so
the root cause is effectively hidden. Make sure that
javax.sql.DataSource is nowhere to be found in your app's WEB-INF/lib,
and only once in tomcat's lib directory.

Olaf

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