Got exception when validating against a DTD

We are using the XML Parser for Java v2.
We created an instance of DOMParser, called parseDTD with a valid dtd file and called getDocType to obtain a handle to the DTD object.
Then, we created a SAXParser and called setDocType(myDTD), where myDTD in the step above and called setValidationMode(true)
We then use the SAXParser instance to parse an XML document that contains errors and we got the following exception:
java.lang.ArrayIndexOutOfBoundsException: 101
at oracle.xml.parser.v2.XMLError.error(XMLError.java:103)
at oracle.xml.parser.v2.XMLError.error(XMLError.java:152)
at oracle.xml.parser.v2.ValidatingParser.pushState(ValidatingParser.java:786)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:913)
at oracle.xml.parser.v2.ValidatingParser.parseRootElement(ValidatingParser.java:98)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:201)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:106)
We don't get this exception if we use small files. We only get this if we use slightly larger files (>10000 lines)
What is causing this exception? Any work arounds? Thanks.

Was my fault. It worked fine !!
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by R|diger Brand ([email protected]):
Hello,
what do I have to do if I want to validate a XML file against a DTD ?
I use cpp-Version for NT and have set the flags, but I didn't get an error-message for a wrong xml-file ?!<HR></BLOCKQUOTE>
null

Similar Messages

  • XML validation against a DTD

    Is there any one that can help me to :
    1- validate the well-formedness of the xml
    2- validate it against a DTD
    Thanks

    read the JAXP, SAX, DOM section of the tutorial:
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JavaWSTutorialTOC.html

  • Validating against a DTD

    Hello,
    what do I have to do if I want to validate a XML file against a DTD ?
    I use cpp-Version for NT and have set the flags, but I didn't get an error-message for a wrong xml-file ?!

    Was my fault. It worked fine !!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by R|diger Brand ([email protected]):
    Hello,
    what do I have to do if I want to validate a XML file against a DTD ?
    I use cpp-Version for NT and have set the flags, but I didn't get an error-message for a wrong xml-file ?!<HR></BLOCKQUOTE>
    null

  • Validating against a DTD specified externally

    Hi all,
    I don't know if this is possible (well anything is possible):
    I would like to validate an XML file from a DTD that I specify. The problem that I have is that the XML is generated by an external system and it can be deployed either on a unix or windows architecture.
    I load the XML from file located on either architecture and I want to control the location on either system where the DTD is kept and if possible tell the validator what DTD to use. I am having problems using relative paths when specifying the DTD in the XML and the company doesn't want to use an external public URI.
    I am using Java 1.4 and SAX 2.0 . Any pointers or help would be very much appreciated [code is even better ;-)]

    Hi,
    I cant seem to make the EntityResolver work properly. I was tasked to validate a lot of XML files but they do not have a DOCTYPE entity because the location of the dtd is configurable.
    i have stripped down the xml to only contain the root for brevity of testing but i am still stuck. the xml is this:
    <?xml version="1.0" encoding="utf-8"?>
    <ngui full="f" r="f">
    </ngui>and my validation code is this
    public class SimpleXMLValidator {
      public boolean validate(String xmlFilePath, String schemaFilePath){
            boolean validXML = true;
            System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
                               "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            factory.setValidating(true);
            //factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                                          "http://www.w3.org/2001/XMLSchema" );
            //factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",schemaFilePath);
            try {
                DocumentBuilder builder = factory.newDocumentBuilder();
                ExternalResolver er = new ExternalResolver();
                er.addURL(schemaFilePath);
                builder.setEntityResolver(er);
                builder.parse(new File(xmlFilePath));
            } catch (ParserConfigurationException e) {
                validXML = false;
                e.printStackTrace();
            } catch (SAXException e) {
                validXML = false;
                e.printStackTrace();
            } catch (IOException e) {
                validXML = false;
                e.printStackTrace();
            return validXML;
       private class ExternalResolver implements EntityResolver{
            private HashMap urlMap = null;
            public InputSource resolveEntity(String publicId, String systemId){
                System.out.println("resolvedEntity:" +publicId +" and "+systemId);
                if ( urlMap != null && urlMap.get(systemId)!= null ){
                    try {
                        return new InputSource(new FileReader(systemId));
                    } catch (FileNotFoundException e) {
                        System.out.println("[ERROR] Unable to load entity reference: " + systemId );
                return null;
            public void addURL(String filePath) throws MalformedURLException{
                addURL(new File(filePath).toURL());
            public void addURL(URL url) {
                if ( urlMap == null ){
                    urlMap = new HashMap();
                urlMap.put(url, null);
    }If I hardcode the DOCTYPE then the file passes through the validation. and printout the System.out that I placed in the entity resolver. However I am getting the following exceptions:
    * if I remove the hard-coded DOCTYPE (notice that the EntityResolver output line is not written)
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
    set, which is probably not what is desired.  Parser will use a default
    ErrorHandler to print the first 10 errors.  Please call
    the 'setErrorHandler' method to fix this.
    Error: URI=file:C:/APPS/Eclipse-ws/testbed/bin/../testdata/ac3.xml Line=2: Document is invalid: no grammar found.
    Error: URI=file:C:/APPS/Eclipse-ws/testbed/bin/../testdata/ac3.xml Line=2: Document root element "ngui", must match DOCTYPE root "null".* if I uncomment the setAttribute calls:
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at SimpleXMLValidator.validate(SimpleXMLValidator.java:61)
            at SimpleXMLValidator.main(SimpleXMLValidator.java:40)* the setAttributes is still active in the compiled class but this time I hardcoded the DOCTYPE again.
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at SimpleXMLValidator.validate(SimpleXMLValidator.java:61)
            at SimpleXMLValidator.main(SimpleXMLValidator.java:40)does anybody know what I am missing here? Thanks.
    ciao!
    [edit] This posting of mine looks horrible both on IE and Firefox because its HTML tags are all in the text. I posted this question in http://ramfree17.org/capsule/?p=38 which is hopefully more readable.

  • I got Exception when i try to start default weblogic server

    Hi,
    I download a trial version weblogic application server 6.1 and installed succesfully by using GUI mode and my Operating system is WINDOWS NT 4.0(service pack6).
    When i try start default weblogic server
    and i got the following excetion any could me help.
    Exception:
    ####<Dec 19, 2001 3:41:33 PM EST> <Info> <Logging> <unknown> <myserver> <main> <> <> <000000> <FileLogger Opened.>
    ####<Dec 19, 2001 3:41:34 PM EST> <Emergency> <Server> <unknown> <myserver> <main> <> <> <000000> <Unable to initialize the server: 'Fatal initialization exception
    Throwable: java.net.UnknownHostException: MANIKYAM
    java.net.UnknownHostException: MANIKYAM
         at java.net.InetAddress.getAllByName0(InetAddress.java:571)
         at java.net.InetAddress.getAllByName0(InetAddress.java:540)
         at java.net.InetAddress.getAllByName(InetAddress.java:533)
         at java.net.InetAddress.getLocalHost(InetAddress.java:723)
         at weblogic.rjvm.JVMID.setLocalID(JVMID.java:120)
         at weblogic.t3.srvr.T3Srvr.setJVMID(T3Srvr.java:325)
         at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:360)
         at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:197)
         at weblogic.Server.main(Server.java:35)
    '>
    ####<Dec 19, 2001 3:44:34 PM EST> <Info> <Logging> <unknown> <myserver> <main> <> <> <000000> <FileLogger Opened.>%

    Hi Manikyam,
    It sounds as if your host name is not setup to resolve in your DNS. You can
    either add it to the DNS, or if that's not available, you can manually add
    it to your hosts file (located in c:\WINNT\system32\drivers\etc -- if the
    file does not exist, you can create a new one).
    Dennis Munsie
    Developer Relations Engineer
    BEA Support
    "manikyam" <[email protected]> wrote in message
    news:3c21084d$[email protected]..
    Hi,
    I download a trial version weblogic application server 6.1 andinstalled succesfully by using GUI mode and my Operating system is WINDOWS
    NT 4.0(service pack6).
    When i try start default weblogic server
    and i got the following excetion any could me help.
    Exception:
    ####<Dec 19, 2001 3:41:33 PM EST> <Info> <Logging> <unknown> <myserver><main> <> <> <000000> <FileLogger Opened.>
    ####<Dec 19, 2001 3:41:34 PM EST> <Emergency> <Server> <unknown><myserver> <main> <> <> <000000> <Unable to initialize the server: 'Fatal
    initialization exception
    Throwable: java.net.UnknownHostException: MANIKYAM
    java.net.UnknownHostException: MANIKYAM
    at java.net.InetAddress.getAllByName0(InetAddress.java:571)
    at java.net.InetAddress.getAllByName0(InetAddress.java:540)
    at java.net.InetAddress.getAllByName(InetAddress.java:533)
    at java.net.InetAddress.getLocalHost(InetAddress.java:723)
    at weblogic.rjvm.JVMID.setLocalID(JVMID.java:120)
    at weblogic.t3.srvr.T3Srvr.setJVMID(T3Srvr.java:325)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:360)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:197)
    at weblogic.Server.main(Server.java:35)
    '>
    ####<Dec 19, 2001 3:44:34 PM EST> <Info> <Logging> <unknown> <myserver><main> <> <> <000000> <FileLogger Opened.>%

  • Strange problem when validating XML agains DTD file.

    Dear experts,
    I'm write a simple code snippet that validates my XML file agains a given DTD.
    It allways report the following error:
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)Althought, my xml file is OK with Xmlspy.
    My code is:
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
                             "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(
              "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
              "http://www.w3.org/2001/XMLSchema");
          factory.setAttribute(
              "http://java.sun.com/xml/jaxp/properties/schemaSource", SchemaUrl);
          DocumentBuilder builder = factory.newDocumentBuilder();
          Validator handler = new Validator();
          builder.setErrorHandler(handler);
          builder.parse(new java.io.FileInputStream(new java.io.File(XmlDocumentUrl)));And here are the xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE capsule SYSTEM "c:/SampleFiles/capsule.dtd">
    <capsule>
         <header>
              <name>Capsule 1</name>
              <author>Author</author>
              <company>Company</company>
              <last-save-time>Fri Apr 01 14:59:21 GMT+07:00 2005</last-save-time>
              <description>description</description>
         </header>
         <datasets>
              <dataset type="input">
                   <name>dataset1</name>
                   <description></description>
                   <columns>
                        <column type="fromsource">
                             <name>partno</name>
                             <data-type>varchar</data-type>
                             <length>80</length>
                             <precision/>
                             <scale/>
                             <allow-null>false</allow-null>
                             <default-value/>
                        </column>
                        <column type="notfromsource">
                             <name>balanceonhand</name>
                             <data-type>integer</data-type>
                             <length/>
                             <precision/>
                             <scale/>
                             <allow-null>false</allow-null>
                             <default-value/>
                        </column>
                   </columns>
                   <rule>LET a=update; LET b=employye set salary = 100; print a + b</rule>
                   <!--output: update employee set salary = 100-->
                   <command>inmemory (getvalue_dataset("dataset1".rule))</command>
                   <params>
                        <param>
                             <name/>
                             <type/>
                        </param>
                   </params>
              </dataset>
         </datasets>
    </capsule>What I can do now? Change my xml file?
    Please provide some hints.
    Thanks in advance.

    I tried to remove the DOCTYPE, but the problem stayed the same.
    Thanks.

  • Got exception when running CrystalReportViewer on 64 bit Windows 2008

    We have a client/server app built with c#, .NET2, CR2008 .net runtime SP2, and VS2008. The smart client hosts a CrystalReportViewer, which consumes the ServerFileReportService.
    The client on XP, 2003, Vista, and 32 bit Windows 2008 works fine with 32 bit Windows 2008/2003 server. But the client on 64 bit Windows 2008 throws the following exception,
    EXCEPTION >>
    IndexOutOfRangeExceptionMessage: Index was outside the bounds of the array.
    Source: CrystalDecisions.Windows.Forms
    TargetSite: System.String GetResourcePath()
    StackTrace:
       at CrystalDecisions.Windows.Forms.ParameterPromptControl.GetResourcePath()
       at CrystalDecisions.Windows.Forms.ParameterPromptControl.BuildPromptingRequestContext(PromptingHTMLFeedback feedback)
       at CrystalDecisions.Windows.Forms.ParameterPromptControl.BuildPromptingRequestContext()
       at CrystalDecisions.Windows.Forms.ParameterPromptControl.StartPromting()
       at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
       at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Edited by: Frank88 on Oct 9, 2009 8:55 PM

    Hi Jonathan,
    Currently the .NET solution contains over 70 assemblies, and only one assembly has reference to CR2008 .Net runtime SP2.  All the 70 projects for each assemblies are compiled with Platform Target set to Any CPU.  We build an installer with InstallShield, which deploys the runtime by CRRuntime_12_2_mlb.msi.
    If we resolve all the parameters, and donu2019t prompt user for the parameters, then the same report runs fine on 64-bit Window 2008. Otherwise we always get the error on prompting parameters.
    We resolved the issue by recompiling the exe with Platform Target set to (x86). And all the 70 assemblies are still compiled with Any CPU.
    Regards,
    Frank
    Edited by: Frank88 on Oct 12, 2009 11:07 PM
    Edited by: Frank88 on Oct 13, 2009 9:30 PM
    Edited by: Frank88 on Oct 14, 2009 3:28 AM

  • Got exception when design tab is selected

    JniPortal for D:\JDeveloper 3.1\java1.2\jre\bin\OJVM\jvm.dll reported
    com/klg/jclass/swing/JCMDIFrameBeanInfo
    java.lang.NoClassDefFoundError: com/klg/jclass/swing/JCMDIFrameBeanInfo
    void oracle.jdeveloper.customizer.CustomizerViewImpl.setTarget(borland.jbuilder.cmt.CmtSubcomponent)
    void borland.jbuilder.inspector.Inspector.setTarget(borland.jbuilder.cmt.CmtSubcomponent)
    void borland.jbuilder.inspector.Inspector.selectionChanged(borland.jbcl.model.GraphSelection)
    void borland.jbuilder.inspector.Inspector.changeContext(borland.jbuilder.designer.DesignContext)
    void borland.jbuilder.inspector.Inspector.designerOpened(borland.jbuilder.designer.DesignerEvent)
    void borland.jbuilder.designer.DesignerEvent.dispatch(java.util.EventListener)
    void borland.jbcl.util.EventMulticaster.dispatch(borland.jbcl.util.DispatchableEvent)
    void borland.jbuilder.designer.DesignerManager.processDesignerEvent(borland.jbuilder.designer.DesignerEvent)
    void borland.jbuilder.designer.DesignContext.open(borland.jbuilder.addin.Url, boolean)
    void borland.jbuilder.designer.DesignContext.changeUrl(borland.jbuilder.addin.Url)
    void oracle.jdeveloper.addin.impl.JavaMasterViewerImpl.changeViewerUrl(java.lang.String)
    void oracle.jdeveloper.addin.CustomViewer.changeUrl(java.lang.String)
    void oracle.jdeveloper.addin.JavaMasterViewer_JavaDispatch.invoke(int, borland.javaport.JavaCallStack)

    Michel,
    This JNI portal issue is usually associated
    with installing one version of JDeveloper over an older version of JDeveloper.
    If this is the case, I would install JDeveloper 3.1 into a different directory - If you want to use the same directory, then run the Add/Remove program from Control Panel and then delete the directory where JDev was installed entirely before installing the new version.
    If this is not your case, please elaborate
    and tell us how this error occurs (include version #s) and send us the source code for the class which exhibits this behavior.
    Thanks,
    John - JDeveloper Team

  • How to disable validation against DTD while unmarshalling

    Hi All
    I am relatively new to XML and JAXB. I have a tool that needs to run offline, however the XML documents that are being read in are automatically being validated against the DTD even though I have specified unmarshaller.setValidating(false). How can I completely diable validation while offline? Here is my code:
    context = JAXBContext.newInstance("my.xmlobjects.package");
    Unmarshaller u = context.createUnmarshaller();
    u.setValidating(false);
    testLog = (TestLog) u.unmarshal(new File("/path/to/my/file.xml"));
    I've also tried a suggestion I saw on another forum (note that I know nothing about SAX, I've been trying to make sense of the documentation):
    SAXParserFactory parserFactory = SAXParserFactory.newInstance();
    parserFactory.setValidating(false);
    SAXParser saxParser = parserFactory.newSAXParser();
    XMLReader xmlReader = saxParser.getXMLReader();
    EntityResolver entityResolver = new EntityResolver()
    public InputSource resolveEntity (String publicId, String systemId)
    return null;
    xmlReader.setEntityResolver(entityResolver);
    InputSource source = new InputSource(new FileInputStream("/path/to/my/file.xml");
    SAXSource saxSource = new SAXSource(xmlReader, source);
    context = JAXBContext.newInstance("my.xmlobjects.package");
    Unmarshaller u = context.createUnmarshaller();
    u.setValidating(false);
    testLog = (TestLog) u.unmarshal(saxSource);
    Both of these work when connected, but fail when disconnected from the internet. Is there an Oracle specific property that needs to be set here?
    Thanks
    Jeff

    Well you can create non validating parser programatically .
    http://edocs.bea.com/wls/docs100/xml/programming.html#wp1069856
    i.e.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(false);
    Hope this helps.

  • Exception when retrieving the WS invoker using the execution destination

    We got exception when we had tried to call WS in Web Dynpro for Java (NWDS 7.1 SP 5):
    "Exception when retrieving the WS invoker using the execution destination".
    We imported model as Adaptive Web Service Model with destination and
    implemented Component Controller using document
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e
    We used:
    1. Netweaver 7.1 CE
    2. Backend R/3 system with RFC wrapped by Web Service without autorization on R/3
    3. In our CE system we created two logical destinations (metadata and execution) to R/3 Web Service

    Hi Yuriy,
    It would be great if you can say how exactly you solved the problem as i am encountering the same error.
    Regards,
    Tekumalla

  • Validating against dtd

    Hi,
    I am trying to parse an xml against a dtd, using SAX parser. The validation is proper..but i want to parse the entire file even if there is a mismatch in the middle of the xml document.
    say if there is an error at one particular element, the parser throws an exception and quits..but i want the parser to continue with the rest of the document..
    how can i achieve this functionality..
    thanks & regards

    Hi,
    I had put the try catch block, the exception was getting caught and the program was exiting...later i used the ErrorHandler class to handle the exceptions..
    and it is working fine if there is a saxparseexception..
    But if there is some fatal error in the xml file, the parser throws the exception and quits. Is there any way to catch the fatal error and still proceed with the parsing.
    Thanks & regards

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • Getting an Out of memory exception while validating XML against XSD

    Hello friends,
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             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("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Getting an out of memory exception while validating my XML against a XSD

    Hello friends,
    I have asked this question in following thread too. Pasting it again here just to saye your time
    http://forum.java.sun.com/thread.jspa?threadID=690812&tstart=0
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             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("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Validating XML documents against a DTD

    Guys I am new to XML and I have this requirement to validate a XML document against a DTD.This validation has to be done through my java application.In short , a user enters a XML data thru a JSP form ,and moment he presses the SAVE button my java program should validate the XML data against a DTD and then display any error or else save the data into an Oracle table.
    I was wondering lot of program/utitlities must be available out there which will do the validation for me ,rather than me re-inventing the wheel.
    Please advice.
    Thanks
    Manohar.

    You should go through this to learn more on XML with Java :
    http://www.onjava.com/pub/a/onjava/excerpt/learnjava_23/index1.html
    You can check following how to to parse XML doc against a schema
    http://otn.oracle.com/sample_code/tech/java/codesnippet/xdk/SchemaValidation/SchemaValidation.html
    You should also look at chapter 4 of following doc for parsing XML using java :
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96621/toc.htm
    Chandar

Maybe you are looking for

  • Internet does not work on sharing computer

    ok the problem is this the second computer that shares the internet connection download speed starts ok but within 1/2 a second slows down to zero the same thing with mail gets a connection but then cuts off.Both computers are running 10.5.1 the main

  • Can not fine external hard drive for time machine sence lion was installed

    I can not fine external hard drive for time machine sence lion was installed, it don't reconise it at all.

  • Mail synchro and smtp server problems

    I have a permanent problem with using my MB Pro and email client. Instead of icloud email im using some other email adresses and its appear everytime when i come back home (using wifi connection) problems with Mail program. Sometimes appears in a fol

  • ***Calling Java finctions in XSLT MApping

    Hi All, How to  call java mapping functions in XSLT.I have created Value mapping function in java,want to call the same through XSLT. could you provide me  general XSLT prdefined functions with explanations that may be used commonly. Thanks, Srinivas

  • Permissions problem when importing file in Final Cut Pro X 10.1.3

    Hi guys!! Today, like all days, I opened up my Final Cut Pro X version 10.1.3 and created a new Library and new project. Then I selected "Import Files" and I checked all the files I needed. Last I clicked on import selected files and I received this