[svn] 4207: Feature: Validation API

Revision: 4207
Author: [email protected]
Date: 2008-12-01 13:21:16 -0800 (Mon, 01 Dec 2008)
Log Message:
Feature: Validation API
QA: Yes
Doc: Yes
Checkintests: Pass
Details: Implemented most of validation API as outlined in the spec. More specifically:
-Renamed MessageBrokerFilter(Chain/Context) to MessageFilter(Chain/Context) and moved to flex.messagaging.filters package.
-Added configuration parsing/validation for message filters and validators.
-Add a public method to ClassUtil to let someone validate the creation of a default instance with the broker, also added public methods to ClassUtil to explicitly validate creation of classes and assignment of values.
-Changed AMF0/AMF3 deserialization code to use the newly added ClassUtil methods while creating instances and assigning values.
TODO:
-Add validation support to AMFX.
-Implement the default validator implementation ClassDeserializationValidator.
Modified Paths:
blazeds/trunk/apps/team/WEB-INF/src/features/filters/SecondaryTestFilter.java
blazeds/trunk/apps/team/WEB-INF/src/features/filters/TestFilter.java
blazeds/trunk/modules/common/src/flex/messaging/config/ConfigurationConstants.java
blazeds/trunk/modules/common/src/flex/messaging/errors.properties
blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java
blazeds/trunk/modules/core/src/flex/messaging/client/FlexClient.java
blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java
blazeds/trunk/modules/core/src/flex/messaging/config/ServerConfigurationParser.java
blazeds/trunk/modules/core/src/flex/messaging/io/AbstractProxy.java
blazeds/trunk/modules/core/src/flex/messaging/io/BeanProxy.java
blazeds/trunk/modules/core/src/flex/messaging/io/MapProxy.java
blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java
blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf0Input.java
blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf3Input.java
blazeds/trunk/modules/core/src/flex/messaging/util/ClassUtil.java
blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/remoting/datatype/EnumProxy.java
blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/filters/SecondaryTestFilter.ja va
blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/filters/TestFilter.java
Added Paths:
blazeds/trunk/modules/core/src/flex/messaging/config/MessageFilterSettings.java
blazeds/trunk/modules/core/src/flex/messaging/config/ValidatorSettings.java
blazeds/trunk/modules/core/src/flex/messaging/filters/
blazeds/trunk/modules/core/src/flex/messaging/filters/MessageFilter.java
blazeds/trunk/modules/core/src/flex/messaging/filters/MessageFilterChain.java
blazeds/trunk/modules/core/src/flex/messaging/filters/MessageFilterContext.java
blazeds/trunk/modules/core/src/flex/messaging/validators/
blazeds/trunk/modules/core/src/flex/messaging/validators/DeserializationValidator.java
Removed Paths:
blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerFilter.java
blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerFilterChain.java
blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerFilterContext.java

imho i don´t think FB4.5 had SVN installed - would be nice!
I just updated my FB4.6 prerelease to the release version and installed subclipse 1.6 via "install new software"....seems to work!
Did you uninstall FB before updating?

