Re: Tomcat 8 Connection Pooling

2017-07-18 Thread Riccardo Cohen
You'll find here : http://www.5flow.com/tmp/tomcatjndidb.zip a very small sample that works on my computer (with IntelliJ project). Just change the context.xml with your database. Viewing the home page will create a database, insert records, then display them. The data source is of type java

Re: Tomcat 8 Connection Pooling

2017-07-18 Thread Avinash Krishnan
Hello Riccardo, When I try using the pool properties(Without JNDI ) it gives me URL Cannot Be null error. What I have understood is that, when we make the data source as a static variable or a member variable of another class and try to use it another class's function it throws error. If I instant

Re: Getting user role membership without context

2017-07-18 Thread Mark Thomas
On 18/07/17 23:21, Alex O'Ree wrote: > Nice, any idea which method I need to call? You already have the Context so you want Context.findChildren() for a list of all the Wrappers (and it is the wrapper object you need) or Context.findChild(String) for a specific Wrapper if you know the name. Th

Re: Getting user role membership without context

2017-07-18 Thread Alex O'Ree
Nice, any idea which method I need to call? On Jul 18, 2017 3:54 PM, "Mark Thomas" wrote: > On 18/07/17 17:41, Alex O'Ree wrote: > > Alright, quick update on this. > > > > At this point, I have servlet context and a username running off the > > main tomcat http threads (quartz job) > > > >> Stan

Re: run thread from servlet

2017-07-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Lance, On 7/18/17 9:56 AM, Campbell, Lance wrote: > Tomcat 8.0.x Question: I am wanting to know the proper way to start > a thread from a servlet. > > Use Case: A batch process will call a URL that is a servlet. The > servlet will call a processes

Re: run thread from servlet

2017-07-18 Thread Mark Thomas
On 18/07/17 18:07, Campbell, Lance wrote: > Also if tomcat is shut down and a thread is running how does tomcat > communicate with my software to end a thread? It can't. The thread will either just stop if it is a Daemon thread or the Java process won't exit until your thread does. > Is this wh

Re: Getting user role membership without context

2017-07-18 Thread Mark Thomas
On 18/07/17 17:41, Alex O'Ree wrote: > Alright, quick update on this. > > At this point, I have servlet context and a username running off the > main tomcat http threads (quartz job) > >> StandardContext tomcat;load from reflection from ApplicationContext from >> ServletContext as Applicatio

RE: run thread from servlet

2017-07-18 Thread Campbell, Lance
Also if tomcat is shut down and a thread is running how does tomcat communicate with my software to end a thread? Is this where you were referring to the servlet context listener? -Original Message- From: Campbell, Lance [mailto:la...@illinois.edu] Sent: Tuesday, July 18, 2017 12:00 P

RE: run thread from servlet

2017-07-18 Thread Campbell, Lance
Basically I have batch jobs that I need to run on many different web applications. The batch jobs call servlets that then create threads to do whatever task I need done behind the scenes. The servlets immediately return a message after starting the batch threaded job.However my understandi

Re: Tomcat 8.5.16 - APR version mismatch error upon startup

2017-07-18 Thread M. Manna
Thanks Konstantin 1) Our %CATALINA_HOME% and %CATALINA_BASE% are both pointing to the root of the binary folder - as described by the Reading.txt 2) We have never set anything for java.library.path - and it has always worked because %CATALINA_HOME%\bin is part of the search path. Our application

Re: Reverse proxy support in Tomcat

2017-07-18 Thread Igal @ Lucee.org
On 7/18/2017 6:29 AM, Mark Thomas wrote: Note: Passing on the host header can require explicit configuration. In the proxy. e.g. for httpd: ProxyPreserveHost On The best tool that I found to set up reverse proxy is Tomcat's RemoteIpFilter -- https://tomcat.apache.org/tomcat-8.5-doc/api/org/a

Re: Getting user role membership without context

2017-07-18 Thread Alex O'Ree
Alright, quick update on this. At this point, I have servlet context and a username running off the main tomcat http threads (quartz job) > StandardContext tomcat;load from reflection from ApplicationContext from > ServletContext as ApplicationContextFacade > Realm realm = tomcat.getRealm()

Re: Tomcat 8.5.16 - APR version mismatch error upon startup

2017-07-18 Thread Konstantin Kolinko
2017-07-18 17:42 GMT+03:00 M. Manna : > Hello, > > We have recently upgraded our tomcat from 8.0.29 to 8.5.16. As part of > standard upgrade we have cleaned up all our bin/conf/lib folder contents > and removed any older jars (e.g. ecj jars). > > Upon startup - we are getting the following error: >

Re: Tomcat 8 Connection Pooling

