I'm guessing this is a .NET 4.0 environment and a pre-4.2 
XCC.net<http://XCC.net>, which won't work.

The fact that the Java version referenced below is 4.2-3 makes me wonder, but 
this is definitely the error that occurs when you use an older version of the 
IKVM runtime with .NET 4.0.


Sam Neth
Lead Engineer
MarkLogic Corporation





On May 7, 2011, at 8:38 AM, Mark Helmstetter wrote:

I was not able to reproduce this error.  Are you using SimpleQueryRunner as-is, 
or have you made modifications to it?

What version of .NET are you using?  What version of XCC.net<http://XCC.net> 
are you using?  And which MarkLogic Server version?

Is there more to the error message “The type initializer for 'java.net.URI' 
threw an exception”, e.g. a more complete stack trace?

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Farshad Farzan
Sent: Friday, May 06, 2011 2:26 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] The type initializer for 'java.net.URI' threw 
an exception

I can not get the xcc for .net working ,

I can test the server using the xcc java example below  ,

java  -classpath 
"d:/temp/xcc/examples/marklogic-xcc-4.2.3.jar;d:/temp/xcc/examples/marklogic-xcc-examples-4.2.3.jar"
 com.marklogic.xcc.examples.ContentFetcher 
xcc://admin:pass@localhost:8003/CDADatabase /CDA/foo.xml -o 
d:/temp/xcc/foo_out.xml


But the the .net code throws exception at the following line:
ContentSource cs = ContentSourceFactory.NewContentSource(serverUri);

With the following debug message:
The type initializer for 'java.net.URI' threw an exception


Where:

using System;

using Marklogic.Xcc;

Uri serverUri = new Uri("xcc://admin:pass@localhost:8003/CDADatabase");

SimpleQueryRunner sqr = new SimpleQueryRunner(serverUri);


SimpleQueryRunner uses : ContentSource cs = 
ContentSourceFactory.NewContentSource(serverUri)

And this throughs exception: and I get the following error:

System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean 
preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)




_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to