Class Loader Problem

kosta
edited February 11, 2022 in Analytics #1
Hello BIRT community,

I wanted to know about the js.jar file used in BIRT. It seems that there are the Rhino libraries. Now we have very strange situation with the class loader. The main application uses Rhino as library and when the BIRT module is started SecurityException is thrown because the classloader finds FunctionNode twice and then probably the SHA1-Digest code is used on the wrong class (Rhino jar) and fails.

Is this issue known?
Thanks for any hint and suggestion.
Warning No formatter is installed for the format ipb

Comments

  • JasonW
    edited December 31, 1969 #2
    If you already have js.jar in the classpath, try removing it from BIRT.

    Jason
  • kosta
    edited September 26, 2012 #3
    Hi, Jason,<br />
    <br />
    when I remove it from the classpath an Exception occures:<br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>
    Exception in thread "main" java.lang.NoClassDefFoundError: org/mozilla/javascript/FunctionNode
    at org.eclipse.birt.core.data.ExpressionUtil.extractColumnExpressions(ExpressionUtil.java:282)
    at org.eclipse.birt.core.data.ExpressionUtil.extractColumnExpressions(ExpressionUtil.java:207)
    at org.eclipse.birt.report.model.parser.CompatibleMiscExpressionState.setupBoundDataColumns(CompatibleMiscExpressionState.java:174)
    at org.eclipse.birt.report.model.parser.CompatibleMiscExpressionState.end(CompatibleMiscExpressionState.java:96)
    at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:176)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:94)
    at org.eclipse.birt.report.model.parser.LibraryReader.read(LibraryReader.java:164)
    at org.eclipse.birt.report.model.core.DesignSessionImpl.openLibrary(DesignSessionImpl.java:562)
    at org.eclipse.birt.report.model.core.DesignSessionImpl.openLibrary(DesignSessionImpl.java:533)
    at org.eclipse.birt.report.model.api.SessionHandleImpl.openLibrary(SessionHandleImpl.java:399)
    ...
    Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.FunctionNode
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 27 more
    </pre>
    Very stange behaviour. Maybe this one reason more for updating birt to the newest version.
    Warning No formatter is installed for the format ipb
  • JasonW
    edited December 31, 1969 #4
    What version of BIRT are you using?

    Jason
  • kosta
    edited December 31, 1969 #5
    2.6.2 as BIRT API.
    Warning No formatter is installed for the format ipb
  • JasonW
    edited December 31, 1969 #6
    Understood. Can you try 3.7? Remove the js.jar from the web-inf/lib of the viewer.

    Jason