tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7654] New: - Exception in preInit - java.lang.ClassCastException
Date Mon, 01 Apr 2002 09:11:01 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7654>.
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=7654

Exception in preInit - java.lang.ClassCastException

           Summary: Exception in preInit - java.lang.ClassCastException
           Product: Tomcat 3
           Version: 3.3.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: maxim@tradertools.com


I switched from Tomcat 3.2.1 to latest 3.3.1 final and got exception;
here is Tomcat's output:
---------------------------------------------------------------------
2002-04-01 09:35:31 - ServerXmlReader: Config=$TOMCAT_HOME\conf\server.xml
2002-04-01 09:35:31 - PathSetter: home=C:\Program Files\Tomcat
2002-04-01 09:35:31 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-12
7.0.0.1.xml
2002-04-01 09:35:31 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ad
min.xml
2002-04-01 09:35:31 - ContextXmlReader: Context config=$TOMCAT_HOME\conf\apps-ex
amples.xml
2002-04-01 09:35:31 - AutoWebApp: Loaded from config: DEFAULT:/admin
2002-04-01 09:35:31 - AutoWebApp: Loaded from config: DEFAULT:/examples
2002-04-01 09:35:31 - AutoWebApp: Auto-Adding DEFAULT:/LsGateway
2002-04-01 09:35:31 - AutoWebApp: Auto-Adding DEFAULT:/
2002-04-01 09:35:31 - ContextManager: Tomcat configured and in stable state
2002-04-01 09:35:31 - ContextManager: Adding  DEFAULT:/admin
2002-04-01 09:35:31 - ContextManager: Adding  DEFAULT:/examples
2002-04-01 09:35:31 - ContextManager: Adding  DEFAULT:/LsGateway
2002-04-01 09:35:31 - ContextManager: Adding  DEFAULT:/ROOT
2002-04-01 09:35:33 - Ctx(/LsGateway) : Exception in preInit org.apache.crimson.
jaxp.SAXParserFactoryImpl - java.lang.ClassCastException: org.apache.crimson.jax
p.SAXParserFactoryImpl
        at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
135)
        at pfs.ls.gateway.LsGateway.<init>(LsGateway.java:33)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Unknown Source)
        at org.apache.tomcat.facade.ServletHandler.getServlet(ServletHandler.jav
a:346)
        at org.apache.tomcat.facade.ServletHandler.preInit(ServletHandler.java:4
39)
        at org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java:228)

        at org.apache.tomcat.facade.LoadOnStartupInterceptor.contextInit(LoadOnS
tartupInterceptor.java:136)
        at org.apache.tomcat.core.Context.init(Context.java:542)
        at org.apache.tomcat.core.ContextManager.init(ContextManager.java:597)
        at org.apache.tomcat.startup.EmbededTomcat.initContextManager(EmbededTom
cat.java:564)
        at org.apache.tomcat.startup.EmbededTomcat.execute1(EmbededTomcat.java:7
03)
        at org.apache.tomcat.startup.EmbededTomcat$1.run(EmbededTomcat.java:687)

        at org.apache.tomcat.util.compat.Jdk12Support$PrivilegedProxy.run(Jdk12S
upport.java:190)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.tomcat.util.compat.Jdk12Support.doPrivileged(Jdk12Support.
java:100)
        at org.apache.tomcat.startup.EmbededTomcat.execute(EmbededTomcat.java:68
5)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.tomcat.util.IntrospectionUtils.execute(IntrospectionUtils.
java:87)
        at org.apache.tomcat.startup.Main.execute(Main.java:313)
        at org.apache.tomcat.startup.Main.main(Main.java:140)

EmbededTomcat: Init time 6409
2002-04-01 09:35:34 - Http10Interceptor: Starting on 8080
2002-04-01 09:35:34 - Ajp12Interceptor: Starting on 8007
2002-04-01 09:35:34 - Ajp13Interceptor: Starting on 8009
EmbededTomcat: Startup time 561
--------------------------------------------------------------
Code that causes exception is:
public class LsGateway extends HttpServlet
{
  ...
  private javax.xml.parsers.SAXParserFactory spf = 
javax.xml.parsers.SAXParserFactory.newInstance(); //Exception at this line
  ...
  public void init(ServletConfig config) throws ServletException
  {
    super.init(config);
    ...
  }
  ...
}

Howewer, when I changed my code as follows everything works fine:
public class LsGateway extends HttpServlet
{
  ...
  private javax.xml.parsers.SAXParserFactory spf;
  ...
  public void init(ServletConfig config) throws ServletException
  {
    super.init(config);
    spf = javax.xml.parsers.SAXParserFactory.newInstance(); 
  }
  ...
}
I'm using default, unchanged configuration, that means using XML parser 
provided by Tomcat.

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message