2017-07-18 Thread Riccardo Cohen
Can you see any info in the log : login incorrect, database not found etc. ? (There are many logs in tomcat : localhost log, catalina log, manager log, host manager log, localhost access log) On 18/07/2017 13:55, Avinash Krishnan wrote: Hello Riccardo , Thanks for the response. This didn't wo

Re: Tomcat 8.5.16 - APR version mismatch error upon startup

2017-07-18 Thread Mark Thomas
On 18/07/17 15:42, M. Manna wrote: > Hello, > > We have recently upgraded our tomcat from 8.0.29 to 8.5.16. As part of > standard upgrade we have cleaned up all our bin/conf/lib folder contents > and removed any older jars (e.g. ecj jars). That sounds like you have been installing new versions on

Tomcat 8.5.16 - APR version mismatch error upon startup

2017-07-18 Thread M. Manna
Hello, We have recently upgraded our tomcat from 8.0.29 to 8.5.16. As part of standard upgrade we have cleaned up all our bin/conf/lib folder contents and removed any older jars (e.g. ecj jars). Upon startup - we are getting the following error: Listening for transport dt_socket at address: 5005

RE: run thread from servlet

2017-07-18 Thread Tran, Dung Minh
Hello Pradip, Thanks for the comments. Could you please clarify the statement "the servlet can enque the data in a concurrent queue, and then notify the object " ? Would you assume that there would be two threads in the servlet ? One is context listener thread, and the other is enqueue data th

Re: run thread from servlet

2017-07-18 Thread Pradip Bhattacharya
Hello, I hope I understood the requirement correctly. I believe you can start EmailProcess thread by the context listener. This thread can wait on an object. And the servlet can enque the data in a concurrent queue, and then notify the object, on which EmailProcess thread is waiting. Is this EmailP

run thread from servlet

2017-07-18 Thread Campbell, Lance
Tomcat 8.0.x Question: I am wanting to know the proper way to start a thread from a servlet. Use Case: A batch process will call a URL that is a servlet. The servlet will call a processes that will trigger a thread to run to do a particular job. The thread will run for a while. The servlet wi

Re: Reverse proxy support in Tomcat

2017-07-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 André, On 7/18/17 8:29 AM, André Warnier (tomcat) wrote: > Hi. > > On 18.07.2017 14:09, Jan Hlavatý wrote: >> Hello, >> >> I can't seem to figure out the proper setup for the situation >> where I have multiple webhosts behind a reverse proxy serve

Re: Reverse proxy support in Tomcat

2017-07-18 Thread Mark Thomas
On 18/07/17 13:29, André Warnier (tomcat) wrote: > Hi. > > On 18.07.2017 14:09, Jan Hlavatý wrote: >> Hello, >> >> I can't seem to figure out the proper setup for the situation where I >> have multiple webhosts behind a reverse proxy server being forwarded to >> Tomcat. >> >> There can be only one

Re: Reverse proxy support in Tomcat

2017-07-18 Thread tomcat
Hi. On 18.07.2017 14:09, Jan Hlavatý wrote: Hello, I can't seem to figure out the proper setup for the situation where I have multiple webhosts behind a reverse proxy server being forwarded to Tomcat. There can be only one proxyHost and proxyPort on a Connector but I have multiple Hosts and Al

Reverse proxy support in Tomcat

2017-07-18 Thread Jan Hlavatý
Hello, I can't seem to figure out the proper setup for the situation where I have multiple webhosts behind a reverse proxy server being forwarded to Tomcat. There can be only one proxyHost and proxyPort on a Connector but I have multiple Hosts and Aliases. How am I supposed to do that? Make mult

Re: Tomcat 8 Connection Pooling

2017-07-18 Thread Avinash Krishnan
Hello Riccardo , Thanks for the response. This didn't work for me. Connections are not getting initated and I am seeing java.lang.NullPointerException on accessing getConnection. I am refering to http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html The pool properties is also not working. On

Re: Tomcat 8 Connection Pooling

2017-07-18 Thread Riccardo Cohen
Hello Avinash I'm not expert but this is rather simple : in web/META-INF/context.xml write something like : in web/WEB-INF/web.xml add in tag : jdbc/tomcattest javax.sql.DataSource and in a java class add this : public class T3Servlet extends HttpSe

Tomcat 8 Connection Pooling

2017-07-18 Thread Avinash Krishnan
I am trying to implement Apache Tomcat 8.5.15 "Tomcat JDBC Connection Pool" using the steps mentioned in the guide. Can some one help me to understand how this connection pooling has to be done. Is the Plain Java Method,by implementing Pool Properties is an alternative to the JNDI lookup based p