Re: Translations update

2018-12-13 Thread Woonsan Ko
Hi all,

Korean translation has just got to 100% line! Congrats to all the contributors!
I also see Japanese fellows making a breakthrough, approaching the
finish line. Congrats in advance!
I will proofread Korean translations next week one more or two.
Perhaps I can write something about how each term, phrase and sentence
were to be translated for other (Korean) translators.

Cheers,

Woonsan

On Wed, Nov 21, 2018 at 6:58 PM Mark Thomas  wrote:
>
> Hi all,
>
> I wanted to let you know about the amazing progress that is being made
> on the Tomcat translations at
> https://poeditor.com/join/project/NUTIjDWzrl
>
> In the short time since this effort has started the community has
> achieved the following:
>
> - French has increased from 18% to 64% coverage
> - Simplified Chinese has been added and has already reached 32% coverage
> - Korean has been added and has reached 10% coverage
> - German has increased from 2% to 7% coverage
> - Brazilian Portuguese has been added and has reached 4% coverage
> - Spanish has increased from 42% to 44% coverage
>
> as well as a smaller number of additions and corrections to another 6
> languages.
>
> A big thank you to everyone who has contributed.
>
> There is still lots to do so if you would like to help out please join
> us at:
> https://poeditor.com/join/project/NUTIjDWzrl
>
> Thanks,
>
> Mark
>
> -
> 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: Spring+Tomcat

2018-12-13 Thread Adlet Azhibek
>
> thanks a lot for your help! I got project with .jars in "lib" from
> previous developer. And I should update version of my spring, so I thought
> that there is a way to download tomcat with all libs in it. Now I inserted
> all neccessary libs manually one-by-one, and it works.
>
>


Re: Error running the application as WAR in tomcat 9

2018-12-13 Thread Kok How Teh
I filed a bug at Spring JIRA and this is the response I get (
https://jira.spring.io/browse/SPR-17599):

There seems to be a misunderstanding in that conversation on the Tomcat
mailing list: It's not that we can't find the class of the name
javax.websocket.server.ServerContainer, it's the *ServletContext
attribute* with
name "javax.websocket.server.ServerContainer" that we can't find. In other
words, we can't find a pre-initialized WebSocket container instance.

So the root of the problem you can easily reproduce without Spring: Simply
implement a Servlet and check the return value of
getServletContext().getAttribute("javax.websocket.server.ServerContainer")
...


People

   - Assignee:[image: juergen.hoeller] Juergen HoellerReporter:[image:
   khteh] Teh Kok HowLast updater:Juergen Hoeller


   - Votes:0 Vote for this issueWatchers:2 Start watching this issue



Dates

   - Created:YesterdayUpdated:YesterdayDays since last comment:10 hours, 48
   minutes ago


On Mon, Dec 10, 2018 at 11:41 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> KH,
>
> On 12/9/18 22:10, Kok How Teh wrote:
> > Hi; I use Spring Boot to develop GraphQL applications. However,
> > when the application is packaged as WAR and deployed to Tomcat 9,
> > it throws illegalstate exception. I have tried the workaround by
> > adding a ServletContextAware bean but it doesn't help on Tomcat 9.
> > I have filed 2 issues in separate github projects:
> >
> > https://github.com/eh3rrera/graphql-java-spring-boot-example/issues/10
> #issuecomment-445095690
> 
> >
> >
> > https://github.com/graphql-java-kickstart/graphql-spring-boot/issues/1
> 65
> >
> >  It's reported that the exception is only specific to Tomcat 9. Any
> > advice and insight is appreciated.
>
> Spring is throwing the exception. Tomcat ships with the
> javax.websocket.server.ServerContainer class.
>
> I don't believe there are any differences between Tomcat 8.5.x and
> 9.0.x when it comes to ClassLoader layout and class visibility.
>
> I'd ask Spring how they are performing that sanity check to see why
> they are throwing that exception.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwOiT0ACgkQHPApP6U8
> pFj3AhAAjhGBIid6nN/KUBJiIeuNHGi6A3pzJ9Gn4T5irwWgqvUS+i3nDvc63Od6
> vOVsMab0HdVUhIrzGkSNAr/dhK2TaOET2taDR9Q9OcnGorYOJ8xaG2uV5++ydI9D
> xk3rWWeBKbIH/ESElSyU4oJ7FtdL/+3LIi77+HZL8KrF0OOkn4Ac/pYJkH5BDslx
> Tds5OIhCiUUtsP621sLvcarqN+Dqx3/2iJSQMz7qWmPp9fqpzvkLquZcQHRbcYq1
> D7yrKxkr1lrjydqeXIEotfwCPOkai2WH97rFKru2rwZNriUzFUmz6k7OOgXIACRY
> WDKlyaqCWVmZR9UgBQ5xnxVkVY/CTDJO0KkT0mFbAtAD1VDT2Vx88ShhZPXlQWQu
> PtKeDMSNvt0Wsz9sbaewaHMSyGDNd+P8P0KURtSymTw+3IOMDLSaIIr8KvJFKpN1
> XXpho2tusH7YJEsXx9e1VnPUND+si6uMW+fVT51f3fjUos5S5LVD6lUjYDI9kvtY
> LiqB0lflXYLgLU6zQYGGwadU2lGlM9skSza+EzEdLaN1HjMHrwAEtUOa4C5k60x/
> 3snuiWj98aMrjG3KK18KJLnVsx18QDxj6ptTg9kRaZbCOCrfNWzgyBcAYmtgPjV9
> cP2MheADzGXO9bIsDPu4aOjND96X64yPLueKVBQuY9qyAmKFLeA=
> =sXt5
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: lingering mysql connections

2018-12-13 Thread HeeGu Lee
Hi, chris.

You can use apache commons-dbcp2-2.5.0.
This problem is fixed in this version.
And ServletContextListener is not necessary!

This is make you happy. :-)

