[NAS-2694] Errors Starting GUI - some SiteSections missing Created: 16/Jan/18  Updated: 12/Apr/18  Resolved: 06/Feb/18

Status: Closed
Project: NetarchiveSuite
Component/s: GUI
Affects Version/s: None
Fix Version/s: 5.4

Type: Bug Priority: Blocker
Reporter: Colin Rosenthal Assignee: Colin Rosenthal
Resolution: Fixed  
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File gui.png     File start_GUIApplication.log    
Sprint: NAS 5.4
Verification:

Tested as part of the general release test & system test. We'd notice right away if it weren't fixed.


 Description   

Only three of the SiteSections are loaded (see attached).

There are two distinct errors in the start log and it's not obvious if they are related

01:42:07,426 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [dk.netarkivet.monitor.logging.CachingSLF4JAppender]
01:42:07,427 |-ERROR in ch.qos.logback.core.joran.action.AppenderAction - Could not create an Appender of type [dk.netarkivet.monitor.logging.CachingSLF4JAppender]. ch.qos.logback.core.util.IncompatibleClassException
        at ch.qos.logback.core.util.IncompatibleClassException
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:62)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:48)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:35)

and further down

2018-01-16 09:27:14.886 DEBUG d.n.common.webinterface.HTMLUtils.generateHeader - Loading URL 'http://kb-test-adm-001.kb.dk:8071/' with title 'Main menu'
2018-01-16 09:27:14.912 DEBUG d.n.common.webinterface.HTMLUtils.generateHeader - Loaded URL 'http://kb-test-adm-001.kb.dk:8071/' with title 'Main menu'
2018-01-16 09:27:18.503 DEBUG dk.netarkivet.common.utils.Settings.getAll - Value found in classpath data: dk.netarkivet.harvester.webinterface.DefinitionsSiteSection,dk.netarkivet.harvester.webinterface.HistorySiteSection,dk.netarkivet.harvester.webinterface.HarvestChannelSiteSection,dk.netarkivet.archive.webinterface.BitPreservationSiteSection,dk.netarkivet.viewerproxy.webinterface.QASiteSection,dk.netarkivet.monitor.webinterface.StatusSiteSection
Jan 16, 2018 9:27:18 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/History] threw exception [dk.netarkivet.common.exceptions.IOFailure: Cannot read site section from settings] with root cause
java.lang.ClassCastException: dk.netarkivet.archive.webinterface.BitPreservationSiteSection cannot be cast to dk.netarkivet.common.webinterface.SiteSection
        at dk.netarkivet.common.webinterface.SiteSection.getSections(SiteSection.java:229)
        at dk.netarkivet.common.webinterface.HTMLUtils.getTitle(HTMLUtils.java:519)
        at dk.netarkivet.common.webinterface.HTMLUtils.generateHeader(HTMLUtils.java:149)
        at org.apache.jsp.Harveststatus_002dalljobs_jsp._jspService(Harveststatus_002dalljobs_jsp.java:297)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 Comments   
Comment by Colin Rosenthal [ 17/Jan/18 ]

Ok, I think I have it. At some point, some NAS dependencies had been added to the pom.xml for History.war - but not marked as scope-provided. So "the same" jars were both packaged inside the wars and in the NAS /lib directory. How exactly this was causing this behavious I haven't worked out yet, but it's all working now that I fixed the scope. I'll rerun SystemTest and then make a fisheye review if all looks well.

Comment by Colin Rosenthal [ 17/Jan/18 ]

Ah, not quite. It reads 6 definitions but can only load 3 of them.

Comment by Colin Rosenthal [ 17/Jan/18 ]

Not sure of the details yet, but somewhere the History section appears to be picking up a settings configuration that only contains three SiteSections -

String[] sitesections = Settings.getAll(CommonSettings.SITESECTION_CLASS);

in SiteSection.getSections() is returning an array of size 3.

Comment by Colin Rosenthal [ 17/Jan/18 ]

The behaviour seems to be that whenever you click on "Harvest status" the Bitpreservation, Quality Asssurance, and System State menu items disappear. Clicking on any of the other items brings them back. Clicking on the top left icon neither causes them to disappear not brings them back if they are absent.

Comment by Søren Vejrup Carlsen (Inactive) [ 16/Jan/18 ]

So why do we get

java.lang.ClassCastException: dk.netarkivet.archive.webinterface.BitPreservationSiteSection cannot be cast to dk.netarkivet.common.webinterface.SiteSection

The dk.netarkivet.archive.webinterface.BitPreservationSiteSection still extends dk.netarkivet.common.webinterface.SiteSection
https://github.com/netarchivesuite/netarchivesuite/commits/master/archive/archive-core/src/main/java/dk/netarkivet/archive/webinterface/BitPreservationSiteSection.java

So the problem must lie elsewhere

Comment by Søren Vejrup Carlsen (Inactive) [ 16/Jan/18 ]

You get this

dk.netarkivet.common.exceptions.IOFailure: Cannot read site section from settings
	at dk.netarkivet.common.webinterface.SiteSection.getSections(SiteSection.java:231)
	at dk.netarkivet.common.webinterface.HTMLUtils.getTitle(HTMLUtils.java:519)
	at dk.netarkivet.common.webinterface.HTMLUtils.generateHeader(HTMLUtils.java:149)
	at org.apache.jsp.Harveststatus_002dalljobs_jsp._jspService(Harveststatus_002dalljobs_jsp.java:297)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: dk.netarkivet.archive.webinterface.BitPreservationSiteSection cannot be cast to dk.netarkivet.common.webinterface.SiteSection
	at dk.netarkivet.common.webinterface.SiteSection.getSections(SiteSection.java:229)
	... 25 more

        

The first time you load the History/Harveststatus-alljobs.jsp

The next time, you load the page, it disappears

Comment by Søren Vejrup Carlsen (Inactive) [ 16/Jan/18 ]

The logback exceptions disappear if we remove log4j-1.2.17.jar slf4j-log4j12-1.7.5.jar

But the initial problem with loading the sitesections still persists

Comment by Søren Vejrup Carlsen (Inactive) [ 16/Jan/18 ]

Parts of the History/Harveststatus-jobdetails.jsp are also absent, The parts only shown if this conditions holds true:

if (SiteSection.isDeployed(Constants.QA_SITESECTION_DIRNAME)
Comment by Søren Vejrup Carlsen (Inactive) [ 16/Jan/18 ]

Others have seen this: https://stackoverflow.com/questions/19566969/custom-logback-appender-throws

Generated at Sat Apr 20 00:27:46 CEST 2024 using Jira 9.4.15#940015-sha1:bdaa9cbecfb6791ea579749728cab771f0dfe90b.