Bug 61170 - CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "****" on bean "BeanId(****-ear#hrapps-ejb.jar#***ServiceImpl, null)". Exception data: java.lang.NoClassDefFoundError: org.apache.poi.util.SAXHelper
Summary: CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation...
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.16-FINAL
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL: https://stackoverflow.com/q/44429083/...
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-09 09:30 UTC by BalaajiChander
Modified: 2017-06-16 18:29 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BalaajiChander 2017-06-09 09:30:31 UTC
https://stackoverflow.com/q/44429083/4522875
Comment 1 BalaajiChander 2017-06-12 04:28:56 UTC
Static initialization failed for Saxhelper

  /**
     * Creates a new SAX XMLReader, with sensible defaults
     */
    public static synchronized XMLReader newXMLReader() throws SAXException, ParserConfigurationException {
        XMLReader xmlReader = saxFactory.newSAXParser().getXMLReader();
        xmlReader.setEntityResolver(IGNORING_ENTITY_RESOLVER);
        trySetSAXFeature(xmlReader, XMLConstants.FEATURE_SECURE_PROCESSING);
        trySetXercesSecurityManager(xmlReader);
        return xmlReader;
    }


cause : java.lang.NoClassDefFoundError: org/apache/poi/util/SAXHelpernull
Caused by: java.lang.ClassNotFoundException: org.apache.poi.util.SAXHelpernull
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at java.net.URLClassLoader.findClass(URLClassLoader.java:434)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:230)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:703)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at java.lang.ClassLoader.loadClass(ClassLoader.java:682)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:123)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at java.lang.ClassLoader.loadClass(ClassLoader.java:665)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:566)null
[6/12/17 9:52:13:904 IST] 00000077 SystemErr     R   	at java.lang.ClassLoader.loadClass(ClassLoader.java:665)null
Comment 2 Dominik Stadler 2017-06-12 06:04:46 UTC
Sounds very much like a local classpath issue, nothing that we can fix in POI unless you can provide an isolated unit test which still shows the problem. 

Please test your code outside any web-container to check if that is related. Also the exact version of JVM that you are using might help.
Comment 3 Dominik Stadler 2017-06-12 06:07:45 UTC
And based on the SO question-comments this is very likely related to Eclipse framework, so what would you expect us to do here?
Comment 4 Javen O'Neal 2017-06-12 15:28:33 UTC
See NoClassDefFoundError in https://poi.apache.org/faq.html
Comment 5 PJ Fanning 2017-06-14 23:14:17 UTC
I added extra logging to SAXHelper in https://github.com/apache/poi/pull/58
Maybe that might help to show if its the static initializer.
Comment 6 Javen O'Neal 2017-06-15 05:10:50 UTC
(In reply to PJ Fanning from comment #5)
> I added extra logging to SAXHelper in https://github.com/apache/poi/pull/58
> Maybe that might help to show if its the static initializer.

Thanks for the suggestion. Added in r1798792 and r1798793.
Comment 7 Dominik Stadler 2017-06-16 18:29:37 UTC
Closing this for now as I don't see anything more that we can do here. We have improved logging in trunk which you can use to get some more details, but overall it seems the problem lies elsewhere related to class loading in your specific environment.