SAXNotRecognizedException

I recently installed Java WSDP on a UNIX machine. Do I need to change any environment variables in order to use JAXP1.2? I thought this installation would get rid of the SAXNotRecognizedException, but it's still coming up:
org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
at weblogic.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1558)
at weblogic.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
at weblogic.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:187)
at weblogic.xml.jaxp.WebLogicSAXParser.setProperty(WebLogicSAXParser.java:117)
at weblogic.xml.jaxp.RegistrySAXParser.setProperty(RegistrySAXParser.java:106)

found this in 30 seconds
http://forum.java.sun.com/thread.jsp?forum=34&thread=281543
using this search
http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2BSAXNotRecognizedException&col=javaforums&x=14&y=13

Similar Messages

  • Org.xml.sax.SAXNotRecognizedException

    I'm Working on Jdeveloper...
    It compiles pretty fine.. but I get a bunch of errors when I try to run. Can anybody help me come across this problem.
    the stack trace is here:
    [Digester.java:686] ERROR - Digester.getParser:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
         at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
         at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
         at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
         at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
         at org.apache.commons.digester.Digester.getParser(Digester.java:682)
         at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
         at org.apache.commons.digester.Digester.parse(Digester.java:1572)
         at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
         at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
         at javax.servlet.GenericServlet.init(GenericServlet.java:256)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2112)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4430)
         at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2753)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:720)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:288)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:294)
         at java.lang.Thread.run(Thread.java:534)
    1766 [PropertyMessageResources.java:127] INFO - Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    1828 [Digester.java:686] ERROR - Digester.getParser:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
         at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
         at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
         at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
         at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
         at org.apache.commons.digester.Digester.getParser(Digester.java:682)
         at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
         at org.apache.commons.digester.Digester.parse(Digester.java:1572)
         at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
         at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
         at javax.servlet.GenericServlet.init(GenericServlet.java:256)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2112)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4430)
         at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2753)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:720)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:288)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:294)
         at java.lang.Thread.run(Thread.java:534)
    The error is here on the runtime page:
    500 Internal Server Error
    java.lang.NullPointerException     at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)     at org.apache.commons.digester.Digester.parse(Digester.java:1572)     at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)     at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)     at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)     at javax.servlet.GenericServlet.init(GenericServlet.java:256)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpApplication.loadServlet(HttpApplication.java:2112)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpApplication.findServlet(HttpApplication.java:4430)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2753)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:720)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:288)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:294)     at java.lang.Thread.run(Thread.java:534)

    Use the Commons Digester 1.7 instead of the Comman Digester library included with JDeveloper 10.1.3.
    http://jakarta.apache.org/commons/digester/

  • Getting org.xml.sax.SAXNotRecognizedException in Java mapping. Help!

    Hi Experts
       I have written a java code for schema validating XI message.
    my java code:
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import com.sap.aii.mapping.api.StreamTransformation;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class P2PValidation extends DefaultHandler implements StreamTransformation{
         private Map map;
         private OutputStream out;
         //Constants when using XML Schema for SAX parsing.
         static final String JAXP_SCHEMA_LANGUAGE =
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         static final String W3C_XML_SCHEMA =
         "http://www.w3.org/2001/XMLSchema";
         static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
         public void setParameter (Map param){
              map = param;
         public void execute (InputStream in, OutputStream out)
         throws com.sap.aii.mapping.api.StreamTransformationException {
            DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              // Obtain an object of class javax.xml.parsers.SAXParser,
             factory.setNamespaceAware(true);
             factory.setValidating(true);
              try {
                   SAXParser saxParser = factory.newSAXParser();
                   // Setup the schema file
                   //saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                   //saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File("IOReqMsgSchema.xsd"));
                   saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
                   saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", new File("IOReqMsgSchema.xsd"));
                  //System.out.println("Parsing");
                  this.out = out;
                   saxParser.parse(in, handler);
              catch (Exception t){
                   t.printStackTrace();
         private void write (String s) throws SAXException{
              try{
                   out.write(s.getBytes()); out.flush();
              catch (IOException e){
                   throw new SAXException("I/O error", e);
         public void startDocument () throws SAXException{
              write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              write("<ns0:ValidInternalOrder xmlns:ns0=\"http://www.xyz.com/Gopal\">");
         public void endDocument () throws SAXException {
              write("</ns0:ValidInternalOrder>");
              try { out.flush();
              catch (IOException e) {
                   throw new SAXException("I/O error", e);
         public void startElement (String namespaceURI, String sName, String qName, Attributes attrs)
         throws SAXException {
            System.out.println("sName="sName" qName="+sName);
                if(sName.equals(qName))
                   write("<"sName">");
         public void endElement (String namespaceURI, String sName, String qName) throws SAXException {
              if(sName.equals(qName))
                   write("</"sName">");
         public void characters (char buf[], int offset, int len)
         throws SAXException {
              String s = new String(buf, offset, len);
              write (s);
         public void error(SAXParseException se) throws SAXException {
              throw se;
    But when I run the code in my local machine or in Xi i am getting the error:
    org.xml.sax.SAXNotRecognizedException:
            at com.inqmy.lib.xml.parser.SAXParser.setProperty(SAXParser.java:111)
            at com.inqmy.lib.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:51
            at P2PValidation.execute(P2PValidation.java:38)
    What is wrong with the properties I have set for schema validatation?
    //Constants when using XML Schema for SAX parsing.
         static final String JAXP_SCHEMA_LANGUAGE =
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         static final String W3C_XML_SCHEMA =
         "http://www.w3.org/2001/XMLSchema";
         static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
    Kindly help me understand how to correct this error. What are the correct values for properties?
    Please help! URGENT!!!
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Mar 4, 2008 12:45 PM

    Hi Gabriel,
       I have already seen that link but did not get any solution yet.
      Please help me!
    -Gopal

  • XML: VALIDATING WITH XML SCHEMA: SAXNotRecognizedException

    Hi,
    1. From The Java� Web Services Tutorial for SAX
    If the parser is not 1.2 compliant, and therefore does not support XML Schema,it could throw a SAXNotRecognizedException .
    SAXParser saxParser =factory.newSAXParser();
    try {
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
    catch (SAXNotRecognizedException x){
    //Happens if the parser does not support JAXP 1.2
    2. How do we know if the parser is not 1.2 compliant or not? 1M Thanks.

    If you have an older xerces.jar in your class path your parser will not be JAXP 1.2 compliant.
    Try replacing xerces.jar with both xercesImpl.jar and xml-apis.jar.

  • Anybody know how to read "xerces"?? and a lot more......

    And, what's the relationship between xerces and sun's JAXP? Is jaxp more a interface less an implementation? I found jaxp calls some part of xerces pack. Meanwhile, in xerces pack there sits a jaxp pack. Xerces say it support jaxp, so, is that mean xerces is a implementation of jaxp interface?
    Both of the two pack contains some implementation..... I'm confused.
    Can anybody give me an insider's view of jaxp package?
    "The SAX Plugability classes allow an application programmer to provide an implementation of the
    org.xml.sax.DefaultHandler API to a SAXParser implementation and parse XML documents. As the parser processes the XML document, it will call methods on the provided DefaultHandler."
    ------from jaxp1.2 spec
    I'm sorry but English isn't my mother tongue. I'm rather confused by the statements above. Anybody do me a favour to translate it to plain English? Very much thanks.
    Also, what does the following code mean? (from javax.xml.parser.SAXParserFactory.java)
    class FactoryFinder is in nowhere to be found. Can anybody help explain it?
        public static SAXParserFactory newInstance()
            throws FactoryConfigurationError
            try {
                return (SAXParserFactory) FactoryFinder.find(
                    /* The default property name according to the JAXP spec */
                    "javax.xml.parsers.SAXParserFactory",
                    /* The fallback implementation class name */
                    "org.apache.crimson.jaxp.SAXParserFactoryImpl"); //what's this??
            } catch (FactoryFinder.ConfigurationError e) {
                throw new FactoryConfigurationError(e.getException(),
                                                    e.getMessage());
        }Moreover, what the relation between SAXParserFactoryImpl and SAXParserFactory?
    I wrote a program to validate xml files against dtd or schema. Does the package automatically find dtd or schema files within the xml or i have to offer them in the command line? In my case, it seems to be the latter.

    Well, you see, my real problem is that i coded to validate a xml file against xsd or dtd. However, I have to feed the program with a dtd or xsd file in the command line to make it work. Isn't it supposed to find out a proper dtd/xsd in the xml file(when specified)? Or I it isn't properly configured?
    Help me, please!
    Here is the code:
    package xmltool;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import java.io.*;
    * This class validate a xml file against its DTD or Schema.
    * @version 1.1
    * @auther Data Zoe
    public class Check extends DefaultHandler
        /** Constants used for JAXP 1.2 */
        static final String JAXP_SCHEMA_LANGUAGE =
            "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
        static final String W3C_XML_SCHEMA =
            "http://www.w3.org/2001/XMLSchema";
         public static void main(String args[])throws Exception
              //tag varible
              boolean dtdValidate = false;
              boolean xsdValidate = false;
              //xml file to be validated
              String fileName = null;
              //Check input
              for(int i=0;i<args.length;i++)
                        if(args.endsWith(".xml")||args[i].endsWith(".XML"))
                             fileName = args[i];
                        else if(args[i].endsWith(".xsd")||args[i].endsWith(".XSD"))
                             xsdValidate = true;
                        else if(args[i].endsWith(".dtd")||args[i].endsWith(".DTD"))
                             dtdValidate = true;
                        else
                                  System.err.println("Out put usage infomation.");
              if(fileName!=null)
                   SAXParserFactory spf = SAXParserFactory.newInstance();
                   spf.setNamespaceAware(true);
                   spf.setValidating(dtdValidate||xsdValidate);
                   SAXParser saxParser = spf.newSAXParser();
                   XMLReader xmlReader = saxParser.getXMLReader();
                   xmlReader.setContentHandler(new Check());
                   xmlReader.setErrorHandler(new myErrorHandler(System.err));
                   xmlReader.parse(fileName);
                   if (xsdValidate)
                        try     {saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);}
                        catch (SAXNotRecognizedException x)
                                  // This can happen if the parser does not support JAXP 1.2
                                  System.err.println(
                                       "Error: JAXP SAXParser property not recognized: "
                                       + JAXP_SCHEMA_LANGUAGE);
                                  System.err.println(
                                       "Check to see if parser conforms to JAXP 1.2 spec.");
                                  System.exit(1);
              else
                   System.err.println("No xml file to validate");
         * Error handler
         private static class myErrorHandler implements ErrorHandler
              /** Error handler output goes here */
              private PrintStream out;
              myErrorHandler(PrintStream out)
                   this.out = out;
              * Returns a string describing parse exception details
              private String getParseExceptionInfo(SAXParseException spe)
                   String systemId = spe.getSystemId();
                   if (systemId == null)
                        systemId = "null";
                   String info = "URI=" + systemId +
                        " Line=" + spe.getLineNumber() +
                        ": " + spe.getMessage();
                   return info;
              // The following methods are standard SAX ErrorHandler methods.
              // See SAX documentation for more info.
              public void warning(SAXParseException spe) throws SAXException
                   out.println("Warning: " + getParseExceptionInfo(spe));
              public void error(SAXParseException spe) throws SAXException
                   String message = "Error: " + getParseExceptionInfo(spe);
                   throw new SAXException(message);
              public void fatalError(SAXParseException spe) throws SAXException
                   String message = "Fatal Error: " + getParseExceptionInfo(spe);
                   throw new SAXException(message);

  • Struts 1.2.9 on OC4J 10.1.2 Not working

    Hi All,
    I have been trying all sort of different things to deploy my .ear file on OC4J that has struts used in .war file. The same .ear file deploys correctly and works fine on runtime for my Standalone OC4J10.1.2 on windows but when I try to deploy it on UNIX box for Standalone OC4J10.1.2 it does deploy right but it breaks runtime on access to login.jsp as soon as it finds the first struts tag.
    Pl help me asap. I have no idea, if this version of struts is not supported by this version of OC4J or what?
    Here is the config for web.xml
         <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <init-param>
                   <param-name>application</param-name>
                   <param-value>ApplicationResources</param-value>
              </init-param>
              <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/struts-config.xml</param-value>
              </init-param>
              <init-param>
                   <param-name>debug</param-name>
                   <param-value>2</param-value>
              </init-param>
              <init-param>
                   <param-name>detail</param-name>
                   <param-value>2</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
         </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    My all struts related jars are located at WEB-INF/lib
    commons-fileupload.jar
    commons-logging.jar
    commons-digester.jar
    commons-beanutils.jar
    commons-validator.jar
    jakarta-oro.jar
    antlr.jar
    struts.jar
    I am not specifying any classpath as the server should pick up libraries from WEB-INF/lib.
    Here is my login.jsp
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <style type="text/css" media="screen">
    @import url(<html:rewrite page="/COES/css/coes.css" />);
    </style>
    <script type="text/javascript" language="Javascript"
    src="/COES/javascript/coes.js">
    </script>
    <script type="text/javascript" language="Javascript"
    src="/COES/javascript/datefunctions.js">
    </script>
    <title><bean:message key="coes.title"/></title>
    <!-- Begin Validator Javascript Function-->
    <html:javascript formName="LoginForm"/>
    <!-- End of Validator Javascript Function-->
    </head>
    <body>
    <table>
    <tr><td class="errors"><html:errors/></td></tr>
    <tr>
    <td>
    <table width="100%" class="headertable" border="0">
    <tr>
    <td width="1%"><html:image page="/img/nexcomlogo.gif" styleClass="css/headerLogoImage" altKey="coes.build"/></td>
    <td align="center"><bean:message key="coes.title"/> - <bean:message key="coes.version"/><br><br>
    </td>
    <td> </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td>
    <html:form action="Login" onsubmit="return validateLoginForm(this);">
    <b>Enter your location passcode:</b> 
    <html:password property="passcode"/>
    <html:submit property="login"
    styleClass="smallblackbutton"
    value="Log In"
    onmouseover="javascript:goLite(this)"
    onmouseout="javascript:goDim(this)"
    />
    </html:form>
    </td>
    </tr>
    </table>
    </body>
    </html>
    It breaks at line
    @import url(<html:rewrite page="/COES/css/coes.css" />);
    and on browser I see err
    java.lang.NullPointerException     at org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1070)     at org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:449)     at org.apache.struts.taglib.html.RewriteTag.doStartTag(RewriteTag.java:55)     at jsp.login._jspService(_login.java:51)     [SRC:/jsp/login.jsp:12]     at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)     at java.lang.Thread.run(Thread.java:568)
    The log file always shows below err, no matter what change I make:
    [17 Nov 2006 10:22:24] ERROR [Digester] Digester.getParser:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
         at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
         at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
         at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
         at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
         at org.apache.commons.digester.Digester.getParser(Digester.java:682)
         at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
         at org.apache.commons.digester.Digester.parse(Digester.java:1572)
         at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
         at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
         at com.evermind.server.Application.getHttpApplication(Application.java:890)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
         at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
         at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
         at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)
         at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)
         at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)
         at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)
         at java.lang.Thread.run(Thread.java:568)
    [17 Nov 2006 10:22:24] ERROR [ActionServlet] Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
    java.lang.NullPointerException
         at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
         at org.apache.commons.digester.Digester.parse(Digester.java:1572)
         at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
         at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
         at com.evermind.server.Application.getHttpApplication(Application.java:890)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
         at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
         at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
         at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)
         at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)
         at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)
         at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)
         at java.lang.Thread.run(Thread.java:568)
    Thanks

    Did you try changing the xml parser to use Xerces instead of Oracle?
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    It is a pretty long article.
    Pat

  • XMl parser version problem for running struts project in jdeveloper 10.1.3

    Dear All.
    I am trying to run a struts (v 1.2.9) based project in Jdeveloper 10.1.3.1.0.The struts version in Jdeveloper is 1.1.
    when i am trying to run the index.jsp i get an error:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
    I think the XML parser version is a problem.Jdeveloper has OracleXMLParser v2 and i think the XML Parser apis used in building the project is different.I have placedcustiom xml parser apis and the xerces.jar in the jdevbin/jdev/lib folder and included these jar in the bootclasspath as follows:
    AddVMOption -Xbootclasspath/p:../lib/xml-apis.jar
    AddVMOption -Xbootclasspath/p:../lib/xerces-2.6.2.jar
    But even then the Exception persists.Is the syntax for Xbootclasspath wrong or i need to place these custom api's in some other location of jdev.
    I am not being able to figure out the XMl parser problem.
    Any help wud be great.
    Is it that i cant run the project in jdeveloper.Just to mention the application is deployed in OC4J on the server and runs fine..But its only that i kant run it locally through jdeveloper

    I am also facing the same issue on my laptop. I searched for forum but no luck.
    appreciate if anybody can throw some light on this.

  • Error while Validating xml against a schema using jaxp

    Hi All,
    Following code validates xml against a schema using JAXP .It gives SAXNotRecognizedException error when you run the program.
    static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    SAXParserFactory myFactory = SAXParserFactory.newInstance();
    myFactory.setNamespaceAware(true);
    myFactory.setValidating(true);
    javax.xml.parsers.SAXParser parser;
    String filename = "C:/Note.xml";
    File xmlFile = new File(filename);
    try
         DefaultHandler handler = new DefaultHandler();
         parser = myFactory.newSAXParser();
         parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
         parser.parse(xmlFile, handler);
    catch (ParserConfigurationException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (SAXException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (IOException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    Error Details :
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
         at org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1682)
         at org.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
         at org.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:183)
    How do i fix the above mentioned problem ?
    Thanks in Advance.
    Ansh

    Validate with the JAXP DOMParser instead of the JAXP SAXParser.
    To validate with a SAXParser use the xerces SAXParser.
    thanks,
    Deepak

  • Xml document validation using Schema

    I want to validate XML Document using XML Schema...
    does any body have an idea how to do it.
    Every time i m running my java file by using different XML FILE AND XSD FILE in command line i m getting same error.
    error is:
    Exception in thread "main" org.xml.sax.SAXException: Error: URI=null Line=2: s4s-elt-schema-ns: The namespace of element 'catalog' must be from the schema name space.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1115)
    at SAXLocalNameCount.main(SAXLocalNameCount.java:117)
    Below is my java code with xml file and schema file.
    plz get back to me as soon as possible it is urgent.
    thanx
    java File
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import java.util.*;
    import java.io.*;
    public class SAXLocalNameCount extends DefaultHandler {
    /** Constants used for JAXP 1.2 */
    static final String JAXP_SCHEMA_LANGUAGE =
    "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    static final String W3C_XML_SCHEMA =
    "http://www.w3.org/2001/XMLSchema";
    static final String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    /** A Hashtable with tag names as keys and Integers as values */
    private Hashtable tags;
    // Parser calls this once at the beginning of a document
    public void startDocument() throws SAXException {
    tags = new Hashtable();
    // Parser calls this for each element in a document
    public void startElement(String namespaceURI, String localName,
    String qName, Attributes atts)
         throws SAXException
    String key = localName;
    Object value = tags.get(key);
    if (value == null) {
    // Add a new entry
    tags.put(key, new Integer(1));
    } else {
    // Get the current count and increment it
    int count = ((Integer)value).intValue();
    count++;
    tags.put(key, new Integer(count));
    System.out.println("TOTAL NUMBER OF TAG IN FILE = "+count);
    // Parser calls this once after parsing a document
    public void endDocument() throws SAXException {
    Enumeration e = tags.keys();
    while (e.hasMoreElements()) {
    String tag = (String)e.nextElement();
    int count = ((Integer)tags.get(tag)).intValue();
    System.out.println("Local Name \"" + tag + "\" occurs " + count
    + " times");
    static public void main(String[] args) throws Exception {
    String filename = null;
    String schemaSource = null;
    // Parse arguments
    schemaSource = args[0];
    filename = args[1];
    // Create a JAXP SAXParserFactory and configure it
    SAXParserFactory spf = SAXParserFactory.newInstance();
    // Set namespaceAware to true to get a parser that corresponds to
    // the default SAX2 namespace feature setting. This is necessary
    // because the default value from JAXP 1.0 was defined to be false.
    //spf.setNamespaceAware(true);
    // Validation part 1: set whether validation is on
    spf.setValidating(true);
    // Create a JAXP SAXParser
    SAXParser saxParser = spf.newSAXParser();
    System.out.println(" saxparser "+saxParser);
    // Validation part 2a: set the schema language if necessary
    if (true) {
    try {
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
    System.out.println(" saxparser ");
    } catch (SAXNotRecognizedException x) {
    // This can happen if the parser does not support JAXP 1.2
    System.err.println(
    "Error: JAXP SAXParser property not recognized: "
    + JAXP_SCHEMA_LANGUAGE);
    System.err.println(
    "Check to see if parser conforms to JAXP 1.2 spec.");
    System.exit(1);
    // Validation part 2b: Set the schema source, if any. See the JAXP
    // 1.2 maintenance update specification for more complex usages of
    // this feature.
    if (schemaSource != null) {
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File(schemaSource));
    System.out.println(" saxparser 123");
    // Get the encapsulated SAX XMLReader
    XMLReader xmlReader = saxParser.getXMLReader();
    System.out.println(" XML READER "+xmlReader);
    // Set the ContentHandler of the XMLReader
    xmlReader.setContentHandler(new SAXLocalNameCount());
    System.out.println(" XML READER 345 ");
    // Set an ErrorHandler before parsing
    xmlReader.setErrorHandler(new MyErrorHandler(System.err));
    System.out.println(" XML READER 67878 ");
    // Tell the XMLReader to parse the XML document
    xmlReader.parse(filename);
    System.out.println(" XML READER ");
    // Error handler to report errors and warnings
    private static class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintStream out;
    MyErrorHandler(PrintStream out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    // The following methods are standard SAX ErrorHandler methods.
    // See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    xml file(books.xml)
    <?xml version="1.0"?>
    <catalog>
    <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>An in-depth look at creating applications
    with XML.</description>
    </book>
    <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-12-16</publish_date>
    <description>A former architect battles corporate zombies,
    an evil sorceress, and her own childhood to become queen
    of the world.</description>
    </book>
    <book id="bk103">
    <author>Corets, Eva</author>
    <title>Maeve Ascendant</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-11-17</publish_date>
    <description>After the collapse of a nanotechnology
    society in England, the young survivors lay the
    foundation for a new society.</description>
    </book>
    <book id="bk104">
    <author>Corets, Eva</author>
    <title>Oberon's Legacy</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-03-10</publish_date>
    <description>In post-apocalypse England, the mysterious
    agent known only as Oberon helps to create a new life
    for the inhabitants of London. Sequel to Maeve
    Ascendant.</description>
    </book>
    <book id="bk105">
    <author>Corets, Eva</author>
    <title>The Sundered Grail</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-09-10</publish_date>
    <description>The two daughters of Maeve, half-sisters,
    battle one another for control of England. Sequel to
    Oberon's Legacy.</description>
    </book>
    <book id="bk106">
    <author>Randall, Cynthia</author>
    <title>Lover Birds</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-09-02</publish_date>
    <description>When Carla meets Paul at an ornithology
    conference, tempers fly as feathers get ruffled.</description>
    </book>
    <book id="bk107">
    <author>Thurman, Paula</author>
    <title>Splish Splash</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>A deep sea diver finds true love twenty
    thousand leagues beneath the sea.</description>
    </book>
    <book id="bk108">
    <author>Knorr, Stefan</author>
    <title>Creepy Crawlies</title>
    <genre>Horror</genre>
    <price>4.95</price>
    <publish_date>2000-12-06</publish_date>
    <description>An anthology of horror stories about roaches,
    centipedes, scorpions and other insects.</description>
    </book>
    <book id="bk109">
    <author>Kress, Peter</author>
    <title>Paradox Lost</title>
    <genre>Science Fiction</genre>
    <price>6.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>After an inadvertant trip through a Heisenberg
    Uncertainty Device, James Salway discovers the problems
    of being quantum.</description>
    </book>
    <book id="bk110">
    <author>O'Brien, Tim</author>
    <title>Microsoft .NET: The Programming Bible</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-09</publish_date>
    <description>Microsoft's .NET initiative is explored in
    detail in this deep programmer's reference.</description>
    </book>
    <book id="bk111">
    <author>O'Brien, Tim</author>
    <title>MSXML3: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-01</publish_date>
    <description>The Microsoft MSXML3 parser is covered in
    detail, with attention to XML DOM interfaces, XSLT processing,
    SAX and more.</description>
    </book>
    <book id="bk112">
    <author>Galos, Mike</author>
    <title>Visual Studio 7: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>49.95</price>
    <publish_date>2001-04-16</publish_date>
    <description>Microsoft Visual Studio 7 is explored in depth,
    looking at how Visual Basic, Visual C++, C#, and ASP+ are
    integrated into a comprehensive development
    environment.</description>
    </book>
    </catalog>
    (books.xsd)
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="catalog">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="book" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="publish_date" type="xsd:date"/>
    <xsd:element name="description" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    Add xmlns:xsi attribute to the root element <catalog>.
    <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation='books.xsd'>

  • Error on startup of Tomcat

    I am attempting to use the Tomcat servlet engine with Apache on Win 98. The versions I am using are Apache/1.3.20 and Tomcat 4.0.1. I have unzipped the tomcat binary to C:\jakarta-tomcat-4.0.1 and set CATALINA_HOME to C:\jakarta-tomcat-4.0.1.
    I am running the same versions of Apache and Tomcat at work on NT 4.0 and had no problems. But on my Win 98 machine when I try to start Tomcat with "startup" I am getting the following (at least I think it is the equivalent on startup with what I'm getting on shutdown--the startup console window is closing before I can capture the message):
    C:\jakarta-tomcat-4.0.1\bin>shutdown
    Using CATALINA_BASE: C:\jakarta-tomcat-4.0.1
    Using CATALINA_HOME: C:\jakarta-tomcat-4.0.1
    Using CLASSPATH: C:\jakarta-tomcat-4.0.1\bin\bootstrap.jar;C:\jdk1.3\l
    ls.jar;C:\jdk1.3\jre\lib\ext\lib\jcert.jar;C:\jdk1.3\jre\lib\ext\lib\jnet.
    \jdk1.3\jre\lib\ext\lib\jsse.jar
    Using JAVA_HOME: C:\jdk1.3
    ERROR reading C:\jakarta-tomcat-4.0.1\conf\server.xml
    At http://xml.org/sax/features/raw-names
    Catalina.stop: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/f
    s/raw-names
    org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/raw-nam
    at org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java
    at org.apache.xerces.parsers.SAXParser.setFeature(SAXParser.java:5
    at org.xml.sax.helpers.XMLReaderAdapter.setupXMLReader(XMLReaderAd
    java:204)
    at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.jav
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:290)
    at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:2
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:817)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
    at java.lang.reflect.Method.invoke(Native Method)
    Thanks in advance for your assistance.
    Roy

    Very simple. On the start up Jakarta is looking for server.xml file. Apparently, it can not read it.
    Check all your env. variables. Make sure you have
    JAVA_HOME, TOMCAT_HOME set correctly. If TOMCAT_HOME is not set up correctly, it would not be able to locate server.xml file.

  • What's wrong with jdeveloper?

    Does anybody else have this problem?
    When i'm developing in Jdev 10.1.3, when I double click a JSP the ide hangs up ('till i kill the process), i eats all my memory (about 680 MB!!!, i have 1GB). I just want to edit a jsp why is this happening. It is really anoying...
    Now i just had to use e simple text editor...
    ¿Does anybody knows what's the problem?
    I have downloaded the last two updates (and the critical update)... since then everything is really anoying!!!!

    Thanks for your answer
    Well, i did what you told me and the stacktrace is really huge. By the way I'm usin jdev 10.1.3.0.4, developing a Struts (1.2.9) application
    It looks like there are some missing libraries or version conflicts...
    Here's a piece of the stacktrace:
    at oracle.jdevimpl.webapp.design.support.http.HttpResourceProducer.getResourceByteArray(HttpResourceProducer.java:41)
            at oracle.jdevimpl.webapp.view.box.ImageBox._prepareImage(ImageBox.java:562)
            at oracle.jdevimpl.webapp.view.box.ImageBox.preLayout(ImageBox.java:125)
            at oracle.jdevimpl.webapp.view.box.InLineBox.preLayout(InLineBox.java:785)
            at oracle.jdevimpl.webapp.view.box.LineBox.preLayout(LineBox.java:354)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1675)
            at oracle.jdevimpl.webapp.view.box.TableCellBox.preLayout(TableCellBox.java:207)
            at oracle.jdevimpl.webapp.view.box.TableGroupBox.preLayout(TableGroupBox.java:856)
            at oracle.jdevimpl.webapp.view.box.TableRowBox.preLayout(TableRowBox.java:1360)
            at oracle.jdevimpl.webapp.view.box.TableGroupBox.preLayout(TableGroupBox.java:856)
            at oracle.jdevimpl.webapp.view.box.TableBox.preLayout(TableBox.java:891)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.layout.ContinousLayout.layout(ContinousLayout.java:118)
            at oracle.jdevimpl.webapp.view.DisplayManager.reflowImpl(DisplayManager.java:1626)
            at oracle.jdevimpl.webapp.view.DisplayManager.mav$reflowImpl(DisplayManager.java:102)
            at oracle.jdevimpl.webapp.view.DisplayManager$Refresh.run(DisplayManager.java:1474)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    [AWT-EventQueue-0] ERROR org.apache.commons.digester.Digester - Digester.getParser:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
            at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
            at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
            at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
            at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
            at org.apache.commons.digester.Digester.getParser(Digester.java:682)
            at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
            at org.apache.commons.digester.Digester.parse(Digester.java:1572)
            at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
            at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
            at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
            at javax.servlet.GenericServlet.init(GenericServlet.java:256)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletInfo.init(DesignTimeServletInfo.java:179)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletInfo.service(DesignTimeServletInfo.java:257)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeRequestDispatcher.dispatch(DesignTimeRequestDispatcher.java:197)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletContainerContext._service(DesignTimeServletContainerContext
    .java:611)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletContainerContext.serviceResource(DesignTimeServletContainer
    Context.java:579)
            at oracle.jdevimpl.webapp.design.support.http.HttpResourceProducer.getResourceByteArray(HttpResourceProducer.java:41)
            at oracle.jdevimpl.webapp.view.box.ImageBox._prepareImage(ImageBox.java:562)
            at oracle.jdevimpl.webapp.view.box.ImageBox.preLayout(ImageBox.java:125)
            at oracle.jdevimpl.webapp.view.box.InLineBox.preLayout(InLineBox.java:785)
            at oracle.jdevimpl.webapp.view.box.LineBox.preLayout(LineBox.java:354)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1675)
            at oracle.jdevimpl.webapp.view.box.TableCellBox.preLayout(TableCellBox.java:207)
            at oracle.jdevimpl.webapp.view.box.TableGroupBox.preLayout(TableGroupBox.java:856)
            at oracle.jdevimpl.webapp.view.box.TableRowBox.preLayout(TableRowBox.java:1360)
            at oracle.jdevimpl.webapp.view.box.TableGroupBox.preLayout(TableGroupBox.java:856)
            at oracle.jdevimpl.webapp.view.box.TableBox.preLayout(TableBox.java:891)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.box.BlockBox.preLayout(BlockBox.java:1584)
            at oracle.jdevimpl.webapp.view.layout.ContinousLayout.layout(ContinousLayout.java:118)
            at oracle.jdevimpl.webapp.view.DisplayManager.reflowImpl(DisplayManager.java:1626)
            at oracle.jdevimpl.webapp.view.DisplayManager.mav$reflowImpl(DisplayManager.java:102)
            at oracle.jdevimpl.webapp.view.DisplayManager$Refresh.run(DisplayManager.java:1474)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    [AWT-EventQueue-0] ERROR org.apache.struts.action.ActionServlet - Unable to initialize Struts ActionServlet due to an unexpected e
    xception or error thrown, so marking the servlet as unavailable.  Most likely, this is due to an incorrect or missing library depe
    ndency.
    java.lang.NullPointerException
            at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
            at org.apache.commons.digester.Digester.parse(Digester.java:1572)
            at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
            at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
            at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
            at javax.servlet.GenericServlet.init(GenericServlet.java:256)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletInfo.init(DesignTimeServletInfo.java:179)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletInfo.service(DesignTimeServletInfo.java:257)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeRequestDispatcher.dispatch(DesignTimeRequestDispatcher.java:197)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletContainerContext._service(DesignTimeServletContainerContext
    .java:611)
            at oracle.jdevimpl.webapp.design.support.http.DesignTimeServletContainerContext.serviceResource(DesignTimeServletContainer
    Context.java:579)

  • Xerces - validator won't catch wrong input in xml file

    Hi there,
    I am using xerces 2.9.1 and Java 5
    here is my code
    package xmltesting;
    import java.io.IOException;
    import org.apache.xerces.parsers.DOMParser;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXNotRecognizedException;
    import org.xml.sax.SAXNotSupportedException;
    public class DomParserExample {
         Document dom;
         public DomParserExample() {
         public void runExample() {
              //parse the xml file and get the dom object
              parseXmlFile();
         private void parseXmlFile(){
              //get the factory
              DOMParser parser = new DOMParser();
              try {
                   parser.setFeature("http://apache.org/xml/features/validation/schema",true);
              } catch (SAXNotRecognizedException e) {
                   e.printStackTrace();
              } catch (SAXNotSupportedException e) {
                   e.printStackTrace();
              try {
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   //parse using builder to get DOM representation of the XML file
                   parser.parse("xmltesting/shiporder.xml");
                   dom = parser.getDocument();
              } catch(IOException ioe) {
                   ioe.printStackTrace();
              } catch (SAXException saxe) {
                   saxe.printStackTrace();
              System.out.println("Everything parsed without any problem");
         public static void main(String[] args){
              //create an instance
              DomParserExample dpe = new DomParserExample();
              //call run example
              dpe.runExample();
    }My xml is following
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <shiporder orderid="889923"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="shiporder.xsd">
    <orderperson>John Smith</orderperson>
    <shipto>
      <name>Ola Nordmann</name>
      <address>Langgt 23</address>
      <city>4000 Stavanger</city>
      <country>Norway</country>
    </shipto>
    <item>
      <title>Empire Burlesque</title>
      <note>Special Edition</note>
      <quantity>1</quantity>
      <price>10.90</price>
    </item>
    <item>
      <title>Hide your heart</title>
      <quantity>1</quantity>
      <price>9.90</price>
    </item>
    </shiporder>
    </xs:schema>and schema xsd is
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="shiporder">
    <xs:complexType>
      <xs:sequence>
       <xs:element name="orderperson" type="xs:string"/>
       <xs:element name="shipto">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="name" type="xs:string"/>
          <xs:element name="address" type="xs:string"/>
          <xs:element name="city" type="xs:string"/>
          <xs:element name="country" type="xs:string"/>
         </xs:sequence>
        </xs:complexType>
       </xs:element>
       <xs:element name="item" maxOccurs="unbounded">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="title" type="xs:string"/>
          <xs:element name="note" type="xs:string" minOccurs="0"/>
          <xs:element name="quantity" type="xs:positiveInteger"/>
          <xs:element name="price" type="xs:decimal"/>
         </xs:sequence>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="orderid" type="xs:string" use="required"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>Now I wanted to try and create problems in the xml file so the validator can catch those errors so i changed the quantity and price values to 'abc' string (they should be integer and decimal values respectively) everywhere in the xml file BUT the validation did not throw any errors and that is where i am confused.
    do i need to do something else in the Java code?
    thanks
    Edited by: Shazmiester on Aug 11, 2008 10:20 AM
    Edited by: Shazmiester on Aug 11, 2008 10:25 AM

    here is my ErrorChecker code
    package xmltesting;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.SAXParseException;
    public class ErrorChecker extends DefaultHandler
         public ErrorChecker() {
         public void error (SAXParseException e) {
              System.out.println("Parsing Error: " + e.getMessage());
         public void warning (SAXParseException e) {
              System.out.println("Parsing warning: " + e.getMessage());
         public void fatalError(SAXParseException e) {
              System.out.println("Fatal Parsing Error.: " + e.getMessage());
              System.out.println("Exiting...");
              System.exit(1);
    }Looks ok to me, the warnings don't show up at all.

  • Java.lang.NullPointerException javax.xml.parsers.DocumentBuilder.parse

    Hi all,
    i have a problem by solving an error in my code. The Code is mainly from Ian Darwin.
    The code i am running works with j2sdk1.4.2_04. But now i have to bring it to work with jdk1.6.0_13.
    The code parses xml documents. With small xml documents the code works. With large xml documents i get the following error while running the produced class file.
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.setChunkIndex(DeferredDocumentImpl.java:1944)
    at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.appendChild(DeferredDocumentImpl.java:644)
    at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.characters(AbstractDOMParser.java:1191)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.characters(XMLDTDValidator.java:862)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:463)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
    at XParse.parse(XParse.java:38)
    at XParse$JFileChooserrv.<init>(XParse.java:119)
    at XParse.main(XParse.java:213)
    I know what a java.lang.NullPointerException mens. But i don't know where i have to look for. Specially i don't know what or where "com.sun.org.apache...." is.
    Is there a package that a have to add to the environment? Can some one tell my where i can find this package?
    I wrote the code for some years ago, 2006 or so. With the knew jdk1.6.0_13 some thinks chance in the environment. Couldn't find what exactly.
    The code has only 215 lines, but some how i can't add it to this Message, because Maximum allowed is only 7500.
    Is there an other Forum, which may is better for my question?

    Here is the code:
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.Container;
    import javax.swing.JTextArea;
    * This code is mainly from @author Ian Darwin, [email protected]
    public class XParse {
         /** Convert the file */
         public static void parse(File file, boolean validate) {
              try {
                   System.err.println("");
                   String fileName = file.getAbsolutePath();
                   System.err.println("Parsing " + fileName + "...");
                   // Make the document a URL so relative DTD works.
                   //String uri = new File(fileName).getAbsolutePath();
                   //System.err.println(uri);
                   DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
                   if (validate)
                   f.setValidating(true);
                   DocumentBuilder p = f.newDocumentBuilder();
                   p.setErrorHandler(new MyErrorHandler(System.err));
                   //XmlDocument doc = XmlDocument.createXMLDocument(file);
                   boolean vaild =  p.isValidating();
                   if (vaild) {
                        System.out.println("yes parsing");
                        Document doc = p.parse(file); // <<<< ERROR
                   System.out.println("Parsed OK");
              } catch (SAXParseException ex) {
                   System.err.println("+================================+");
                   System.err.println("|       *SAX Parse Error*        |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   System.err.println("At line " + ex.getLineNumber());
                   System.err.println("+================================+");
              } /**catch (RuntimeException ex) {
                   System.err.println("+================================+");
                   System.err.println("|       *SAX Parse Error*        |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   //System.err.println("At line " + ex.getLineNumber());
                   //System.err.println("At line " + ex.getMessage());
                   System.err.println("+================================+");
              }**/ catch (SAXException ex) {
                   System.err.println("+================================+");
                   System.err.println("|          *SAX Error*           |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
                   System.err.println("+================================+");
              /*}} catch (SAXNotRecognizedException  ex) {
                   System.err.println(" no SAX");*/
              } catch (ParserConfigurationException ex) {
                   System.err.println(" ???");
               } catch (IOException ex) {
                   System.err.println("+================================+");
                   System.err.println("|           *XML Error*          |");
                   System.err.println("+================================+");
                   System.err.println(ex.toString());
    private static class JFileChooserrv {
         JFileChooserrv(JFrame f, boolean vverabreiten) {
              String openfile;
              String verror;
              boolean validate = true;
              final JFrame frame = f;
              String vFilename = "Z:\\Boorberg\\parsen_vista\\daten";
              //String vFilename = "C:\\";
              File vFile = new File(vFilename);
              final JFileChooser chooser = new JFileChooser(vFile);
              JFileFilter filter = new JFileFilter();
              filter.addType("xml");
              filter.addType("sgml");
              filter.addType("html");
              filter.addType("java");
              filter.setDescription("strukturfiles");
              chooser.addChoosableFileFilter(filter);
              boolean vjeas = true;
              chooser.setMultiSelectionEnabled(vjeas);
              int returnVal = chooser.showOpenDialog(frame);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   //Array  filearry[] = chooser.getSelectedFiles();
                   //if (vFile = chooser.getSelectedFiles()) {
                   //File  file[] = chooser.getSelectedFiles();
                   File  vfile[] = chooser.getSelectedFiles();
                   //String openfile = new String();
                   int vlenght = vfile.length;
                   if (vlenght>1) {
                        int x=0;
                        while (x< vlenght) {
                                  parse(vfile[x], validate);
                                  x = x +1;
                   if (vlenght<=1) {
                        File v2file = chooser.getSelectedFile();
                             parse(v2file, validate);
              } else {
                   System.out.println("You did not choose a filesystem           object.");
         System.exit(0);
    private static class JFileFilter extends javax.swing.filechooser.FileFilter {
         protected String description, vnew;
         protected ArrayList<String> exts = new ArrayList<String>();
         protected boolean vtrue;
         public void addType(String s) {
              exts.add(s);
         /** Return true if the given file is accepted by this filter. */
         public boolean accept(File f) {
              // Little trick: if you don't do this, only directory names
              // ending in one of the extentions appear in the window.
              if (f.isDirectory()) {
                   return true;
              } else if (f.isFile()) {
                   Iterator it = exts.iterator();
                   while (it.hasNext()) {
                        if (f.getName().endsWith((String)it.next()))
                             return true;
              // A file that didn't match, or a weirdo (e.g. UNIX device file?).
              return false;
         /** Set the printable description of this filter. */
         public void setDescription(String s) {
              description = s;
         /** Return the printable description of this filter. */
         public String getDescription() {
              return description;
    private static class MyErrorHandler implements ErrorHandler {
            // Error handler output goes here
            private PrintStream out;
            MyErrorHandler(PrintStream out) {
                this.out = out;
             * Returns a string describing parse exception details
            private String getParseExceptionInfo(SAXParseException spe) {
                String systemId = spe.getSystemId();
                if (systemId == null) {
                    systemId = "null";
                String info = "URI=" + systemId +
                    " Line=" + spe.getLineNumber() +
                    ": " + spe.getMessage();
                return info;
            // The following methods are standard SAX ErrorHandler methods.
            // See SAX documentation for more info.
            public void warning(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                //out.println("Warning: " + getParseExceptionInfo(spe));
            public void error(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                String message = "Error: " + getParseExceptionInfo(spe);
                throw new SAXException(message);
            public void fatalError(SAXParseException spe) throws SAXException {
                   //System.exit(0);
                String message = "Fatal Error: " + getParseExceptionInfo(spe);
                throw new SAXException(message);
         public static void main(String[] av) {
              JFrame vframe = new JFrame("chose files to pars");
              boolean vverabreiten = true;
              boolean validate = true;
              JFileChooserrv vdateienwaehlen = new JFileChooserrv(vframe, vverabreiten);
    }The Stack Trace i posted in the last Message. But i couldn't read it, i am not a programmer.

  • XML, jdom problem

    Hello Java-People,
    I am having a problem with Java and XML using the jdom package (www.jdom.org).
    An exception
    (java.lang.NoClassDefFoundError: org/xml/sax/SAXNotRecognizedException
         at YAAFile.openXMLDataFile(YAAFile.java:161))
    is thrown.
    I use java 1.4.1_01 on MacOS X (10.2.6). My IDE is Project Builder.
    The following classes are involved:
    YAAObject: stores my data in bean style with setters and getters, only used to hold the data.
    YAAFile: holds the YAAObject instances in a vector and saves them in a xml file, opens xml file and returns the objects to other classes.
    A third class that holds the YAAFile class.
    1st test scenario:
    My class YAATest calls:
    YAAFile f1 = new YAAFile();
    f1.openXMLDataFile();
    YAAObject[] array = f1.returnYAAObjectArray();
    for (int i = 0; i < array.length; i++){
    array.outputData();
    This works fine. The outputData() method puts the content via System.out.println() on the console.
    2nd (application) scenario:
    My class YouAreAl calls:
    (above) YAAFile currentYAAFile;
    currentYAAFile = new YAAFile();
    currentYAAFile.openXMLDataFile();
    Does not work. I get the output:
    java.lang.NoClassDefFoundError: org/xml/sax/SAXNotRecognizedException
         at YAAFile.openXMLDataFile(YAAFile.java:161)
         at YouAreAl.<init>(YouAreAl.java:173)
         at YouAreAl.main(YouAreAl.java:260)
         at java.lang.reflect.Method.invoke(Native Method)
         at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
         at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
         at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
    -[NSJavaVirtualMachine initWithClassPath:] cannot instantiate a Java virtual machine
    YouAreAl has exited with status 0.
    Both scenarios execute the following code at the openXMLDataFile() method:
    protected void openXMLDataFile(){
    builder = new SAXBuilder(); //here the exception is thrown!
    Document doc = null;
    try{
    doc = builder.build(DataFileName);
    catch (JDOMException e)
    System.err.println("JDOMException openXMLDataFile 1");
    System.err.println(e.getMessage());
    catch (IOException e)
    System.err.println("IOException openXMLDataFile 3");
    System.err.println(e.getMessage());
    ...and so on...
    The exception is thrown at line:
    builder = new SAXBuilder();
    As both scenarios execute the same piece of code I do not understand where the difference is.
    I have the jdom.jar in the Library/Java/Extensions directory.
    In my opinion builder wants to throw the SAXNotRecognizedException but can not find it. The point is why does it not word in the second scenario when everything is fine in the first one?
    If there is anyone out there having a deeper understanding of this matter, please give me a hint.
    Thanks in advance
    Tobias

    Hi people,
    I found the problem. I'll post it here in case anyone runs into the same kind of problem.
    The reason for the exception was not the source code but the built product.
    Scenario one built a .jar file and it worked just fine.
    Scenario two built an .app file and it threw an exception.
    When compiling scenario two on the console it ran fine as well. So thr problem seems to lie either in the packaging or the IDE. It looks as if you are not allowed to use extensions when packaging your class files as an .app
    So I'll stick with jar files for a while...
    Regards,
    Tobias

  • Validation Error in Parsing

    Hi
    Please help i am trying to fix this for last 2 days ..
    I am trying to validate the XML in SAX parser and i am getting
    "java.lang.ClassCastException: " error.
    I am pasting the code i have and the sample XML. If some one faced the same kind of problem please share the thoughts
    thanks in advance.
    I am sending the XML from the command prompt
    This is the code i have
    class XMLBean {
    public void onMessage (String uri) {
    Object [] schemas = new Object[] { "C:/Murugaraj/Projects/Atlys-interface/XSD/Schemas/Common/Types/Public/rDataModel.xsd",
    "C:/raj/Projects/Atlys-interface/XSD/Schemas/Atlas/jms/Public/SubscriberNotification.xsd",
    "C:/raj/Projects/Atlys-interface/XSD/Schemas/Atlas/Container/Public/SubscriberNotification.xsd",
    "C:/raj/Projects/Atlys-interface/XSD/Schemas/Atlas/Container/Public/MessageHeader.xsd"};
    System.out.println("Parsing XML File: " + uri + "\n\n");
    // The SAX handler Events are in RequestHandler which is extends from Defaulthandler
    RequestHandler rh = new RequestHandler();
    try {
    String txt = uri;
    System.out.println(txt);
    SAXParserFactory fact = SAXParserFactory.newInstance();
    fact.setNamespaceAware(true);
    fact.setValidating(true);
    fact.setFeature("http://xml.org/sax/features/validation", true);
    fact.setFeature("http://apache.org/xml/features/validation/schema",true);
    fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    SAXParser sp = fact.newSAXParser();
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemas);
    InputSource inSource = new InputSource(new FileInputStream(txt));
    sp.parse(inSource, rh);
    }catch(SAXNotRecognizedException x){
         System.out.println(" SAXNotRecognizedException Parsing error" );
         x.getMessage();
    }catch(SAXParseException spe){
         System.out.println("\n** Parsing error SAXParseException" + ", line " + spe.getLineNumber() + ", uri " + spe.getSystemId());
    System.out.println(" " + spe.getMessage());
         Exception x = spe;
         if (spe.getException() != null)
         x = spe.getException();
         x.printStackTrace();
    }catch(SAXException sxe){
         System.out.println(" SAXException Parsing error" );
         Exception x = sxe;
         if(sxe.getException() != null)
              x=sxe.getException();
         x.printStackTrace();
    }catch (IOException ioe) {
    System.out.println(" IOException Parsing error" );
    ioe.printStackTrace();
    }catch (Throwable t){
    t.printStackTrace();
    } // End of catch
    } // End of onMessage
    public static void main(String[] args) {
         if (args.length != 1) {
         System.out.println("Usage: java SAXParserDemo [XML URI]");
         System.exit(0);
         String uri = args[0];
         XMLBean call = new XMLBean ();
         call.onMessage(uri);
    } // End of main
    } // End of XMLBean
    This is the error i am getting
    java.lang.ClassCastException: [Ljava.lang.Object;
    at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.reset(Lweblogic/apa
    che/xerces/xni/parser/XMLComponentManager;)V(XMLSchemaValidator.java:1374)
    at weblogic.apache.xerces.parsers.BasicParserConfiguration.reset()V(Basi
    cParserConfiguration.java:523)
    at weblogic.apache.xerces.parsers.DTDConfiguration.reset()V(DTDConfigura
    tion.java:624)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Z)Z(DTDConfigur
    ation.java:498)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Lweblogic/apach
    e/xerces/xni/parser/XMLInputSource;)V(DTDConfiguration.java:581)
    at weblogic.apache.xerces.parsers.XMLParser.parse(Lweblogic/apache/xerce
    s/xni/parser/XMLInputSource;)V(XMLParser.java:152)
    at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(Lorg/xml/sax/I
    nputSource;)V(AbstractSAXParser.java:1175)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(Lorg/xml/sax/InputSource;)V
    (WebLogicXMLReader.java:135)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(Lorg/xml/sax/InputSource;)V
    (RegistryXMLReader.java:152)
    at javax.xml.parsers.SAXParser.parse(Lorg/xml/sax/InputSource;Lorg/xml/s
    ax/helpers/DefaultHandler;)V(SAXParser.java:345)
    at XMLBean.onMessage(Ljava/lang/String;)V(XMLBean.java:80)
    at XMLBean.main([Ljava/lang/String;)V(XMLBean.java:130)
    The Sample XML looks like this
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SubscriberNotification xmlns:cng="http://csi.test.com/CSI/Namespaces/Types/Public/DataModel.xsd" xmlns="http://csi.test.com/ATLAS/Namespaces /Container/JMS/SubscriberNotification.xsd" xmlns:sn="http://csi.test.com/ATLAS/Namespaces/Container/Public/SubscriberNotification.xsd" xmlns:mh="http://csi.test.com/ATLAS/Namespaces/Container/Public/MessageHeader.xsd">
    - <mh:MessageHeader>
    - <mh:TrackingMessageHeader>
    <cng:version>v3</cng:version>
    <cng:messageId>08001200312101117273772521</cng:messageId>
    <cng:originatorId>CARE</cng:originatorId>
    <cng:dateTimeStamp>2005-08-23T13:45:57Z</cng:dateTimeStamp>
    </mh:TrackingMessageHeader>
    - <mh:SequenceMessageHeader>
    <cng:sequenceNumber>1</cng:sequenceNumber>
    <cng:totalInSequence>1</cng:totalInSequence>
    </mh:SequenceMessageHeader>
    </mh:MessageHeader>
    - <sn:SubscriberNotification>
    <sn:billingSystemEventGenrationDateTime>2003-12-10T11:17:27.377Z</sn:billingSystemEventGenrationDateTime>
    <sn:notificationType>UpdateSubscriberStatusNotification</sn:notificationType>
    <sn:notificationSubType>3400</sn:notificationSubType>
    - <sn:Account>
    - <sn:billingMarket>
    <sn:billingMarket>08</sn:billingMarket>
    </sn:billingMarket>
    <sn:billingSystemId>CARE</sn:billingSystemId>
    </sn:Account>
    </sn:SubscriberNotification>
    </SubscriberNotification>

    Thanks bckrispiYou're welcome, :)
    seems like i can pass array of objects so then i
    decided to pass multiple schemas. Also there is one
    sun website claims validating multiple schemasIf you're talking about the new Validation Framework, yes, the tutorials say you can pass it multiple schemas with the same namespace. Unfortunately, the implementation is broken
    Yes, i want to validate with more than one schema ..
    'cos my XML generated based on 4 schemas ( xsd's)
    I did not get what you mean by "import" dependand
    schemas..
    import the depandant schema on the "parent schema"
    thats what you meant ?If you have a "parent" xsd that uses an <xsd:import> on its dependencies, then you just need to pass the parent xsd into your SAX Parser.

Maybe you are looking for