RE: Try a different approach - What's wrong with catalina.session???

2001-12-14 Thread Cox, Charlie



 Craig said...
 
 This kind of problem indicates that your Tomcat installation 
 is somehow
 
 corrupted.  If it were really a bug, it would be happening 
 to everyone,
 
 not just to you.
 
 I suggest that you do the following:
 
 * Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
  (most *especially* not things like servlet.jar or j2ee.jar,
  which are *guaranteed* to cause nothing but grief)
 
 RSH: WHY?  That is where you put these files to allow you to compile
 code.  Why should it cause Tomcat grief (esp. NOT 4.0 but only 4.0.1)
 unless the Tomcat jar loader code is now broken?
 
Actually you should use the CLASSPATH to compile code and not put things
into $JAVA_HOME/jre/lib/ext. When you put things into this directory, the
bootstrapper loads the classes(not tomcat) and tomcat cannot load newer
versions of those libraries. 
So if you have the tomcat4.0 servlet.jar in that directory tomcat cannot
load the tc401servlet.jar since those classes are already loaded. I'm not
sure if servlet.jar file changed from 4.0 to 4.0.1, but that also goes for
any library that you may want to have different versions of for different
web apps.

You should review the classloader doc.

Charlie

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Try a different approach - What's wrong with catalina.session ???

2001-12-14 Thread Jim Cheesman



 
Actually you should use the CLASSPATH to compile code and not put things
into $JAVA_HOME/jre/lib/ext. When you put things into this directory, the
bootstrapper loads the classes(not tomcat) and tomcat cannot load newer
versions of those libraries.



Unless of course that's the behaviour you want... (For example to ensure 
the use of a stable library.)





--

   *   Jim Cheesman   *
 Trabajo: 
[EMAIL PROTECTED] - (34)(91) 724 9200 x 2360
I have this nagging fear that 
everyone is out to make me paranoid.



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Richard S. Huntrods

Greetings!

Let's try this again.  From the error message below, it would appear
that there is something WRONG with
org.apache.catalina.session.StandardSession.  Note from the error that
we get a java.lang.NoSuchMethodError - the method does not exist.

After reading the Catalina Javadocs, it becomes aparent there are two
StandardSessionFacade constructors.  One is:

StandardSessionFacade(javax.servlet.http.HttpSession session);
the other is
StandardSessionFacade(org.apache.catalina.session.StandardSession
session)

It would appear that the catalina session version is getting called by
default, because I ask for no specific one in my code.  The problem is
that there is NO StandardSession class, according to the javadocs - or
if there is (undocumented), it is missing the putSession method, as
stated in the error.

I think this is a BUG in Catalina.  Why call one particular constructor
by default, which does not use the standard javax classes, and then NOT
supply all the required session methods?  NOTE - this constructor is
called OUTSIDE my code by other Catalina code - I have no real control
over which constructor is used.

Does anyone in the developmer community know of a workaround?

java.lang.NoSuchMethodError
 at
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1185)

 at
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)

 at
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)

 at
qti.object.Login.putSession(Login.java:572)




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Mika Goeckel

Hi!

What is the putSession() method of a HttpSession?
Do you mean putValue?
First, this is a deprecated method, but second, StandardSession implements
that method anyway.
StandardSession is org.apache.catalina.session.StandardSession, and
implements HttpSession, which is an interface and as such not
instantiateable.

The exception points to another reason, but I can't tell without knowing
what exact version of Tomcat you use and what you pass in.

Mika

- Original Message -
From: Richard S. Huntrods [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 6:05 PM
Subject: Try a different approach - What's wrong with catalina.session???


 Greetings!

 Let's try this again.  From the error message below, it would appear
 that there is something WRONG with
 org.apache.catalina.session.StandardSession.  Note from the error that
 we get a java.lang.NoSuchMethodError - the method does not exist.

 After reading the Catalina Javadocs, it becomes aparent there are two
 StandardSessionFacade constructors.  One is:

 StandardSessionFacade(javax.servlet.http.HttpSession session);
 the other is
 StandardSessionFacade(org.apache.catalina.session.StandardSession
 session)

 It would appear that the catalina session version is getting called by
 default, because I ask for no specific one in my code.  The problem is
 that there is NO StandardSession class, according to the javadocs - or
 if there is (undocumented), it is missing the putSession method, as
 stated in the error.

 I think this is a BUG in Catalina.  Why call one particular constructor
 by default, which does not use the standard javax classes, and then NOT
 supply all the required session methods?  NOTE - this constructor is
 called OUTSIDE my code by other Catalina code - I have no real control
 over which constructor is used.

 Does anyone in the developmer community know of a workaround?

 java.lang.NoSuchMethodError
  at

org.apache.catalina.session.StandardSession.setAttribute(StandardSession.jav
a:1185)

  at

org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)

  at

org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)

  at
 qti.object.Login.putSession(Login.java:572)




 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Richard S. Huntrods

More stuff

Here is the source code to a servlet that RUNS under Tomcat 4.0 but does
NOT RUN under Tomcat 4.0.1.

