RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
Thanks. I willl try that. Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 15:32:29 -0400> Subject: RE: Singleton in Tomcat 6.0 not working> > I think the Tomcat support in Eclipse WTP is pretty reasonable, but it isn't perfect. For ex

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Larry Isaacs
MAIL PROTECTED] > Sent: Thursday, June 05, 2008 2:24 PM > To: Tomcat Users List > Subject: RE: Singleton in Tomcat 6.0 not working > > > By the way, I was using the Eclipse 3.3, it integrated the Tomcat > development tool. It was the Eclipse add that line to the server.xml. > May

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
:03 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROTECTED]> > Subject: RE: Singleton in Tomcat 6.0 not working> >> > Did you mean I should just remove this element> > from the server.xml?> > You should never have put

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
It works. You are the best :> Thanks a lot. Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 13:15:03 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROTECTED]> > Subject: RE: Single

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > Did you mean I should just remove this element > from the server.xml? You should never have put it in there, so definitely remove it. If you need to set the reloadable attribute

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
I changed the package name. (by only removed the compay name), as I am not supposed to expose the source code. Sorry about that. Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 13:08:14 -0500> Subject: RE: Singleton in Tomcat 6.0 not workin

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
Did you mean I should just remove this element from the server.xml? Thanks Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 12:55:58 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROT

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > -- Filter--- > public class ElwinFilter implements Filter > -- web.xml - > > Elwin Filter > > com.elwin.IMeraFilter >

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > Context from the server.xml > source="org.eclipse.jst.jee.server:ROOT"/> Right there is a problem: the path attribute should be "", not &quo

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
And yes, both have the call. I double checked, both trace log are exact the same. Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 12:30:53 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROT

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
ache.org> Date: Thu, 5 Jun 2008 12:30:53 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROTECTED]> > Subject: RE: Singleton in Tomcat 6.0 not working> >> > I got twice of the following:> > ==> >

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
ilter com.elwin.IMeraFilter Elwin Filter /* --- > From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 > 12:23:03 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: > ktou Ho [mailto:[EMAIL PROTECTED]> >

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > I got twice of the following: > == > com.elwin.sql.RemoteDBConnections.(RemoteDBConnections.java:22) Let's double-check here: both traces include the call f

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
rom: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Thu, 5 Jun 2008 12:11:24 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: ktou Ho [mailto:[EMAIL PROTECTED]> > Subject: RE: Singleton in Tomcat 6.0 not working> >> > Have you tried to p

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > I tried to change the web app to other name, it works fine > now. (only one instance). Look like it is the "ROOT" cause > all problem. Any one know why the ROOT is being

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > Have you tried to put in it the "ROOT"? Yes, I've tried putting it in ROOT, and I get only a single instance, using Tomcat 6.0.16 under JDK 1.6.0_06. For more informati

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
...) line: 597 > Bootstrap.start() line: 288 > Bootstrap.main(String[]) line: 413 > > --> > From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Subject: Re: Singleton in Tomcat 6.0 not working> Date: Thu, 5 Jun 2008 17:19:57 +0200> > > - Original Message

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 Bootstrap.start() line: 288 Bootstrap.main(String[]) line: 413 -- > From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Subject: Re: Singleton > in Tomcat

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread ktou Ho
I got two objects: [EMAIL PROTECTED] and [EMAIL PROTECTED] Thanks Elwin > Date: Thu, 5 Jun 2008 17:06:00 +0200> From: [EMAIL PROTECTED]> To: > users@tomcat.apache.org> Subject: Re: Singleton in Tomcat 6.0 not working> > > ktou Ho wrote:> > The problem I am

Re: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Johnny Kewl
- Original Message - From: "Mikolaj Rydzewski" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Thursday, June 05, 2008 5:06 PM Subject: Re: Singleton in Tomcat 6.0 not working ktou Ho wrote: The problem I am facing is the Singleton is not working at all

Re: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Mikolaj Rydzewski
ktou Ho wrote: The problem I am facing is the Singleton is not working at all in the servlet. I tried to synchnozed the constructor or make it static. I still get two instances of the objects. How can I solve the problem? Is anyone able to reproduce this? public class RemoteDBConnections

RE: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > Get some hints from this link > http://books.google.com/books?id=bgMKmsXVbTAC&pg=PA304&vq=sing > leton&dq=tomcat+6+singleton+not+working&source=gbs_search_s&si >

Re: Singleton in Tomcat 6.0 not working

2008-06-05 Thread Lilianne E. Blaze
Hello, Is there any particular reason you can't just use ServletContext Attribute instead of a static singleton? Greetings, Lilianne E. Blaze ktou Ho wrote: Hi, I am using Tomcat 6.0.16 with JDK 1.6. I created a web application and deployed it as ROOT. (I removed the default ROOT which comes

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
ird... Still don't know why this happend... Thanks Elwin > From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Subject: Re: Singleton > in Tomcat 6.0 not working> Date: Thu, 5 Jun 2008 04:44:54 +0200> > > - > Original Message - > From: "Cal

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
Not it doesn't. It is a test class only contains the constructor and the getInstance() method. Thanks Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Wed, 4 Jun 2008 19:38:09 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > Fr

Re: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Johnny Kewl
- Original Message - From: "Caldarale, Charles R" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Thursday, June 05, 2008 4:18 AM Subject: RE: Singleton in Tomcat 6.0 not working From: Johnny Kewl [mailto:[EMAIL PROTECTED] Subject: Re: Singleton in Tom

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Caldarale, Charles R
> From: Johnny Kewl [mailto:[EMAIL PROTECTED] > Subject: Re: Singleton in Tomcat 6.0 not working > > Doing > RemoteDBConnections obj = new RemoteDBConnections().getInstance(); > would make 2 counters Except the constructor is private, so the above can't be done outside of t

Re: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Johnny Kewl
- Original Message - From: "ktou Ho" <[EMAIL PROTECTED]> To: Sent: Thursday, June 05, 2008 12:14 AM Subject: Singleton in Tomcat 6.0 not working Hi, I am using Tomcat 6.0.16 with JDK 1.6. I created a web application and deployed it as ROOT. (I removed the default

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > I print out the counter in the constructor. ( I also using a > debugger check, my filter got call twice also). Do you have any subclasses of the class with the singleton? If

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
> So you're seeing two print lines from the constructor, the first with a value > of 0, the second with a value of 1? Is that correct? Yes. Elwin> From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Wed, 4 Jun 2008 18:33:33 -0500> Subject: RE: Singleton in

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > I print out the counter in the constructor. ( I also using a > debugger check, my filter got call twice also). So you're seeing two print lines from the constructor, the first wit

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
ut the in the server.xml under > TOMCAT/conf ?! I only have one, and it is Thanks Elwin > From: [EMAIL PROTECTED]> To: users@tomcat.apache.org> Date: Wed, 4 Jun 2008 > 18:21:12 -0500> Subject: RE: Singleton in Tomcat 6.0 not working> > > From: > ktou Ho [mailto

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Caldarale, Charles R
> From: ktou Ho [mailto:[EMAIL PROTECTED] > Subject: RE: Singleton in Tomcat 6.0 not working > > I deploy the web app as ROOT.war to TOMCAT/webapps, (I > removed the old ROOT first for sure). And I am pretty sure, I > didn't deploy twice. How do you know you're

RE: Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
; To: > users@tomcat.apache.org> Subject: Re: Singleton in Tomcat 6.0 not working> > > > ktou Ho wrote:> > Hi,> > I am using Tomcat 6.0.16 with JDK 1.6. I created a > web application and deployed it as ROOT.> How did you deploy you app as ROOT? >

Re: Singleton in Tomcat 6.0 not working

2008-06-04 Thread Mark Thomas
ktou Ho wrote: Hi, I am using Tomcat 6.0.16 with JDK 1.6. I created a web application and deployed it as ROOT. How did you deploy you app as ROOT? It sounds like your app is deploying twice. Mark - To start a new topic, e-m

Singleton in Tomcat 6.0 not working

2008-06-04 Thread ktou Ho
Hi, I am using Tomcat 6.0.16 with JDK 1.6. I created a web application and deployed it as ROOT. (I removed the default ROOT which comes with tomcat). The problem I am facing is the Singleton is not working at all in the servlet. I tried to synchnozed the constructor or make it static. I still