Have a nice day!!!

2018년 12월 14일 (금) 오전 5:51, Chris Cheshire 님이 작성:

> Tomcat 9.0.12, Debian, MySQL Server 5.7.23, Connector/J 5.1.46
>
> I am trying to fix a lingering database connection problem. When I
> reload a context via the tomcat manager, connections to the
> datasources are not being released in mysql. They are still on the 30
> second activity cycle from the eviction thread. I can see this via
> 'show processlist' in the mysql client - the 'time' column resets at
> 30, and each connection has unique process ids that I can track per
> reload.
>
> I have tomcat home and base split (multiple instances of tomcat across
> different users), with the connector/j jar in tomcat_base/lib.
>
> In my webapp's META-INF/context.xml I have 3 different datasources,
> config, data, sched. All have configuration like :
>
>auth="Container"
> type="javax.sql.DataSource"
> driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql://localhost:3306/$DBNAME$?useUnicode=true&characterEncoding=utf8&useSSL=false"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> username="$USER$"
> password="$PASSWORD$"
> maxActive="2"
> maxIdle="1"
> minIdle="1"
> initialSize="1"
> maxWait="3"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> validationQuery="/* ping */"
> testOnBorrow="true"
> testWhileIdle="true"
> timeBetweenEvictionRunsMillis="3"
> defaultAutoCommit="false"
> defaultIsolation="READ_COMMITTED" />
>
> Connections are obtained via
>
> Connection dbConn = ((DataSource)new
> InitialContext().lookup(resourceName)).getConnection()
>
> Connections are all closed via
>
> dbConn.close()
>
> (Simplified greatly, there's convenience methods with exception
> handling in there)
>
>
>
> In contextDestroyed() of a ServletContextListener I am calling
>
> AbandonedConnectionCleanupThread.checkedShutdown();
>
> I have an initialization servlet that must be manually called before
> the webapp is fully online - it is used to load encrypted
> configuration from the conf datasource. It does not touch the data
> datasource, only conf and sched by virtue of starting the quartz
> scheduler which is configured to use this datasource.
>
> My observation are :
> * It doesn't matter what order I declare the datasources, they are
> always getting opened in the order sched, conf, data (judging by
> increased thread/process ids in mysql).
> * When I start tomcat, I get 3 open connections in mysql, 1 to each of
> the databases referenced by the datasources. If I immediately reload
> via the manager, all 3 connections are destroyed and 3 new ones are
> opened.
> * Once I call the initialization servlet, and subsequently reload the
> web app via the manager, previous connections to conf and sched are
> still open in mysql, as well as new ones
> * If I access any part of the web app that uses the data datasource,
> those connections now also linger.
> * Once I stop tomcat (and the JVM) all lingering connections are
> closed in mysql.
> * If I put the connector/j jar in my WEB-INF/lib instead of
> tomcat_base/lib, I get the following warning on reload/shutdown
>
> 13-Dec-2018 20:19:53.968 WARNING [ajp-nio-8019-exec-3]
> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc
> The web application [ct] registered the JDBC driver
> [com.mysql.jdbc.Driver] but failed to unregister it when the web
> application was stopped. To prevent a memory leak, the JDBC Driver has
> been forcibly unregistered.
>
> * There are no warnings or errors in catalina.out about abandoned
> connections during runtime, reload or shutdown of the tomcat instance.
> I have every connection being closed after use. (I have seen the
> warnings when I have made a code mistake however, so the thread is
> doing its job).
> * If I remove the abandoned connection and eviction thread
> configuration entirely, the connection activity timer resets on a 5
> second cycle in mysql. If I explicitly change
> timeBetweenEvictionRunsMillis to -1, the activity timer in mysql never
> resets (which implies that the default is not -1 as the documentation
> suggests)
>
> So it seems that once a datasource is accessed, connections to it
> perpetually linger in mysql until the JVM is shutdown.
>
> I have had this issue for a long time, through tomcat 7, 8.5 and 9,
> and multiple versions of mysql server and the connector., and also
> using the commons pool. On my sandboxes I tend to reload a lot as I
> deploy exploded, rather than deploy an entire WAR each time.
>
> Googling led to multiple old bug reports filed w/ MySQL about the
> cleanup thr

