解决访问 jar 包里面的字体报错:OTS parsing error: incorrect file size in WOFF header
前言: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的更多相关文章
- 我的Android进阶之旅------>Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法
今天使用第三方Jar包afinal.jar时候.想看一下源码,无法看 然后像加入jar相应的源代码包.也无法加入相应的源代码,报错例如以下:The current class path entry b ...
- 我的Android进阶之旅------>Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法
今天使用第三方Jar包afinal.jar时候,想看一下源代码,无法看 然后像添加jar对应的源码包,也无法添加相应的源代码,报错如下:The current class path entry bel ...
- idea引用本地jar包的方法及报错解决
1 首先将本地jar包打入mvn本地仓库 cmd mvn install:install-file -Dfile=E://xx.jar 本地jar包绝对路径 -DgroupId=com.ccp -Da ...
- 转!java web项目 build path 导入jar包,tomcat启动报错 找不到该类
在eclipse集成tomcat开发java web项目时,引入的外部jar包,编译通过,但启动tomcat运行web时提示找不到jar包内的类,需要作如下配置,将jar包在部署到集成的tomcat环 ...
- 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 ...
- maven项目引入依赖之后,jar包没有自动导入报错
解决这个问题可run maven-intall 一下 ,需要在联网的情况下去下载jar包. 我这样做了一下就可以了.
- 解决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
- 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 ...
- html 如何访问 jar 包里面的静态资源(js、css、字体等)
前言:最近两天在尝试写一个工具 jar 包,里面包含后台处理的 java 代码,包含前端 html.js.css.字体文件等,过程中解决了访问 jar 包里的静态资源问题,所以记录下来. 附:自己的一 ...
随机推荐
- BZOJ 3940--[Usaco2015 Feb]Censoring(AC自动机)
3940: [Usaco2015 Feb]Censoring Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 723 Solved: 360[Subm ...
- 09_python_初始函数
一.定义 函数是对功能和动作的封装 def functionname( parameters ): "函数_文档字符串" function_suite return [expres ...
- elasticsearch5.6.3插件部署
需要注意的是,5.x和2.x插件方面改动很大.参考:https://www.elastic.co/blog/running-site-plugins-with-elasticsearch-5-0.因为 ...
- 8 Ways to Become a Better Coder
It’s time to get serious about improving your programming skills. Let’s do it! That’s an easy career ...
- 在MVC3中修改KindEditor实现上传图片到指定文件夹
KindEditor编辑器默认上传的图片文件夹,是根据系统时间自动生成的,图片是自动上传到这些文件夹里面,无法选择.如果要上传图片到指定文件夹,像相册一样管理图片,则需要扩展KindEditor编辑器 ...
- Excel的合并解析
相关文件我放到如下链接: http://files.cnblogs.com/files/DreamDrive/Excel%E5%90%88%E5%B9%B6%E8%A7%A3%E6%9E%90.rar ...
- (转)kafka实战教学
转载自:https://www.cnblogs.com/hei12138/p/7805475.html Apache kafka 工作原理介绍-----https://www.ibm.com/deve ...
- chrome中Timeline的使用(译)
一.概括 Timeline面板包括以下四个部分: 控制面板.开始记录.停止记录.配置捕获信息: 概况.页面性能的整体概况: flame chart.直观展示cpu堆的情况.你能够看到三条虚线,蓝色的代 ...
- 全网最详细的hive-site.xml配置文件里添加<name>hive.cli.print.header</name>和<name>hive.cli.print.current.db</name>前后的变化(图文详解)
不多说,直接上干货! 比如,你是从hive-default.xml.template,复制一份,改名为hive-site.xml 一般是 <configuration> <prope ...
- mysql5.7主从复制配置——读写分离实现
为什么使用主从架构?1.实现服务器负载均衡:2.通过复制实现数据的异地备份:3.提高数据库系统的可用性:4.可以分库[垂直拆分],分表[水平拆分]: 主从配置的前提条件1.MySQL版本一致:2.My ...