markmandel/JavaLoader

Instantiating error

soetji opened this issue · 2 comments

I am using the latest Tika 1.4 and javaloader 1.1 on CF 10 Windows server. I got the following error.

Object instantiation exception.
An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. Error: ''.

The error occurred in D:/www/websites/cfcomponents/tika/test.cfm: line 4

2 : sourcePaths = [GetDirectoryFromPath(GetCurrentTemplatePath()) & 'tika-app-1.4.jar'];
3 : loader = new javaloader.JavaLoader().init(sourcePaths);
4 : oTika = loader.create('org.apache.tika.Tika').init();
5 :

Resources:

Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.

Browser Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0
Remote Address 10.0.2.24
Referrer
Date/Time 11-Feb-14 03:31 PM
Stack Trace
at cftest2ecfm123655522.runPage(D:/www/websites/cfcomponents/tika/test.cfm:4) at cftest2ecfm123655522.runPage(D:/www/websites/cfcomponents/tika/test.cfm:4)

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at coldfusion.runtime.java.JavaProxy.CreateObject(JavaProxy.java:166)
at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:80)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
at cftest2ecfm123655522.runPage(D:\www\websites\cfcomponents\tika\test.cfm:4)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.apache.tika.mime.MimeTypesReader.read(MimeTypesReader.java:117)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:64)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)
at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:499)
at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)
at org.apache.tika.config.TikaConfig.(TikaConfig.java:169)
at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)
at org.apache.tika.Tika.(Tika.java:93)
... 47 more

This has been covered on the mailing list. Closing ticket.

@markmandel hmm.
For anyone else who found this issue via google for the same issue, here's the link to the mailing list.
https://groups.google.com/forum/#!topic/javaloader-dev/k89o2e12YIY
and this
https://github.com/markmandel/JavaLoader/wiki/Switching-the-ThreadContextClassLoader