lingering mysql connections

2018-12-13 Thread Chris Cheshire
Tomcat 9.0.12, Debian, MySQL Server 5.7.23, Connector/J 5.1.46

I am trying to fix a lingering database connection problem. When I
reload a context via the tomcat manager, connections to the
datasources are not being released in mysql. They are still on the 30
second activity cycle from the eviction thread. I can see this via
'show processlist' in the mysql client - the 'time' column resets at
30, and each connection has unique process ids that I can track per
reload.

I have tomcat home and base split (multiple instances of tomcat across
different users), with the connector/j jar in tomcat_base/lib.

In my webapp's META-INF/context.xml I have 3 different datasources,
config, data, sched. All have configuration like :

  

Connections are obtained via

Connection dbConn = ((DataSource)new
InitialContext().lookup(resourceName)).getConnection()

Connections are all closed via

dbConn.close()

(Simplified greatly, there's convenience methods with exception
handling in there)



In contextDestroyed() of a ServletContextListener I am calling

AbandonedConnectionCleanupThread.checkedShutdown();

I have an initialization servlet that must be manually called before
the webapp is fully online - it is used to load encrypted
configuration from the conf datasource. It does not touch the data
datasource, only conf and sched by virtue of starting the quartz
scheduler which is configured to use this datasource.

My observation are :
* It doesn't matter what order I declare the datasources, they are
always getting opened in the order sched, conf, data (judging by
increased thread/process ids in mysql).
* When I start tomcat, I get 3 open connections in mysql, 1 to each of
the databases referenced by the datasources. If I immediately reload
via the manager, all 3 connections are destroyed and 3 new ones are
opened.
* Once I call the initialization servlet, and subsequently reload the
web app via the manager, previous connections to conf and sched are
still open in mysql, as well as new ones
* If I access any part of the web app that uses the data datasource,
those connections now also linger.
* Once I stop tomcat (and the JVM) all lingering connections are
closed in mysql.
* If I put the connector/j jar in my WEB-INF/lib instead of
tomcat_base/lib, I get the following warning on reload/shutdown

13-Dec-2018 20:19:53.968 WARNING [ajp-nio-8019-exec-3]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc
The web application [ct] registered the JDBC driver
[com.mysql.jdbc.Driver] but failed to unregister it when the web
application was stopped. To prevent a memory leak, the JDBC Driver has
been forcibly unregistered.

* There are no warnings or errors in catalina.out about abandoned
connections during runtime, reload or shutdown of the tomcat instance.
I have every connection being closed after use. (I have seen the
warnings when I have made a code mistake however, so the thread is
doing its job).
* If I remove the abandoned connection and eviction thread
configuration entirely, the connection activity timer resets on a 5
second cycle in mysql. If I explicitly change
timeBetweenEvictionRunsMillis to -1, the activity timer in mysql never
resets (which implies that the default is not -1 as the documentation
suggests)

So it seems that once a datasource is accessed, connections to it
perpetually linger in mysql until the JVM is shutdown.

I have had this issue for a long time, through tomcat 7, 8.5 and 9,
and multiple versions of mysql server and the connector., and also
using the commons pool. On my sandboxes I tend to reload a lot as I
deploy exploded, rather than deploy an entire WAR each time.

Googling led to multiple old bug reports filed w/ MySQL about the
cleanup thread, but nothing that would point to me doing anything
different than what I am doing. Are these lingering connections just a
fact of doing business with MySQL, or is there something I need to
configure/change in code to clean this up?


Thanks

Chris

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



Re: Request for a technical review

2018-12-13 Thread Mark Thomas
On 13/12/2018 08:33, Jäkel, Guido wrote:
> Dear Mallory and Mark,
> 
>   then I'm the one of the rare who use an "unusual" setups for more than 10 
> years :) . On a staged farm of about 3*10 Tomcat's we run a whole bunch of 
> "webapps"; most of them in at least two instances for failover.
> 
>   But I never configured more than one Service and one Engine: There is only 
> one Service , with an AJP Connector for the reverse proxy (Apache httpd + 
> Jakarta) and a http Connector for service purposes. Inside, there is one 
> Engine and inside this, there are a bundle of Hosts for each domain needed 
> for the applications and inside each hosts (using an individual appBase for 
> each domain), the deployments spawn contexts for each application running. 
> Among this hosts, there's also a "localhost" taking the admin applications. 
> This one is addressed via the http Connector.