I can email (upone request) a zip file containing the full directory
structure (with class file) that can be unzipped an placed directly
under webapps.  Put it in Tomcat 4.0 and it runs, put it under Tomcat
4.0.1 and it does not.

Of course - tc 4.0 and tc 4.0.1 are in totally separate directories, can
run all example servlets AND any servlet without the session stuff in
it.  Also of course I never try to run TC4 and 4.01 at the same time.
On Solaris 8, this runs under tc 4.0.1 without error.  Only on Win 2000
does this error happen.

I have also re-downloaded Tomcat for Windows and done a binary compare
between what I have and the latest - and they are identical.

It really does seem as if TC 4.0.1 on W2K has a problem with the
catalina.StandardSesionFacade incorrectly calling
catalina.StandardSession instead of javax.servlet.http.HttpSession,
but I do not know why this happens on W2K but NOT on Solaris.

I am not a newbie in this particular stuff, and have done my
homework.  I would appreciate a reply from someone in the Tomcat
developer community.

Cheers,

-Richard

=the code==
/**
 * Title: SessionTestServlet
 *
 * Description: Session Test Servlet - duplicate Catalina Session error
 *
 * Copyright: Copyright (c) 2001, Huntrods Consulting Inc.
 *
 * Company: Huntrods Consulting Inc.
 * Author: Richard S. Huntrods
 * Version: 1.0
 * Date: December 13, 2001
 *
 * @author Richard S. Huntrods
 * @version 1.0
 */

package testing;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class SessionTestServlet extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
}

public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {

doPost(request, response);
}

public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {

response.setContentType (text/html);
StringBuffer buffer = new StringBuffer();

HttpSession session = request.getSession(true);
if(session != null) {
session.setAttribute(name, Richard Huntrods);
session.setAttribute(company, Huntrods Consulting Inc.);

}

buffer.append(HTML\n);
buffer.append(HEAD\n);
buffer.append( META NAME=\GENERATOR\ CONTENT=\WinEdit -
Richard S. Huntrods\\n);
buffer.append( TITLESession Test/TITLE\n);
buffer.append(/HEAD\n);
buffer.append(BODY BGCOLOR=\#99\\\n);
buffer.append( PCENTERBIH2\n);
buffer.append(Session Test\n);
buffer.append( /H2/I/B/CENTER/P\n);
buffer.append(/BODY\n);
buffer.append(/HTML\n);

PrintWriter out = response.getWriter();
out.println(buffer);
out.close();
}

public String getServletInfo() {
return SessionTestServlet Information;
}
}
=





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Mika Goeckel

Hmmm

the difference between these two constructors is, that the one which takes a
StandardSession upcasts it to HttpSession before assigning it to it's
session attribute,
this should not cause this problem, as StandardSession does implement all
HttpSession methods (otherwise the compiler would want to have it declared
abstract).

From my (I confess very distant) position it looks like a jvm on W2K
problem. Especially because you say it does work on Solaris.

Mika

- Original Message -
From: Richard S. Huntrods [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 6:05 PM
Subject: Try a different approach - What's wrong with catalina.session???


 Greetings!

 Let's try this again.  From the error message below, it would appear
 that there is something WRONG with
 org.apache.catalina.session.StandardSession.  Note from the error that
 we get a java.lang.NoSuchMethodError - the method does not exist.

 After reading the Catalina Javadocs, it becomes aparent there are two
 StandardSessionFacade constructors.  One is:

 StandardSessionFacade(javax.servlet.http.HttpSession session);
 the other is
 StandardSessionFacade(org.apache.catalina.session.StandardSession
 session)

 It would appear that the catalina session version is getting called by
 default, because I ask for no specific one in my code.  The problem is
 that there is NO StandardSession class, according to the javadocs - or
 if there is (undocumented), it is missing the putSession method, as
 stated in the error.

 I think this is a BUG in Catalina.  Why call one particular constructor
 by default, which does not use the standard javax classes, and then NOT
 supply all the required session methods?  NOTE - this constructor is
 called OUTSIDE my code by other Catalina code - I have no real control
 over which constructor is used.

 Does anyone in the developmer community know of a workaround?

 java.lang.NoSuchMethodError
  at

org.apache.catalina.session.StandardSession.setAttribute(StandardSession.jav
a:1185)

  at

org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)

  at

org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)

  at
 qti.object.Login.putSession(Login.java:572)




 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Craig R. McClanahan



