java.lang.NoClassDefFoundError for com.saxoni

aganatra
2012-06-05
2012-10-08
  • aganatra
    aganatra
    2012-06-05

    Hi,

    I am getting this exception when I try to invoke the following line in C#. I
    am using Saxon 9.4 EE in .Net.

    XsltTransformer transformer = processor.NewXsltCompiler().Compile(new
    Uri("path")).Load();

    The exception is below. I would appreciate any help.

    java.lang.NoClassDefFoundError was unhandled
    Message=com.saxonica.bytecode.GeneratedCode
    Source=IKVM.Runtime
    StackTrace:
    at IKVM.NativeCode.java.lang.ClassLoader.defineClass1(ClassLoader
    thisClassLoader, String name, Byte b, Int32 off, Int32 len, Object pd, String
    source)
    at java.lang.ClassLoader.defineClass(String name, Byte b, Int32 off, Int32
    len, ProtectionDomain protectionDomain)
    at java.lang.ClassLoader.defineClass(String name, Byte b, Int32 off, Int32
    len)
    at com.saxonica.bytecode.util.CompilerService$1.findClass(String )
    at java.lang.ClassLoader.loadClass(String name, Boolean resolve)
    at java.lang.ClassLoader.loadClass(String name)
    at com.saxonica.bytecode.util.CompilerService.makeClass(ClassWriter writer,
    String className)
    at com.saxonica.bytecode.util.CompilerService.compileToByteCode(Expression
    expr, String objectName, Int32 evaluationModes)
    at com.saxonica.expr.ee.OptimizerEE.compileToByteCode(Expression expr, String
    objectName, Int32 evaluationMethods)
    at net.sf.saxon.style.XSLTemplate.optimize(Declaration declaration)
    at net.sf.saxon.style.PrincipalStylesheetModule.compileStylesheet()
    at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(DocumentImpl doc)
    at net.sf.saxon.PreparedStylesheet.prepare(Source styleSource)
    at net.sf.saxon.TransformerFactoryImpl.newTemplates(Source source,
    CompilerInfo info)
    at Saxon.Api.XsltCompiler.Compile(Uri uri)
    at ConsoleApplication1.Program.Main(String args) in
    C:\Users\aganatra\Documents\Visual Studio
    2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 64
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
    assemblySecurity, String args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
    ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
    ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

     
  • aganatra
    aganatra
    2012-06-05

    I read on another post that this may be a bug that was fixed. Also it was
    suggested that if you turn off byte code generation the issue may be fixed,
    but I wasn't able to set a feature to turn off the byte code. Couldn't get the
    exact property name. I tried the following line, but it didn't work.

    processor.SetProperty("http://saxon.sf.net/feature/generate-byte-
    code
    ", "false");

     
  • Michael Kay
    Michael Kay
    2012-06-05

    It would be useful if you could report problems on dev.saxonica.com rather
    than here, especially if they relate only to commercial versions of the
    software.

    Please make sure you are using the latest maintenance release of the software
    (9.4.0.3). This incorporates a later version of IKVM than 9.4.0.1, which fixes
    some issues in byte code generation.

    If you want to suppress byte code generation, the property name to use is "ht
    tp://saxon.sf.net/feature/generateByteCode
    ". I'm afraid that for historic reasons the property names use
    camelcase versus hyphenated names rather unpredictably. You can find the list
    of names here: http://www.saxonica.com/documentation/configuration/config-
    features.xml

     
  • aganatra
    aganatra
    2012-06-06

    Thanks Michael,

    I believe I am using 9.4.0.3. The download package I used to install says
    "SaxonEE9-4-0-3N-setup".

    I tried with bytecode generation disabled using the property name you provided
    and that seems to get rid of the issue. So for now I will stick to that.

    Thanks a lot for quick response. I will use dev.saxonica.com in future.

     
  • Michael Kay
    Michael Kay
    2012-06-06

    I'm glad you have a workaround, but if you experienced the problem on 9.4.0.3
    then we would much appreciate it if you could put together the materials
    needed for us to reproduce the problem so we can avoid other users running
    into the same issue in the future.