Re: JDBC connection pooling maxActive or MaxTotal

2020-01-05 Thread Guang Chao
On Sat, Jan 4, 2020 at 2:47 AM Dave Bothwell 
wrote:

> Hello,
>
> I am using Tomcat 8.5.11 with JDBC connection pooling. Based on the
> documentation it is clear that DBCP pooling has changed the maxActive
> attribute to maxTotal. However it is unclear, based on this document
> https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
> pooling has also changed maxActive to maxTotal.
>
>
You can also have your own connection pooling from your application.  But
of course JNDI has advantage that it is decoupled and container supplies
the connection.


> Also, I am currently using both attributes maxActive and maxTotal in my
> current server.xml file, which does not appear to be causing any issues.
>
> my question is which attribute should I be using?
>
> Thanks
> Dave
>
> --
>
> 
>
> David Bothwell
>
> Chairman of the Board, Chief technology Officer | Primepoint, LLC
>
> Address: 2 Springside Road, Westampton, NJ 08060
>
> Phone: 800-600-5257
>
> -
> -
> -
> <
> https://www.linkedin.com/company/505608?trk=tyah=clickedVertical%3Acompany%2CclickedEntityId%3A505608%2Cidx%3A2-2-3%2CtarId%3A1447790586761%2Ctas%3Aprimepoint
> >
> - - 
>
> --
> This communication, and any information or attachments contained within,
> may contain privileged or confidential information that is intended for
> the
> sole use of the recipient or recipients named above. If the reader of this
> message is not an intended recipient, or authorized to receive such
> messages for an intended recipient, you are hereby notified that any
> review, use, dissemination, copying, or distribution of this
> communication,
> or any of its contents is strictly prohibited. If you have received this
> message in error, please notify us immediately of the error by return
> email
> and permanently remove the original message, its contents, and any copies
> from your system. Thank you.
>


-- 
I love Java 


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

2020-01-05 Thread Guang Chao
On Mon, Jan 6, 2020 at 9:44 AM zahid  wrote:

>
> Why will MS Windows users will never have to deal with issue of *chmod* ?
>
Apples and Oranges

> also keep in mind why java command line have three  different  options to
> do the same thing ?
>
> java -cp
>
> java -classpath
>
> java class-path
>
> On 06/01/2020 01:21, Guang Chao wrote:
>
> On Sun, Jan 5, 2020 at 9:26 AM zahid  
>  wrote:
>
>
> Actually this is *one of many *punishments following the sin of choosing
> *.nix
>
> and not Microsoft Windows.
>
>
> Why is it Linux fault?
>
>
>
> Have ever heard of "*chmod*" in windows ?
>
> MS windows trust you with your machine.
>
> You bought it , you paid for it , you own it.
>
>
> although you have many ways of installing software.
>
> apt , apt-get yum , blah blah.
>
> You need to familiarise yourself with *find  / -name java* *  ,   which
> java*  because you have no idea where the installer installed the
> software you just installed on "your machine",
>
> Have ever heard of *which* or *find* in windows ?
>
>
> you can be in a directory in one terminal and delete it form another
> terminal .
>
> Is that  linux security  feature ?
>
> can you do the same  in windows  ?
>
> what are others benefits you can enjoy in MS Windows because of this
> particular behaviour is not same in MS Windows ?
>
> After you deleted the directory you are in from somewhere else you will
> end up in trash literally.
>
> why  is this same unique  behaviour in Unix which came after Linux.
>
>
> you see anything what's wrong with this ? can you see the missing the /r /n
>
> manifest.txt
>
> Main-Class:/classname /
>
> why does manifest.text must have /r {carriage} or  /n {newline}.
>
> Is it because jvm.dll it was written in C. C programming language also
> has the same feature.
>
>
> why is there three ways to do same thing  ?
>
> java - cp
>
> java - classpath
>
> java - class-path
>
>
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling = healthy applications
>
> On 04/01/2020 22:51, Emmanuel Bourg wrote:
>
> Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
>
>
> Thanks for this link
>
>
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
> .
>
> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
> strange thing is, it can read another file from another location, e.g in
> /opt/:
>
> The tomcat9 service is configured with a private /tmp directory (using
> the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
> applications write to /tmp, and temporary files written by Tomcat are
> out of reach from the other applications.
>
> This is a security hardening setting that can be overridden as described
> in the README file Olaf mentioned.
>
> Emmanuel Bourg
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
> --www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling
> = healthy applications
>
>
>
> -- www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marriage between loose
> and tight coupling
> = healthy applications
>
>

-- 
I love Java <https://javadevnotes.com/java-integer-to-string-examples>


Re: Tomcat 9 does not allow to read file in /tmp folder with 777 permission?

2020-01-05 Thread Guang Chao
On Sun, Jan 5, 2020 at 9:26 AM zahid  wrote:

>
> Actually this is *one of many *punishments following the sin of choosing
> *.nix
>
> and not Microsoft Windows.
>

Why is it Linux fault?


>
> Have ever heard of "*chmod*" in windows ?
>
> MS windows trust you with your machine.
>
> You bought it , you paid for it , you own it.
>
>
> although you have many ways of installing software.
>
> apt , apt-get yum , blah blah.
>
> You need to familiarise yourself with *find  / -name java* *  ,   which
> java*  because you have no idea where the installer installed the
> software you just installed on "your machine",
>
> Have ever heard of *which* or *find* in windows ?
>
>
> you can be in a directory in one terminal and delete it form another
> terminal .
>
> Is that  linux security  feature ?
>
> can you do the same  in windows  ?
>
> what are others benefits you can enjoy in MS Windows because of this
> particular behaviour is not same in MS Windows ?
>
> After you deleted the directory you are in from somewhere else you will
> end up in trash literally.
>
> why  is this same unique  behaviour in Unix which came after Linux.
>
>
> you see anything what's wrong with this ? can you see the missing the /r /n
>
> manifest.txt
>
> Main-Class:/classname /
>
> why does manifest.text must have /r {carriage} or  /n {newline}.
>
> Is it because jvm.dll it was written in C. C programming language also
> has the same feature.
>
>
> why is there three ways to do same thing  ?
>
> java - cp
>
> java - classpath
>
> java - class-path
>
>
>
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling = healthy applications
>
> On 04/01/2020 22:51, Emmanuel Bourg wrote:
> > Le 04/01/2020 à 16:06, Pham Huu Bang a écrit :
> >
> >> Thanks for this link
> >>
> https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian
> .
> >> But I cannot *read* the file from /tmp (not *write* file to /tmp). The
> >> strange thing is, it can read another file from another location, e.g in
> >> /opt/:
> > The tomcat9 service is configured with a private /tmp directory (using
> > the 'PrivateTmp=yes' systemd directive). So Tomcat can't see what other
> > applications write to /tmp, and temporary files written by Tomcat are
> > out of reach from the other applications.
> >
> > This is a security hardening setting that can be overridden as described
> > in the README file Olaf mentioned.
> >
> > Emmanuel Bourg
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> --
> www.backbutton.co.uk
> ¯\_(ツ)_/¯
> Marry loose with tight
> coupling
> = healthy applications
>
>

-- 
I love Java 


Re: Tomcat 8.5 Error related to Encoding Detector

2019-01-15 Thread Guang Chao
On Tue, Jan 15, 2019 at 8:31 PM prasoon sharma 
wrote:

> Hi
> I used the tutorial at
> https://www.rosehosting.com/blog/how-to-install-tomcat-8-on-a-centos-6-vps/
> and
> some tips from
>
> https://www.openprogrammer.info/2015/06/14/how-to-install-java-8-and-tomcat-8-on-centos-6-as-service/
> I have configured it at 8081 port
>
>
Did you also use Centos 6?


>
> On Tue, Jan 15, 2019 at 4:14 PM Mark Thomas  wrote:
>
> > On 15/01/2019 10:33, prasoon sharma wrote:
> > > Hi
> > > I am facing issue with Tomcat 8.5 on my Centos Server.
> > >
> > > I am getting HTTP 500 error as
> > >
> > > javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could
> > > not initialize class org.apache.jasper.compiler.EncodingDetector
> > >
> > >
> > > Check the detailed description at
> > >
> >
> https://stackoverflow.com/questions/54076418/java-lang-noclassdeffounderror-could-not-initialize-class-org-apache-jasper-com
> >
> > What steps did you take to install Apache Tomcat?
> >
> > Mark
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>


-- 
Guang 


Re: JMS Testing

2018-12-17 Thread Guang Chao
On Tue, Dec 18, 2018 at 7:22 AM Rajendra  wrote:

> Hi,
>
> How to test JMS on Tomcat without writing client code? Please let me know
> if anyone knows the steps or process.
>
>
Hi, I think it would depend on the implementation you are using.


> Thanks !
>
> Rajendra
>
>

-- 
Guang 


Re: precompile JSPs failure issue - Tomcat community

2018-11-01 Thread Guang Chao
On Thu, Nov 1, 2018 at 7:13 PM Rathore, Rajendra  wrote:

> Hi Mark,
>
> I am suspecting the same in 8.5.33 tomcat, do you still won't me to check
> it on tomcat 8.5.33?
>

How about increasing your perm memory?


>
> Thanks and Regards,
> Rajendra Rathore
> 9922701491
>
> -----Original Message-
> From: Guang Chao 
> Sent: 01 November 2018 03:41 PM
> To: Tomcat Users List 
> Subject: Re: precompile JSPs failure issue - Tomcat community
>
> On Thu, Nov 1, 2018 at 5:33 PM Mark Thomas  wrote:
>
> > On 01/11/2018 09:21, Rathore, Rajendra wrote:
> > > Hi Team,
> > >
> > >
> > >
> > > We have precompileJSPs tests that include compilation of around 4000
> > > jsp files. After upgrading to Tomcat *8.5.34* from Tomcat *8.5.32*
> > > we are facing an *Error:*/java.lang.OutOfMemoryError: unable to
> > > create new native thread /
> > >
> > >
> > >
> > > The machines on which tests were executed have *16GB* of RAM, out of
> > > which around *13GB* was free.
> > >
> > > The precompileJSPs tests were executed on Tomcat *8.5.34* by setting
> > > ANT_OPTS from -Xmx4096m to -Xmx10240m, But Still the result was
> > > /OutOfMemoryError./
> > >
> > > / /
> > >
> > > However, We successfully tested precompileJSPs tests for Tomcat
> > > *8.5.32 *with ANT_OPTS as -Xmx384m
> > >
> > >
> > >
> > > Can someone please have a look into this issue?
> >
> > Have you looked at the change log for the changes between 8.5.32 and
> > 8.5.34 that might be relevant?
> >
>
> It could be changelog in 8.5.33
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbz.apache.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D53011data=02%7C01%7Crarathore%40ptc.com%7Cb925903f163440c0623908d63fe25fc4%7Cb9921086ff774d0d828acb3381f678e2%7C0%7C0%7C636766638847501834sdata=0pWCHhvlD%2FBKThN%2FvGEbfDE1%2F4SSXHYOaQIx028%2Fk9Q%3Dreserved=0
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbz.apache.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D53492data=02%7C01%7Crarathore%40ptc.com%7Cb925903f163440c0623908d63fe25fc4%7Cb9921086ff774d0d828acb3381f678e2%7C0%7C0%7C636766638847501834sdata=jzH4WEv0RTY%2BvJYmGvNIKS%2FFM6OSO4Kc8ZFRX4hmt2s%3Dreserved=0
>
>
>
> >
> > Have you tried testing with 8.5.33 to narrow down the version in which
> > the issue first appears?
> >
> > Mark
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>
> --
> Guang <
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjavadevnotes.com%2Fjava-string-to-datedata=02%7C01%7Crarathore%40ptc.com%7Cb925903f163440c0623908d63fe25fc4%7Cb9921086ff774d0d828acb3381f678e2%7C0%7C0%7C636766638847501834sdata=S2z9J%2Bb75VYOsUR0aeRgyXIAjBTUVPvMxM7BU%2FGCDQ0%3Dreserved=0
> >
>


-- 
Guang <http://javadevnotes.com/java-string-compare>


Re: precompile JSPs failure issue - Tomcat community

2018-11-01 Thread Guang Chao
On Thu, Nov 1, 2018 at 5:33 PM Mark Thomas  wrote:

> On 01/11/2018 09:21, Rathore, Rajendra wrote:
> > Hi Team,
> >
> >
> >
> > We have precompileJSPs tests that include compilation of around 4000 jsp
> > files. After upgrading to Tomcat *8.5.34* from Tomcat *8.5.32* we are
> > facing an *Error:*/java.lang.OutOfMemoryError: unable to create new
> > native thread /
> >
> >
> >
> > The machines on which tests were executed have *16GB* of RAM, out of
> > which around *13GB* was free.
> >
> > The precompileJSPs tests were executed on Tomcat *8.5.34* by setting
> > ANT_OPTS from -Xmx4096m to -Xmx10240m, But Still the result was
> > /OutOfMemoryError./
> >
> > / /
> >
> > However, We successfully tested precompileJSPs tests for Tomcat *8.5.32
> > *with ANT_OPTS as -Xmx384m
> >
> >
> >
> > Can someone please have a look into this issue?
>
> Have you looked at the change log for the changes between 8.5.32 and
> 8.5.34 that might be relevant?
>

It could be changelog in 8.5.33
https://bz.apache.org/bugzilla/show_bug.cgi?id=53011
https://bz.apache.org/bugzilla/show_bug.cgi?id=53492



>
> Have you tried testing with 8.5.33 to narrow down the version in which
> the issue first appears?
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Guang 


Re: Connection refused: connect

2018-09-26 Thread Guang Chao
On Fri, Sep 21, 2018 at 4:54 PM Karen Goh 
wrote:

> Hi,
>
> I am repeatedly getting the following exceptions and am stuck here like
> forever.
>
> Hope someone can tell me what's wrong with my tomcat server  version:
> 8.5.24 with Eclipse
>
>
> java.net.ConnectException: Connection refused: connect
> at java.net.DualStackPlainSocketImpl.connect0(Native Method)
> at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
> at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
> at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown
> Source)
> at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
> at java.net.PlainSocketImpl.connect(Unknown Source)
> at java.net.SocksSocketImpl.connect(Unknown Source)
> at java.net.Socket.connect(Unknown Source)
> at java.net.Socket.connect(Unknown Source)
> at java.net.Socket.(Unknown Source)
> at java.net.Socket.(Unknown Source)
> at
> org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:148)
> at java.lang.Thread.run(Unknown Source)
>
> Tks.
>

