Opened 11 years ago
Closed 11 years ago
#1794 closed defect (fixed)
Extensions installer doesn't catch all errors
Reported by: | Nicklas Nordborg | Owned by: | everyone |
---|---|---|---|
Priority: | major | Milestone: | BASE 3.3 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
The situation is similar to what is described in #1042, but while #1042 is about handling errors when using already installed extensions this is about catching error when trying to install a faulty extensions.
For example, the Normalization package 1.1-beta2 (http://baseplugins.thep.lu.se/wiki/net.sf.basedb.normalizers) is not packaged correctly.
NOTE! The problem lies with the qQuantileNormalization plug-in which is disabled in the 1.1-beta2 package so this issue will not show up on new installations.
But, if the qQuantile plug-in is already installed the installation wizard seems to work, but the final status message is missing information. Normally it would say something like 'Updated, 3 plugins installed', but in this case it only says 'Updated'.
To get more information 'debug'-level logging has to be enabled in 'log4j.properies' for the Extensions API. Now we get the following stack trace:
08:18:25,474 ERROR ExtensionsManager:579 - Error when processing extensions with net.sf.basedb.util.extensions.manager.processor.PluginInstallationProcessor@395223b java.lang.NoClassDefFoundError: net/sf/basedb/plugins/AbstractRunBinaryPlugin at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at net.sf.basedb.util.JarClassLoader.findClass(JarClassLoader.java:263) at net.sf.basedb.util.JarClassLoader.loadClass(JarClassLoader.java:350) at java.lang.ClassLoader.loadClass(Unknown Source) at net.sf.basedb.util.ClassUtil.checkAndLoadClass(ClassUtil.java:129) at net.sf.basedb.core.PluginDefinition.newInstance(PluginDefinition.java:1256) at net.sf.basedb.core.PluginDefinition.loadPluginInformation(PluginDefinition.java:1387) at net.sf.basedb.core.PluginDefinition.getNew(PluginDefinition.java:148) at net.sf.basedb.core.PluginDefinition.installOrUpdate(PluginDefinition.java:411) at net.sf.basedb.util.extensions.manager.processor.PluginInstallationProcessor.processFile(PluginInstallationProcessor.java:140) at net.sf.basedb.util.extensions.manager.ExtensionsManager.processFiles(ExtensionsManager.java:572) at net.sf.basedb.clients.web.extensions.ExtensionsControl.scan(ExtensionsControl.java:267) at net.sf.basedb.clients.web.extensions.ExtensionsControl.performActions(ExtensionsControl.java:528) at org.apache.jsp.admin.extensions.index_jsp._jspService(index_jsp.java:134) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69) 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:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: net.sf.basedb.plugins.AbstractRunBinaryPlugin at net.sf.basedb.util.JarClassLoader.loadClass(JarClassLoader.java:364) at java.lang.ClassLoader.loadClass(Unknown Source) ... 41 more
But since the NoClassDefFoundError
exception is a subclass of Error
and not Exception
it is not catched at the proper error-handling place (eg. inside the PluginInstallationProcessor
). It trickles up to a higher level and is only logged to the log file. No message is forwarded to the user in BASE.
(In [6379]) Fixes #1794: Extensions installer doesn't catch all errors
Seems like some installation processors catched
Throwable
and some only catchedException
. Made changes so that all processors now catchThrowable
and also include the actual exception class name in the error message since the message only may contain limited information.