What is unusual about that? Seems fairly standard virtual hosting to me.

Mark

> 
> Guido
> 
>> -Original Message-
>> From: Mark Thomas [mailto:ma...@apache.org]
>> Sent: Wednesday, December 12, 2018 3:26 PM
>> To: users@tomcat.apache.org
>> Subject: Re: Request for a technical review
>> The first architecture diagram:
>> - doesn't show any hosts
>> - incorrectly classes a "Service" as a "webapp" (a context is a webapp)
>> - shows the unusual setup of multiple services
> 
> -
> 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: Spring+Tomcat

2018-12-13 Thread Luis Rodríguez Fernández
Hello Adlet,

Regarding the deployment of spring in tomcat: I would recommend  you to
keep the application libraries (spring and others) in your WEB-INF/lib. You
can have a look at this fantastic tutorial [1].

About websockets: keep in mind that tomcat has out-of-the-box websocket
support. Nevertheless should not be a problem if you choose to use another
implementation that integrates better in your app. Me in the past I did
deploy some websockets [2] applications in tomcat and they worked.

Hope it helps,

Luis

[1] https://www.baeldung.com/spring-boot-war-tomcat-deploy
[2] https://github.com/Atmosphere/atmosphere



El jue., 13 dic. 2018 a las 5:51, Adlet Azhibek ()
escribió:

> *Hi all!*
> how should download a new version of tomcat with *necessary (.jar) files in
> a "lib" directory? I need, for example, "**spring-websocket-5. 1.3. RELEASE
> .jar" in "lib". What should I do? I've downloaded necessary jar files from
> *
> https://mvnrepository.com, *but it doesn't work**.*
>
>
>
> *best regards, Adlet Azhibek*
>
> *a.azhi...@cloudmaker.kz *
>
> *adl.c...@gmail.com *
> *+77474821894*
>


-- 

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

- Samuel Beckett


RE: Request for a technical review

2018-12-13 Thread Jäkel , Guido
Dear Mallory and Mark,

  then I'm the one of the rare who use an "unusual" setups for more than 10 
years :) . On a staged farm of about 3*10 Tomcat's we run a whole bunch of 
"webapps"; most of them in at least two instances for failover.

  But I never configured more than one Service and one Engine: There is only 
one Service , with an AJP Connector for the reverse proxy (Apache httpd + 
Jakarta) and a http Connector for service purposes. Inside, there is one Engine 
and inside this, there are a bundle of Hosts for each domain needed for the 
applications and inside each hosts (using an individual appBase for each 
domain), the deployments spawn contexts for each application running. Among 
this hosts, there's also a "localhost" taking the admin applications. This one 
is addressed via the http Connector.

Guido

>-Original Message-
>From: Mark Thomas [mailto:ma...@apache.org]
>Sent: Wednesday, December 12, 2018 3:26 PM
>To: users@tomcat.apache.org
>Subject: Re: Request for a technical review
>The first architecture diagram:
> - doesn't show any hosts
> - incorrectly classes a "Service" as a "webapp" (a context is a webapp)
> - shows the unusual setup of multiple services


Re: Spring+Tomcat

2018-12-13 Thread Olaf Kock
On 13.12.18 05:51, Adlet Azhibek wrote:
> *Hi all!*
> how should download a new version of tomcat with *necessary (.jar) files in
> a "lib" directory? I need, for example, "**spring-websocket-5. 1.3. RELEASE
> .jar" in "lib". What should I do? I've downloaded necessary jar files from *
> https://mvnrepository.com, *but it doesn't work**.*

Define "necessary": No Spring library is necessary for tomcat, so most
likely you can't download Tomcat anywhere *with* all the libraries that
you need for an arbitrary application.

If you have the libraries, you can copy them to tomcat's lib directory
yourself. Or better, bundle them in the webapp's WEB-INF/lib directory
for any webapp that requires them.

If you're a developer/vendor of an application that runs on Tomcat, your
installation instructions (and ideally the delivery package) should
include the libraries that your application requires (and that you're
willing to support). To equip your development environment with the
necessary dependencies, you'll need to use the appropriate way
prescribed by your build tool. E.g. if you use Maven, and you declare a
dependency as "provided", you better make sure that it is provided.

But ideally, have everything that you need in your webapp bundled in
WEB-INF/lib, rather than in tomcat's global lib/ directory.

Does that help, or did I miss an obvious aspect?

Olaf



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