Can I assume that what you are trying to do are the following?

- You downloaded Tomcat 8 and extracted somewhere on hard drive
- You created a web project in Eclipse
- You created new Server Runtime by adding in preferences and specifying
the path of your Tomcat 8
- You run your web project using the runtime



>
> --- On Sat, 9/15/18, Karen Goh  wrote:
>
> > From: Karen Goh 
> > Subject: Error: Could not find or load main class set
> > To: users@tomcat.apache.org
> > Date: Saturday, September 15, 2018, 2:50 PM
> > Hi,
> >
> > I am now getting the above error.
> > There is no further error stacktrace from error log or
> > console etc.
> >
> > So far, I have deleted the server and
> > created new instances but still getting the same error.
> >
> > I have read the following solutions but
> > they are not helpful
> >
> >
> http://www.java67.com/2016/09/3-ways-to-solve-eclipse-main-class-not-found-error-java.html
> >
> >
> https://www.researchgate.net/post/How_to_solve_Error_Could_not_find_or_load_main_class
> >
> > Please help.
> >
> > Tks,
> > Karen
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Guang 


Re: Application hanging on Tomcat 7.0.54

2018-09-26 Thread Guang Chao
On Thu, Sep 27, 2018 at 3:56 AM Louis Zipes  wrote:

> Problem just re-occurred and so I was able to at least get a JSTACK  (I
> assume it was Tomcat since it was the Java using the most memory on the
> machine).  Here is the reoccurring message.  I get more hits on but haven't
> dug through all of the Google hits yet (due to multi-tasking) so apologies
> up front if there is a simple answer to this.
>
> "Event_Manager_1413" daemon prio=6 tid=0x24856000 nid=0x40c4
> waiting on condition [0x42dae000]
>java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for  <0x0005ab45f7b8> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown
> Source)
> at java.util.concurrent.LinkedBlockingQueue.poll(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor.getTask(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)
>
>
Do you lock from memory or database?  Make sure locking sequence is
consistent all across the application.  Meaning if you have

Lock A
Lock B
Lock C

You dont want another logic that locks something in another order.  E.g.

Lock B
Lock A
Lock C

Because that will cause deadlocks.



>Locked ownable synchronizers:
> - None
>
> > Any comments/suggestions are appreciated!
>
> Your most likely problem is database connection pool mismanagement:
> connections aren't properly released and the pool empties. All threads
> are left waiting on available database connections which will never be
> replenished.
>
> I'm using the ojdbc6.jar if that is what you are referring to or is there
> a better setting somewhere.
>

What db connection pool are you using? Are you letting tomcat manage it via
Context.xml and get connection via JNDI?  Or are you managing inside the
application?


>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, September 26, 2018 3:46 PM
> To: users@tomcat.apache.org
> Subject: Re: Application hanging on Tomcat 7.0.54
>
> - - - external message, proceed with caution - - -
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Louis,
>
> On 9/26/18 14:42, Louis Zipes wrote:
> > Hi all, Tomcat 7.0.54 running on Windows 2012
> >
> > We are running a third party application on Tomcat and today we
> > have intermittently run in issues where the application stops
> > working.  The big changes in our system is that we have added more
> > end users and we are at year end so of course everyone is hitting
> > the system hard. Even if we force a log out of all users and stop
> > all background jobs then the application doesn't recover.
> >
> > We see no active sessions on the database (our application is
> > connecting to an Oracle database) and I see no clear error messages
> > in either our third party application logs or the Tomcat logs (ex.
> > OutofMemory).  When we go to the Windows Task Manager we did not
> > see the machine's Memory max'd out but admittedly I didn't look at
> > the Java session to see if was reaching its Heap Max.  The only
> > thing that we noticed was that TCP connections went down right
> > after the restart.  I did open up Jconsole under Java and I did
> > force a garbage collection but that didn't seem to help.
> >
> > We do have an Oracle Grid Control and we did get an alert in
> > regards to Metric: [HTTP Transaction] Perceived Time per Page going
> > past thresholds but not sure if that was just an old alert with and
> > old range that was set up a long time ago or is a really valid
> > clue.Since this is PRD we had to get it back up and running so
> > all I did was increase the Tomcat Xmx Heap size and restarted.  I'm
> > not really confident that is the solution since as mentioned you
> > tend to see a clear out of memory error if it was too small.
> >
> > So a few questions:
> >
> >
> > 1) Does this sound like a known issue with this earlier version
> > of Tomcat?
>
> No.
>
> > 2) Should I turn up any logging on Tomcat and if so which
> > ones?
>
> Not yet.
>
> > 3) We didn't do a JSTACK dump while it was happening.  Would
> > that have been useful?
>
> Absolutely.
>
> > 4) Do we need to play around with MaxThreads and/or
> > MaxConnections.  We do have maxThreads in our server.mxl but in DEV
> > when we turned it down to a value = 5  hoping to overwhelm it
> > nothing bad happened.
>
> Don't change anything, yet.
>
> > Once again, we are limited to what we could do and collect since it
> > was PRD and we needed to restart it.  We restarted the Tomcat
> > service and everything is processing fine for right now.  I will
> > note that that we did have that bad Windows 

Re: Problem finding native shared library (.so)

2018-05-02 Thread Guang Chao
On Wed, May 2, 2018 at 2:51 AM, Reynolds, Scott  wrote:

