RE: jasper directory missing in distribution

2001-10-27 Thread Joel P. Worrall

Just so you're aware, if you have a xerces parser (same or another version)
in your webapp/WEB-INF/lib directory, the new ClassLoader configuration
breaks Tomcat, generating a ClassCastException on the xerces
DocumentBuilderFactory implementation when trying to start the JspServlet.

In other words, it appears the change has broken Tomcat.  I struggled for 4
days trying to get the 4.0.1 configuration with my web application to work
with absolutely no success.  I finally had to use a previous version with
the old jasper directory and ClassLoader scheme to get Tomcat to even start
up with my web application (silly me for trying to use an XML parser).  I
have logged this with the bug base but I don't believe anyone believes the
problem exists.  All I can say is that my system is up and working under the
old directory structure / class loading scheme and it didn't work before.
I've eliminated all the other variables I can find and it appears the new
ClassLoading is the problem.

Hope that helps the effort.  I've temporarily unsubscribed from the Tomcat
user list so please reply directly with further questions.

-the llama

-Original Message-
From: craigmcc@localhost [mailto:craigmcc@localhost]On Behalf Of Craig
R. McClanahan
Sent: Thursday, October 25, 2001 8:30 PM
To: Tomcat User List (E-mail); [EMAIL PROTECTED]
Subject: Re: jasper directory missing in distribution




On Thu, 25 Oct 2001, Joel P. Worrall wrote:

 Date: Thu, 25 Oct 2001 09:34:24 -0400
 From: Joel P. Worrall [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 To: Tomcat User List (E-mail) [EMAIL PROTECTED]
 Subject: jasper directory missing in distribution

 Is it my imagination or is the jasper directory under CATALINA-HOME
missing
 from the 4.0.1 distribution.  I am still having an issue with the xerces
 parser, so I read the docs on using other XML parsers.  The docs mention
 removing files from the jasper directory, but when I download the
 jakarta-tomcat-4.0.1.tar.gz, the jasper directory does not exist/is not
 included.

 Why?


The switch to using Xerces as the standard parser eliminated the need for
a separate jasper subdirectory and class loader.  Jasper will use
whatever parser is in common/lib or lib (which must be JAXP/1.1
compliant).

Craig




XML ClassCastException and tomcat 4.0 documentation

2001-10-25 Thread Joel P. Worrall

I am facing a terrible dilemma and in need of accurate information.

I believe my issue deals with the Tomcat 4 class loaders and my problem
surrounds the use of Tomcat 4.0.1 on jdk 1.4 with the JDOM beta 7 jar.

2 scenarios:

1.  unpack tomcat 4, configure the server.xml to look to my webapp.

My application WEB-INF/lib jar contains jdom beta 7 and the latest and
greatest xerces jar (built from source of xml.apache.org).  (Note that we
now have a xerces jar in the CATALINA_HOME/common/lib directory AND my
webapp/WEB-INF/lib directories)

For some reason, despite the fact that both xerces are recent, the following
exception occurs.

javax.servlet.ServletException: Servlet.init() for servlet jsp threw
exception
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3267)
at org.apache.catalina.core.StandardContext.start

- Root Cause -
java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.
java:103)
at
org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183)
at
org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCa
che.java:165)
at
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:1
38)
at
org.apache.jasper.EmbededServletOptions.init(EmbededServletOptions.java:32
4)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
at org.apache.catalina.core.StandardWrapper.load
..

For some reason, the ClassLoader(?) get confused and spits back a that
ClassCastException, claiming that the xerces DocumentBuilderFactory
implementation does not implement the interface - when it clearly does.

2.  Ok, so I remove the xerces.jar from the webapp/WEB-INF/lib directory.

I startup the system.  Now the jspservlet starts fine but my own servlet
that (a few levels deeper) makes a call to org.jdom.input.SAXBuilder chokes
b/c the org.apache.xerces.parsers.SAXParser is being cast to an XMLReader.
Now I checked the xerces.jar's SAXParser class AND IT DOES implement
XMLReader, but it throws the following exception none the less.

This leads me to believe its ClassLoader issue.

javax.servlet.ServletException: Error in building:
org.apache.xerces.parsers.SAXParser
at com.commnav.sbh.servlets.ControlServlet.init(ControlServlet.java:155)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
.
org.jdom.JDOMException: Error in building:
org.apache.xerces.parsers.SAXParser
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:306)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:583)
at
com.commnav.sbh.framework.config.ServletConfigConfiguration.init(ServletCo
nfigConfiguration.java:41)
at com.commnav.sbh.servlets.ControlServlet.init(ControlServlet.java:90)
.
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser
at org.jdom.input.SAXBuilder.createParser(SAXBuilder.java:392)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:283)
... 20 more
Root cause: java.lang.ClassCastException:
org.apache.xerces.parsers.SAXParser
at org.jdom.input.SAXBuilder.createParser(SAXBuilder.java:392)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:283)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:583)
at
com.commnav.sbh.framework.config.ServletConfigConfiguration.init(ServletCo
nfigConfiguration.java:41)
at com.commnav.sbh.servlets.ControlServlet.init(ControlServlet.java:90)


