RE: Template tool

2006-06-15 Thread GB Developer
Velocity can do 'templates as Strings'. 

> -Original Message-
> From: Michael Rimov [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 14, 2006 6:38 PM
> To: 'Tomcat Users List'
> Subject: RE: Template tool
> 
> 
> 
> > does it can handle  templates   from   String  or  has to 
> be  templates on
> > file
> 
> Nope, will work with a file. 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat java processes eat processor.

2006-06-19 Thread GB Developer
We use a slightly modified version of what was posted to this list a long
time back.  It lets us look at a running website and quite easily see which
of our pages have got themselves 'stuck'. 

http://marc.theaimsgroup.com/?l=tomcat-user&m=109455426721082&w=2

(It's at the bottom of that page.)

Further along in the thread is this helpful filter: 
http://marc.theaimsgroup.com/?l=tomcat-user&m=109464294927932&w=2



> -Original Message-
> From: Rick Cockerham [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 19, 2006 10:21 AM
> To: Tomcat Users List
> Subject: Re: Tomcat java processes eat processor.
> 
> 
> 
> I wish it would give me a stack trace.  That would be wonderful.  The 
> part I left out was just a list of all the loaded libraries.
> 
> I can't risk a switch in software.  I realize this is a tough one.  I 
> have very little flexibility to help me debug.  That's why I'm asking 
> you guys!
> 
> Thanks,
> Rick
> 
> 
> 
> Leon Rosenberg wrote:
> > On 6/19/06, Rick Cockerham <[EMAIL PROTECTED]> wrote:
> >>
> >> OK.  I finally got a file dumped out from this kill.  But, 
> it doesn't 
> >> look interesting to me.  Any idea what this means to me?
> >>
> >> Any other debug ideas?
> >
> > a) paste complete stack trace
> > b) try a regular vm (suns for example)
> >
> > regards
> > Leon
> >>
> >> Thanks,
> >> Rick
> >>
> >> Unexpected Signal : 3 occurred at PC=0x45C6D876 
> >> Function=(null)+0x45C6D876 
> >> Library=/opt/blackdown-jdk-1.4.2.01/jre/lib/i386/server/libjvm.so
> >>
> >> NOTE: We are unable to locate the function name symbol for 
> the error
> >>   just occurred. Please refer to release documentation 
> for possible
> >>   reason and solutions.
> >>
> >> Dynamic libraries:
> >> 08048000-08057000 r-xp  08:03 815431 
> >> /opt/blackdown-jdk-1.4.2.01/bin/java
> >> ...
> >> ...etc.
> >>
> >> Heap at VM Abort:
> >> Heap
> >>  PSYoungGen  total 102400K, used 84863K [0x4a17, 
> 0x5377,
> >> 0x5377)
> >>   eden [0x4a17,0x4d1702f8,0x4d37)
> >>   from [0x4d37,0x4f64fc38,0x5057)
> >>   to   [0x5057,0x5057,0x5377)
> >>  PSOldGentotal 256000K, used 215274K [0x5377, 
> 0x6317,
> >> 0x6317)
> >>   object [0x5377,0x609aa8c0,0x6317)
> >>  PSPermGen   total 16384K, used 16250K [0x6317, 0x6417,
> >> 0x6717)
> >>   object [0x6317,0x6414e9f0,0x6417)
> >>
> >> Local Time = Mon Jun 19 09:27:56 2006
> >>
> >>
> >> Peter Crowther wrote:
> >> >> From: Rick Cockerham [mailto:[EMAIL PROTECTED]
> >> >> Didn't work.  -3 doesn't kill it.
> >> >>
> >> >
> >> > No.  It produces a thread dump, and the process carries on going.
> >> Given
> >> > that you were complaining about not wanting to restart 
> Tomcat twice 
> >> > daily, I thought you'd appreciate a non-fatal solution :-).
> >> >
> >> >   - Peter
> >> >
> >> > 
> ---
> >> > --
> >> > To start a new topic, e-mail: users@tomcat.apache.org
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> >
> >>
> >> --
> >>
> >> Rick Cockerham
> >> Pocket Knife Software, Inc. http://www.pocketknifesoftware.com
> >> 512-249-0467
> >>
> >>
> >> 
> -
> >> To start a new topic, e-mail: users@tomcat.apache.org
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > 
> -
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> -- 
> 
> Rick Cockerham
> Pocket Knife Software, Inc.
> http://www.pocketknifesoftware.com 
> 512-249-0467
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat's scalability

2006-06-19 Thread GB Developer
How do you propose to add a 'separate instance of Tomcat' without 'adding a
separate JVM'? 

Or do you/others mean by 'instance of tomcat' = 'a separate physical server
with single instance of JVM/Tomcat' ?

> 
> So far it sounds that the approach of adding separate 
> instance of Tomcat and using round robin is better than 
> adding a separate JVM.
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Interfaces and cast problems in Tomcat

2006-06-19 Thread GB Developer
What does the following tell you?

interfaz_dbms.cacheable temp;
temp = interfaz_dbms.cache.getReferencia().Buscar(id,n.getTipo()); 
// add this code below...
if (temp!=null) {
  System.out.println("class >" + temp.getClass() + "<");
}
// back to your code...
n= (materia.materias)temp;


Whatever is output between the >< symbols should be what you're trying to
cast to.   That code above is not meant to be used to program better (don't
try to use that code for 'real'), only to help others on the list diagnose
what the class is/should be.

For example, if we see the output:

Class >Materia.materias<  that means you haven't spelt the package named
correctly in your cast (Java is case-sensitive).




> -Original Message-
> From: Claudio Veas [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 19, 2006 4:15 PM
> To: users@tomcat.apache.org
> Subject: Interfaces and cast problems in Tomcat
> 
> 
> Hello my name is Claudio Veas Im very new in tomcat develop 
> and I was trying to use an interface to implement a cache. I 
> make all the objects that I wanted to keep in memory 
> implement "cacheable" interface so I could insert them into a 
> Vector and then minimize the timing when looking for the same 
> information.
> 
> I dont have problems storing information in cache, and I dont 
> have problems when I try to retrieve directly to a variable 
> declared "cacheable" but when I try a direct cast the server 
> shows me this error 
> 
> 
> 
> type Informe de Excepción
> 
> mensaje 
> 
> descripción El servidor encontró un error interno () que hizo 
> que no pudiera rellenar este requerimiento.
> 
> excepción 
> 
> org.apache.jasper.JasperException: materias.materias
> 
>   org.apache.jasper.servlet.JspServletWrapper
> handleJspException(JspServletWrapper.java:510)
> 
>   
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
> java:393)
> 
>   
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:314)
> 
>   
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> 
> 
> causa raíz 
> 
> java.lang.ClassCastException: materias.materias
> 
>   materia.experto_materias.getmaterias(experto_materias.java:54)
> 
>   org.apache.jsp.buscatema_jsp._jspService(buscatema_jsp.java:88)
> 
>   
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> 
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
>   
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
> java:332)
> 
>   
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:314)
> 
>   
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> 
> 
> nota La traza completa de la causa de este error se encuentra 
> en los archivos de diario de Apache Tomcat/5.5.16.
> 
> 
> 
> Here are the interface and the classes
> 
> 
> 
> 
> 
> CACHEABLE
> 
> package interfaz_dbms;
> 
> 
> 
> public interface cacheable {
> 
>   public  int getId();
> 
>   public  int getTipo();
> 
> }
> 
>  
> 
> CACHE (some cache procedures )
> 
> 
> 
>   public void agregar(cacheable obj){
> 
>   Enumeration e=memoria.elements();
> 
>   while(e.hasMoreElements()){
> 
>   cacheable temp = (cacheable) e.nextElement();
> 
>   if(obj.getId()==temp.getId()||obj.getTipo()==temp.getTipo()){
> 
>   return;
> 
>   }
> 
>   
> 
>   }
> 
>   memoria.addElement(obj);
> 
>} 
> 
> 
> 
> MATERIAS (this procedures gets all the "materias" (subjects) 
> that a profesor teaches,
> 
>  and i saves it in the cache object)
> 
> 
> 
>public static Vector getMateriaProf(int id){
> 
>Vector v=new Vector();
> 
>try{ String consulta ="SELECT 
> m.id_materia,m.nombre,m.descripcion " +
> 
>" FROM materia m, mat_profe mp, profesor p " +
> 
>" WHERE m.id_materia = mp.id_materia " +
> 
>" AND p.id_profesor = mp.id_profesor " +
> 
>" AND p.id_profesor=" + String.valueOf(id);
> 
> ResultSet rs = 
> conneccion.getconection().Consultar(consulta);
> 
> rs.next();
> 
>while(!(rs.isAfterLast())){
> 
>materias m=new 
> materias(rs.getInt("id_materia"),rs.getString(
> nombre"),rs.getString("descripcion")); 
> 
>v.addElement(m); 
> 
>if(cache.getReferencia().EstaEn(m)==null){
> 
>cache.getReferencia().agregar(m);   
> 
>}
> 
>rs.next();
> 
>  }
> 
>
> 
>}
> 
>catch(SQLException e){
> 
>
> 
>
> 
>}
> 
>return v;
> 
>}
> 
> 
> 
>EXPERTO MATERIAS (in some other page I request one of the 
> "materias" but before going to the 
> 
> database again I search for it in memory I retrieved into a 
> cacheable object and when I try the casting

RE: Tomcat's scalability

2006-06-19 Thread GB Developer
My feeling is that by calling an installatin of 'java' or 'the jdk/jre' a
'jvm' is going to produce confusion.

/usr/local/applications/tomcat1
/usr/local/applications/tomcat2
/usr/local/applications/tomcat3
/usr/local/java

That's one *JDK/JRE*, and 3 tomcat *instances*.

Each tomcat startup file uses the same JDK to launch a separate *JVM* (so 3
JVMs equates directly to 3 tomcat instances) because as Leon says, you can't
run 2 tomcats in a single JVM. 

So no need to install java more than once, just launch multiple JVMs (and
thus, multiple tomcats).

We do this on a single CPU box, because we find we 'need' to manage the
memory of the webapps running in each instance. So if we 'need' to bounce a
tomcat server because it's got 1% free and isn't getting any better, then we
still have the other two tomcats serving the websites they serve.  And I
always say 'need' in quotes because yes, one day we'll track down our leaks
and then we won't 'need' to do that.

Of course, we're still CPU-bound, so there's no real 'performance' or
'scalability' enhancement by having more than one instance on a single box.
We'd get that (I think) if we clustered more than one physical box each with
its own tomcat/jvm instance, or by clustering multiple tomcats on a a
single, multiple-cpu box.

That last paragraph is my own weak understanding of
CPUs/scalability/clustering, so could be off.


> -Original Message-
> From: Biernatowski Bartosz J [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 19, 2006 4:55 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat's scalability
> 
> 
> My understanding of Tomcat's instance is having both 
> Tomcat+JVM installed in separate directories. Both Tomcats 
> running on separate ports.
> 
> BJ Biernatowski
> Application Developer, e-Business
> 
> -Original Message-
> From: GB Developer [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 19, 2006 2:40 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat's scalability
> 
> How do you propose to add a 'separate instance of Tomcat' 
> without 'adding a separate JVM'? 
> 
> Or do you/others mean by 'instance of tomcat' = 'a separate 
> physical server with single instance of JVM/Tomcat' ?
> 
> > 
> > So far it sounds that the approach of adding separate
> > instance of Tomcat and using round robin is better than 
> > adding a separate JVM.
> > 
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> This e-mail, including attachments, may include confidential 
> and/or proprietary information, and may be used only by the 
> person or entity to which it is addressed. If the reader of 
> this e-mail is not the intended recipient or his or her 
> authorized agent, the reader is hereby notified that any 
> dissemination, distribution or copying of this e-mail, 
> including its contents and attachments, is prohibited. If you 
> have received this e-mail in error, please notify the sender 
> by a "reply to sender only" message and delete this e-mail 
> immediately and destroy all electronic and hard copies of the 
> communication, including attachments.
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How does Tomcat detect whether a browser accepts cookies

2006-06-22 Thread GB Developer
Just because it's fun to have that one last kick at the dead horse...

You really can't rely on any cookie being set, can you?  I mean most users
are simply not this savvy (or stupid, depending on how you feel about it),
but I can set my browser to prompt for every cookie, and I as the (idiot?)
user can reject the session cookie, and then accept every other cookie. Or,
I can accept the session cookie (because it's a *session* cookie, the kind
that disappear), and reject all others. In fact, doesn't one of them there
browsers have a setting like that, to automatically accept session cookies,
but prompt for the other ones?
 
So no, I don't think you can reliably use isRequestedSessionIdFromCookie to
tell whether or not a client "accepts cookies".  Not all cookies are alike.


> -Original Message-
> From: Pid [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 22, 2006 12:50 PM
> To: Tomcat Users List
> Subject: Re: How does Tomcat detect whether a browser accepts cookies
> 
> 
> You could use the session id location as an indicator, 
> assuming there's a session already.
> 
>  if (hreq.isRequestedSessionIdFromCookie()) {
>   // we're good, do whatever
>  }
>  else {
>   // no cookies, begone!
>  }
> 
> if your initial point of contact does a single instant 
> redirect to the detector, then Tomcat should sort out the 
> session location by the time you need to detect it.
> 
>  servlet1(redirect) > servet2(detect)
> 
> this is the same as was suggested before, but at least you 
> don't have to write your own cookie addition/detection routine.
> 
> 
> 
> Garey Mills wrote:
> > David -
> > 
> > Thanks for the clear, concise answer.
> > 
> > Garey Mills
> > Library Systems Office
> > UC Berkeley
> > 
> > The brain is not where you think
> > 
> > On Wed, 21 Jun 2006, David Smith wrote:
> > 
> >> On first response, Tomcat both set's a cookie JSESSIONID 
> and appends 
> >> the
> >> same to the page links (when properly coded). If the 
> cookie comes back 
> >> on the next request, url rewriting is dropped in favor of 
> the cookie. No 
> >> magic, tomcat just covers all it's bases up front.
> >>
> >> See HttpServletResponse.encodeURL(String) in the servlet spec for 
> >> more info.
> >>
> >> -- David
> >>
> >> Garey Mills wrote:
> >>> David -
> >>>
> >>>   Tomcat uses cookies to establish a session with the 
> browser. If it 
> >>> can't use cookies, it uses URL rewriting. So whenever 
> someone uses 
> >>> my app, Tomcat tries to set a cookie.
> >>>
> >>>   If it was the case that Tomcat didn't know whether the browser 
> >>> accepted cookies until after it tried to set one at the first 
> >>> access, users of browsers that did not accept cookies 
> would not have 
> >>> a session that recorded their first access. I don't think 
> that would 
> >>> be considered acceptable, so I assume that Tomcat knows, 
> before my 
> >>> app is reached, whether the browser accepts cookies. But is my 
> >>> assumption correct, I don't know. That is what I am asking.
> >>>
> >>>
> >>>   
> >>>
> >>> Garey Mills
> >>> Library Systems Office
> >>> UC Berkeley
> >>>
> >>> The brain is not where you think
> >>>
> >>> On Wed, 21 Jun 2006, David Kerber wrote:
> >>>
> >>>   
>  Why would it try until your app tells it to?  AFAIK (admittedly, 
>  not
>  very far; I don't use cookies)  think it needs to be 
> handled by your app.
> 
> 
>  Garey Mills wrote:
> 
>  
> > David -
> >
> > Well, okay then, but how can my app find out 
> what Tomcat knows 
> > about whether the browser accepts cookies or not? And when does 
> > Tomcat try? Before control is passed to my app?
> >
> > Garey Mills
> > Library Systems Office
> > UC Berkeley
> >
> > The brain is not where you think
> >
> > On Wed, 21 Jun 2006, David Kerber wrote:
> >
> >  
> >
> >   
> >> I think what he's getting at is that Tomcat (or any other web 
> >> server)
> >> cannot tell how a browser is set wrt cookies without 
> trying to set one 
> >> and then seeing if it's there.
> >>
> >> Garey Mills wrote:
> >>
> >>
> >>
> >> 
> >>> Martin -
> >>>
> >>>   I guess I'm being obtuse, but WHAT won't work? 
> What I want to 
> >>> know is how Tomcat detects whether the browser 
> accepts cookies, 
> >>> that is, whether it is set to accept cookies or not?
> >>>
> >>> Garey Mills
> >>> Library Systems Office
> >>> UC Berkeley
> >>>
> >>> The brain is not where you think
> >>>
> >>> On Wed, 21 Jun 2006, Martin Gainty wrote:
> >>>
> >>>
> >>>
> >>>  
> >>>
> >>>   
>  Garey-
> 
>  Unfortunately that wont work if your Browser 
> disallows cookies 
>  If its IE Check out the IE options-
> 
>  Tools
>  Internet Options
>  Privacy
>  Advanced
> 

Re: Yet another try: mod_jk 1.2.18 release candidate ready to test

2006-07-20 Thread GB Developer

Any reason the section titling on that page is so confusing?

"Changes from the released JK 1.2.18" makes me think I'm looking at the 
changes that have been made *since* 1.2.18 and will be included in some, as 
yet un-numbered, future release.  If that's actually correct... you mean I 
have to make the mental calcuation "I want to know what changed in version 
x, therefore look for a title that says version x-1" every time I look at a 
changelog?


I'd suggest a tile like "JK 1.2.18 Changes" or even just "JK 1.2.18" (as it 
is for TC).


Just a nit, thought I'd pick it.


- Original Message - 
From: "Rainer Jung" <[EMAIL PROTECTED]>

To: "Tomcat Developers List" 
Cc: 
Sent: Wednesday, July 19, 2006 9:32 PM
Subject: Yet another try: mod_jk 1.2.18 release candidate ready to test



Hi,

thanks to everyone who tested 1.2.17. We had one bug related to special 
types used in the networking code. Furthermore there was one request for 
enhancement we included in the next version 1.2.18.


Today this version 1.2.18 of the Apache Tomcat mod_jk web server connector 
has been tagged. This version fixes the found bugs from 1.2.17. Please 
test and share your experience.


If no critical bugs will be found, we will have a formal release vote
starting at Monday, July 24th.

The source distribution can be downloaded from:

http://tomcat.apache.org/dev/dist/

The updated documentation can be found at

http://tomcat.apache.org/dev/docs/tomcat-connectors-1.2.18/

Please see

http://tomcat.apache.org/dev/docs/tomcat-connectors-1.2.18/changelog.html

for a complete list of changes.

Regards,

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC Realm Configuration

2005-10-28 Thread GB Developer

> -Original Message-
> From: Vicente Couto [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 27, 2005 3:18 PM
> To: Tomcat Users List
> Subject: JDBC Realm Configuration
> 
> 
> But when i put the JDBC realm in server.xml file tomcat 
> throws a lot of exceptions


Such as? 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC Realm Configuration

2005-10-28 Thread GB Developer

> -Original Message-
> From: Vicente Couto [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 28, 2005 12:34 PM
> To: Tomcat Users List
> Subject: Re: JDBC Realm Configuration
> 
> 
> GB Developer, look at the exceptions:
> 
> java.sql.SQLException: org.firebirdsql.jdbc.FBdriver
> at 

one could have hoped for a better description from the driver...


further down, it says: 


> 28/10/2005 15:32:03 org.apache.catalina.realm.JDBCRealm start
> SEVERE: Exception opening database connection
> java.sql.SQLException: org.firebirdsql.jdbc.FBdriver
> at 
> org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:689)
> at 
> org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:763)
> at 



I don't know about firebird, but for example: with mysql you need to connect
to the correct IP, port and with the right username/password, and that
username/password needs read permissions on the tables you've set up for
AUTH.  Have you checked all those things are good?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat-Apache slow PDF response

2005-10-31 Thread GB Developer

> -Original Message-
> From: Guy Knights [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, October 30, 2005 7:38 PM
> To: Tomcat Mailing List
> Subject: Tomcat-Apache slow PDF response
> 
> 
> - compiling and installing the latest mod_jk connector (1.2.6) and 
> testing this with a test copy of apache (2.0.54) and the same copy of 
> tomcat. This didn't solve the problem.


It might not make a differenc, but latest jk is 1.2.14
http://tomcat.apache.org/connectors-doc/news/20050101.html#20050713.1


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inner class session attributes not supported?

2005-11-03 Thread GB Developer
> -Original Message-
> From: Ernesto Garcia [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 03, 2005 9:00 AM
> To: users@tomcat.apache.org
> Subject: Inner class session attributes not supported?
> 
> 
> I define a static inner class inside my JSP

... and then put it in the session. So even if you *could* cast it back out
to the right type (which in my own testing, I haven't managed to do)... you
now have a situation where any class can now access your private inner class
of another class? (Because any other JSP page can call
session.getAttribute).  If that's the usage you want, then why bother making
it a "private inner class" in the first place? 
 
Also, the classname for inner classes has the $ in it, and for JSP pages,
has the name of the jsp page prepended as well.  In my own test, I put a
page at the root of the webapp named test.jsp and the classname of the inner
class was:

instanceObj.getClass() = class org.apache.jsp.test_jsp$MyInnerClass 
 
none of these work:
(org.apache.jsp.test_jsp$MyInnerClass)foo
(test_jsp$MyInnerClass)foo
(test_jsp.MyInnerClass)foo
 
In fact, the nice little "perchance you meant" in the stack trace tells me
someone has a sense of humour about these sorts of situations.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I acces the Underlying Connection of a Data Source?

2005-11-09 Thread GB Developer
does the org.apache.tomcat wrapped dbcp still expose getInnermostDelegate()
?

> Connection c = dc.getInnermostDelegate();
> log(c.getClass().getName() + ": " + c);



> -Original Message-
> From: Robert Upshall [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 09, 2005 10:34 AM
> To: Tomcat Users List
> Subject: How do I acces the Underlying Connection of a Data Source?
> 
> 
> How do I access the underlying connection of a data source?  I am 
> connecting to a DB2 database using the JTOpen drivers.  I define the 
> context in the server.xml and the jndi lookup is successful, 
> so is the 
> getconnection on the datasource.  The problem is that I need 
> access to 
> the underlying connection (AS400JDBCConnection) but I cannot get past 
> the Tomcat connection wrapper.  The getDelegate() method returns null 
> instead of an underlying connection.  How can I force the 
> wrapper to use 
>   AS400JDBCConnection or how do I gain access to it?
> 
> 
> server.xml:
> 
>path="/myapp">
> name="jdbc/myDB"
>   type="javax.sql.DataSource"
>   password="something"
>   driverClassName="com.ibm.as400.access.AS400JDBCDriver"
>   maxIdle="3"
>   maxWait="5000"
>   username="someone"
>   url="jdbc:as400://server;naming=system;libraries=lib1, 
> lib2;errors=full"
>   maxActive="10"/>
> 
> 
> 
> code snipit:
> 
> . . .
> 
> InitialContext cxt = new InitialContext();
> 
> DataSource ds = (DataSource) cxt.lookup( "java:/comp/env/jdbc/myDB" );
> 
> DelegatingConnection dc = (DelegatingConnection) ds.getConnection();
> log(dc.getClass().getName() + ": " + dc);
> 
> Connection c = dc.getDelegate();
> log(c.getClass().getName() + ": " + c);
> 
> . . .
> 
> output:
> 
> INFO: Login: 
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnect
> ionWrapper: 
> [EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I acces the Underlying Connection of a Data Source?

2005-11-09 Thread GB Developer
if you're using the "PoolingDatasource", what is the result of calling: 

((org.apache.commons.dbcp.PoolingDataSource)ds).isAccessToUnderlyingConnecti
onAllowed()

Actually, I suppose it would be the wrapped tomcat version, so that cast
would be wrong. 

> -Original Message-
> From: Robert Upshall [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 09, 2005 11:37 AM
> To: Tomcat Users List
> Subject: Re: How do I acces the Underlying Connection of a 
> Data Source?
> 
> 
> Its does, but it is returning null as well.  Only the 
> getConnection on 
> the data source returns a non-null value.
> 
> 
> GB Developer wrote:
> > does the org.apache.tomcat wrapped dbcp still expose 
> > getInnermostDelegate() ?
> > 
> > 
> >>Connection c = dc.getInnermostDelegate();
> >>log(c.getClass().getName() + ": " + c);
> > 
> > 
> > 
> > 
> >>-Original Message-
> >>From: Robert Upshall [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, November 09, 2005 10:34 AM
> >>To: Tomcat Users List
> >>Subject: How do I acces the Underlying Connection of a Data Source?
> >>
> >>
> >>How do I access the underlying connection of a data source?  I am
> >>connecting to a DB2 database using the JTOpen drivers.  I 
> define the 
> >>context in the server.xml and the jndi lookup is successful, 
> >>so is the 
> >>getconnection on the datasource.  The problem is that I need 
> >>access to 
> >>the underlying connection (AS400JDBCConnection) but I 
> cannot get past 
> >>the Tomcat connection wrapper.  The getDelegate() method 
> returns null 
> >>instead of an underlying connection.  How can I force the 
> >>wrapper to use 
> >>  AS400JDBCConnection or how do I gain access to it?
> >>
> >>
> >>server.xml:
> >>
> >> >>  path="/myapp">
> >>  >>  name="jdbc/myDB"
> >>  type="javax.sql.DataSource"
> >>  password="something"
> >>  driverClassName="com.ibm.as400.access.AS400JDBCDriver"
> >>  maxIdle="3"
> >>  maxWait="5000"
> >>  username="someone"
> >>  url="jdbc:as400://server;naming=system;libraries=lib1,
> >>lib2;errors=full"
> >>  maxActive="10"/>
> >>
> >>
> >>
> >>code snipit:
> >>
> >>. . .
> >>
> >>InitialContext cxt = new InitialContext();
> >>
> >>DataSource ds = (DataSource) cxt.lookup( 
> "java:/comp/env/jdbc/myDB" );
> >>
> >>DelegatingConnection dc = (DelegatingConnection) ds.getConnection();
> >>log(dc.getClass().getName() + ": " + dc);
> >>
> >>Connection c = dc.getDelegate();
> >>log(c.getClass().getName() + ": " + c);
> >>
> >>. . .
> >>
> >>output:
> >>
> >>INFO: Login:
> >>org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnect
> >>ionWrapper: 
> >>[EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> -
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> > 
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: reading file in ServletContextListener

2005-11-28 Thread GB Developer
the javadoc for org.xml.sax.InputSource indicates it can take an
InputStream.

parser.parse(
   new InputSource(
  context.getResourceAsStream("/WEB-INF/classes/friends.xml")
   )
);


You might also get away with the following: 

parser.parse(
   context.getRealPath("/WEB-INF/friends.xml");
);

Note: the first uses getResourceAsStream, so the file must be found in a
classloader (thus, your file is under /WEB-INF/classes). The second is just
a real path to the file, so it can be anywhere.  The second is closest to
what you were trying initially. I'm not familiar with that API, so perhaps a
String that indicates "the location of the file" would work, but where "/"
is (without the getRealPath part) is "the directory from which Tomcat is
being started", and who knows (or should have to care) where that is.

In both examples above, 'context' would be obtained:
ServletContext context = servletContextEvent.getServletContext();




> -Original Message-
> From: Werner van Mook [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, November 27, 2005 4:32 PM
> To: Tomcat Users List
> Subject: Re: reading file in ServletContextListener
> 
> 
> To make it more clear of what I try to do here is the 
> complete method  
> in which I try to read a file.
> 
>  private void list() throws Exception {
>  XMLReader parser = XMLReaderFactory.createXMLReader(
>  "org.apache.xerces.parsers.SAXParser");
>  parser.setContentHandler(new PeopleHandler());
>  parser.parse("/WEB-INF/friends.xml");
>  }
> 
> This parse method want an InputSource. Sorry Wendy it didn't 
> work. I tried filling in a fully qualified URI. It completely 
> stops tomcat  
> from starting.
> The URI is to a file in the webapp which is trying to start.
> 
> And see there we have a chicken and egg problem.
> The web app needs the file to start.
> The file is not there if there is no web app.
> 
> 
> 
> 
> On Nov 27, 2005, at 11:06 PM, Wendy Smoak wrote:
> 
> > On 11/27/05, Werner van Mook <[EMAIL PROTECTED]> wrote:
> >> In my class which implements ServletContextListener I try 
> to read a 
> >> file.
> >>   it looks like :
> >> parser.parse("friends.xml");
> >>
> >> When I start tomcat 5.5.12 I get a FileNotFound Exception on the 
> >> friends.xml file.
> >>
> >> The file is in the root of my web-app.
> >> I also tried "/friends.xml" but alas it did not work.
> >
> > Try using ServletContext's getResourceAsStream() method to find the 
> > file, assuming that you have a 'parse' method that will take an 
> > InputStream.
> >
> > --
> > Wendy
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: reading file in ServletContextListener

2005-11-28 Thread GB Developer
whoops. 

I meant to say "/" is the root of the filesystem and _not_ having a slash
would mean "the current directory", so that would be "where tomcat has been
started from".  

And you want neither of those. 

> -----Original Message-
> From: GB Developer [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 28, 2005 11:28 AM
> To: 'Tomcat Users List'
> Subject: RE: reading file in ServletContextListener
> 
> would work, but where "/" is (without the getRealPath part) 
> is "the directory from which Tomcat is being started", and 
> who knows (or should have to care) where that is.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: File Download not working for anchor tags

2005-11-30 Thread GB Developer
Display and generation are two separate issues and I'm confused about which
is which for the OP.

does the anchor tag link to an actual real file on the filesystem somewhere,
like: 
click to download

or are you linking to a dynamically generated file, as from a servlet:
click to
download


in the first case, you're using JSP to display the link and it's more likely
a web-server MIME type that is missing. Are you using TC stand-alone or
fronted with Apache? 

in the second case, you need to worry about setting headers in your
servlet/JSP (the generating servlet/jsp, _not_ the display one) both for
content type and that disposition setting which is the FAQ that Tim linked
to, because now you're generating the contents of the linked "file" in a JSP
or servlet (so actually, not a file, but rather a streamed response).



> -Original Message-
> From: Mike [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 30, 2005 5:36 PM
> To: Tomcat Users List
> Subject: Re: File Download not working for anchor tags
> 
> 
> 
> I'm using a JSP page for displaying the anchor actually.  
> The anchor is 
> linked to a file, either a .xls or .csv file.
> 
>Mike
> 
> At 04:09 PM 11/30/2005, you wrote:
> >I assume you are using a servlet since JSPs always return a 
> >Content-Type.
> >Try setting Content-Type in your servlet so the headers are 
> identical.
> >
> >Mark
> >
> >Mike wrote:
> >>Hi Mark,
> >>   I compared them and the Content-Type is not showing in 
> 4.1.31.  In
> >> 4.1.18 it shows as "text/plain".
> >>   Thanks,
> >>   Mike Gilby
> >>At 02:47 PM 11/30/2005, you wrote:
> >>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat and iptables?

2005-12-16 Thread GB Developer
on linux, it's 
$CATALINA_HOME/logs/catalina.out




> -Original Message-
> From: Martin Gainty [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 16, 2005 11:18 AM
> To: Tomcat Users List
> Subject: Re: Tomcat and iptables?
> 
> 
> Sebastian-
> send us the logs specifically stdout_MMDD.log
> Martin-
> - Original Message - 
> From: "Sebastian Funk" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Sent: Friday, December 16, 2005 11:52 AM
> Subject: Re: Tomcat and iptables?
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat sends certain files with missing chunks

2006-01-05 Thread GB Developer
This APR documentation?  http://tomcat.apache.org/tomcat-5.5-doc/apr.html

Where on that page might I find a reference to this "dumb bug", or any
indication that APR might be responsible for serving files with holes in the
middle of them and that disabling sendfile is the cure? 


> -Original Message-
> From: Remy Maucherat [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 05, 2006 8:12 AM
> To: Tomcat Users List
> Subject: Re: tomcat sends certain files with missing chunks
> 
>  - OP snipped - 
>
> There's a dumb bug in Tomcat 5.5.12 regarding the ranges that 
> are passed to the sendfile call, so it may fail. Either 
> upgrade to a newer Tomcat or disable sendfile (you didn't 
> read the APR documentation, apparently).
> 
> --
> x
> Rémy Maucherat
> Developer & Consultant
> JBoss Group (Europe) SàRL
> x
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Single Thread is deprecated?

2006-01-06 Thread GB Developer
> -Original Message-
> From: Duan, Nick [mailto:[EMAIL PROTECTED] 
> Sent: Friday, January 06, 2006 5:14 PM
> To: Tomcat Users List
> Subject: RE: Single Thread is deprecated?
> 
> Typo due to my laziness.  I knew someone was going to catch 
> this. Actually the sentence should read:  ... because there 
> is only one servlet that is active during a single user session.  
> 
> In other words, there is no way a single user session 
> (represented by a worker thread) can access more than one 
> servlet at a time.

Yah, I don't think that's right either, and besides that, it's a little
backwards to describe it as you have.   A sessions doesn't so much access
servlets, as the servlets (more than one, regardless of their
single-threadness) can access a single Session at once.

Sessions are (never?) thread-safe. Which is perhaps one reason why
SingleThreadModel was deprecated. People thought by using that interface
that they would never have to worry about synch issues again.   

Even if you have nothing but singleThread servlets, that only prevents
concurrent access to that servlet. Neither singleThread servlets nor any
other mechanism I'm aware of can prevents concurrent access to a single
Session object. 

Perhaps Remy will weigh in again with so many wildly varying 'opinions'  ;)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: PreparedStatement w/ Connection Pooling

2006-01-13 Thread GB Developer
I've looked at the CVS HEAD for PoolingConnection...
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/dbcp/src/java/org/apache/c
ommons/dbcp/PoolingConnection.java?view=markup

public synchronized PreparedStatement prepareStatement(String sql) throws
SQLException {
try {
 
return(PreparedStatement)(_pstmtPool.borrowObject(createKey(sql)));


>From this code, I surmise the following: 

When you do multiple calls to prepareStatement(foo), where 'foo' contains
the same SQL string, then the "PoolingConnection" object will automatically
give you back a previously pooled preparedstatement.  So the answer to you
question: "how do I access these pooled statement?" might be as simple as
"don't worry about it, just use the prepareStatement() API and DBCP handles
it for you". 

I don't know for sure and you'll probably get more traction asking this
specific question on the commons-user email list. And uh.. I probably coulda
just started there...

http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=112975440702682&w=2

> >
> >
> > > -Original Message-
> > > From: Khawaja Shams [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, January 12, 2006 11:12 PM
> > > To: Tomcat Users List
> > > Subject: Re: PreparedStatement w/ Connection Pooling
> > >
> > > I am guessing the main attribute to change is the following:
> > >   poolPreparedStatements="true"
> > >
> > > Suppose that this is set to true, how do I access these pooled 
> > > statement? My setup is exactly as you described, so this 
> > > modification seems minor, but I
> > > would appreciate guidance on how to get a hold of these
> > > pooled prepared
> > > statement.  Thanks for your help.
> > >
> > > Sincerely,
> > > Khawaja Shams
> > >


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Connection Pool Woes

2006-01-23 Thread GB Developer
That it's registered with JNDI does not help.  But perhaps what is really
meant is "configure your pool through Tomcat's built-in support for DBCP
(which uses JNDI)".  Then you'd get whatever management of the pool that
Tomcat brings (for example, when the webapp is shutdown, it will .close()
the pool itself, which perhaps you'd forget to do, if you manage your own
pooling).  But other than that, I can't think of what advantage it would
bring. 

> -Original Message-
> From: Alex Turner [mailto:[EMAIL PROTECTED] 
> Sent: Monday, January 23, 2006 11:54 AM
> To: Tomcat Users List
> Subject: Re: Connection Pool Woes
> 
> 
> How does registering my pooling datasource with a naming 
> directory help connection management?  (Honest question - I 
> really don't know)
> 
> Alex.
> 
> On 1/23/06, Asad Habib <[EMAIL PROTECTED]> wrote:
> > You should use JNDI with your connection pool to ensure that 
> > connections are being managed appropriately.
> >
> > - Asad
> >


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: kindly help : where Business Logic(BL) files are been put?

2006-02-01 Thread GB Developer
Two things: 

1) format of your import statement
  (from your first email)
  <%@ page import="primeReports/bl/MemGrossBl"%>

should be: 

  <%@ page import="primeReports.bl.MemGrossBl.*" %>

periods, not slashes. 
end it with a .*, if you are importing every class within the package, or
(better) fully specify the class. 

2) name of the folder
TOMCAT_HOME\webapps\primeReports\WEB-INF\classes\Reports\

should be:
TOMCAT_HOME\webapps\primeReports\WEB-INF\classes\primeReports\bl\MemGrossBl\




> -Original Message-
> From: gupta vidhi [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 01, 2006 5:27 AM
> To: Tomcat Users List
> Subject: kindly help : where Business Logic(BL) files are been put?
> 
> 
> hello,
>
>   kindly tell me where Business Logic(BL) files are been 
> put?i'd put in 
> TOMCAT_HOME\webapps\primeReports\WEB-INF\classes\Reports\
>
>   where,
>   primeReports is the name of the folder which i'd created.
>   the following error is coming:-
>
>   org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> Generated servlet error:
> Only a type can be imported. Reports.MemGrossBl resolves to a package
> 
>   Here MemGrossBl id my (Business Logic)BL File.
>   Kindly help me and tell me the solution.
>
>   Thanks & Regards,
>   Vidhi
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help me

2006-02-09 Thread GB Developer
The error reported is: 

org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error: Only a type can be imported. 
org.apache.commons.fileupload.DiskFileUpload resolves to a package

And the JSP page is: 

<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>


Look at the error, the part that says
"org.apache.commons.fileupload.DiskFileUpload resolves to a package" and
look at the first import statement, the one that imports
"org.apache.commons.fileupload.DiskFileUpload" and use just a smattering of
basic Java knowledge.  

Asked another way:  What do you imagine would happen if I tried to do the
following in a regular java program (or heck, a JSP):

import java.io;



This exception has nothing to do with using a single import statement vs.
multiple ones, or where you put your jar file or CLASSPATH. 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logging session timeouts

2006-02-09 Thread GB Developer
Well let's just think about that for a second.
 
Filter:
a filter is called each and every time you make a web request.  So even if
the filter is highly efficient, if you make 1000 requests in a session, you
(that is, the container) will invoke the filter's doFilter method 1000
times. 

Listener:
A session is created exactly once and destroyed exactly once. 



> -Original Message-
> From: David Kerber [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 09, 2006 12:16 PM
> To: Tomcat Users List
> Subject: Re: Logging session timeouts
> 
> 
> I still have a question about performance:  any idea which of these 
> methods (filter or listener) will use less cpu time when 
> handling 50 to 
> 100 simultaneous users, each logged in with their own ID and session?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlet problem

2006-02-20 Thread GB Developer
> Can anyone tell me where I'm going wrong?

what filip said, but also...
>From your servlet source code, make sure not to expect a server-side
operation, such as: 

dispatcher.forward(request, response);
 
to result in a client-side 'refresh' to the 'specified' page
(searchnone.jsp, when you obtained the dispatcher).

dispatcher.forward() and .include() are performed as part of the original
request for /WEB-INF/classes/SearchServlet (which filip pointed out is
problematic)
 
Just from the way you phrased your question, I thought you were hoping to
see 'searchnone.jsp' on the address bar, and you won't get that with your
servlet as coded.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlet problem/Data Source Problem

2006-02-21 Thread GB Developer
Did you look in the catalina.out file for any thrown Exceptions?  You are
try/catching and then System.out.println'ing them. You should have seen a
SQLException trace of some sort, read inline below...


> -Original Message-
> From: Mark Whitby [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 21, 2006 7:38 AM
> To: Tomcat Users List
> Subject: Servlet problem/Data Source Problem
> 
>ResultSet rst = stmt.executeQuery("select id, chest from 
> testdata");

you're missing this:
 if (rst.next()) {

> blob = rst.getInt("chest");
 }

you're also missing a WHERE clause in the query. You'll select everything
from testdata, by rs.next() will only get you to the first row.  To process
all rows, you make it a "while (rst.next()) { ", but then it would have to
be some sort of concatenation operation instead of just
blob=rst.getInt("chest"), because of course, if you did 'while', blob would
only contain the *last* row. So if you're interested in just the first row
or just the last row, there are more efficient ways of obtaining them.


> address = "/testy.jsp?errorcode=" + blob;
> stmt.close();
> con.close();
> } catch(NamingException e){
> System.out.println(e.toString());
> } catch(SQLException sql){
> System.out.println(sql.toString());
> }
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: manikandan mvk wants to chat

2006-04-07 Thread GB Developer
inside mail.google.com, if you can see the 'google chat' "portlet" (or
whatever we're calling them these days),  type in an email address that
isn't currently on your google talk list (but *is* in your inbox) and one of
the options that appears is "invite to chat".   Whoever you invite, is sent
an email that is formatted like the one this list received.   It's just like
an MSN invite. 

So, it's "manikandan mvk" spam. 



> -Original Message-
> From: Boris Unckel [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 07, 2006 11:24 AM
> To: Tomcat Users List
> Subject: Re: manikandan mvk wants to chat
> 
> 
> Hi,
> 
> does the user "manikandan mvk" provoke this, or is it the 
> first google 
> spam I have ever seen? (Aside from
> commercial advertising on websites)
> 
> Hopefully some google guy recognizes this and stops it.
> 
> Regards
> Boris
> 
> manikandan mvk wrote:
> > 
> --
> > -
> >
> > manikandan mvk wants to stay in better touch using some of Google's 
> > coolest new products.
> >
> > If you already have Gmail or Google Talk, visit: 
> > http://mail.google.com/mail/b-8255bd5e0c-39d09e9a8a-072a1724bd16f73c
> > You'll need to click this link to be able to chat with 
> manikandan mvk.
> >
> > To get Gmail - a free email account from Google with over 2,600 
> > megabytes of storage - and chat with manikandan mvk, visit: 
> > http://mail.google.com/mail/a-8255bd5e0c-39d09e9a8a-3cf12b0d57
> >
> > Gmail offers:
> > - Powerful spam protection
> > - Built-in search for finding your messages and a helpful 
> way of organizing
> >   emails into "conversations"
> > - No pop-up ads or untargeted banners - just text ads and 
> related information
> >   that are relevant to the content of your messages
> > - Instant messaging capabilities right inside Gmail
> >
> > All this, and its yours for free. But wait, there's more! 
> You can also 
> > get Google Talk:
> >
> > http://www.google.com/talk/
> >
> > Its a small Windows* download that lets you make free calls to your 
> > friends through your computer. It's simple and clutter-free, and it 
> > works with any computer speaker and microphone.
> >
> > Gmail and Google Talk are still in beta. We're working hard 
> to add new 
> > features and make improvements, so we might also ask for 
> your comments 
> > and suggestions periodically. We appreciate your help in making our 
> > products even better!
> >
> > Thanks,
> > The Google Team
> >
> > To learn more about Gmail and Google Talk, visit: 
> > http://mail.google.com/mail/help/about.html
> > http://www.google.com/talk/about.html
> >
> > (If clicking the URLs in this message does not work, copy and paste 
> > them into the address bar of your browser).
> >
> > * Not a Windows user? No problem. You can also connect to 
> the Google 
> > Talk service from any platform using third-party clients 
> > (http://www.google.com/talk/otherclients.html).
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >   
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: Directory listing... what happened ?

2006-04-17 Thread GB Developer
buried in your stacktrace: 

SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:80

Combine this with your previous statement "... until I rebooted my
computer"

Most likely there is a version of Apache web server that was enabled with
your ubuntu installation, that at some point in the past, you or someone
else turned off (and have subsequently forgotten about).  On restart, ubuntu
is configured to start apache, which it does, and it grabs port 80.

Then, tomcat fails to start as stated in its logs. 

Which is why you see the default "congrats on setting up apache" message
from apache. Even though you didn't install apache, it's part of your ubuntu
setup and it restarts with your box. 




> -Original Message-
> From: Jonathan Pare [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 17, 2006 4:18 PM
> To: Tomcat Users List
> Subject: RE: Re: Directory listing... what happened ?
> 
> 
> There are my 2 logs:
> 
> SEVERE: Error initializing endpoint
> java.net.BindException: Address already in use:80
>   at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: Directory listing... what happened ?

2006-04-18 Thread GB Developer
ask in an ubuntu-related forum for help on permanently disabling your apache
server, or, connect your apache server to tomcat with mod_jk.   

If you're unsure of how to do the first, you probably will feel more pain
trying the second (so do that first thing).



> -Original Message-
> From: Jonathan Pare [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 17, 2006 5:20 PM
> To: Tomcat Users List
> Subject: RE: Re: Directory listing... what happened ?
> 
> 
> That's it ! Thaks a lot !  I changed the tomcat port back to 
> 8080 and everything went back to normal.  But then I 
> remembered why I change the port in the first place.  It's 
> because I want to use dyndns to access my website from 
> outside my network, so I have to use (I think) the port 80. 
> Any suggestion ?
> 
> 
> > From: [EMAIL PROTECTED]
> > To: users@tomcat.apache.org
> > Subject: RE: Re: Directory listing... what happened ?
> > Date: Mon, 17 Apr 2006 16:43:33 -0500
> > 
> > buried in your stacktrace:
> > 
> > SEVERE: Error initializing endpoint
> > java.net.BindException: Address already in use:80
> > 
> > Combine this with your previous statement "... until I rebooted my 
> > computer"
> > 
> > Most likely there is a version of Apache web server that 
> was enabled 
> > with your ubuntu installation, that at some point in the 
> past, you or 
> > someone else turned off (and have subsequently forgotten 
> about).  On 
> > restart, ubuntu is configured to start apache, which it 
> does, and it 
> > grabs port 80.
> > 
> > Then, tomcat fails to start as stated in its logs.
> > 
> > Which is why you see the default "congrats on setting up apache" 
> > message from apache. Even though you didn't install apache, 
> it's part 
> > of your ubuntu setup and it restarts with your box.
> > 
> > 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4.1.31 hangs after 2 days .. any idea on what going on .. ?... please help

2005-10-13 Thread GB Developer
You could try getting a thread dump.

KILL -3 
 
 is the pid of your tomcat process. The output of this command should
be in catalina.out, or wherever you have (re)directed stderr. Look into this
output for threads you've created (or tomcat processing threads) that seem
to be hung up on code you've written. 


> -Original Message-
> From: David Gagnon [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 13, 2005 1:14 PM
> To: Tomcat Users List
> Subject: Re: Tomcat 4.1.31 hangs after 2 days .. any idea on 
> what going on .. ?... please help
> 
> 
> Thanks for your answer !
> 
>   I'll check for that but like I said :
> 
>  In my webapp I have a thread that look into the db .. I know 
> that this thread is still working properly.  Is someone have 
> any idea on what
> 
> So sound to me that the problem is elsewhere.  But I will 
> check for that 
> anyway!  Thanks  for your help
> 
> /David
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to search in Tomcat Mailing list archive?

2005-10-13 Thread GB Developer
I kinda like : http://marc.theaimsgroup.com/?l=tomcat-user&r=1&w=2

Doesn't seem to have anything from today. Must be the new email address.

> -Original Message-
> From: Philip Chang [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 13, 2005 2:20 PM
> To: users@tomcat.apache.org
> Subject: How to search in Tomcat Mailing list archive?
> 
> How can I search all the monthly archives without clicking 
> and opening them 
> individually?
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Unsubscribe DON'T WORK!

2005-10-19 Thread GB Developer
I have an idea, perhaps it's correct. 

It looks like a mail server admin has got their spam filter cranked past
"MAX". 

>From your returned email:

>   The Postfix program
> 
> <[EMAIL PROTECTED]>: host 
> asf.osuosl.org[140.211.166.49]
> said: 552 spam score (7.0) exceeded threshold
> 

So your 'unsubscribe me' message is being bounced back to you, because the
mailserver at asf.osuosl.org thinks it's spam.  That is: the unsubscribe
message is never getting to the tomcat-user list server.  

Hmm.. 'asf' sounds like maybe an "Apache Software Foundation" mirror?   So
is this a mirror problem? 

Or is it the Postfix program at host galadriel.portugalmail.pt?

Maybe it's not the asf.osuosl.org server, but your own mailserver. 

Who knows how to read mailserver spew? 


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 19, 2005 5:01 PM
> To: users@tomcat.apache.org
> Subject: Unsubscribe DON'T WORK!
> 
> 
> Hi team of Tomcat Users List!
> 
> All email that you have for unsubscribe DON'T WORK!
> 
> I send more then 20 times for the 2 emails that you gave and 
> they DON'T WORK! Always get the Undelivered Mail Returned to 
> Sender! Do you have any ideia of what is going on?
> 
> Best Regards
> António
> 
> - Mensagem Reenviada de 
> [EMAIL PROTECTED] -
> Data: Wed, 19 Oct 2005 22:53:08 +0100 (WEST)
>   De: Mail Delivery System 
> <[EMAIL PROTECTED]>
> Responder para: Mail Delivery System 
> <[EMAIL PROTECTED]>
>  Assunto: Undelivered Mail Returned to Sender
> Para: [EMAIL PROTECTED]
> 
> This is the Postfix program at host galadriel.portugalmail.pt.
> 
> I'm sorry to have to inform you that the message returned
> below could not be delivered to one or more destinations.
> 
> For further assistance, please send mail to 
> 
> If you do so, please include this problem report. You can 
> delete your own text from the message returned below.
> 
>   The Postfix program
> 
> <[EMAIL PROTECTED]>: host 
> asf.osuosl.org[140.211.166.49]
> said: 552 spam score (7.0) exceeded threshold
> 
> 
> - Finalizar mensagem reenviada -
> 
> 
> -- 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Trouble finding Datsource Resource with DataSourceRealm

2005-10-19 Thread GB Developer
My Tomcat's having trouble finding the JNDI Datasource to use for a
DataSourceRealm.

Details:

Tomcat 5.0.28
Java 1.4.2_04-b05
on Linux


partial server.xml:





   

  





  











 
 
  
   factory
   org.apache.commons.dbcp.BasicDataSourceFactory
  
  
   username
   username
  
  
   password
   secret
  
  
   driverClassName
   com.mysql.jdbc.Driver
  
  
   url
   jdbc:mysql://xxx.xxx.xxx.xxx:/?autoReconnect=true
  
 snip DBCP params
 


 
 
  
   mail.smtp.host
   .globallyboundless.com
  
 








  






web.xml is (I think) not useful in diagnosis. 

I remove all files from the logs directory, and restart the server.  The
entire contents of catalina.out, (hopefully) formatted for readability. So
the only thing different between this and the actual output is whitespace
and newlines.

[EMAIL PROTECTED]:/usr/tomcat51/logs$ cat engine_log.2005-10-19.txt

2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
Resource parameters for sql/DataSource = ResourceParams[
  name=sql/DataSource, 
  parameters={url=jdbc:mysql://xxx.xxx.xxx.xxx:/?autoReconnect=true,

  maxIdle=5, 
  maxActive=5, 
  driverClassName=com.mysql.jdbc.Driver, 
  maxWait=5000, 
  removeAbandoned=true, 
  username=secret, 
  factory=org.apache.commons.dbcp.BasicDataSourceFactory, 
  logAbandoned=true, 
  removeAbandonedTimeout=15, 
  password=password}]
  
2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
Adding resource ref sql/DataSource

2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
ResourceRef[className=javax.sql.DataSource,
  factoryClassLocation=null,
  factoryClassName=org.apache.naming.factory.ResourceFactory,
  {type=scope,content=Shareable},
  {type=auth,content=Container},
 
{type=url,content=jdbc:mysql://xxx.xxx.xxx.xxx:/?autoReconnect=true}
,
  {type=maxIdle,content=5},
  {type=maxActive,content=5},
  {type=driverClassName,content=com.mysql.jdbc.Driver},
  {type=maxWait,content=5000},
  {type=removeAbandoned,content=true},
  {type=username,content=secret},
  {type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},
  {type=logAbandoned,content=true},
  {type=removeAbandonedTimeout,content=15},
  {type=password,content=password}]
  
2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
Resource parameters for mail/Session = ResourceParams[
  name=mail/Session, 
  parameters={mail.smtp.host=.globallyboundless.com}]

2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
Adding resource ref mail/Session

2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
ResourceRef[className=javax.mail.Session,
  factoryClassLocation=null,
  factoryClassName=org.apache.naming.factory.ResourceFactory,
  {type=scope,content=Shareable},
  {type=auth,content=Container},
  {type=mail.smtp.host,content=.globallyboundless.com}]

2005-10-19 18:08:12
NamingContextListener[/Catalina/foo.globallyboundless.com]:   
Resource parameters for UserTransaction = null



So you can see from the output everything seems good, though the Realm not
showing up is strange. But it is being configured, because when I browse to
http://foo.globallyboundless.com, it tries to authenticate (the browser
throws up the BASIC dialog box), but it fails with this in the engine log:


2005-10-19 18:11:43 DataSourceRealm[]: Exception performing authentication
javax.naming.NameNotFoundException: Name sql is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
at
org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:437)
at
org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:
277)
at
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe
nticator.java:129)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:504)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org

RE: Trouble finding Datsource Resource with DataSourceRealm

2005-10-20 Thread GB Developer
I should have mentioned, I have a ContextListener that contains the
following:

---
initCtx = new InitialContext();
envCtx  = (Context) initCtx.lookup("java:comp/env");

logger.info("*** loading Data Source");
try {
ds = (DataSource) envCtx.lookup("sql/DataSource");
application.setAttribute("services.datasource", ds);
logger.info("*** DataSource loaded @ services.datasource");
} catch (NamingException ne) {
logger.fatal("ERROR loading DataSource: ", ne);
}
---

And I get both 'info' messages.  So the DataSource resource is being loaded,
and it *can* be found at "sql/DataSource" (by my code in the context
listener).  It's just the Realm that can't seem to find it, as indicated by
the stacktrace below.

However, leaving no stone un-turned, I deleted the entire work directory for
the 'foo' host and get the same result. 


This still appears in the engine log when I attempt to authenticate: 

2005-10-20 09:51:15 DataSourceRealm[]: Exception performing authentication
javax.naming.NameNotFoundException: Name sql is not bound in this Context
  at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
  at
org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:437)
  at
org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:
277)
  at
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe
nticator.java:129)



> -Original Message-
> From: Stanley Bradbury [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 19, 2005 8:07 PM
> To: Tomcat Users List
> Subject: Re: Trouble finding Datsource Resource with DataSourceRealm
> 
< big snip />

> >
> Hi -
> I had a similar problem (with 5.5.12) that turned out to be 
> related to 
> restart persistence (see post 10/17 Subj: "Odd problem with Restart 
> Persistance..." for more info).  You can do a quick test by 
> deleting the 
> SESSIONS.ser file in ...work/Catalina/localhost/ 
> (or whatever 
> name and host relates to your installation) - start Tomcat and see if 
> the datasource is found.  If so, you will want to disable restart 
> persistance for this App (see my note for more info).
> 
> Hope this Helps
> 
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Trouble finding Datsource Resource with DataSourceRealm

2005-10-20 Thread GB Developer
well, I couldn't get a Realm to function when the DataSource it needed was
defined in the same Context as the Realm itself. 

I've made it work by declaring the datasource resource in the 'global naming
resources' section of server.xml, and the realm directly under the 'engine'
element. And then in my host, I use a resourcelink to reference (and rename)
the globalresource to what my application is expecting. 

still puzzled why I couldn't get the other setup to work. 


> -Original Message-
> From: GB Developer [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 20, 2005 9:56 AM
> To: 'Tomcat Users List'
> Subject: RE: Trouble finding Datsource Resource with DataSourceRealm
> 
> 
> I should have mentioned, I have a ContextListener that contains the
> following:
> 
> ---
> initCtx = new InitialContext();
> envCtx  = (Context) initCtx.lookup("java:comp/env");
> 
> logger.info("*** loading Data Source");
> try {
>   ds = (DataSource) envCtx.lookup("sql/DataSource");
>   application.setAttribute("services.datasource", ds);
>   logger.info("*** DataSource loaded @ services.datasource");
> } catch (NamingException ne) {
>   logger.fatal("ERROR loading DataSource: ", ne);
> }
> ---
> 
> And I get both 'info' messages.  So the DataSource resource 
> is being loaded,
> and it *can* be found at "sql/DataSource" (by my code in the context
> listener).  It's just the Realm that can't seem to find it, 
> as indicated by
> the stacktrace below.
> 
> However, leaving no stone un-turned, I deleted the entire 
> work directory for
> the 'foo' host and get the same result. 
> 
> 
> This still appears in the engine log when I attempt to authenticate: 
> 
> 2005-10-20 09:51:15 DataSourceRealm[]: Exception performing 
> authentication
> javax.naming.NameNotFoundException: Name sql is not bound in 
> this Context
>   at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
>   at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
>   at
> org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm
> .java:437)
>   at
> org.apache.catalina.realm.DataSourceRealm.authenticate(DataSou
> rceRealm.java:
> 277)
>   at
> org.apache.catalina.authenticator.BasicAuthenticator.authentic
> ate(BasicAuthe
> nticator.java:129)
> 
> 
> 
> > -Original Message-
> > From: Stanley Bradbury [mailto:[EMAIL PROTECTED] 
> > Sent: Wednesday, October 19, 2005 8:07 PM
> > To: Tomcat Users List
> > Subject: Re: Trouble finding Datsource Resource with DataSourceRealm
> > 
> < big snip />
> 
> > >
> > Hi -
> > I had a similar problem (with 5.5.12) that turned out to be 
> > related to 
> > restart persistence (see post 10/17 Subj: "Odd problem with Restart 
> > Persistance..." for more info).  You can do a quick test by 
> > deleting the 
> > SESSIONS.ser file in ...work/Catalina/localhost/ 
> > (or whatever 
> > name and host relates to your installation) - start Tomcat 
> and see if 
> > the datasource is found.  If so, you will want to disable restart 
> > persistance for this App (see my note for more info).
> > 
> > Hope this Helps
> > 
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]