Trying to retrieve woff2 file results in "Resource not found" error

182 views
Skip to first unread message

Hayden Young

unread,
Jul 19, 2016, 1:33:19 AM7/19/16
to DSpace Technical Support
Hi

When using a Mirage2 derivative theme, and when trying to retrieve the glyphicon woff2 file from Bootstrap, we are getting a "Resource not found" error and the file will not load.

What I have noticed is that if I try and load any of the other font files, some also do not load, in particular the .eot font file. Checking my Tomcat list of mimetypes (web.xml) I see no reference to woff2 but there is a reference to eot so I'm assuming this is not the problem.

I'm wondering if the problem is related to a configuration issue in sitemap.xmap but I cannot see anything that could possibly single out these files.

Both .eot and .woff2 definitely exist and the stack trace is definitely retrieving the file from the correct location.

Stacktrace:

Java stacktrace: org.apache.cocoon.ResourceNotFoundException: Resource not found (vendor/bootstrap-sass-official/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2)
    at
<map:read type="ThemeResourceReader"> - jndi:/archive.dspace-demo.knowledgearc.net/themes/Mirage2/sitemap.xmap:170:65
    at
<map:match> - jndi:/archive.dspace-demo.knowledgearc.net/themes/Mirage2/sitemap.xmap:169:46
    at org
.dspace.app.xmlui.cocoon.ThemeResourceReader.setup(ThemeResourceReader.java:72)
    at sun
.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:606)
    at org
.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:71)
    at com
.sun.proxy.$Proxy40.setup(Unknown Source)
    at org
.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupReader(AbstractProcessingPipeline.java:560)
    at org
.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:464)
    at org
.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:411)
    at sun
.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:606)
    at org
.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:71)
    at com
.sun.proxy.$Proxy30.process(Unknown Source)
    at org
.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:94)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55)
    at org
.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
    at org
.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
    at org
.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)
    at org
.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)
    at org
.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171)
    at org
.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)
    at org
.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55)
    at org
.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
    at org
.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
    at org
.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
    at org
.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)
    at org
.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)
    at org
.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171)
    at org
.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)
    at org
.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)
    at org
.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
    at org
.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
    at javax
.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org
.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)
    at org
.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)
    at org
.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)
    at org
.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org
.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com
.sun.proxy.$Proxy27.service(Unknown Source)
    at org
.dspace.springmvc.CocoonView.render(CocoonView.java:113)
    at org
.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    at org
.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    at org
.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org
.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org
.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax
.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at javax
.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org
.dspace.app.xmlui.cocoon.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
    at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org
.dspace.app.xmlui.cocoon.DSpaceCocoonServletFilter.doFilter(DSpaceCocoonServletFilter.java:274)
    at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org
.dspace.app.xmlui.cocoon.servlet.multipart.DSpaceMultipartFilter.doFilter(DSpaceMultipartFilter.java:119)
    at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org
.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78)
    at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org
.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org
.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org
.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org
.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org
.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org
.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
    at org
.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org
.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    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:745)


Andrea Schweer

unread,
Jul 19, 2016, 6:39:03 PM7/19/16
to Hayden Young, DSpace Technical Support
Hi,

due to security concerns, we recently introduced a whitelist of extensions that clients are allowed to load from the theme directories. woff2 and eot are currently not on the default whitelist. Could you add the two extensions to the xmlui.theme.whitelist setting in dspace.cfg, restart Tomcat and try again? If those files exist in the file system then they should load after the change. So the setting should look like this:

xmlui.theme.whitelist = css, js, json, gif, jpg, jpeg, png, bmp, ico, htm, html, svg, ttf, woff, woff2, eot

Also, what DSpace version are you using? In DSpace 5, I'm not seeing the woff2 file on disk but I had noticed the problem with requests to the the eot file resulting in 404 errors when I looked over our web server logs recently. We may need to update the default whitelist to include woff2/eot.

cheers,
Andrea
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

-- 
Dr Andrea Schweer
Lead Software Developer, ITS Information Systems
The University of Waikato, Hamilton, New Zealand
+64-7-837 9120

Hayden Young

unread,
Jul 20, 2016, 6:15:46 AM7/20/16
to DSpace Technical Support, hay...@knowledgearc.com
Hi Andrea

Adding woff2 to the xmlui.theme.whitelist worked, thanks.

We're developing our own theme which is using bootstrap 3; this contains the woff2 file which was failing to load.

Thanks for your help.


Hayden
Reply all
Reply to author
Forward
0 new messages