My frustration comes in that the documentation (HOWTO on ClassLoader) seems
to be very inaccurate, and I am left wondering how the ClassLoaders work,
what I need to configure to seperate these jars or whatever might be needed.

Someone who knows what they're doing... please help me.  I can (and do)
duplicate the error like clockwork.  I'm certain not to be the only one with
this issue and I hope to contribute the solution / explanation to the
community.

thanks,
the llama


Joel P. Worrall
Senior Software Engineer
 CommNav, Inc.
  (717) 796-1936 x274
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
 home - (717) 796-2314
 Tango the gifted Llama
-





jasper directory missing in distribution

2001-10-25 Thread Joel P. Worrall

Is it my imagination or is the jasper directory under CATALINA-HOME missing
from the 4.0.1 distribution.  I am still having an issue with the xerces
parser, so I read the docs on using other XML parsers.  The docs mention
removing files from the jasper directory, but when I download the
jakarta-tomcat-4.0.1.tar.gz, the jasper directory does not exist/is not
included.

Why?


Joel P. Worrall
Senior Software Engineer
 CommNav, Inc.
  (717) 796-1936 x274
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
 home - (717) 796-2314
 Tango the gifted Llama
-





RE: TC 4.0.1 - Catalina.start: LifecycleException

2001-10-24 Thread Joel P. Worrall

I believe you'll find that the BindException is occurring because Tomcat has
not totally shutdown.  On startup, it grabs the 2 server ports you specify
in the server.xml.  

It appears that 4.0.1 uses threads to go out and kill those server ports on
shutdown.  My experience has been that it takes between 2 seconds or more to
reliably assume those ports are now open again.  

If that is not the case, use netstat on the server and determine what is
using that port(s).  Perhaps there's another copy of tomcat running on those
ports (especially if you're using the default install).

-Original Message-
From: Andrew Bruno [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 7:28 PM
To: Tomcat-User (E-mail)
Subject: TC 4.0.1 - Catalina.start: LifecycleException


Hello tomcat-users,

I am receiving this problem on a Windows 2000 Server SP2, which is
trying to execute TOMCAT 4.0.1, using JDK 1.3.1_01 on port 8080.  Port
80 is used for IIS.

Any ideas what it could be related to?

Catalina.start: LifecycleException:  null.open:  java.net.BindException:
Address in use: JVM_Bind
LifecycleException:  null.open:  java.net.BindException: Address in use:
JVM_Bind
at
org.apache.catalina.connector.http.HttpConnector.initialize(HttpConnecto
r.java:1116)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java
:454)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:5
52)
at org.apache.catalina.startup.Catalina.start(Catalina.java:775)
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at
org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
- Root Cause -
java.net.BindException: Address in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.init(Unknown Source)
at java.net.ServerSocket.init(Unknown Source)
at
org.apache.catalina.net.DefaultServerSocketFactory.createSocket(DefaultS
erverSocketFactory.java:118)
at
org.apache.catalina.connector.http.HttpConnector.open(HttpConnector.java
:946)
at
org.apache.catalina.connector.http.HttpConnector.initialize(HttpConnecto
r.java:1114)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java
:454)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:5
52)
at org.apache.catalina.startup.Catalina.start(Catalina.java:775)
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at
org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

 winmail.dat


JspServlet will not init

2001-10-19 Thread Joel P. Worrall
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1011)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
)
at java.lang.Thread.run(Thread.java:539)

Help?

-the llama


Joel P. Worrall
Senior Software Engineer
 CommNav, Inc.
  (717) 796-1936 x274
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
 home - (717) 796-2314
 Tango the gifted Llama
-





XML libraries

2001-10-19 Thread Joel P. Worrall

What libraries of Xerces are supposed to be used with Tomcat 4.0?  I am
getting the following exception.  I assume it a library issue.

It is keeping the JspServlet from starting... that's bad.

java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.
java:103)
at
org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183)
at
org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCa
che.java:165)
at
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:1
38)
at
org.apache.jasper.EmbededServletOptions.init(EmbededServletOptions.java:32
4)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3267)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)


Joel P. Worrall
Senior Software Engineer
 CommNav, Inc.
  (717) 796-1936 x274
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
 home - (717) 796-2314
 Tango the gifted Llama
-