cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler JspDocumentParser.java PageInfo.java

2003-08-08 Thread kinman
kinman  2003/08/08 15:22:10

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java PageInfo.java
  Log:
  - Refactor some code in JspDocumentParser, since startPrefixMapping
got called before startElement.
  - Turn on push/pop prefixes for taglibs in XML syntax, so that proper
prefix can be located.
  - Fix a minor bug in PageInfo.
  
  Revision  ChangesPath
  1.62  +31 -30
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- JspDocumentParser.java21 Jul 2003 21:52:51 -  1.61
  +++ JspDocumentParser.java8 Aug 2003 22:22:09 -   1.62
  @@ -109,6 +109,7 @@
   private boolean isTagFile;
   private boolean directivesOnly;
   private boolean isTop;
  +private Stack prefixMapStack;
   
   /*
* Constructor
  @@ -127,6 +128,7 @@
this.isTagFile = isTagFile;
this.directivesOnly = directivesOnly;
this.isTop = true;
  +this.prefixMapStack = new Stack();;
   }
   
   /*
  @@ -265,20 +267,9 @@
isTaglib = true;
} else {
String attrUri = attrs.getValue(i);
  - if (!pageInfo.hasTaglib(attrUri)) {
  - TagLibraryInfo tagLibInfo = null;
  - try {
  - tagLibInfo = getTaglibInfo(attrQName, attrUri);
  - } catch (JasperException je) {
  - throw new SAXParseException(
  -
Localizer.getMessage("jsp.error.could.not.add.taglibraries"),
  - locator, je);
  - }
  - if (tagLibInfo != null) {
  - isTaglib = true;
  - }
  - pageInfo.addTaglib(attrUri, tagLibInfo);
  - }
  + // TaglibInfo for this uri already established in
  + // startPrefixMapping
  + isTaglib = pageInfo.hasTaglib(attrUri);
}
if (isTaglib) {
if (taglibAttrs == null) {
  @@ -555,16 +546,34 @@
   /*
* Receives notification of the start of a Namespace mapping. 
*/
  - public void startPrefixMapping(String prefix, String uri)
  +public void startPrefixMapping(String prefix, String uri)
 throws SAXException {
  - // XXX
  +TagLibraryInfo taglibInfo;
  +try {
  +taglibInfo = getTaglibInfo(prefix, uri);
  +} catch (JasperException je) {
  +throw new SAXParseException(
  +Localizer.getMessage("jsp.error.could.not.add.taglibraries"),
  +locator, je);
  +}
  +
  +if (taglibInfo != null) {
  +pageInfo.addTaglib(uri, taglibInfo);
  +pageInfo.pushPrefixMapping(prefix, uri);
  +prefixMapStack.push(new Boolean(true));
  + }
  +else {
  +prefixMapStack.push(new Boolean(false));
  +}
}
   
/*
 * Receives notification of the end of a Namespace mapping. 
 */
   public void endPrefixMapping(String prefix) throws SAXException {
  - // XXX
  +if (((Boolean)prefixMapStack.pop()).booleanValue()) {
  +pageInfo.popPrefixMapping(prefix);
  +}
   }
   
   
  @@ -792,23 +801,15 @@
* Creates the tag library associated with the given uri namespace, and
* returns it.
*
  - * @param qName The qualified name of the xmlns attribute
  - * (of the form 'xmlns:')
  + * @param prefix The prefix of the xmlns attribute