Similar Messages

  • [svn] 4583: Feature: Validation API

    Revision: 4583
    Author: [email protected]
    Date: 2009-01-19 14:19:38 -0800 (Mon, 19 Jan 2009)
    Log Message:
    Feature: Validation API
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Bunch of changes to the validation API after further discussions
    -After talking to Jeff, we decided that security conscious customers would want to validate creation of all classes, including regular Java types. So, reverted back to the original implementation where all type creations are validated including regular Java types such as Integer, Boolean, Date, Document, String. As a result, validation code moved from AbstractProxy to ClassUtil as before.
    -DeserializationValidator was set on SerializationContext once when the endpoint was starting to avoid expensive MessageBroker lookups but apparently this prevents the deserialization validator to be set at runtime. Changed the code so that validator is set in AbstractEndpoint#setThreadLocals method which is called once per thread and this enables the deserialization validator to be set at runtime.
    -Optimized ClassDeserializationValidator to include encountered allow and disallow class lists that keep track of the encountered classes and whether they were accepted or not by the validator. This should result in faster lookups.
    -Removed validation of traits as they are AMF internal and should not be validated.
    -Updated the validation sample in the team app.
    Modified Paths:
    blazeds/trunk/apps/team/WEB-INF/flex/services-config.xml
    blazeds/trunk/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializati onValidator.java
    blazeds/trunk/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.java
    blazeds/trunk/modules/core/src/flex/messaging/io/AbstractProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/BeanProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/MapProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf0Input.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf3Input.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amfx/AmfxInput.java
    blazeds/trunk/modules/core/src/flex/messaging/util/ClassUtil.java
    blazeds/trunk/modules/core/src/flex/messaging/util/XMLUtil.java
    blazeds/trunk/modules/core/src/flex/messaging/validators/ClassDeserializationValidator.ja va
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/remoting/datatype/EnumProxy.java

    imho i don´t think FB4.5 had SVN installed - would be nice!
    I just updated my FB4.6 prerelease to the release version and installed subclipse 1.6 via "install new software"....seems to work!
    Did you uninstall FB before updating?

  • [svn] 4264: Feature: Validation API

    Revision: 4264
    Author: [email protected]
    Date: 2008-12-09 08:20:33 -0800 (Tue, 09 Dec 2008)
    Log Message:
    Feature: Validation API
    QA: Yes
    Doc: Yes
    Checkintests: Pass
    Details:
    -Moved validateCreation and validateAssignment methods from ClassUtil to AbstractProxy.
    -Added deserialization validator to SerializationContext. This enables us to lookup for deserialization validator once when the endpoint starts up and avoid further lookups for validator.
    -Removed for special casing for java.* and javax.* packages in ClassDeserializationValidator as java classes are allowed by default now by deserialization code.
    Modified Paths:
    blazeds/trunk/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.java
    blazeds/trunk/modules/core/src/flex/messaging/io/AbstractProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/BeanProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/MapProxy.java
    blazeds/trunk/modules/core/src/flex/messaging/io/SerializationContext.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf0Input.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amf/Amf3Input.java
    blazeds/trunk/modules/core/src/flex/messaging/io/amfx/AmfxInput.java
    blazeds/trunk/modules/core/src/flex/messaging/util/ClassUtil.java
    blazeds/trunk/modules/core/src/flex/messaging/validators/ClassDeserializationValidator.ja va
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/remoting/datatype/EnumProxy.java

    imho i don´t think FB4.5 had SVN installed - would be nice!
    I just updated my FB4.6 prerelease to the release version and installed subclipse 1.6 via "install new software"....seems to work!
    Did you uninstall FB before updating?

  • [svn] 4815: Feature: Client side load balancing.

    Revision: 4815
    Author: [email protected]
    Date: 2009-02-03 10:47:12 -0800 (Tue, 03 Feb 2009)
    Log Message:
    Feature: Client side load balancing.
    QA: Yes
    Doc: Yes
    Checkintests: Pass
    Reviewer: Seth
    Details: Added client side code for client side load balancing as described in 2 tier messaging spec.
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Channel.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ServerConfig.as

    Hi,
    please find here an Whitepaper with the information
    http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf
    kind regards

  • [svn] 4814: Feature: Client side load balancing.

    Revision: 4814
    Author: [email protected]
    Date: 2009-02-03 10:44:03 -0800 (Tue, 03 Feb 2009)
    Log Message:
    Feature: Client side load balancing.
    QA: Yes
    Doc: Yes
    Checkintests: Pass
    Details: Added server side code for client side load balancing as described in 2 tier messaging spec.
    Modified Paths:
    blazeds/trunk/modules/common/src/flex/messaging/config/ClientConfigurationParser.java
    blazeds/trunk/modules/common/src/flex/messaging/config/ConfigurationConstants.java
    blazeds/trunk/modules/common/src/flex/messaging/config/ServicesDependencies.java
    blazeds/trunk/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.java

    Hi,
    please find here an Whitepaper with the information
    http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf
    kind regards

  • PKI Certificate validation API

    Hi,
    I'm looking at the different methods that verify the validity of a digital certificate (chert chain...).
    I would like to know where I can read about the *"best practice"* of the above, meaning, which parameters (CN, Subject, etc) do I have to check in order to be confident that the dig cert is valid.
    THANKS.

    800414 wrote:
    Another question,
    can't the subject\CN be from a different entity? a situation I would like deal with.The subject's certificate can be for anyone, whether they are from inside the company you work in, or not. However, the trust you have in the subject's certificate is derived, NOT from the subject's certificate itself, but from the Root Certification Authority (CA) to which the subject's certificate is chained. The JVM has chosen to establish trust in a number of third-party CA's for you. But this doesn't mean that you should automatically trust every certificate issued by every one of those CAs.
    I would begin studying these topics with this "Introduction to Public Key Cryptography" (http://docs.sun.com/source/816-6154-10/index.html) and go onto "Secure Electronic Commerce" by Warwick Ford and Michael S. Baum (PTR). The book covers many technical and legal issues associated with using certificates and establishing trust for e-commerce.
    Arshad Noor
    StrongAuth, Inc.

  • [svn] 2925: Feature: Message throttling.

    Revision: 2925
    Author: [email protected]
    Date: 2008-08-20 09:13:31 -0700 (Wed, 20 Aug 2008)
    Log Message:
    Feature: Message throttling.
    QA: Yes
    Doc: Yes
    Details: More cleanup of throttling. Removed REPLACE policy. It was deprecated but I don't think anyone depends on it anyway as it never worked correctly. Removed ERROR policy from outbound throttling as discussed in throttling spec. Started using Java5 enums in throttling code base and fixed QA apps to run with the changes.
    Modified Paths:
    blazeds/trunk/modules/core/src/java/flex/messaging/MessageDestination.java
    blazeds/trunk/modules/core/src/java/flex/messaging/config/ThrottleSettings.java
    blazeds/trunk/modules/core/src/java/flex/messaging/services/MessageService.java
    blazeds/trunk/modules/core/src/java/flex/messaging/services/messaging/ThrottleManager.jav a
    blazeds/trunk/qa/apps/qa-manual/WEB-INF/src/runtimeconfig/components/RuntimeJMSDestinatio nNoConnFact.java
    blazeds/trunk/qa/apps/qa-manual/WEB-INF/src/runtimeconfig/components/RuntimeJMSDestinatio nNoJNDIDestName.java
    blazeds/trunk/qa/apps/qa-manual/WEB-INF/src/runtimeconfig/components/RuntimeMessageDestin ationClustered.java
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/messaging-config.mods.xml
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/components/RuntimeJMSDestinati on.java
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/components/RuntimeMessageDesti nation.java
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/components/RuntimeMessageDesti nationClustered.java
    blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/runtimeconfig/remoteobjects/ROMessageDestina tion.java

    Are you looking for something like described here in section "19.3.27 Updates to Scheduling Trading Partner Downtime Documentation" (serach for 12.5. Throttling on the page)-
    http://download.oracle.com/docs/cd/E17904_01/relnotes.1111/e10132/b2b.htm
    Regards,
    Anuj

  • [svn:cairngorm3:] 16634: Extended API to history and wizards to expose next and previous indices and destinations , improve error localization in Waypoint processors

    Revision: 16634
    Revision: 16634
    Author:   [email protected]
    Date:     2010-06-23 08:57:57 -0700 (Wed, 23 Jun 2010)
    Log Message:
    Extended API to history and wizards to expose next and previous indices and destinations, improve error localization in Waypoint processors
    Modified Paths:
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/history/Abstract History.as
        cairngorm3/trunk/libraries/Navigation/test/com/adobe/cairngorm/navigation/history/Waypoin tHistoryTest.as
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/core/presentation/Navigation Bar.mxml

  • [svn:cairngorm3:] 16635: Extended API to history and wizards to expose next and previous indices and destinations , improve error localization in Waypoint processors

    Revision: 16635
    Revision: 16635
    Author:   [email protected]
    Date:     2010-06-23 09:56:15 -0700 (Wed, 23 Jun 2010)
    Log Message:
    Extended API to history and wizards to expose next and previous indices and destinations, improve error localization in Waypoint processors
    Modified Paths:
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/history/Abstract WaypointHistory.as
        cairngorm3/trunk/libraries/Navigation/test/com/adobe/cairngorm/navigation/history/Waypoin tHistoryTest.as

  • [svn:cairngorm3:] 16632: Extended API to history and wizards to expose next and previous indices and destinations , improve error localization in Waypoint processors

    Revision: 16632
    Revision: 16632
    Author:   [email protected]
    Date:     2010-06-23 07:27:14 -0700 (Wed, 23 Jun 2010)
    Log Message:
    Extended API to history and wizards to expose next and previous indices and destinations, improve error localization in Waypoint processors
    Modified Paths:
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/history/Abstract History.as
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/history/Abstract WaypointHistory.as
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/waypoint/decorat or/ContainerDestinationRegistration.as
        cairngorm3/trunk/libraries/Navigation/src/com/adobe/cairngorm/navigation/wizard/AbstractW izard.as
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/core/application/ContentDest ination.as
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/core/presentation/ContentVie wStack.mxml
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/core/presentation/Navigation Bar.mxml
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/messages/presentation/Messag esView.mxml
        cairngorm3/trunk/libraries/NavigationSpringASTest/src/sample1/messages/presentation/Messa gesView.mxml
        cairngorm3/trunk/libraries/NavigationSwizTest/src/sample1/messages/presentation/MessagesV iew.mxml
    Removed Paths:
        cairngorm3/trunk/libraries/NavigationParsleyTest/src/sample1/messages/presentation/MyStat eWizard.mxml
        cairngorm3/trunk/libraries/NavigationSpringASTest/src/sample1/messages/presentation/MySta teWizard.mxml
        cairngorm3/trunk/libraries/NavigationSwizTest/src/sample1/messages/presentation/MyStateWi zard.mxml

  • Mplayer-svn disables features?

    I just installed mplayer-svn through the AUR. For some reason, opengl is on the list of disabled video outputs.
    I have a pretty nice nVidia 8800GT, which definitely supports opengl. Am I just mistaken and mplayer-svn is still "allowed" to use opengl2 through gl2, or is it completely ignoring opengl in all of its variations?
    It's also possible that I'm asking a dumb question =-)

    Both any2dvd and tovid have been trying to do something like this:
    (this one is from any2dvd, which seems to be a little nicer)
    transcode -H0 -i "1.avi" -x mplayer="-mc 0",mplayer -f 29.970 -g 1280x720 -n 0x1 -e 44100,16,2 -y ffmpeg -F mpeg2 -Z 720x480 --export_asr 3 -D0 -N 0x2000 -E 48000,16,2 -b 384 -m "tmp_any2dvd/1.ac3" -o "tmp_any2dvd/1.m2v" -w 5000
    I tried to rename the file to .avi in case that was the problem, but it didn't help. The filetype is actually mp4 (and trying it with that extension didn't go anywhere).

  • [svn] 3095: Feature: Message throttling - message frequency limits subfeature.

    Revision: 3095
    Author: [email protected]
    Date: 2008-09-04 08:50:31 -0700 (Thu, 04 Sep 2008)
    Log Message:
    Feature: Message throttling - message frequency limits subfeature.
    QA: Yes
    Doc: Not yet
    Checkintests: Pass
    Details: This is the BlazeDS client part of the message frequency limits sub-feature of Message throttling feature. This check-in adds the ability for the Consumer to specify a maxFrequency globally or per-subscription.
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/AbstractConsumer.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicConsumer.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/SubscriptionInfo.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/CommandMessage.as

  • [svn:osmf:] 11069: Minor API change: Use Vector not Array for MediaElement. get traitTypes.

    Revision: 11069
    Author:   [email protected]
    Date:     2009-10-21 16:52:10 -0700 (Wed, 21 Oct 2009)
    Log Message:
    Minor API change: Use Vector not Array for MediaElement.get traitTypes.  Approved by dev team. Should be no impact to sample apps, unit tests, or test apps.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/media/MediaElement.as
        osmf/trunk/framework/MediaFramework/org/osmf/proxies/ProxyElement.as

    Revision: 11069
    Author:   [email protected]
    Date:     2009-10-21 16:52:10 -0700 (Wed, 21 Oct 2009)
    Log Message:
    Minor API change: Use Vector not Array for MediaElement.get traitTypes.  Approved by dev team. Should be no impact to sample apps, unit tests, or test apps.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/media/MediaElement.as
        osmf/trunk/framework/MediaFramework/org/osmf/proxies/ProxyElement.as

  • JAXP API provides no way to enable XML Schema validation mode

    I am evaluating XDK 9.2.0.5.0 for Java and have encountered another
    problem with XML Schema support when using the JAXP API.
    Using the classes in oracle.xml.jaxp.*, it appears to be impossible to
    enable XML Schema validation mode. I can set the schema object, but
    the parser does not use it for validation.
    If I use DOMParser directly, I can call the setValidationMode(int)
    method to turn on schema validation mode. There is no equivalient
    means to enable XML Schema validation when using the JAXP API.
    Test case for JAXP API:
    === begin OracleJAXPSchemaTest.java ======
    package dfranklin;
    import java.io.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class OracleJAXPSchemaTest
    private final static String xsd = ""
    +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:dfranklin:test\">"
    +" <xsd:element name=\"amount\" type=\"xsd:integer\"/>"
    +"</xsd:schema>";
    private final static String xml =
    "<amount xmlns=\"urn:dfranklin:test\">1</amount>";
    public static void main(String[] args)
    throws Exception
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
              "oracle.xml.jaxp.JXDocumentBuilderFactory");
    new OracleJAXPSchemaTest().run();
    public void run()
    throws Exception
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    dbf.setNamespaceAware(true);
    XMLSchema xmlSchema = buildXMLSchema(new StringReader(xsd));
    dbf.setAttribute("oracle.xml.parser.XMLParser.SchemaObject",
              xmlSchema);
    DocumentBuilder docbldr = dbf.newDocumentBuilder();
    Document doc = docbldr.parse(new InputSource(new StringReader(xml)));
    print(doc);
    private XMLSchema buildXMLSchema(Reader xsdin)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    private void print(Document doc)
    throws
    javax.xml.transform.TransformerConfigurationException,
    javax.xml.transform.TransformerException
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(new DOMSource(doc), new StreamResult(System.out));
    System.out.println();
    === end OracleJAXPSchemaTest.java ======
    Running that program:
    java dfranklin.OracleJAXPSchemaTest
    produces this output
    Exception in thread "main" oracle.xml.parser.v2.XMLParseException: Element 'amount' used but not declared.
    at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:148)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:269)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
    at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:96)
    at dfranklin.OracleJAXPSchemaTest.run(OracleJAXPSchemaTest.java:40)
    at dfranklin.OracleJAXPSchemaTest.main(OracleJAXPSchemaTest.java:27)
    This shows that the parser is not using the XML Schema to validate the
    document. I think it's expecting to find a DTD.
    Here is the equivalent program using DOMParser directly, and setting
    validation mode to SCHEMA_VALIDATION.
    === begin OracleParserTest.java ====
    package dfranklin;
    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import oracle.xml.parser.v2.DOMParser;
    import oracle.xml.parser.v2.XMLParser;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class OracleParserTest
    private final static String xsd = ""
    +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:dfranklin:test\">"
    +" <xsd:element name=\"amount\" type=\"xsd:integer\"/>"
    +"</xsd:schema>";
    private final static String xml =
    "<amount xmlns=\"urn:dfranklin:test\">1</amount>";
    public static void main(String[] args)
    throws Exception
    new OracleParserTest().run();
    public void run()
    throws Exception
    DOMParser dp = new DOMParser();
    XMLSchema xmlSchema = buildXMLSchema(new StringReader(xsd));
    dp.setXMLSchema(xmlSchema);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.parse(new InputSource(new StringReader(xml)));
    Document doc = dp.getDocument();
    print(doc);
    private XMLSchema buildXMLSchema(Reader xsdin)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    private void print(Document doc)
    throws
    javax.xml.transform.TransformerConfigurationException,
    javax.xml.transform.TransformerException
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(new DOMSource(doc), new StreamResult(System.out));
    System.out.println();
    === end OracleParserTest.java ====
    Running that program
    java dfranklin.OracleParserTest
    produces this output
    <?xml version = '1.0'?>
    <amount xmlns="urn:dfranklin:test">1</amount>
    In this case, the parser has validated the document.
    I also tried this with version 10.1.0.0.0 beta, and got the same
    error.
    Darin Franklin

    Thanks for posting that. I tried that code and still got my problem. The big difference is that I'm reading a group of XML files each of which uses a large number of schema files. There are over 50 schema files organized so they can be included as needed. Each of the XML files has a noNamespaceSchemaLocation attribute specifying one of the ten top schma files, that includes many others.
    However, I did solve the problem. I added one line --
           saxb.setFeature( "http://apache.org/xml/features/validation/schema",
                    true);
            // next line is new
            saxb.setProperty( JAXPConstants.JAXP_SCHEMA_LANGUAGE,
                    JAXPConstants.W3C_XML_SCHEMA );after the setFeature to turn on schema validation.
    (It needs an import org.apache.xerces.jaxp.JAXPConstants; statement.)
    Note:With the feature set to true and the setProperty commented out, the EntityResolver is called at construction tiem, and for each schema file, but each element is flagged as needing to be declared.
    With the feature commented out, and the setProperty in place, the EntityResolver is not called, and there is no validation performed. (I added invalid content to one of the files and there were no errors listed.)
    With both the setFeature and the setProperty in place, however, I get the calls from the EntityResolver indicating that it is processing the schema files, and for the good files, I get no errror, but for the bad file, I get an error indicating a bad validation.
    Now I can make the EntityResolver quiet and get what I wanted. Maybe there are other ways to do this, but I've got one that works. :-)
    Thanks to all who have helped.
    Dave Patterson

  • XML validation with DTD in java 1.5 not supporting

    Hi,
    I am facing a problem regarding validation of xml file with DTD tag in it.
    I have disabled the parser through setValidating(false) method.
    xml file is not parsed in JRE 1.5.but it is parsed in JRE 1.6.
    Why this is showing such a behavior?
    I have used xerces 2.9.0,xml-api.jar and other jar regarding XML api but still it is giving error.
    please help me.
    please provide a jar file name or its issue resolution in jre 1.5 or 1.4.

    thanks for your prompt reply.
    I required that it should be completely disabled in jre 1.5(jdk1.5 or 1.4).
    I am using DOM Parsing.I have currently disabled with follwowing method,
    builderFactory.setValidating(false);
    builderFactory.setFeature("http://xml.org/sax/features/validation",
         false);
         builderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
         builderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false);
         builderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
         builderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
         factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    in 1.6 it is working fine but I required that i have to disabled it.but it is giving a error in jre1.5.
    Exception in thread "main" java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
    I just want to disable the parsing in jdk version 1.5 or 1.4
    thanks in advance
    anand

Maybe you are looking for