0 Replies Latest reply on Oct 11, 2005 3:06 AM by Roman

    SAXParser property problem in JBoss

    Roman Newbie

      Hi all,

      I have very interesting problem - some piece of source works over stand alone application with no problems but when I put this source in JBoss WAR file project there is a Exception.The source is :

      public void validate() throws Exception{
      final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
      final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
      final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
      String xsdFile = "C:/xsd/CONST_XSD-REGFM.xsd";
      // Pour SAX
      SAXParserFactory spf = SAXParserFactory.newInstance();
      spf.setNamespaceAware(true);
      spf.setValidating(true);
      SAXParser sp = spf.newSAXParser();
      sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
      sp.setProperty(JAXP_SCHEMA_SOURCE, xsdFile);
      // sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",xsdFile);
      // sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",xsdFile);



      sp.parse(new FileInputStream(new File("c:/testValidation1128945458976.xml")), new Validator());



      }

      and Exception message is:
      10:05:39,157 INFO [TilesRequestProcessor] Tiles definition factory found for request processor ''.
      10:06:35,147 ERROR [STDERR] org.xml.sax.SAXNotRecognizedException: Property: http://java.sun.com/xml/jaxp/properties/sch
      emaLanguage
      10:06:35,147 ERROR [STDERR] at org.apache.crimson.parser.XMLReaderImpl.setProperty(XMLReaderImpl.java:272)
      10:06:35,147 ERROR [STDERR] at org.apache.crimson.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:190)
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.utils.XmlValidation.validate(XmlValidation.java:199)
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.utils.BusinessExecuter.registrationProccess(BusinessExecuter.java:117)
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.dti.actions.SubmitRegistrationAction.execute(SubmitRegistrationAction.j
      ava:52)
      10:06:35,147 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
      419)
      10:06:35,147 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
      10:06:35,147 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
      10:06:35,147 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      10:06:35,147 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      10:06:35,147 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.
      java:342)
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.utils.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.ja
      va:38)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.
      java:334)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:2
      86)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      10:06:35,147 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507
      )
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      10:06:35,147 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:460)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      10:06:35,147 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      10:06:35,147 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      10:06:35,147 ERROR [STDERR] at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
      10:06:35,147 ERROR [STDERR] java.lang.Exception: Registration xml from pdf Registration form is invalide and with differ
      ent xsd schema from the original!
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.utils.BusinessExecuter.registrationProccess(BusinessExecuter.java:123)
      10:06:35,147 ERROR [STDERR] at bg.latona.nca.dti.actions.SubmitRegistrationAction.execute(SubmitRegistrationAction.j
      ava:52)
      10:06:35,163 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
      419)
      10:06:35,163 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
      10:06:35,163 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
      10:06:35,163 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      10:06:35,163 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      10:06:35,163 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.
      java:342)
      10:06:35,163 ERROR [STDERR] at bg.latona.nca.utils.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.ja
      va:38)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.
      java:334)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:2
      86)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      10:06:35,163 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507
      )
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      10:06:35,163 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:460)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      10:06:35,163 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      10:06:35,163 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      10:06:35,163 ERROR [STDERR] at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)


      The Exception is thrown by this rows:
      sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
      sp.setProperty(JAXP_SCHEMA_SOURCE, xsdFile)
      I thing maybe the link is not reachable through JBoss...Actionaly I don't know. Does sombady know waht can be a reason for this mistake?
      The xsd and xsm file are exactly same through standalone proccess and JBoss process,the execute source also.