Saxon 11 HE: can I create a Configuration without Saxon trying to instantiate its StandardLogger class which tries to access System.err?
Added by Martin Honnen about 2 years ago
I am still trying to find some way to run Saxon 11 under .NET MAUI, I have had limited success with SaxonCS under Windows and now also with an IKVM cross-compiled Saxon HE 11.4 Java.
Trying to get the latter to run on an iOs simulator I always end up with an exception thrown by Saxon trying instantiate a StandardLogger which has a property private PrintWriter writer = new PrintWriter(System.err);
set up in https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/he_mirror_saxon_11_4/entry/src/main/java/net/sf/saxon/lib/StandardLogger.java#L26.
Under the iOs that gives an exception basically saying it is not supported on that platform (I have pasted a Stacktrace further below).
It seems I can implement the abstract Logger class with my own subclass to avoid the use of StandardLogger but how could I create a Configuration that doesn't first create a StandardLogger?
There seems to be only the new Configuration()
constructor and later a way to do setLogger()
. But before I get there it looks as if Configuration nevertheless tries to instantiate a StandardLogger (trying to access System.err which gives me an exception).
Any ideas?
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.TypeInitializationException: The type initializer for 'java.lang.StdIO' threw an exception.
---> System.TypeInitializationException: The type initializer for 'java.io.FileDescriptor' threw an exception.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.ConsolePal.OpenStandardInput()
at System.Console.OpenStandardInput()
at java.io.FileDescriptor.getStandardStream(Int32 fd)
at java.io.FileDescriptor.standardStream(Int32 fd)
at java.io.FileDescriptor..cctor()
--- End of inner exception stack trace ---
at java.lang.StdIO..cctor()
--- End of inner exception stack trace ---
at java.lang.System.get_err()
at net.sf.saxon.lib.StandardLo
gger..ctor()
at net.sf.saxon.Configuration..ctor()
Replies (1)
RE: Saxon 11 HE: can I create a Configuration without Saxon trying to instantiate its StandardLogger class which tries to access System.err? - Added by Michael Kay about 2 years ago
The answer to the headline question: no it's not possible.
Obviously, this is easy enough to change.
Please register to reply