* @param uri The uri namespace (value of the xmlns attribute)
*
* @return The tag library associated with the given uri namespace
*/
  -private TagLibraryInfo getTaglibInfo(String qName, String uri)
  +private TagLibraryInfo getTaglibInfo(String prefix, String uri)
   throws JasperException {
   
TagLibraryInfo result = null;
  -
  - // Get the prefix
  - String prefix = "";
  - int colon = qName.indexOf(':');
  - if (colon != -1) {
  - prefix = qName.substring(colon + 1);
  - }
   
if (uri.startsWith(URN_JSPTAGDIR)) {
// uri (of the form "urn:jsptagdir:path") references tag file dir
  
  
  
  1.38  +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
  
  Index: PageInfo.java
  

DO NOT REPLY [Bug 22158] - Getting following error => java.sql.SQLException: Logical handle no longer valid

2003-08-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22158

Getting following error => java.sql.SQLException: Logical handle no longer valid

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE



--- Additional Comments From [EMAIL PROTECTED]  2003-08-06 07:13 ---


*** This bug has been marked as a duplicate of 22159 ***

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



cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse JSSE14SocketFactory.java

2003-08-08 Thread luehe
luehe   2003/08/08 16:57:02

  Modified:util/java/org/apache/tomcat/util/net/jsse
JSSE14SocketFactory.java
  Log:
  Removed unneeded imports
  
  Revision  ChangesPath
  1.6   +1 -8  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE14SocketFactory.java
  
  Index: JSSE14SocketFactory.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE14SocketFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JSSE14SocketFactory.java  8 Aug 2003 23:40:17 -   1.5
  +++ JSSE14SocketFactory.java  8 Aug 2003 23:57:02 -   1.6
  @@ -62,18 +62,11 @@
   import java.net.*;
   import java.security.KeyStore;
   import java.security.SecureRandom;
  -import javax.net.ServerSocketFactory;
  -import javax.net.ssl.SSLServerSocket;
  -import javax.net.ssl.SSLSocket;
  -import javax.net.ssl.SSLException;
  -import javax.net.ssl.SSLServerSocketFactory;
  -import javax.net.ssl.HandshakeCompletedListener;
  -import javax.net.ssl.HandshakeCompletedEvent;
  -import javax.net.ssl.TrustManagerFactory;
   import javax.net.ssl.SSLContext;
   import javax.net.ssl.KeyManager;
   import javax.net.ssl.KeyManagerFactory;
   import javax.net.ssl.TrustManager;
  +import javax.net.ssl.TrustManagerFactory;
   
   /*
 1. Make the JSSE's jars available, either as an installed
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse JSSE14SocketFactory.java

2003-08-08 Thread Bill Barker

>   +protected TrustManager[] getTrustManagers(String keystoreType)
>   +throws Exception {
>   +
>   +TrustManager[] tm = null;

Don't you need a check for keystoreType == null here?

>   +
>   +KeyStore trustStore = getTrustStore(keystoreType);
>   +if (trustStore != null) {
>   +TrustManagerFactory tmf =
TrustManagerFactory.getInstance("SunX509");
>   +tmf.init(trustStore);
>   +tm = tmf.getTrustManagers();
>   +}
>   +
>   +return tm;
>   +}
>}
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

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

Re: [5.0.7] New build by Sunday

2003-08-08 Thread Remy Maucherat
Bill Barker wrote:
"Remy Maucherat" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

I plan to make a new build available by Sunday. Comments ? Any issues
which would need to be resolved by then ?
A number of issues have been filed about commons-daemon and the new
Windows .exe wrapper. Is anyone working on resolving them ? (Mladen, JF
?) I could have helped on that, but the requirement for Visual C++
prevents me from doing so. Is there any way around ?
Clicking through to the TC 5 bugzilla link, I don't see anything for
commons-daemon on Unix.  Could you provide bug #s? (and, yes, I'm very
interested).
There's nothing for Unix. The JSVC wrapper should allow using Tomcat as 
non root on port 80.

For procrun, I pretty much understand the bugs now, but won't be able to
meet a Sunday deadline (basically, I have MSVC on my work computer (but not
my home), but the firewall there prevents me from having CVS access).  If
you are going to stick to a Sunday deadline, then the procrun bugs will be
fixed in 5.0.8.
All the bugs so far are with the (brand new) procrun for NT. Bugs 18220, 
21279 (IMO, to make things more reliable and keep it simple, procrun 
should wait for the child VM to die before stopping everything, rather 
than simply waiting until the stop method returns), 22174.
5.0.8 is good enough :)

You should also indicate if you need the the binaries (@see previous
paragraph).  If you do, my build-platform will be XP, but they should still
work with W2K.
Yes. I think JF made it so that procrun is supposed to run on Windows 9x 
also. Do you think compiling on XP could still produce 9x compatible 
binaries ?

Thanks :)

Remy

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


package javax.servlet does not exist error

2003-08-08 Thread Dmitry Beransky
Hi,

My apologies if this has been discussed on the list before.  Searching the 
archive returned a bunch of irrelevant results and I couldn't figure out 
how to narrow the search down.

I'm trying to compile Tomcat 4.1.27 on a Windows box with JDK 1.4.2.  I 
have all the packages installed and build.properties in 
jakarta-tomcat-4.1.27-src modified to reflect new package locations (btw, I 
had no problems at all compiling Tomcat 4.0.6).  I've downloaded 
jakarta-tomcat-jasper and put it into the same directory as the tomcat 
package.  I've also changed build.properties inside jasper2 directory to 
point back to the tomcat project.

Now, when I'm try to run ant and when the compilation process gets around 
to jasper2, I get a punch of messages all of which are complaining about 
the same thing:

  package javax.servlet does not exist

I do have jakarta-servletapi-4 and ${servlet.home} in build.properties 
properly points to it.  So why am I getting this error?  What am I missing?

Thanks
Dmitry 

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


DO NOT REPLY [Bug 22174] - tomcat service launcher does not accept path to jvm.dll with spaces

2003-08-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22174

tomcat service launcher does not accept path to jvm.dll with spaces

[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]



--- Additional Comments From [EMAIL PROTECTED]  2003-08-06 19:42 ---
*** Bug 22187 has been marked as a duplicate of this bug. ***

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



RE: window close session invalidate

2003-08-08 Thread Paul Wallace


-Original Message-
From: Paul Wallace 
Sent: Thursday, 7 August 2003 9:20 AM
To: Tomcat Developers List
Subject: RE: window close session invalidate

OK, Thanks for that. 
An interesting note however..after some testing, the session is not killed 
when run from another terminal i.e running the same instance of TC (same server) but 
from different terminals. That would suggest it is an IE configuration issue (at much 
annoyance to certain developers). I will at this stage bring this up on the user list!

Thanks

Paul.

i had the same problem with internet explorer. mozilla seems to work
properly.
i tracked the problem down and found out that internet explorer looses
the session cookie when closing the popup browser window.

then i added
 
to my virtualhost definition in server.xml to disable the session-cookie
mechanism.
after that everything worked fine for me.
remember to encode all urls with response.encodeURL().

jochen schwörer


Wednesday, August 6, 2003, 6:00:57 AM, you wrote:

PW> Dear all,
PW> May someone enlighten me on why my session is being invalidated
PW> when I close a browser window? I am doing this in one of two ways - the
PW> application close icon on the top right of the window, or a simple:

PW> CLOSE

PW> Does anyone have any experience of this? The session is being killed and
PW> thus so is my app. I will submit this query to the user list, but
PW> thought it appropriate for this list as I am getting the same result
PW> from multiple instances of TC on different servers, implying it is not a
PW> configuration issue as first suspected. 

PW> Thanks

PW> Paul.

PW> -
PW> To unsubscribe, e-mail: [EMAIL PROTECTED]
PW> 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: [5.0.7] New build by Sunday

2003-08-08 Thread Remy Maucherat
Jean-Francois Arcand wrote:
+1. There is 1 bug in bugtraq currently open about *.jsp url mapping 
that I need to investigate (I'm not sure yet it's a bug) but I hope to 
have a fix before Sunday.
And what would the bug be ?
(I think I know the mapper code far better than you do, so it would be 
faster ;-) Of course, it might not be a mapper bug)

Remy

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


DO NOT REPLY [Bug 18004] - JDBCRealm.authenticate() eats SQLExceptions and should not

2003-08-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18004

JDBCRealm.authenticate() eats SQLExceptions and should not

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX



--- Additional Comments From [EMAIL PROTECTED]  2003-08-08 17:19 ---
As already stated, the realm does logs the exception so any error which is
occuring may be discovered by the server administrator. 

For security purposes, the user should be denied access with the default webapp
or container error message. Anything less is a security violation. 

This will NOT be fixed in tomcat.  

If this is still an issue, I recommend extending JDBCRealm (which is a non-final
class) with your proposed fix and deploy it to $CATALINA_HOME/server/classes dir
(as well as following all the needed instructions for writing a custom realm)

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



Java eror!

2003-08-08 Thread Fredric Palmgren
Do I have the wrong Java version or what?

"
G:\WebServer\Tomcat4.1\work\Standalone\localhost\examples\jsp\xml\xml_js
p.java:7: cannot access java.util.Date
bad class file: C:\java\j2sdk1.4\jre\lib\rt.jar(java/util/Date.class)
class file has wrong version 48.0, should be 47.0"

/Fredric

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



Re: [5.0.7] New build by Sunday

2003-08-08 Thread jean-frederic clere
Remy Maucherat wrote:
Hi,

I plan to make a new build available by Sunday. Comments ? Any issues 
which would need to be resolved by then ?

A number of issues have been filed about commons-daemon and the new 
Windows .exe wrapper. Is anyone working on resolving them ? (Mladen, JF 
?) I could have helped on that, but the requirement for Visual C++ 
prevents me from doing so. Is there any way around ?
I use _only_ cygwin and gcc for the developements I have done for windoze.

Thanks,
Remy
-
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]


cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

2003-08-08 Thread remm
remm2003/08/06 01:58:19

  Modified:catalina/src/share/org/apache/catalina/loader
WebappClassLoader.java
  Log:
  - Fix problems with the Eclipse test case by extracting all non class resources
from a JAR on access.
  - This of course has a performance penalty, but is the only way to have
this use case work. It is not very valid, but I gave up trying to get people to
change their code.
  - This is needed, because it is the only way to save valuable server resources
(file descriptors and memory on Unix, plus JAR locking on Windows preventing
webapp management without a Tomcat restart).
  
  Revision  ChangesPath
  1.18  +82 -15
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WebappClassLoader.java15 Jun 2003 07:22:16 -  1.17
  +++ WebappClassLoader.java6 Aug 2003 08:58:19 -   1.18
  @@ -1079,29 +1079,15 @@
   // Locating the repository for special handling in the case 
   // of a JAR
   ResourceEntry entry = (ResourceEntry) resourceEntries.get(name);
  -FileOutputStream os = null;
   try {
   String repository = entry.codeBase.toString();
   if (repository.endsWith(".jar")) {
   // Copy binary content to the work directory if not present
   File resourceFile = new File(loaderDir, name);
  -if (entry.lastModified > resourceFile.lastModified()) {
  -resourceFile.getParentFile().mkdirs();
  -os = new FileOutputStream(resourceFile);
  -os.write(entry.binaryContent);
  -}
   url = resourceFile.toURL();
   }
   } catch (Exception e) {
   // Ignore
  -e.printStackTrace();
  -} finally {
  -if (os != null) {
  -try {
  -os.close();
  -} catch (IOException ex) {
  -}
  -}
   }
   if (log.isDebugEnabled())
   log.debug("  --> Returning '" + url.toString() + "'");
  @@ -1529,6 +1515,10 @@
   permissionList.clear();
   loaderPC.clear();
   
  +if (loaderDir != null) {
  +deleteDir(loaderDir);
  +}
  +
   }
   
   
  @@ -1815,6 +1805,58 @@
   } catch (IOException e) {
   return null;
   }
  +
  +// Extract resources contained in JAR to the workdir
  +if (!(path.endsWith(".class"))) {
  +byte[] buf = new byte[1024];
  +File resourceFile = new File
  +(loaderDir, jarEntry.getName());
  +if (!resourceFile.exists()) {
  +Enumeration entries = jarFiles[i].entries();
  +while (entries.hasMoreElements()) {
  +JarEntry jarEntry2 = 
  +(JarEntry) entries.nextElement();
  +if (!(jarEntry2.isDirectory()) 
  +&& (!jarEntry2.getName().endsWith
  +(".class"))) {
  +resourceFile = new File
  +(loaderDir, jarEntry2.getName());
  +resourceFile.getParentFile().mkdirs();
  +FileOutputStream os = null;
  +InputStream is = null;
  +try {
  +is = jarFiles[i].getInputStream
  +(jarEntry2);
  +os = new FileOutputStream
  +(resourceFile);
  +while (true) {
  +int n = is.read(buf);
  +if (n <= 0) {
  +break;
  +}
  +os.write(buf, 0, n);
  +}
  +} catch (IOException e) {
  +// Ignore
  +  

DO NOT REPLY [Bug 22154] - occurs ClassNotFoundException when webapp reload

2003-08-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22154

occurs ClassNotFoundException when webapp reload

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE



--- Additional Comments From [EMAIL PROTECTED]  2003-08-06 02:49 ---


*** This bug has been marked as a duplicate of 22096 ***

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



DO NOT REPLY [Bug 22151] - ThreadPool OutOfMemoryException

2003-08-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22151

ThreadPool OutOfMemoryException

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||WONTFIX



--- Additional Comments From [EMAIL PROTECTED]  2003-08-06 16:39 ---
Well, it seems to me that the ThreadPool shouldn't die when the JVM is out of 
memory.  In my case, the JVM hasn't been allocated all of the memory it can be, 
so future attempts to create new threads would be likely to work.  Would it be 
too hard to catch this exception and make ThreadPool sleep for a few seconds?  
I'll try to hack up the code and see what happens.  For now, I'll close this 
bug as it's being received with attitude.

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