On Thu, 13 Dec 2001, Richard S. Huntrods wrote:

 Date: Thu, 13 Dec 2001 10:05:31 -0700
 From: Richard S. Huntrods [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Subject: Try a different approach - What's wrong with catalina.session???

 Greetings!

 Let's try this again.  From the error message below, it would appear
 that there is something WRONG with
 org.apache.catalina.session.StandardSession.  Note from the error that
 we get a java.lang.NoSuchMethodError - the method does not exist.


This kind of problem indicates that your Tomcat installation is somehow
corrupted.  If it were really a bug, it would be happening to everyone,
not just to you.

I suggest that you do the following:

* Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
  (most *especially* not things like servlet.jar or j2ee.jar,
  which are *guaranteed* to cause nothing but grief)

* Do a clean installation of Tomcat 4 into a new directory.

* Make sure that all the examples work (including the ones that
  use sessions)

* Install your applications and test.

Craig McClanahan


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session??

2001-12-13 Thread Richard S. Huntrods

Hmmm

the difference between these two constructors is, that the one which
takes a
StandardSession upcasts it to HttpSession before assigning it to it's
session attribute,
this should not cause this problem, as StandardSession does implement
all
HttpSession methods (otherwise the compiler would want to have it
declared
abstract).
.
From my (I confess very distant) position it looks like a jvm on W2K
problem. Especially because you say it does work on Solaris.

Mika

EXACTLY!  That is what I think as well, except... Both TC 4.0 and TC
4.0.1 are on the same machine.  I have read all the release notes with
both versions, and cannot find anywhere that suggests a difference in
how the JVM is found / used.  In fact, the batch file I created to run
tc 4.0 and to run 4.0.1 is identical (i.e. JAVA_HOME) except for the
location of the bin files that actually start Tomcat.

So - if you or anyone knows of differences in how TC 4.0 vs. 4.0.1
find/load/use things like the servlet .jar files in JAVA_HOME vs. the
Tomcat libraries, I'd like to know.


-Richard





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Richard S. Huntrods

Greetings!

Craig said...

This kind of problem indicates that your Tomcat installation is somehow

corrupted.  If it were really a bug, it would be happening to everyone,

not just to you.

I suggest that you do the following:

* Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
 (most *especially* not things like servlet.jar or j2ee.jar,
 which are *guaranteed* to cause nothing but grief)

RSH: WHY?  That is where you put these files to allow you to compile
code.  Why should it cause Tomcat grief (esp. NOT 4.0 but only 4.0.1)
unless the Tomcat jar loader code is now broken?


* Do a clean installation of Tomcat 4 into a new directory.

RSH: Done 3 times, downloaded new binaries 2 times, did binary
comparisons of all copies of 4.0.1 - all the same every time.  That is
NOT the problem.

* Make sure that all the examples work (including the ones that
  use sessions)

RSH: Which ones are the session ones?  I tried 1/2 dozen examples, all
worked.


* Install your applications and test.

We're now down to the simple servlet I sent to this list.  Why doesn't
someone with 4.0.1 on W2K compile it and try it.  If it runs, then tell
me which version of the Sun Java SDK you have, and what is inside
.../jre/lib/ext ?  And, if servlet.jar is NOT in that directory, how the
heck did they get my servlet to compile with the SDK? (Using JBuilder is
cheatingG).

-Richard


Craig McClanahan





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Mika Goeckel

Session in use:
From the jsps,
NumberGuess, Snoop, ErrorPage (after submitting the form), Carts (after
submitting) (I did stop testing here)
From the servlets only the session example.

Mika

- Original Message -
From: Richard S. Huntrods [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 14, 2001 12:40 AM
Subject: Re: Try a different approach - What's wrong with
catalina.session???


 Greetings!

 Craig said...

 This kind of problem indicates that your Tomcat installation is somehow

 corrupted.  If it were really a bug, it would be happening to everyone,

 not just to you.
 
 I suggest that you do the following:
 
 * Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
  (most *especially* not things like servlet.jar or j2ee.jar,
  which are *guaranteed* to cause nothing but grief)

 RSH: WHY?  That is where you put these files to allow you to compile
 code.  Why should it cause Tomcat grief (esp. NOT 4.0 but only 4.0.1)
 unless the Tomcat jar loader code is now broken?

 
 * Do a clean installation of Tomcat 4 into a new directory.

 RSH: Done 3 times, downloaded new binaries 2 times, did binary
 comparisons of all copies of 4.0.1 - all the same every time.  That is
 NOT the problem.
 
 * Make sure that all the examples work (including the ones that
   use sessions)

 RSH: Which ones are the session ones?  I tried 1/2 dozen examples, all
 worked.

 
 * Install your applications and test.

 We're now down to the simple servlet I sent to this list.  Why doesn't
 someone with 4.0.1 on W2K compile it and try it.  If it runs, then tell
 me which version of the Sun Java SDK you have, and what is inside
 .../jre/lib/ext ?  And, if servlet.jar is NOT in that directory, how the
 heck did they get my servlet to compile with the SDK? (Using JBuilder is
 cheatingG).

 -Richard

 
 Craig McClanahan





 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Try a different approach - What's wrong with catalina.session???

2001-12-13 Thread Richard S. Huntrods

Thanks, Mika.

I tried this servlet in Tomcat 4.0.1:

http://localhost:8080/examples/servlet/SessionExample

and it works in 4.0.1 UNTIL I press the URL encoded link.  Then I get
the exact same error message as I've been reporting.  Also, typing in
the Name of Session... and pressing Submit Query also generates the
same error.

Kind of supports the theory that the way 4.0.1. loads the jar files has
changed.  Now to find out how to fix it...

-Richard



Session in use:
From the jsps,
NumberGuess, Snoop, ErrorPage (after submitting the form), Carts (after

submitting) (I did stop testing here)
From the servlets only the session example.

Mika




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]