> Hi,
>
> I'm trying to deploy a webapp to Tomcat 8.0.39 on CentOS 7 x86_64 that
> depends on native shared libraries.  I can't install the shared libraries
> in a system-wide location because there are multiple applications/webapps
> being deployed to this system that use different versions of the same
> native shared libraries.  We're already running two instances of Tomcat to
> isolate the webapps from one another.  Here's what's going on:
>
> Tomcat #1 (/opt/tomcatwx) - The webapp described below is able to find all
> necessary native shared libraries
>
> bin/setenv.sh source's bin/setenv-wx.sh.
>
> bin/setenv-wx.sh appends -Djava.library.path=/usr/
> lib64:/lib64:/lib:/usr/lib:/opt/tomcatwx/lib/gdal to JAVA_OPTS.
>
> conf/catalina.properties appends ,"${catalina.home}/lib/gdal","
> ${catalina.home}/lib/gdal/*.jar" to common.loader.
>
> lib/gdal contains the following files:
> drwxr-xr-x. 2 tomcatwx root 4096 Apr 16 01:06 data
> -rw-r--r--. 1 tomcatwx root   134785 Apr 16 00:59 gdal.jar
> -rwxr-xr-x. 1 tomcatwx root86176 Apr 16 00:59 libgdalconstjni.so
> -rwxr-xr-x. 1 tomcatwx root  1911144 Apr 16 00:59 libgdaljni.so
> -rwxr-xr-x. 1 tomcatwx root 93499064 Apr 16 00:59 libgdal.so
> -rwxr-xr-x. 1 tomcatwx root   222448 Apr 16 00:59 libgnmjni.so
> -rwxr-xr-x. 1 tomcatwx root   968920 Apr 16 00:59 libogrjni.so
> -rwxr-xr-x. 1 tomcatwx root   483536 Apr 16 00:59 libosrjni.so
> -rw-r--r--. 1 tomcatwx root   335488 Apr 16 15:28 libproj.so
> -rw-r--r--. 1 tomcatwx root 2021 Apr 16 01:06
> ./lib/gdal/data/gdalicon.png
> -rw-r--r--. 1 tomcatwx root19884 Apr 16 01:06
> ./lib/gdal/data/gdalvrt.xsd
> -rw-r--r--. 1 tomcatwx root   234839 Apr 16 01:06
> ./lib/gdal/data/gdal_datum.csv
> -rwxr-xr-x. 1 tomcatwx root  1911144 Apr 16 00:59 ./lib/gdal/libgdaljni.so
> -rwxr-xr-x. 1 tomcatwx root86176 Apr 16 00:59
> ./lib/gdal/libgdalconstjni.so
> -rw-r--r--. 1 tomcatwx root   134785 Apr 16 00:59 ./lib/gdal/gdal.jar
> -rwxr-xr-x. 1 tomcatwx root 93499064 Apr 16 00:59 ./lib/gdal/libgdal.so
>
>
> Tomcat #2 (/srv/tomcat) - The webapp described below is unable to find a
> native shared library referenced by the JNI shared library.
> Native library load failed.
> java.lang.UnsatisfiedLinkError: /srv/tomcat/lib/3p/libgdaljni.so:
> libgdal.so.20: cannot open shared object file: No such file or directory
>
> bin/setenv.sh source's bin/setenv-3p.sh.
>
> bin/setenv-3-.sh appends -Djava.library.path=/srv/tomcat/lib/3p to
> JAVA_OPTS.
>
> conf/catalina.properties appends 
> ,"${catalina.home}/lib/3p","${catalina.home}/lib/3p/*.jar"
> to common.loader.
>
> lib/3p contains the following files:
> drwxr-xr-x. 2 tomcat tomcat 4096 Dec  5 20:04 gdal
> -rwxr-xr-x. 1 tomcat tomcat   128680 Dec  5 20:06 libgdalconstjni.so
> -rwxr-xr-x. 1 tomcat tomcat  1982984 Dec  5 20:06 libgdaljni.so
> lrwxrwxrwx. 1 tomcat tomcat   17 Dec  5 20:04 libgdal.so ->
> libgdal.so.20.3.101632
> lrwxrwxrwx. 1 tomcat tomcat   17 Dec  5 20:04 libgdal.so.20 ->
> libgdal.so.20.3.101632
> -rwxr-xr-x. 1 tomcat tomcat 93494552 Dec  5 20:04 libgdal.so.20.3.101632
> -rwxr-xr-x. 1 tomcat tomcat   294464 Dec  5 20:06 libgnmjni.so
> -rw-r--r--. 1 tomcat tomcat  3409872 Jul 15  2016 libjhdf5.so
> -rw-r--r--. 1 tomcat tomcat  1268496 Jul 15  2016 libjhdf.so
> -rwxr-xr-x. 1 tomcat tomcat  1039816 Dec  5 20:06 libogrjni.so
> -rwxr-xr-x. 1 tomcat tomcat   554768 Dec  5 20:06 libosrjni.so
> lrwxrwxrwx. 1 tomcat tomcat   17 Dec  5 19:35 libproj.so ->
> libproj.so.12.0.03
> lrwxrwxrwx. 1 tomcat tomcat   17 Dec  5 19:35 libproj.so.12 ->
> libproj.so.12.0.03
> -rwxr-xr-x. 1 tomcat tomcat  1871352 Dec  5 19:35 libproj.so.12.0.03
> drwxr-xr-x. 2 tomcat tomcat 4096 Dec  5 19:35 proj
>
>
I thought this is just file permission issue, but you have rx for
everyone.  I think your best bet is to remove the synbolink link and copy
libgdal.so.20.3.101632  to libgdal.so.  Why are you using symbolink link on
the second instance but not on the first? Why not just copy the whole file
structure from the first one?


> webapps/myapp/WEB-INF/lib contains the JNI jar:
> -rw-r--r--. 1 tomcat tomcat 134646 May  1 14:03 webapps/myapp/WEB-INF/lib/
> gdal-2.2.2.jar
>
> which references libgdaljni.so
> libgdaljni.so references libgdal.so
> which references libgdal.so.20
> which references libgdal.so.20.3.101632
>
> What have I failed to do that is preventing Tomcat/Java from finding the
> fully resolved libgdal.so that is in the same directory where it found
> libgdaljni.so?
>
> I tried eliminating the symbolic links by copying  libgdal.so.20.3.101632
> to libgdal.so, without success.
> I tried copying the gdal-2.2.2.jar to the lib/3p directory, without
> success.
>
> Thanks in advance for any help.
>
> Scott
>
>
>


-- 
Guang 


Re: Socket accept failed: The specified network name is no longer available.

2018-04-30 Thread Guang Chao
On Tue, Apr 17, 2018 at 2:13 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Rémy,
>
> On 4/16/18 11:05 AM, Rémy Maucherat wrote:
> > On Mon, Apr 16, 2018 at 4:51 PM, Igor 
> > wrote:
> >
> >> If this is really such a simple problem then how can I get rid of
> >> its output into error log?
> >>
> >
> > You can always configure the logging if you'd like to filter this
> > one out, but this looks like a serious error during accept. I'd
> > think you should try to find the root cause of the issue.
>
> +1
>
> It's probably something like your server disconnecting and
> reconnecting to the network. Bad NIC? Flaky DHCP server? Bad advice to
> use a WiFi network for a server? Lots of other possibilities, here, too.
>
>
How about testing from the server using a browser, since it is using
Windows.  If there is no problem, then it might be just network issues.



> This kind of thing doesn't happen with a stable server and network.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrU58gACgkQHPApP6U8
> pFhJDw/+ON6Z6G8DGuvyeIBrnQOVM3efmiyI21YR4fsyOW8l6zFwcLg0tcwtZ6n+
> 4vophvplqyLQ6pG7empVBX4e3gdX3ygobFYMpC5pFZpWlJgzGpphMVSnq0RIs9jr
> LJPEIbupUL8HElBuHEVeITQpIDSgZmH2hdYfxXiU0Za7Q3XWDJyBEQFzF8rNkJEO
> UClHSp+1BElQvwGwo8xRlWAEG9CrgL0BpANYd1SneLYkkn45EQufYXl9yW8raM8U
> V0AV9pGSQShdtx3dlVAgtCpHFRUR+Tainn0Q/uQgyjY0hYhJZpgKisBx2Hn3a/Fn
> Ybdn9VjB9Wbpa+uke+yLMBbdgYaEVDaw9Ec/8Ws1oxv2kaRW4gYwljhw4h0YG7uv
> Uiq7XH9DmvRzRvEtwi5T/A8HaoyvacW43mlIB2WQTjQxsv9X7VcLoRS8lzlBtYkv
> 8eDZTeD16/6uSUzY3p5QKgZVPyrzOnOtc2+0AGjneuk18y7hQaY0ltVZ8CmvA76y
> 2eToMcEZkVNnTNzdJiKmJ6W6GFSOyrg/1hlMVeO5ZK5M/rhaf9IXF0DvCrLWqHWm
> 2yUZ91GC6VJykGJ2hZLrhWgNGpgvg9tiJR4Gm9bgapWG+kVpRYc3GBNpqTPIj/bq
> kkAc3sX2erqg62IgRZhT+FrqP8QfpaDVQszB18jPeldVflzNFSM=
> =qj2m
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Guang 


Re: Help needed - JPA probem - No connection specified with project

2017-09-29 Thread Guang Chao
On Fri, Sep 22, 2017 at 6:35 PM, Karen Goh 
wrote:

> Hi expert,
>
> I have been trying very hard to nail the above problem including asking
> various forums like CodeRanch, dream in code etc but to no avail.
>
> As such, I am hoping to get help from the Apache Tomcat user support.
>
> Tools and setting : Eclipse Mars, Tomcat 1.8, MySQL, OS : Windows 7,
> Maven, Java JPA with Hibernate framework 5.1.0
>
> The MySQL setting is confirmed correct, as I have managed to insert the
> data via single JDBC connection.
>
> Project summary : J2ee servlet with JSP, Java JPA in Hibernate framework.
> (Hibernate is for pure insertion of data - many to many relationship)
>
> My purpose is to get the JNDI datasource working but till now I can't just
> get it work.
>
> Here's my context.xml :
>
> 
>  antiResourceLocking="true" debug="1">
>  type="javax.sql.DataSource"/>
> 
> name="jdbc/hi5"
> auth="Container"
> type="javax.sql.DataSource"
> maxTotal="8"
> maxActive="100"
> maxIdle="30"
> maxWait="-1"
> username="root"
> singleton="true"
> override="true"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> password="password"
>   alternateUsernameAllowed="true"
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/hi5" />
>   
>   
>
>
I review again original, can you remove the factory here and try?
 factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"


> Here's my web.xml:
>
> 
> http://www.w3.org/2001/XMLSchema-instance; xmlns="
> http://xmlns.jcp.org/xml/ns/javaee; xsi:schemaLocation="http://
> xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/
> javaee/web-app_3_1.xsd" version="3.1">
>   Hi5S
>   
> Index.jsp
>   
>   
> MySQL Datasource
> jdbc/hi5
> javax.sql.DataSource
> Container
>   
>
> 
>
> And my singletonDatasource class:
>
> package util;
>
>
> import java.sql.Connection;
> import java.sql.SQLException;
>
> import javax.annotation.Resource;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
> import javax.sql.DataSource;
>
>
> @Resource(name = "jdbc/hi5")
> public class SingletonDBConnection{
>
> private static SingletonDBConnection singleInstance;
> private static DataSource dataSource;
> private static Connection dbConnect;
>
> private SingletonDBConnection() {
> try {
> Context initContext = new InitialContext();
> Context envContext = (Context) initContext.lookup("java:/
> comp/env");
> dataSource = (DataSource) envContext.lookup("jdbc/hi5");
>
> try {
> dbConnect = dataSource.getConnection();
> } catch (SQLException e) {
> e.printStackTrace();
> }
> } catch (NamingException e) {
> e.printStackTrace();
> }
> }
>
>
> public static DataSource getMySQLDataSource() { // using apacheDBCP
> if (singleInstance == null) {
> synchronized (SingletonDBConnection.class) {
> if (singleInstance == null) {
> singleInstance = new SingletonDBConnection();
> }
> }
> }
>
> return (DataSource) singleInstance;
> }
>
> public static DataSource getConnInst() {
> try {
> dbConnect = dataSource.getConnection();
> } catch (SQLException e1) {
> e1.printStackTrace();
> }
>
> if (dbConnect == null) {
> try {
> Context initContext = new InitialContext();
> Context envContext = (Context) initContext.lookup("java:/
> comp/env");
> dataSource = (DataSource) envContext.lookup("jdbc/hi5");
>
> try {
> dbConnect = dataSource.getConnection();
> } catch (SQLException e) {
> e.printStackTrace();
> }
> } catch (NamingException e) {
> e.printStackTrace();
> }
> }
>
> return dataSource;
> }
>
> }
>
>
> And the persistence.xml ;
>
> 
> http://xmlns.jcp.org/xml/ns/persistence;
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="
> http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/
> persistence/persistence_2_1.xsd">
> 
> model.Subject
> model.Tutor
>
> 
> 
>value="java:comp/env/jdbc/hi5"/>
>
> 
> 
>
> 
>
> As the mailing list does not allow large error attachment, therefore, I am
> appending the error below :
>
> Sep 22, 2017 5:59:46 PM org.apache.tomcat.util.digester.SetPropertiesRule
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
> property 'debug' to '1' did not find a matching property.
> Sep 22, 2017 5:59:46 PM org.apache.tomcat.util.digester.SetPropertiesRule
> begin
> WARNING: 

Re: Randomly tomcat process create another copy process of it. Now see two PIDs of tomcat running

2017-09-28 Thread Guang Chao
On Thu, Sep 28, 2017 at 2:50 PM, Naresh Yadav <nyadav.tec...@gmail.com>
wrote:

> my hard requirement is to run tomcat from eclipse only using sysdeo or
> other plugin.
> But yes i can try running from service OR startup bat file also...
>
> Another thing want to highlight is this problem is not consistent and it
> appear randomly...
> my guess is when there is more load on server then someone create another
> tomcat pid.
>

It could be an Eclipse issue not Tomcat issue, because you launch from
Eclipse.


>
> One more information wanted to share is :
>  In this environment we have 2 node tomcat setup running behind
> mod_jk loadbalancer with session replication enabled.
>  right now we observed this problem on one of node only.
>

Do both nodes getting around the same load?  It could be that only one node
is getting all the request, but problem may occur to both.


>
> Please give next level pointers.
>
> On Thu, Sep 28, 2017 at 6:26 AM, Guang Chao <guang.chao.1...@gmail.com>
> wrote:
>
> > On Tue, Sep 26, 2017 at 5:52 PM, Naresh Yadav <nyadav.tec...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > Already posted my problem on stackoverflow but not got any respo/nses
> so
> > > thought
> > > of posting here. Please read and help me with possible resolutions ??
> > >
> >
> > Would it be possible one is run as a service and another run using the
> > *.bat file?
> >
> >
> > >
> > > https://stackoverflow.com/questions/46409358/randomly-
> > > tomcat-process-create-another-copy-process-of-it-now-see-two-pids-of-t
> > >
> > > Thanks
> > > Naresh
> > >
> >
> >
> >
> > --
> > Guang <http://grails.asia/check-if-string-array-contains-a-value-
> in-java/>
> >
>



-- 
Guang <http://grails.asia/java-string-array-initialization/>


Re: Help needed - JPA probem - No connection specified with project

2017-09-27 Thread Guang Chao
On Thu, Sep 28, 2017 at 12:57 PM, Karen Goh 
wrote:

>
> 
> On Tue, 9/26/17, Konstantin Kolinko  wrote:
>
>  Subject: Re: Help needed - JPA probem - No connection specified with
> project
>  To: "Tomcat Users List" 
>  Date: Tuesday, September 26, 2017, 8:52 AM
>
>  2017-09-25 18:02 GMT+03:00 Karen
>  Goh :
>  > Hi Kolinko,
>  >
>  > I have now removed the ResourceLink and
>  left with Resource in my context.xml which is resided at
>  WebContent/META-INF.
>  >
>  > And this is C:\Program Files\Apache
>  Software Foundation\Tomcat 8.0\conf\context.xml
>  >
>  >   version="1.0" encoding="UTF-8"?>
>  > 
>  >
>  > 
>  > 
>  >
>  WEB-INF/web.xml
>  >
>  ${catalina.base}/conf/web.xml
>  >
>  > 
>  > 
>  >
>  > 
>  > 
>  >
>  
>  >
>  >
>  And here's my web.xml :
>  >
>  >   encoding="UTF-8"?>
>  >
>  http://www.w3.org/2001/XMLSchema-instance;
>  xmlns="http://xmlns.jcp.org/xml/ns/javaee;
>  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
> http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
>  version="3.1">
>  >
>  Hi5S
>  >   
>  >
>  Index.jsp
>  >   
>  >   
>  > MySQL
>  Datasource
>  >
>  jdbc/hi5
>  >
>  javax.sql.DataSource
>  >
>  Container
>  >   
>  >
>  > 
>  >
>  > The error remains the
>  same and my Tomcat failed to start, despite I cleaned them
>  etc etc.
>  >
>  > SEVERE: A
>  child container failed during start
>  >
>  java.util.concurrent.ExecutionException:
>  org.apache.catalina.LifecycleException: Failed to start
>  component
>  [StandardEngine[Catalina].StandardHost[localhost]]
>  >
>  > Could you advise how
>  to go about making it work ?
>
>  Mailing list rules:
>  http://tomcat.apache.org/lists.html#tomcat-users
>  -> Top-posting is bad.
>
> Ok. Tks, now I follow your requirements.
>
>
>  1. See a link to Eclipse IDE FAQ here:
>
>  https://wiki.apache.org/tomcat/FAQ/Developing#Q6
>
>
>  2. See the
>  following thread on how to turn on "Publish module
>  context
>  to separate XML files" option
>  in Eclipse.
>
>  By default
>  (without that option) Eclipse IDE places 
>  elements
>  into server.xml, which is a rather
>  discourage practice.
>
>  http://markmail.org/message/7zkyocvph56b6t6q
>
>
> OK.  I managed to turn on "Publish module context..but my problem of
> context not bound is still there.
>
>  3.
>  Documentation on Context:
>
>  http://tomcat.apache.org/tomcat-8.0-doc/config/context.html
>
>  The  element in
>  your context.xml has a lot of attributes that
>  should not be there, starting with
>  "debug". What (bad) example were
>  they copied from?
>
>
>  4. The current version of
>  Tomcat 8.0 is 8.0.46.
>  There were security
>  fixes in Java as well (8u141 was a security update
>  in July 2017)
>
>  Also EOL date for Tomcat 8.0 has been
>  announced. Users are advised to
>  migrate to
>  8.5.
>  http://tomcat.apache.org/tomcat-80-eol.html
>
> Hi kolinko, I have now installed Tomcat 8.5.20 but same problem.
>
>
>
>
>  5. Your
>  META-INF/context.xml is broken:
>  [[[
>// here is rogue
>  ">", thus your Resource has no name (all
>  the following is plain text, not attributes)
>  and thus NPE happens
>
>  name="jdbc/hi5"
>
>  auth="Container"
>
>  type="javax.sql.DataSource"
>
>  maxTotal="8"
>
>  maxActive="100"
>
>  maxIdle="30"
>
>  maxWait="-1"
>
>  username="root"
>
>  singleton="true"
>
>  override="true"
>
>  factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>  password="password"
>
>  alternateUsernameAllowed="true"
>
>driverClassName="com.mysql.jdbc.Driver"
>
>  url="jdbc:mysql://localhost:3306/hi5" />  //
>  You either use /> or
>  ,
>  not both.
>
>  ]]]
>
>
> I have changed my context.xml as follows :
>
> 
>  >
>  name="jdbc/hi5"
> auth="Container"
> type="javax.sql.DataSource"
> maxTotal="8"
> maxActive="100"
> maxIdle="30"
> maxWait="-1"
> username="root"
> singleton="true"
> override="true"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> password="password"
>alternateUsernameAllowed="true"
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/hi5" />
>
>
> And my web.xml ;
>
> 
> http://www.w3.org/2001/XMLSchema-instance; xmlns="
> http://xmlns.jcp.org/xml/ns/javaee; xsi:schemaLocation="http://
> xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/
> javaee/web-app_3_1.xsd" version="3.1">
>   Hi5S
>   
> Index.jsp
>   
>   
> MySQL dataSource
> JDBC/hi5
>

Try add here jdbc/hi5


> javax.sql.DataSource
> Container
>   
>
> util.HibernateSessionFactoryListener
> // I do not know if this is necessary.  Wld like to have your comments. Tks.
> 
> 
>
>  Best
>  regards,
>  Konstantin Kolinko
>
>  -
> 

Re: Randomly tomcat process create another copy process of it. Now see two PIDs of tomcat running

2017-09-27 Thread Guang Chao
On Tue, Sep 26, 2017 at 5:52 PM, Naresh Yadav 
wrote:

> Hi all,
>
> Already posted my problem on stackoverflow but not got any respo/nses so
> thought
> of posting here. Please read and help me with possible resolutions ??
>

Would it be possible one is run as a service and another run using the
*.bat file?


>
> https://stackoverflow.com/questions/46409358/randomly-
> tomcat-process-create-another-copy-process-of-it-now-see-two-pids-of-t
>
> Thanks
> Naresh
>



-- 
Guang 


Re: Tomcat 7/8/9 context path restrictions/validation

2017-09-20 Thread Guang Chao
On Wed, Sep 20, 2017 at 5:47 PM, Konstantin Ryadov 
wrote:

>
> Hello!
> Could you explain context path (e.g. described on
> https://tomcat.apache.org/tomcat-7.0-doc/config/context.html ) value set
> in server.xml limitations?
> Does it exist any context path validation (unescaped symbols, whitespaces
> and so on)?
> Is first “/” always required in context path value? What is the difference
> between value with first “/” and without?
>

I have not checked before, but I assume white spaces and special characters
are not ok.


> Ps
> I found "All of the context paths within a particular Host must be
> unique." only in documentation.
>
>
>


-- 
Guang 


Re: BIO: Async servlet with it's own thread pool; but get connection refused!

2017-09-07 Thread Guang Chao
On Thu, Sep 7, 2017 at 3:59 AM, Yasser Zamani 
wrote:

> Hi there,
>
> I'm studying Servlet 3's async API using tomcat. I see following strange
> behavior from tomcat in a very simple test app!
>
> I have following JMeter test plan:
> Number of threads (users): 700
> Ramp-Up period (in seconds): 23
> Loop count: 1
>
> So JMeter generates 30.43 requests per second and 304.3 requests per 10
> seconds. I'm planning to full tomcat's BIO pool and accept buffer :)
>
> I have an always async test servlet which on destroy, I print tomcat
> container max used threads count. It prints 187 for me which is lower
> than 200 (tomcat default pool size) so I should not get any "connection
> refuse" but I get!
>
> I have simulated a blocking operation by a sleep for 10 seconds. When my
> servlet gets a request, it quickly starts an async and add further
> processing to my own thread pool (container thread comes back to pool
> quickly, right). My own thread pool size is 310 which is greater than
> 304.3 (requests in 10 seconds) so never full.
>
> I've tested several times. Tomcat successfully returns from all requests
> below 326th but fails 102 requests from 326th to 700th with "connection
> refuse" and afew with "connection reset".
>
> Why?! My own thread pool does the jobs and Tomcat's pool is free (my
> servlet uses 187 threads of tomcat at max).
>
> Thanks in advance!
>
> JMETER RESULT of RESPONSE TIMES:
> Max: 60 seconds (lower then tomcat and asyncContext timeout)
> MIN: 10 seconds
> AVG: 37 seconds
> ERR: 15%
>
> CONFIGURATIONS:
>
> Server.xml
>  connectionTimeout="12"
> redirectPort="7743" />
>
> Async.java
>
> package com.sstr.example;
>
> import javax.servlet.*;
> import javax.servlet.annotation.WebInitParam;
> import javax.servlet.annotation.WebServlet;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import java.io.IOException;
> import java.util.concurrent.ExecutorService;
> import java.util.concurrent.Executors;
> import java.util.concurrent.ThreadFactory;
>
> @WebServlet(
>  name = "async",
>  value = {"/async"},
>  asyncSupported = true,
>  initParams = {
>  @WebInitParam(name = "JobPoolSize", value = "310")
>  }
> )
> public class Async extends HttpServlet {
>
>  public final int REQUEST_TIMEOUT = 12;
>  private ExecutorService exe;
>
>  @Override
>  public void init() throws ServletException {
>  int size = Integer.parseInt(getInitParameter("JobPoolSize"));
>  exe = Executors.newFixedThreadPool(
>  size,
>  new ThreadFactory() {
>  @Override
>  public Thread newThread(Runnable r) {
>  return new Thread(r, "Async Processor");
>  }
>  }
>  );
>  }
>
>  @Override
>  protected void doGet(HttpServletRequest req, HttpServletResponse
> resp) throws ServletException, IOException {
>  final AsyncContext context = req.startAsync();
>  context.setTimeout(REQUEST_TIMEOUT);
>  exe.execute(new ContextExecution(context,
> Thread.currentThread().getName()));
>  }
>

I'm not 100% sure, but it seems the doGet method code here is not correct.


>
>  @Override
>  public void destroy() {
>  System.out.println("Container MAX used threads: " + threadCount);
>  exe.shutdown();
>  }
>
>  int threadCount = 0;
>  class ContextExecution implements Runnable {
>
>  final AsyncContext context;
>  final String containerThreadName;
>
>  public ContextExecution(AsyncContext context, String
> containerThreadName) {
>  this.context = context;
>  this.containerThreadName = containerThreadName;
>  }
>
>  @Override
>  public void run() {
>  try {
>  int threadNumber =
> Integer.parseInt(containerThreadName.substring(
>  containerThreadName.lastIndexOf('-')+1));
>  if(threadNumber > threadCount) {
>  threadCount = threadNumber;
>  }
>
>  // Simulate Time Consuming Task
>  Thread.sleep(1);
>
>  ServletResponse resp = context.getResponse();
>  if (resp != null) {
>  resp.getWriter().write("Ok");
>  }
>
>  context.complete();
>  } catch (Exception e) {
>  // Handle ?
>  }
>  }
>  }
> }
>
> OUTPUT:
>
> Container MAX used threads: 187
>



-- 
Guang 


Re: Struts Vulnerability

2017-09-07 Thread Guang Chao
On Thu, Sep 7, 2017 at 3:17 PM, Greg Huber  wrote:

> >2) Does Apache Struts only run on Apache Webserver and Tomcat?
>
> Should run on java based servers Glassfish, Websphere etc
>
> >3) Is there a simple way to determine if a server has Struts installed,
> >instead of logging into each of the servers and checking the programs
> >list?
>
> You could try and execute a struts action ie test.action on the server, if
> struts is there it will reply:
>
> There is no Action mapped for namespace [/] and action name [test]
> associated with context path [].
>
> ..but it depends on how the server is setup and how it deals with the
> 404's.
>

It seems OP has no docs for SCM. He may not also know what are the context
path of the applications.


>
> Alternatively Look for a jar struts.x.x.x.jar or struts2-core-x.x.x.jar in
> the lib directory of tomcat.
>

Yes use wildcard to search for struts2 jar.  I think this jar is bundled
with application and not  with app server.


>
> Struts1 is EOL, Struts2 struts2-core-2.5.13.jar
>
> Look at the struts website for security bulletins etc
> https://struts.apache.org/
>
>
> On 7 September 2017 at 00:18, Sean Son 
> wrote:
>
> > Hello all
> >
> > I am new to the mailing list as well as new to Apache Struts.  We all
> heard
> > in the news about the vulnerability affecting Apache Struts. I have been
> > tasked to determine which of our servers have Struts running on them.  I
> > have a few questions on how to determine if a server is running Struts or
> > not:
> >
> > 1) How does one determine if a Windows server, running IIS, has the
> Apache
> > Struts framework installed on it?
> >
> > 2) Does Apache Struts only run on Apache Webserver and Tomcat?
> >
> > 3) Is there a simple way to determine if a server has Struts installed,
> > instead of logging into each of the servers and checking the programs
> list?
> >
> >
> > I appreciate ALL help!
> >
>



-- 
Guang 


Re: For some reason, the AUTHBIND approach isn't working with 8.5

2017-09-07 Thread Guang Chao
On Thu, Sep 7, 2017 at 8:02 AM, James H. H. Lampert <
jam...@touchtonecorp.com> wrote:

> A little over a month ago, I had a problem with getting Tomcat 7 to bind
> to port 443 on Debian.
>
> We solved that problem with the "authbind" approach.
>
> Now, I'm attempting to do the same with Tomcat 8.5, and it's not working.
>
> 06-Sep-2017 23:47:46.293 SEVERE [main] org.apache.coyote.AbstractProtocol.init
>> Failed to initialize end point associated with ProtocolHandler
>> ["https-jsse-nio-443"]
>>  java.net.SocketException: Permission denied
>> at sun.nio.ch.Net.bind0(Native Method)
>> at sun.nio.ch.Net.bind(Net.java:463)
>> at sun.nio.ch.Net.bind(Net.java:455)
>> at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelI
>> mpl.java:223)
>> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.
>> java:74)
>> at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java
>> :210)
>> at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEnd
>> point.java:970)
>> at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(Abstrac
>> tJsseEndpoint.java:244)
>> at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.
>> java:613)
>> at org.apache.coyote.http11.AbstractHttp11Protocol.init(Abstrac
>> tHttp11Protocol.java:66)
>> at org.apache.catalina.connector.Connector.initInternal(Connect
>> or.java:968)
>> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.
>> java:107)
>> at org.apache.catalina.core.StandardService.initInternal(Standa
>> rdService.java:549)
>> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.
>> java:107)
>> at org.apache.catalina.core.StandardServer.initInternal(Standar
>> dServer.java:875)
>> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.
>> java:107)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:630)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:57)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
>>
>
You can not use port below 1024 if service is non root.
You can use routing via iptables
Another option is have a reverse proxy, e.g. nginx listening on 443
fronting your tomcat listening on a higher port.


>
> I think I did everything the same as before. I uncommented AUTHBIND in
> /etc/default/tomcat8, and set it to "AUTHBIND=yes"; an
> /etc/authbind/byuid/109 (the uid of the tomcat8 user) was generated with
> contents
>
>> 0.0.0.0/0:1,1023
>> ::/0,1-1023
>>
>
> and yet still, I get the stack trace given above.
>
> --
> JHHL
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Guang 


Re: TomCat stops after few seconds

2017-09-07 Thread Guang Chao
On Wed, Sep 6, 2017 at 6:09 PM, Irene Almendros  wrote:

> Good morning,
>
> I am having the following problem with TomCat: I open Tomcat Monitor and
> start the service but after a few seconds, it stops. The Apache service is
> running.
>
> One week ago, my windows updated to the latest version but yesterday I had
> to restore again the previous version as some applications stopped working
> with the latest update. This morning when I tried to start Tomcat service,
> I got the above issue. I have tried to generate a threat dump file from the
> Monitor but there is o tomcatNN-stdout.DATE.log file in the logs folder.
>
> I am quite new in Tomcat world so any help you can provide would be
> appreciated.
>
> I am using:
>
> TomCat 8.0.44
> Windows10 Pro version 1607
> System type 64-bit
>
> Many thanks in advance.
>

Do you have any server monitoring installed?  Maybe check if OS has run out
of memory or something.


>
> Best regards.
> Irene.
>
>
>
>


-- 
Guang 


Re: web.xml

2017-09-07 Thread Guang Chao
On Wed, Sep 6, 2017 at 6:16 AM, Alejandro Vargas M. <
alejandro.var...@kymsolutions.com> wrote:

> Good afternoon,
>
> I have a website on a client, and they ran a vulnerability test, and it
> throws a vulnerability that any user can see web.xml from a web browser,
>
> how can I hide to see web.xml or any other file from the browser?
>

Do you have a reverse proxy or a webserver directly serving static files?


>
> Thanks.
>
>
> --
>
>
>
>
> Alejandro Vargas Mayorga
> *Gerente Desarrollo C.A. & C.*
> *Tel. 506- 7232-3366*
> *Email:**alejandro.var...@kymsolutions.com*
> <%20alejandro.var...@kymsolutions.com>
> *www.kymsolutions.com* 
> * Visite nuestra aula virtual! *
>



-- 
Guang 


Re: Page cannot be displayed , TOMCAT installation on windows 2012 R2

2017-09-07 Thread Guang Chao
On Tue, Sep 5, 2017 at 6:38 PM, ford royal 
wrote:

> HI team,
>
>
>
> I have installed Tomcat on windows 2012 r2 , but I get page cannot be
> displayed when I try to open http:\\localhost:8080I have given Java path
> also but still no.Java 8 update 144  tomcat is 8.5.20
> please guide
>
>
Can you share catalina.out under logs folder?


>  Best Regards, Thank you, Rao
>
>




-- 
Guang 


Re: Struts Vulnerability

2017-09-07 Thread Guang Chao
On Thu, Sep 7, 2017 at 7:18 AM, Sean Son 
wrote:

> Hello all
>
> I am new to the mailing list as well as new to Apache Struts.  We all heard
> in the news about the vulnerability affecting Apache Struts. I have been
> tasked to determine which of our servers have Struts running on them.  I
> have a few questions on how to determine if a server is running Struts or
> not:
>
> 1) How does one determine if a Windows server, running IIS, has the Apache
> Struts framework installed on it?
>
> 2) Does Apache Struts only run on Apache Webserver and Tomcat?
>
> 3) Is there a simple way to determine if a server has Struts installed,
> instead of logging into each of the servers and checking the programs list?
>
>
> I appreciate ALL help!
>

You can try to search the file system for struts jar.
Btw, it seems only struts 2 are affected by the issue

-- 
Guang 


Re: Does Tomcat scan static file directories on startup? If so, how does one prevent it?

2017-09-07 Thread Guang Chao
On Wed, Sep 6, 2017 at 4:11 AM, Meta Schemer  wrote:

> We're using Apache Tomcat/7.0.64 and have recently switched to using a
> cloud-based file system for our static assets (which consists of millions
> of files). The problem we now face is that the startup time for our app has
> now gone through the roof (many hours). File system snooping has revealed
> that Tomcat seems to be scanning the entire static assets directory at
> startup (which is exponentially slower on the cloud based file-system.)
>
> A work around that we have found is that we mount the static assets only
> after the server has started up. While this works for the moment, it is not
> an appropriate long-term solution for us.
>
> For now, this does not seem to stem from jar-scanning (i.e., turning off
> jar-scanning did not change this behavior.)
>
> So, the question is: is there a way to turn off this startup static
> file-scanning behavior?
>

Sorry if unrelated.  But what if you move the millions of static files from
the Java App, and serve it statically using httpd or nginx?



-- 
Guang 


Re: [OT] Session timeout despite user activity - websockets on Tomcat 8.5.16

2017-08-09 Thread Guang Chao
On Thu, Aug 10, 2017 at 12:46 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Mark,
>
> On 8/9/17 11:35 AM, Mark Thomas wrote:
> > On 09/08/17 16:09, David Wall wrote:
> >> We're using Tomcat 8.5.16 with Java 1.8.0_91, Vaadin 7.7.10 and
> >> Atmosphere Websockets.
> >>
> >> We have had reports of sessions logging out while users are
> >> active with our Vaadin-based application.  This has been
> >> frustrating as we can't seem to track down why Tomcat's session
> >> is not being updated, but figure it's something to do with the
> >> websockets/push not updating Tomcat reliably.
> >>
> >> Our app shows a "last sent to server" timestamp that seems to
> >> keep current with user activity, updating as the user clicks on
> >> buttons, checkboxes, etc.
> >>
> >> We also have a "list of active sessions" screen that shows all
> >> active sessions including the HttpSession.getCreationTime() and
> >> HttpSession.getLastAccessedTime().  We see it appears as if the
> >> last accessed time stops being updated when using simple forms
> >> that perhaps update via websockets rather than HTTP requests.
> >> Our "last sent to server" timestamp shows each of these clicks
> >> updating it, but the HttpSession.getLastAccessedTime() is not
> >> updating.
> >>
> >> Is there something about push/websockets or anything else that
> >> would cause the HttpSession access time not to update?  I don't
> >> think we have a way to update it ourselves as I believe it's
> >> managed by Tomcat itself, but as Tomcat is handling the websocket
> >> requests, it's unclear why they are not tied to the HttpSession.
> >>
> >> Anybody have any ideas?  Thanks as we have a lot of frustrated
> >> users who would love for us to find out what's going astray.
> >
> > What you are seeing is expected behaviour. This was discussed in
> > the WebSocket EG. The short version is: - WebSocket requests don't
> > update the session's last accessed time - you need an HTTP request
> > from the browser to update the session's last accessed time (and
> > update the expiry time of the browser's session cookie) - so the
> > application has to do periodic HTTP requests.
> >
> > You can reduce the frequency of these requests by extending the
> > session timeout (remembering you need an HTTP request after this to
> > update the browser's cookie). You then need to be careful to reduce
> > the timeout again once WebSocket comms end.
>
> Websocket ignoramus, here. Is there a way for (websocket) application
> code on the server side to trigger a "touch" of the HttpSession that
> is linked with the connection? Or is the problem that the websocket
> connection and the HTTP connection are essentially independent?
>
>
Maybe just have a javascript with settimeout to poll heartbeat via http
request.


> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlmLPEUACgkQHPApP6U8
> pFjVpRAAhIk//uWfkihpjwqp75MwDqe4mlAN3zbdvLoa4EU0QJyA8fZRnIFuO7Gg
> ksQYycpuGniEMPQH+l4Mb3T5/KogTkY3DZrBRh7vN+8oA3ELayuqTxDAdNjjsnmg
> uKWeYv3obL8pZQuSb5hVFXx4Dfe6pAXWk7CwuHls5Cs97lRqvN9C5lQM1QPArPpt
> nqNnDUm7HHmrSZVo82bdJxgXfpRXnoIg5qie3wGURHzdQK4JZGpZY7jJDAmM/HTW
> QNHg2saIFR1ce5YdGD2UZ5KbcVylfP1vX3oQZj9O+ytRGW37qiuAqjkuLZ73gJt7
> Xlz/6hAwxq+RMsfysJQitdytAcZj/BZQs3OesvcYxSpG9M2zOs3y6Pi+V7ieRk+i
> GbwGFzlGzmyA8LWdpgWFNHjGPlGwa04ALtp/zN6MoovULZs9XskUd3PBM622roJ2
> A+BUrr1GHo8nbcnStcTdL9JQuyrjFPOyyT+FUQR0pWk/PQKutpMzqoKYgK/CWcBv
> bxiREyfCOxTMLKkWXp4tZV6zMakdk+/srbPJbW35HS7PJT6iTP1ldWjh2hw4XXbD
> Jn1OXXJQZ6AHDPGMpKSAvVeCQre/jb6yvFhsgHYz1VjZs5dIw8kqgy5AZrgnjwcX
> 9azk5oNJon6AplWbnN0QVddP+rmxgiPwyvu7ywgxrlgdU3ykazo=
> =h6fX
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Guang



Re: Errors establishing secure connections with tomcat 8.5.15

2017-07-13 Thread Guang Chao
On Fri, Jul 7, 2017 at 9:51 PM, Kevin Mango <kma...@nysif.com> wrote:

>
>
> -Original Message-
> From: André Warnier (tomcat) [mailto:a...@ice-sa.com]
> Sent: Friday, July 7, 2017 4:14 AM
> To: users@tomcat.apache.org
> Subject: Re: Errors establishing secure connections with tomcat 8.5.15
>
> 1) don't top-post
>
> On 07.07.2017 02:39, Guang Chao wrote:
> > Sorry, the Tomcat will connect to other web applications hosted
> > somewhere else in your network?  Is my understanding correct?
> >
> > On Fri, Jul 7, 2017 at 12:38 AM, Kevin Mango <kma...@nysif.com> wrote:
> >
> >> Hello,
> >>
> >> I have been working to setup Apache Tomcat 8.5.15 to establish a
> >> secure connection to web applications on our server. However I have
> >> been having difficulties setting up this functionality.
> >>
> >> The most meaningful error we have been getting is from Firefox,
> >> "Unsupported elliptic curve. Error code: SEC_ERROR_UNSUPPORTED_
> ELLIPTIC_CURVE".
> >> We have setup Tomcat to fully debug javax.net, and from these logs it
> >> appears that the handshake is failing at the server or client key
> >> exchanges. Below is the output after reaching the server key exchange:
> >>
> >> ECDH ServerKeyExchange
> >> Signature Algorithm SHA256withRSA
> >> Server key: 
> >> *** ServerHelloDone
> >> [write] MD5 and SHA1 hashes:  len = 5073 
> >> https-jsse-nio-8443-exec-3, WRITE: TLSv1.2 Handshake, length = 5073
> >> [Raw write]: length = 5078 
> >> https-jsse-nio-8443-exec-1, WRITE: TLSv1.2 Handshake, length = 5073
> >> [Raw write]: length = 5078  [Raw read]: length =
> >> 2  
> >> https-jsse-nio-8443-exec-5, READ: TLSv1.2 Alert, length = 2
> >> https-jsse-nio-8443-exec-5, RECV TLSv1.2 ALERT:  fatal,
> >> illegal_parameter https-jsse-nio-8443-exec-5, fatal: engine already
> >> closed.  Rethrowing
> >> javax.net.ssl.SSLException: Received fatal alert: illegal_parameter
> >> https-jsse-nio-8443-exec-5, fatal: engine already closed.  Rethrowing
> >> javax.net.ssl.SSLException: Received fatal alert: illegal_parameter
> >> https-jsse-nio-8443-exec-5, called closeOutbound()
> >> https-jsse-nio-8443-exec-5, closeOutboundInternal()
> >> https-jsse-nio-8443-exec-5, SEND TLSv1.2 ALERT:  warning, description
> >> = close_notify https-jsse-nio-8443-exec-5, WRITE: TLSv1.2 Alert,
> >> length = 2
> >> 
> >> 
> >> 
> >> --
> >> There isn't any error output from stderr, only standard print
> statements.
> >> The ciphersuite that is chosen is TLS_ECDHE_RSA_WITH_AES_128_
> GCM_SHA256.
> >> Below are some details about the machine we are running tomcat on:
> >>
> >> Windows Server 2012 R2 64 bit
> >> 16gb ram
> >> 2.2ghz intel xeon cpu
> >> Java 1.8.131
> >>
> >> Here is the connector in our server.xml file:
> >>
> >>  >> protocol="org.apache.coyote.http11.Http11NioProtocol"
> >> maxThreads="200"
> >> scheme="https" secure="true" SSLEnabled="true"
> >> defaultSSLHostConfigName=" "
> >> >
> >> >>  hostname=" "
> >>  protocols="TLSv1.2"
> >>  sslProtocol="TLSv1.2">
> >>   >>   certificateKeystorePassword=""
> >>   certificateKeystoreType="PKCS12"
> >>   type="RSA"/>
> >>
> >>
> >>  
> >>
> >> Some additional notes:
> >>
> >>1.  The server we are running this on is internal and therefore
> >> can't be accessed outside our network
> >>2.  The web browser on the machine is unable to access the web
> >> application locally due to our network security
> >>3.  I am able to connect via http to the web apps
> >>
> >> Any assistance that could be provided in this matter would be greatly
> >> appreciated.
> >>
> >> Thank you,
> >> Kevin
> >>
> >>
>
> 2) One thing which you 

Re: Getting tablib definition issues in tomcat8

2017-07-12 Thread Guang Chao
On Thu, Jul 13, 2017 at 12:06 AM, D, Dwarakesh (External) <
dwarakes...@xerox.com> wrote:

> Hi Team,
>
> I am trying to deploy a web application in tomcat 8 and getting the error
> 'taglib definition not consistent with specification version' in web.xml.
> I have the Jstl1.2.jar under my /lib directory. Do I need to make any
> other changes?
> Below is the content of my web.xml.
>
> 
> http://java.sun.com/xml/ns/j2ee;
>   xmlns:xsi=
>   "http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=
> "http://java.sun.com/xml/ns/j2ee
>   http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd; version="3.0">
> --
>
> 
> ...
> /WEB-INF/taglib/x.tld
>

Can you share contents of the tld file?


> 
>
>
> 
>
> Thanks,
> Dwarak
>
>


-- 
Guang 


Re: tomcat 8.5.16 silent exit without any error logs on ubuntu 16.04.2

2017-07-11 Thread Guang Chao
Can you try "grep -i 'killed process' /var/log/messages"

On Tue, Jul 11, 2017 at 12:49 PM, 李员外 <281170...@qq.com> wrote:

> Yes,  I have done that in fact. I download zip file, and unzip, then chmod
> 777 startup.sh.  Problems love me still. I am trying to monitor tomcat
> remotely.
>
>
> --
> 做自己
>
>
>
>
>
>
>
> -- 原始邮件 --
> 发件人: "Guang Chao";<guang.chao.1...@gmail.com>;
> 发送时间: 2017年7月11日(星期二) 中午12:34
> 收件人: "Tomcat Users List"<users@tomcat.apache.org>;
>
> 主题: Re: tomcat 8.5.16 silent exit without any error logs on ubuntu 16.04.2
>
>
>
> On Sun, Jul 9, 2017 at 7:10 PM, 李员外 <281170...@qq.com> wrote:
>
> > There is any file name started with hs_err_, also has no any dumps under
> > the /tmp folder. Really helplessness...
> >
> >
> Can you try not using Tomcat from the package manager?  Just download for
> example
> http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.16/bin/
> apache-tomcat-8.5.16.zip
> put your app in the webapps directory and execute bin/startup.sh
>
>
> >
> > --
> > 做自己
> >
> >
> >
> >
> >
> >
> >
> > -- 原始邮件 --
> > 发件人: "Greg Huber";<gregh3...@gmail.com>;
> > 发送时间: 2017年7月7日(星期五) 下午4:08
> > 收件人: "Tomcat Users List"<users@tomcat.apache.org>;
> >
> > 主题: Re: tomcat 8.5.16 silent exit without any error logs on ubuntu
> 16.04.2
> >
> >
> >
> > Check /tmp for any dumps,  hs_err_pid.log if there is a jdk issue.
> >
> > Sometimes jsvc restarts for me :
> >
> > V  [libjvm.so+0x98f752]  oopDesc*
> > PSPromotionManager::copy_to_survivor_space(oopDesc*)+0x162
> >
> >
> > On 7 July 2017 at 02:22, 李员外 <281170...@qq.com> wrote:
> >
> > > Will try that. The RAM of machine is 8 GigaByte, 4-core CPU, even if
> > > silent exit is caused by Insufficient  memory, at least, tomcat would
> > > record error info to log file, right?
> > >
> > >
> > > Thanks in advance!
> > > --
> > > 做自己
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > -- 原始邮件 --
> > > 发件人: "Guang Chao";<guang.chao.1...@gmail.com>;
> > > 发送时间: 2017年7月7日(星期五) 上午8:26
> > > 收件人: "Tomcat Users List"<users@tomcat.apache.org>;
> > >
> > > 主题: Re: tomcat 8.5.16 silent exit without any error logs on ubuntu
> > 16.04.2
> > >
> > >
> > >
> > > How much RAM your hardware have?  Have you tried installing Tomcat from
> > > download and make it  a service through your own init scripts?  (E.g.
> > > https://gist.github.com/miglen/5590986)
> > >
> > > On Fri, Jul 7, 2017 at 12:40 AM, 李员外 <281170...@qq.com> wrote:
> > >
> > > > Hi, guys
> > > >
> > > >
> > > > I use tomcat 8.5.16, and I found at least 5 times tomcat silent exit
> > > > without any error logs after keep running 2-3 days, that means
> > > catalina.out
> > > > has no error info located in /opt/apache-tomcat-8.5.16/logs/.
> > > > And application log file also has no error info.
> > > > I do not know why? How should I to find out reason?
> > > >
> > > >
> > > > Please help me!
> > > > Thanks in advance!
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 做自己
> > >
> > >
> > >
> > >
> > > --
> > > Guang <http://javadevnotes.com/java-string-contains-examples/>
> >
>
>
>
> --
> Guang <http://javadevnotes.com/java-int-array-examples/>




-- 
Guang <http://javadevnotes.com/java-initialize-array-examples/>


Re: Solution for the connection pool issue

2017-07-10 Thread Guang Chao
On Mon, Jul 10, 2017 at 3:20 PM, Sai Kumar 
wrote:

> Hi Users,
>
> im getting the connection pool issue.
>
>
> *Unable to fetch a connection in xx seconds, none available[size:xxx;
> busy:xxx; idle:xx; lastwait:]. *
>
> *And Idle count is incresing more than the Maxidle connections.*
>
>
>
>
> *Here is the server.xml configured file,*
> >
> >  > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> > type="javax.sql.DataSource" maxActive="100"
> > minIdle="10" maxIdle="30"
> > maxWait="1" username="@scc.datasource.
> username@"
> > password="@scc.datasource.password@"
> > driverClassName="@scc.datasource.driver@"
> > url="@scc.datasource.driverurl@" logAbandoned="true"
> > validationQuery="SELECT 1"
> >   removeAbandoned="true"
> >   testOnBorrow="true"
> >   testWhileIdle="true"
> >   timeBetweenEvictionRunsMillis="1"
> >   minEvictableIdleTimeMillis="18"
> >   removeAbandonedTimeout="60"
> > />
> >  > auth="Container" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> > type="javax.sql.DataSource" maxActive="100"
> > minIdle="10" maxIdle="30"
> > maxWait="1"
> > username="@scc.reports.datasource.username@"
> > password="@scc.reports.datasource.password@"
> > driverClassName="@scc.reports.datasource.driver@
> "
> > url="@scc.reports.datasource.driverurl@" logAbandoned="true"
> > validationQuery="SELECT 1"
> >   removeAbandoned="true"
> >   testOnBorrow="true"
> >   testWhileIdle="true"
> >   timeBetweenEvictionRunsMillis="1"
> >   minEvictableIdleTimeMillis="18"
> >   removeAbandonedTimeout="60"
> >   />
> >  > auth="Container" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> > type="javax.sql.DataSource" maxActive="100"
> > minIdle="10"  maxIdle="30"
> > maxWait="1"
> > username="@scc.tickets.datasource.username@"
> > password="@scc.tickets.datasource.password@"
> > driverClassName="@scc.tickets.datasource.driver@
> "
> > url="@scc.tickets.datasource.driverurl@"
> > validationQuery="SELECT 1"
> >   removeAbandoned="true"
> >   testOnBorrow="true"
> >   testWhileIdle="true"
> >   timeBetweenEvictionRunsMillis="1"
> >   minEvictableIdleTimeMillis="18"
> >   removeAbandonedTimeout="60"
> >   />
> >> auth="Container" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> > type="javax.sql.DataSource" maxActive="100"
> > minIdle="10" maxIdle="30"
> > maxWait="1"
> > username="@monitoring.datasource.username@"
> > password="@monitoring.datasource.password@"
> > driverClassName="@monitoring.datasource.driver@"
> > url="@monitoring.datasource.driverurl@"
> > validationQuery="SELECT 1"
> >   removeAbandoned="true"
> >   testOnBorrow="true"
> >   testWhileIdle="true"
> >   timeBetweenEvictionRunsMillis="1"
> >   minEvictableIdleTimeMillis="18"
> >   removeAbandonedTimeout="60"
> >   />
> >
>
>
> I checked my code,There is no problem with closing connections and all.
>
>
Can you share your code that looks up for connection?


>
> I was tried with upgrading tomcat from 7.0.52 to minor versions of 7.0.x
> and Major version 8.0.x too.
>
> Please tell me the solution permanent solution for this.
>
>
> --
> S Saikumar
>



-- 
Guang 


Re: tomcat 8.5.16 silent exit without any error logs on ubuntu 16.04.2

2017-07-10 Thread Guang Chao
On Sun, Jul 9, 2017 at 7:10 PM, 李员外 <281170...@qq.com> wrote:

> There is any file name started with hs_err_, also has no any dumps under
> the /tmp folder. Really helplessness...
>
>
Can you try not using Tomcat from the package manager?  Just download for
example
http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.16/bin/apache-tomcat-8.5.16.zip
put your app in the webapps directory and execute bin/startup.sh


>
> --
> 做自己
>
>
>
>
>
>
>
> -- 原始邮件 --
> 发件人: "Greg Huber";<gregh3...@gmail.com>;
> 发送时间: 2017年7月7日(星期五) 下午4:08
> 收件人: "Tomcat Users List"<users@tomcat.apache.org>;
>
> 主题: Re: tomcat 8.5.16 silent exit without any error logs on ubuntu 16.04.2
>
>
>
> Check /tmp for any dumps,  hs_err_pid.log if there is a jdk issue.
>
> Sometimes jsvc restarts for me :
>
> V  [libjvm.so+0x98f752]  oopDesc*
> PSPromotionManager::copy_to_survivor_space(oopDesc*)+0x162
>
>
> On 7 July 2017 at 02:22, 李员外 <281170...@qq.com> wrote:
>
> > Will try that. The RAM of machine is 8 GigaByte, 4-core CPU, even if
> > silent exit is caused by Insufficient  memory, at least, tomcat would
> > record error info to log file, right?
> >
> >
> > Thanks in advance!
> > --
> > 做自己
> >
> >
> >
> >
> >
> >
> >
> > -- 原始邮件 --
> > 发件人: "Guang Chao";<guang.chao.1...@gmail.com>;
> > 发送时间: 2017年7月7日(星期五) 上午8:26
> > 收件人: "Tomcat Users List"<users@tomcat.apache.org>;
> >
> > 主题: Re: tomcat 8.5.16 silent exit without any error logs on ubuntu
> 16.04.2
> >
> >
> >
> > How much RAM your hardware have?  Have you tried installing Tomcat from
> > download and make it  a service through your own init scripts?  (E.g.
> > https://gist.github.com/miglen/5590986)
> >
> > On Fri, Jul 7, 2017 at 12:40 AM, 李员外 <281170...@qq.com> wrote:
> >
> > > Hi, guys
> > >
> > >
> > > I use tomcat 8.5.16, and I found at least 5 times tomcat silent exit
> > > without any error logs after keep running 2-3 days, that means
> > catalina.out
> > > has no error info located in /opt/apache-tomcat-8.5.16/logs/.
> > > And application log file also has no error info.
> > > I do not know why? How should I to find out reason?
> > >
> > >
> > > Please help me!
> > > Thanks in advance!
> > >
> > >
> > >
> > >
> > > --
> > > 做自己
> >
> >
> >
> >
> > --
> > Guang <http://javadevnotes.com/java-string-contains-examples/>
>



-- 
Guang <http://javadevnotes.com/java-int-array-examples/>


Re: Errors establishing secure connections with tomcat 8.5.15

2017-07-06 Thread Guang Chao
Sorry, the Tomcat will connect to other web applications hosted somewhere
else in your network?  Is my understanding correct?

On Fri, Jul 7, 2017 at 12:38 AM, Kevin Mango  wrote:

> Hello,
>
> I have been working to setup Apache Tomcat 8.5.15 to establish a secure
> connection to web applications on our server. However I have been having
> difficulties setting up this functionality.
>
> The most meaningful error we have been getting is from Firefox,
> "Unsupported elliptic curve. Error code: 
> SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE".
> We have setup Tomcat to fully debug javax.net, and from these logs it
> appears that the handshake is failing at the server or client key
> exchanges. Below is the output after reaching the server key exchange:
>
> ECDH ServerKeyExchange
> Signature Algorithm SHA256withRSA
> Server key: 
> *** ServerHelloDone
> [write] MD5 and SHA1 hashes:  len = 5073
> 
> https-jsse-nio-8443-exec-3, WRITE: TLSv1.2 Handshake, length = 5073
> [Raw write]: length = 5078
> 
> https-jsse-nio-8443-exec-1, WRITE: TLSv1.2 Handshake, length = 5073
> [Raw write]: length = 5078
> 
> [Raw read]: length = 2
> 
> 
> https-jsse-nio-8443-exec-5, READ: TLSv1.2 Alert, length = 2
> https-jsse-nio-8443-exec-5, RECV TLSv1.2 ALERT:  fatal, illegal_parameter
> https-jsse-nio-8443-exec-5, fatal: engine already closed.  Rethrowing
> javax.net.ssl.SSLException: Received fatal alert: illegal_parameter
> https-jsse-nio-8443-exec-5, fatal: engine already closed.  Rethrowing
> javax.net.ssl.SSLException: Received fatal alert: illegal_parameter
> https-jsse-nio-8443-exec-5, called closeOutbound()
> https-jsse-nio-8443-exec-5, closeOutboundInternal()
> https-jsse-nio-8443-exec-5, SEND TLSv1.2 ALERT:  warning, description =
> close_notify
> https-jsse-nio-8443-exec-5, WRITE: TLSv1.2 Alert, length = 2
> 
> 
> 
> --
> There isn't any error output from stderr, only standard print statements.
> The ciphersuite that is chosen is TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256.
> Below are some details about the machine we are running tomcat on:
>
> Windows Server 2012 R2 64 bit
> 16gb ram
> 2.2ghz intel xeon cpu
> Java 1.8.131
>
> Here is the connector in our server.xml file:
>
> protocol="org.apache.coyote.http11.Http11NioProtocol"
>maxThreads="200"
>scheme="https" secure="true" SSLEnabled="true"
>defaultSSLHostConfigName=" "
>>
>hostname=" "
> protocols="TLSv1.2"
> sslProtocol="TLSv1.2">
>   certificateKeystorePassword=""
>  certificateKeystoreType="PKCS12"
>  type="RSA"/>
>   
>
> 
>
> Some additional notes:
>
>   1.  The server we are running this on is internal and therefore can't be
> accessed outside our network
>   2.  The web browser on the machine is unable to access the web
> application locally due to our network security
>   3.  I am able to connect via http to the web apps
>
> Any assistance that could be provided in this matter would be greatly
> appreciated.
>
> Thank you,
> Kevin
>
>
>
> 
> This e-mail transmission contains confidential information that is the
> property of the sender. If you are not the intended recipient, you are
> notified that any retention, disclosure, reproduction or distribution of
> the contents of this e-mail transmission, or the taking of any action in
> reliance thereon or pursuant thereto, is strictly prohibited. No warranty
> is given by NYSIF that this e-mail is free of viruses, interception or
> interference. NYSIF disclaims liability for any unauthorized opinion,
> representation, statement, offer or contract made by the sender on behalf
> of NYSIF. NYSIF's delegation of authorities, setting out who may make
> representations or contract on behalf of NYSIF, is available by contacting
> NYSIF at mail...@nysif.com. Jurisdiction for all actions arising out of
> dealings with NYSIF shall lie only in a court of competent jurisdiction of
> the State of New York
>



-- 
Guang



Re: tomcat 8.5.16 silent exit without any error logs on ubuntu 16.04.2

2017-07-06 Thread Guang Chao
How much RAM your hardware have?  Have you tried installing Tomcat from
download and make it  a service through your own init scripts?  (E.g.
https://gist.github.com/miglen/5590986)

On Fri, Jul 7, 2017 at 12:40 AM, 李员外 <281170...@qq.com> wrote:

> Hi, guys
>
>
> I use tomcat 8.5.16, and I found at least 5 times tomcat silent exit
> without any error logs after keep running 2-3 days, that means catalina.out
> has no error info located in /opt/apache-tomcat-8.5.16/logs/.
> And application log file also has no error info.
> I do not know why? How should I to find out reason?
>
>
> Please help me!
> Thanks in advance!
>
>
>
>
> --
> 做自己




-- 
Guang