Menu

#2 NamespaceParserRegistry: System.UriFormatException: Invalid

open
nobody
None
5
2009-05-26
2009-05-26
No

Spring.Objects.Factory.Xml.NamespaceParserRegistry

I had to change the line 343 from:
schemas.Add(namespaceUri, schemaDocument, new XmlResourceUrlResolver());
to:
schemas.Add(XmlSchema.Read(schema.InputStream, null));

So I wouldn't get the following error while calling the dll from a VB6 application.

2009-05-25 10:36:48,096 [4844] FATAL Grad.Vb2NetAbstractStarter (null) - Unexpected exception parsing XML document from file [c:\Temp\Logs\test.xml]Inner exception message= The type initializer for 'Spring.Objects.Factory.Xml.NamespaceParserRegistry' threw an exception.
Spring.Objects.Factory.ObjectDefinitionStoreException: Unexpected exception parsing XML document from file [c:\Temp\Logs\test.xml]Inner exception message= The type initializer for 'Spring.Objects.Factory.Xml.NamespaceParserRegistry' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Spring.Objects.Factory.Xml.NamespaceParserRegistry' threw an exception. ---> System.ArgumentException: Could not load schema from resource = assembly [Spring.Core, Version=1.2.0.11313, Culture=neutral, PublicKeyToken=65e474d141e25e07], resource [Spring.Objects.Factory.Xml.spring-objects-1.1.xsd] ---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, UriKind uriKind)
at System.Xml.Schema.Parser.StartParsing(XmlReader reader, String targetNamespace)
at System.Xml.Schema.Parser.Parse(XmlReader reader, String targetNamespace)
at System.Xml.Schema.XmlSchemaCollection.Add(String ns, XmlReader reader, XmlResolver resolver)
at Spring.Objects.Factory.Xml.NamespaceParserRegistry.RegisterSchema(String namespaceUri, String schemaLocation)
--- End of inner exception stack trace ---
at Spring.Objects.Factory.Xml.NamespaceParserRegistry.RegisterSchema(String namespaceUri, String schemaLocation)
at Spring.Objects.Factory.Xml.NamespaceParserRegistry.RegisterParser(INamespaceParser parser, String namespaceUri, String schemaLocation)
at Spring.Objects.Factory.Xml.NamespaceParserRegistry.Reset()
at Spring.Objects.Factory.Xml.NamespaceParserRegistry..cctor()
--- End of inner exception stack trace ---
at Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.CreateValidatingReader(MemoryStream stream)
at Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.DoLoadObjectDefinitions(Stream stream, IResource resource)
--- End of inner exception stack trace ---
at Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.DoLoadObjectDefinitions(Stream stream, IResource resource)
at Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.LoadObjectDefinitions(IResource resource)
at Spring.Objects.Factory.Support.AbstractObjectDefinitionReader.LoadObjectDefinitions(String location)
at Grad.BisNenaplaceniRacuniPrijenos.NenaplaceniRacuniStart.LoadContext() in c:\documents and settings\marko\my documents\projekti\staro\.net\bisnenaplaceniracuniprijenos\bisnenaplaceniracuniprijenos\nenaplaceniracunistart.cs:line 40
at Grad.BisNenaplaceniRacuniPrijenos.NenaplaceniRacuniStart.Start(String filter) in c:\documents and settings\marko\my documents\projekti\staro\.net\bisnenaplaceniracuniprijenos\bisnenaplaceniracuniprijenos\nenaplaceniracunistart.cs:line 19

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.