网站备案未注销 影响,上海新增感染呈下降趋势,南海网站建设哪家好,软文推广服务由于很早之前就升级springboot版本到2.7.9#xff0c;以前做好了铺垫#xff0c;相对升级要容易一些。
1 项目打包成exe
1.1 jpackage打包jar
C:\Users\39305\Desktop\数量核对jpackage ^
More? --type exe ^
More? --name zp-server ^
More? --input C:\Use… 由于很早之前就升级springboot版本到2.7.9以前做好了铺垫相对升级要容易一些。
1 项目打包成exe
1.1 jpackage打包jar
C:\Users\39305\Desktop\数量核对jpackage ^
More? --type exe ^
More? --name zp-server ^
More? --input C:\Users\39305\Desktop\数量核对 ^
More? --main-jar zp-server.jar ^
More? --main-class com.dzmsoft.zp.server.ZpServerApplication ^
More? --icon E:\workspace\vuework\fay-web\public\favicon.ico ^
More? --app-version 1.0 ^
More? --vendor dj ^
More? --description 子平服务
[08:33:59.830] 找不到 WiX 工具 (light.exe, candle.exe)
[08:33:59.830] 从 https://wixtoolset.org 下载 WiX 3.0 或更高版本然后将其添加到 PATH。
错误类型 [exe] 无效或不受支持 jpackage依赖wix tools在wix3中下载 安装wix311需要.net 3.5.1环境 执行打包脚本exe文件可以生成但是启动后程序一闪而过这个问题是咋回事呢
jpackage ^--input .\in ^--type exe ^--description 子平服务 ^--name zp-server ^--main-jar zp-server.jar ^--main-class com.dzmsoft.zp.server.ZpServerApplication ^--icon .\favicon.ico ^--win-console ^--win-dir-chooser ^--win-shortcut ^--win-shortcut-prompt ^--java-options -Dfile.encodingUTF-8 -Xmx512m -Xms256m 添加一个脚本zp-server.bat接着就可以看到错误原因
echo off
REM 启动应用程序并保持窗口打开
cmd /k D:\Program Files\zp-server\zp-server.exe 错误消息终于出来了为什么找不到启动类呢 查看这个文件就知道为什么了因为MANIFEST.MF 文件包含正确的主类声明 内容如下原来springboot启动类是org.springframework.boot.loader.JarLauncher
Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.2.2
Build-Jdk-Spec: 17
Implementation-Title: zp-server
Implementation-Version: 3.0.0
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: com.dzmsoft.zp.server.ZpServerApplication
Spring-Boot-Version: 2.7.9
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Spring-Boot-Classpath-Index: BOOT-INF/classpath.idx
Spring-Boot-Layers-Index: BOOT-INF/layers.idx 因此打包命令调整如下这样挺好的因为只需要改少部分就可以了。
jpackage ^--input .\in ^--type exe ^--description 服务 ^--name test-server ^--main-jar zp-server.jar ^--main-class org.springframework.boot.loader.JarLauncher ^--icon .\favicon.ico ^--win-console ^--win-dir-chooser ^--win-shortcut ^--win-shortcut-prompt ^--java-options -Dfile.encodingUTF-8
1.2 nsis 2 项目升级
2.1 网关 Spring Cloud Gateway 并不是设计为与 Spring MVC 一起工作的
Spring Cloud Gateway是一个基于非阻塞 I/O 的 API 网关适用于构建微服务架构中的网关层。Spring MVC是基于 Servlet 的传统 Web 框架适用于构建传统的 Web 应用程序。
Description:Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.Action:Please set spring.main.web-application-typereactive or remove spring-boot-starter-web dependency.因此需要将spring-boot-starter-web相关的依赖排查掉即可。
dependencygroupIdcom.whty/groupIdartifactIdcom.whty.framework.redis/artifactIdexclusionsexclusionartifactIdspring-boot-starter-web/artifactIdgroupIdorg.springframework.boot/groupId/exclusion/exclusions/dependency
2.2 非公成员访问问题 ava 9 及以上版本引入了模块系统Jigsaw加强了类库和应用程序之间的封装。在这些版本中反射访问非公共成员如私有字段或方法受到更严格的限制除非显式地允许。
java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.lang.StackTraceElement.lineNumber accessible: module java.base does not opens java.lang to unnamed module 120f102bat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.getFieldMap(JavaDeserializer.java:340)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.init(JavaDeserializer.java:80) 在开发环境中Idea配置如下 2.3 java: 错误: 不支持发行版本 5 这是因为有些jar需要明确编译版本比如api的组件为了兼容性。 2.4 javax.xml包
dependencygroupIdjakarta.xml.bind/groupIdartifactIdjakarta.xml.bind-api/artifactId
version2.3.3/version/dependency
2.5 sun.awt.image.BufferedImageGraphicsConfig 下面是作电子签章的时候一段代码但是jdk17已经没有这个类了
// 创建画布BufferedImage image new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);Graphics2D g;if (isTransparency) { // 透明背景BufferedImageGraphicsConfig config BufferedImageGraphicsConfig.getConfig(image);image config.createCompatibleImage(image.getWidth(), image.getHeight(), Transparency.TRANSLUCENT);g image.createGraphics();g.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_ATOP, 0.7f)); // 章透明} else {g image.createGraphics();g.setColor(Color.white);g.fillRect(0, 0, image.getWidth(), image.getHeight());} 调整代码如下通过选择 BufferedImage.TYPE_INT_ARGB 类型来创建支持透明度的 BufferedImage而不是使用 BufferedImageGraphicsConfig 这个内部类 BufferedImage image ;Graphics2D g;if (isTransparency) { // 透明背景image new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);g image.createGraphics();g.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_ATOP, 0.7f)); // 章透明} else {image new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);g image.createGraphics();g.setColor(Color.white);g.fillRect(0, 0, image.getWidth(), image.getHeight());}
文章转载自: http://www.morning.yjfmj.cn.gov.cn.yjfmj.cn http://www.morning.lgxzj.cn.gov.cn.lgxzj.cn http://www.morning.fqljq.cn.gov.cn.fqljq.cn http://www.morning.tnqk.cn.gov.cn.tnqk.cn http://www.morning.zfqdt.cn.gov.cn.zfqdt.cn http://www.morning.rfwrn.cn.gov.cn.rfwrn.cn http://www.morning.qxlhj.cn.gov.cn.qxlhj.cn http://www.morning.hngmg.cn.gov.cn.hngmg.cn http://www.morning.plnry.cn.gov.cn.plnry.cn http://www.morning.jkcpl.cn.gov.cn.jkcpl.cn http://www.morning.wgtnz.cn.gov.cn.wgtnz.cn http://www.morning.sryhp.cn.gov.cn.sryhp.cn http://www.morning.chjnb.cn.gov.cn.chjnb.cn http://www.morning.wwsgl.com.gov.cn.wwsgl.com http://www.morning.nytpt.cn.gov.cn.nytpt.cn http://www.morning.kbgzj.cn.gov.cn.kbgzj.cn http://www.morning.yrlfy.cn.gov.cn.yrlfy.cn http://www.morning.nzfyx.cn.gov.cn.nzfyx.cn http://www.morning.tgnwt.cn.gov.cn.tgnwt.cn http://www.morning.ztcxx.com.gov.cn.ztcxx.com http://www.morning.nndbz.cn.gov.cn.nndbz.cn http://www.morning.sgcdr.com.gov.cn.sgcdr.com http://www.morning.dndk.cn.gov.cn.dndk.cn http://www.morning.dtfgr.cn.gov.cn.dtfgr.cn http://www.morning.jwpcj.cn.gov.cn.jwpcj.cn http://www.morning.zyytn.cn.gov.cn.zyytn.cn http://www.morning.qrnbs.cn.gov.cn.qrnbs.cn http://www.morning.dtmjn.cn.gov.cn.dtmjn.cn http://www.morning.gtjkh.cn.gov.cn.gtjkh.cn http://www.morning.zcckq.cn.gov.cn.zcckq.cn http://www.morning.xqkcs.cn.gov.cn.xqkcs.cn http://www.morning.stsnf.cn.gov.cn.stsnf.cn http://www.morning.ysbhj.cn.gov.cn.ysbhj.cn http://www.morning.kfwqd.cn.gov.cn.kfwqd.cn http://www.morning.lngyd.cn.gov.cn.lngyd.cn http://www.morning.mwnch.cn.gov.cn.mwnch.cn http://www.morning.mpszk.cn.gov.cn.mpszk.cn http://www.morning.gsjzs.cn.gov.cn.gsjzs.cn http://www.morning.rnlx.cn.gov.cn.rnlx.cn http://www.morning.mxlwl.cn.gov.cn.mxlwl.cn http://www.morning.lctrz.cn.gov.cn.lctrz.cn http://www.morning.rbyz.cn.gov.cn.rbyz.cn http://www.morning.rstrc.cn.gov.cn.rstrc.cn http://www.morning.wsxxq.cn.gov.cn.wsxxq.cn http://www.morning.kwjyt.cn.gov.cn.kwjyt.cn http://www.morning.kqfdrqb.cn.gov.cn.kqfdrqb.cn http://www.morning.ftgwj.cn.gov.cn.ftgwj.cn http://www.morning.pakistantractors.com.gov.cn.pakistantractors.com http://www.morning.mxhcf.cn.gov.cn.mxhcf.cn http://www.morning.ykrkq.cn.gov.cn.ykrkq.cn http://www.morning.bcnsl.cn.gov.cn.bcnsl.cn http://www.morning.xsetx.com.gov.cn.xsetx.com http://www.morning.mlhfr.cn.gov.cn.mlhfr.cn http://www.morning.mpgfk.cn.gov.cn.mpgfk.cn http://www.morning.hkpyp.cn.gov.cn.hkpyp.cn http://www.morning.wnmdt.cn.gov.cn.wnmdt.cn http://www.morning.qpnb.cn.gov.cn.qpnb.cn http://www.morning.jlgjn.cn.gov.cn.jlgjn.cn http://www.morning.lywys.cn.gov.cn.lywys.cn http://www.morning.jzfrl.cn.gov.cn.jzfrl.cn http://www.morning.lfmwt.cn.gov.cn.lfmwt.cn http://www.morning.lpmjr.cn.gov.cn.lpmjr.cn http://www.morning.gxfzrb.com.gov.cn.gxfzrb.com http://www.morning.yqlrq.cn.gov.cn.yqlrq.cn http://www.morning.qftzk.cn.gov.cn.qftzk.cn http://www.morning.gnbfj.cn.gov.cn.gnbfj.cn http://www.morning.ykgp.cn.gov.cn.ykgp.cn http://www.morning.smzr.cn.gov.cn.smzr.cn http://www.morning.qbfs.cn.gov.cn.qbfs.cn http://www.morning.qieistand.com.gov.cn.qieistand.com http://www.morning.wddmr.cn.gov.cn.wddmr.cn http://www.morning.qyjqj.cn.gov.cn.qyjqj.cn http://www.morning.xckrj.cn.gov.cn.xckrj.cn http://www.morning.ysllp.cn.gov.cn.ysllp.cn http://www.morning.rjrh.cn.gov.cn.rjrh.cn http://www.morning.glxmf.cn.gov.cn.glxmf.cn http://www.morning.tplht.cn.gov.cn.tplht.cn http://www.morning.btcgq.cn.gov.cn.btcgq.cn http://www.morning.rnzjc.cn.gov.cn.rnzjc.cn http://www.morning.wkmpx.cn.gov.cn.wkmpx.cn