mbleron / ExcelTable

ExcelTable is an Oracle SQL interface to read Microsoft Excel files (.xlsx, .xlsm, .xlsb, .xls, .xml), ODF spreadsheet files (.ods) and flat files as external tables
MIT License
45 stars 12 forks source link

ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError #28

Closed mmclaughlin3111 closed 3 years ago

mmclaughlin3111 commented 3 years ago

I am trying to run the loadData function with the following:

declare

ctx GDRDBA.ExcelTable.DMLContext; nrows integer;

begin dbms_output.put_line( '1'); ctx := GDRDBA.ExcelTable.createDMLContext('T544'); dbms_output.put_line( '2');
GDRDBA.ExcelTable.mapColumnWithDefault(ctx, p_col_name => 'VALID_DATE', p_default => sysdate); GDRDBA.ExcelTable.mapColumn(ctx, p_col_name => 'CURRENCY_CODE', p_col_ref => 'A'); GDRDBA.ExcelTable.mapColumn(ctx, p_col_name => 'CONVERSION_RATE', p_col_ref => 'G'); dbms_output.put_line( '3');
nrows := GDRDBA.ExcelTable.loadData( p_ctx => ctx , p_file => GDRDBA.ExcelTable.getFile('EXCEL_FILE_DIR','FX Rates Feb 2021.xlsx') , p_sheet => 'query (2)' , p_method => GDRDBA.ExcelTable.STREAM_READ , p_dml_type => GDRDBA.ExcelTable.DML_INSERT );

dbms_output.put_line(nrows || ' rows inserted.');

end;

When I run this on my database I get the following error:

ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError ORA-06512: at "GDRDBA.EXCELTABLE", line 2026 ORA-06512: at "GDRDBA.EXCELTABLE", line 2754 ORA-06512: at "GDRDBA.EXCELTABLE", line 3157 ORA-06512: at "GDRDBA.EXCELTABLE", line 5019 ORA-06512: at "GDRDBA.EXCELTABLE", line 5043

Can anyone help me out to figure out why I am getting this uncaught Exception?

Thanks

Mike

mbleron commented 3 years ago

Please add this bit to redirect the Java stacktrace to DBMS_OUTPUT buffer : dbms_java.set_output(10000); It should give us a little more details.

As pointed out in issue #27, I'd also suggest cleaning up and reinstalling the jar in a non-SYS schema.

mmclaughlin3111 commented 3 years ago

I really appreciate your reply!
Taking your advice, I had my DBA's uninstall the jar from the SYS schema and install it in our GDRDBA schema.

I also added the dbms_java.set_output(10000) to my test script. After running this again in the GDRDBA schema I now get the following error:

ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError ORA-06512: at "GDRDBA.EXCELTABLE", line 2026 ORA-06512: at "GDRDBA.EXCELTABLE", line 2754 ORA-06512: at "GDRDBA.EXCELTABLE", line 3157 ORA-06512: at "GDRDBA.EXCELTABLE", line 5019 ORA-06512: at "GDRDBA.EXCELTABLE", line 5043 ORA-06512: at line 15

Getting the DBMS_OUTPUT buffer: Exception in thread "Root Thread" java.lang.ExceptionInInitializerError at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1175) at java.lang.ClassLoader.getResource(ClassLoader.java:1014) at java.lang.ClassLoader.getResource(ClassLoader.java:1012) at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1133) at java.lang.Class.getResource(Class.java:2142) at oracle.i18n.text.converter.CharacterConverterOGS$1.run(CharacterConverterOGS.java:391) at java.security.AccessController.doPrivileged(Native Method) at oracle.i18n.text.converter.CharacterConverterOGS.readObj(CharacterConverterOGS.java:386) at oracle.i18n.text.converter.CharacterConverterOGS.getInstance(CharacterConverterOGS.java:132) at oracle.sql.converter.CharacterConverterFactoryOGS.make(CharacterConverterFactoryOGS.java:41) at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:95) at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:127) at oracle.sql.CharacterSetDbms.(CharacterSetFactoryDefault.java:58) at oracle.sql.CharacterSetFactoryDefault.make(CharacterSetFactoryDefault.java:36) at oracle.sql.CharacterSet.make(CharacterSet.java:509) at oracle.jdbc.driver.T2SConnection$1T2SConversion.(T2SConnection.java:257) at oracle.jdbc.driver.T2SConnection.logon(T2SConnection.java:315) at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:656) at oracle.jdbc.driver.T2SDriverExtension.getConnection(T2SDriverExtension.java:29) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:501) at oracle.jdbc.driver.OracleDriver.defaultConnection(OracleDriver.java:538) at oracle.aurora.rdbms.security.PolicyTable.connection(PolicyTable.java:110) at oracle.aurora.rdbms.security.PolicyTableQuery.statement(PolicyTableQuery.java:84) at oracle.aurora.rdbms.security.PolicyTableQuery.rows(PolicyTableQuery.java:66) at oracle.aurora.rdbms.security.PolicyTable.allRows(PolicyTable.java) at oracle.aurora.rdbms.security.PolicyTable.computeRowCache(PolicyTable.java:403) at oracle.aurora.rdbms.security.PolicyTable.getRowCache(PolicyTable.java:395) at oracle.aurora.rdbms.security.TypePermissions.initFromRowCache(TypePermissions.java) at oracle.aurora.rdbms.security.TypePermissions.(TypePermissions.java:107) at oracle.aurora.rdbms.security.SchemaPermissions.getTypePermissionsFor(SchemaPermissions.java:124) at oracle.aurora.rdbms.security.PolicyTable.getPermissions(PolicyTable.java:269) at oracle.aurora.rdbms.security.PolicyTableProxy$Type.implies(PolicyTableProxy.java:134) at oracle.aurora.rdbms.security.PolicyTableProxy.implies(PolicyTableProxy.java:56) at java.security.ProtectionDomain.implies(ProtectionDomain.java:285) at oracle.aurora.rdbms.security.SchemaProtectionDomain.implies(SchemaProtectionDomain.java:93) at java.security.AccessControlContext.checkPermission(AccessControlContext.java) at java.security.AccessController.checkPermission(AccessController.java) at java.lang.SecurityManager.checkPermission(SecurityManager.java) at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java) at java.lang.System.getProperty(System.java) at java.io.FileSystem.getBooleanProperty(FileSystem.java:223) at java.io.FileSystem.(FileSystem.java:233) at java.io.File.(File.java:120) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:209) at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:123) at db.office.spreadsheet.oox.OOXCellReaderImpl.(OOXCellReaderImpl.java:51) at db.office.spreadsheet.ReadContext.(ReadContext.java:39) at db.office.spreadsheet.ReadContext.initialize(ReadContext.java:52) Caused by: java.lang.NullPointerException at java.io.File.(File.java:269) at sun.jkernel.DownloadManager.getBundlePath(DownloadManager.java:622) at sun.jkernel.DownloadManager$2.run(DownloadManager.java:165) at java.security.AccessController.doPrivileged(Native Method) at sun.jkernel.DownloadManager.(DownloadManager.java:155) ... 49 more

mbleron commented 3 years ago

I think you're hitting this issue : java.lang.ExceptionInInitializerError / java.lang.NullPointerException / java.lang.NoClassDefFoundError after applying the January 2018 OJVM PSU patch (Doc ID 2365509.1)

The sample error stack provided in the MOS doc matches yours exactly. There's a workaround mentioned too. You may have your DBA take a look at it.

Hope that helps.

mbleron commented 3 years ago

Closing the issue as not related to ExcelTable.