前言:jar 包里面的字体加载,浏览器 console 中报警告信息,这里记录一下解决方案。

附:自己的一个 jar 包源码 https://github.com/yuleGH/querydb

错误问题:

  谷歌浏览器 console 中报警告信息:

  Failed to decode downloaded font: http://localhost:8080/font/element-icons.woff?v=230-rc1
  OTS parsing error: incorrect file size in WOFF header

原因:

  网上说是由于使用 maven 的 resource 插件开启 filtering 功能后,会破坏有二进制内容的文件。

解决方案:

  我把我的 jar 包里面的代码贴出来,亲测可用

            <!--配置打包时字体文件不被maven拷贝,导致字体文件破坏-->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
<include>**/*.html</include>
<include>**/*.js</include>
<include>**/*.css</include>
<include>**/*.xml</include>
</includes>
<excludes>
<exclude>**/*.ttf</exclude>
<exclude>**/*.woff</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.ttf</include>
<include>**/*.woff</include>
</includes>
</resource>

解决访问 jar 包里面的字体报错:OTS parsing error: incorrect file size in WOFF header的更多相关文章

  1. 我的Android进阶之旅------&gt;Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法

    今天使用第三方Jar包afinal.jar时候.想看一下源码,无法看 然后像加入jar相应的源代码包.也无法加入相应的源代码,报错例如以下:The current class path entry b ...

  2. 我的Android进阶之旅------>Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法

    今天使用第三方Jar包afinal.jar时候,想看一下源代码,无法看 然后像添加jar对应的源码包,也无法添加相应的源代码,报错如下:The current class path entry bel ...

  3. idea引用本地jar包的方法及报错解决

    1 首先将本地jar包打入mvn本地仓库 cmd mvn install:install-file -Dfile=E://xx.jar 本地jar包绝对路径 -DgroupId=com.ccp -Da ...

  4. 转!java web项目 build path 导入jar包,tomcat启动报错 找不到该类

    在eclipse集成tomcat开发java web项目时,引入的外部jar包,编译通过,但启动tomcat运行web时提示找不到jar包内的类,需要作如下配置,将jar包在部署到集成的tomcat环 ...

  5. javafx:JavaFX Scene Builder 2.0打开含有第三方jar包的fxml文件报错 Caused by: java.lang.ClassNotFoundException

    报错如下: java.io.IOException: javafx.fxml.LoadException: /C:/User.................test.fxml at com.orac ...

  6. maven项目引入依赖之后,jar包没有自动导入报错

    解决这个问题可run maven-intall 一下 ,需要在联网的情况下去下载jar包. 我这样做了一下就可以了.

  7. 解决org.apache.jasper.JasperException: org.apache.jasper.JasperException: XML parsing error on file org.apache.tomcat.util.scan.MergedWebXml

    1.解决办法整个项目建立时采用utf-8编码,包括代码.jsp.配置文件 2.并用最新的tomcat7.0.75 相关链接: http://ask.csdn.net/questions/223650

  8. mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    mysql中文乱码解决 mysql修改my.cnf后启动报错Starting MySQL... ERROR! The server quit without updating PID file (/v ...

  9. html 如何访问 jar 包里面的静态资源(js、css、字体等)

    前言:最近两天在尝试写一个工具 jar 包,里面包含后台处理的 java 代码,包含前端 html.js.css.字体文件等,过程中解决了访问 jar 包里的静态资源问题,所以记录下来. 附:自己的一 ...

随机推荐

  1. 关于GROUP BY和聚合函数

    可以这样去理解group by和聚合函数 转自 http://www.cnblogs.com/wiseblog/articles/4475936.html 写在前面的话:用了好久group by,今天 ...

  2. [学习笔记]BSGS

    \(\%\%\% Fading\) 早就会了,我最近才理解,当时颓废太多忘学了 1.[SDOI2013]随机数生成器 当天正好在学数列,回来发现用必修五的知识就没了-- 不过特判好烦啊. \(Code ...

  3. Android在onCreate中获取控件的宽高

    在某些需求下,我们需要在onCreate的时候就获取到控件的宽高,但是如果直接用view.getWidth()或view.getHeight()会得到0.这是因为在onCreate执行的时候,控件还没 ...

  4. 【TensorFlow】:解决TensorFlow的ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败

    [背景] 在scikit-learn基础上系统结合数学和编程的角度学习了机器学习后(我的github:https://github.com/wwcom614/machine-learning),意犹未 ...

  5. 使用Flexbox:新旧语法混用实现最佳浏览器兼容

    Flexbox非常的棒,肯定是未来布局的一种主流.在过去的几年这之中,语法改变了不少,这里有一篇“旧”和“新”新的语法区别教程(如果你对英文不太感兴趣,可以移步阅读中文版本).但是,如果我们把Flex ...

  6. WebRTC开发基础(WebRTC入门系列2:RTCPeerConnection)

    RTCPeerConnection的作用是在浏览器之间建立数据的“点对点”(peer to peer)通信. 使用WebRTC的编解码器和协议做了大量的工作,方便了开发者,使实时通信成为可能,甚至在不 ...

  7. POJ 2876

    #include<iostream> #include<string> using namespace std; ]; int main() { //freopen(" ...

  8. 解决Maven的Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart

    eclipse配置好了Maven,创建maven-archetype-quickstart项目报错如下: Could not resolve archetype org.apache.maven.ar ...

  9. (转)python-user-agents

    原文:http://blog.topspeedsnail.com/archives/1958 Python3网络爬虫(四):使用User Agent和代理IP隐藏身份-------https://bl ...

  10. Java8-用Lambda表达式给List集合排序

    Lambda用到了JDK8自带的一个函数式接口Comparator<T>. 准备一个Apple类 public class Apple { private int weight; priv ...