
JAVA
紫气东来_999
传统武术爱好者
展开
-
Error:(3, 32) java: 程序包org.springframework.boot不存在
mvn -U idea:idea原创 2022-07-26 14:17:50 · 986 阅读 · 1 评论 -
java.lang.OutOfMemoryError: Java heap space 调整tomcat参数
修改catalina.bat找到:rem Guess CATALINA_HOME if not defined补充一行:set JAVA_OPTS=-Xms256m -Xmx1024m设置tomcat9w.exe中JAVA页签的两个参数如何设置PermSize:1. 双击tomcat9w.exe, Apache tomcat8 属性框将打开,选中Java tab。2. 在Java Options框中输入,如下格式的参数(数值大小根据需要设置,格式可以复制本经验格式原创 2022-01-10 14:39:26 · 650 阅读 · 0 评论 -
spring boot 发邮件 填坑指南
发送报错javamail could not connect to smtp host解决:在VM arguments中输入-Djava.net.preferIPv4Stack=true 【因为:用的jdk8默认使用IPV6,只要改为IPV4就能解决。】备注SMTP的配置也要正确:spring: mail: host: aa.bb.com.cn #发送邮件服务器 smtp.qq.com username: ehr@aa.bb.cn #发送邮件的邮箱地址 ...原创 2021-02-04 14:20:17 · 975 阅读 · 0 评论 -
idea 解决ava.lang.NoClassDefFoundError错误
再用360优化了一次磁盘之后,IDEA启动起来一个旧项目,突然打包报错了:java.lang.NoClassDefFoundError然后maven下 CLEAN也是报:java.lang.NoClassDefFoundError根据日志:10:13 Unable to import maven project: See logs for details最终发现问题是IDEA中的maven路径被改了:...原创 2020-09-17 10:25:35 · 2382 阅读 · 0 评论 -
spring boot 连接SQL SERVER 部署k8s docker环境后报错:Failed to configure a DataSource: ‘url‘ attribute is not
本机调试OK,但是部署DOCKER之后报错:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.一直以为是数据驱动JAR问题,后来验证了两点:1:spring boot 2.0之后,数据库连接SQL server用: <dependency> <g...原创 2020-07-29 11:40:38 · 989 阅读 · 1 评论 -
idea package 打包包含外部JAR
菜单:Build-Build Artifacts 选择:Build 或者 Rebuild然后再去右侧package备注PACKAGE参数:spring.profiles.active=prd2skip test原创 2020-07-16 14:35:25 · 483 阅读 · 0 评论 -
常用MAVEN 中镜像地址
<!--配置华为云Maven镜像--><mirror> <id>huaweicloud</id> <mirrorOf>*</mirrorOf> <url>https://mirrors.huaweicloud.com/repository/maven/</url></mirror> <mirror> <id>nexus-ali...原创 2020-06-16 17:21:46 · 3023 阅读 · 0 评论 -
清理C盘 移动idea缓存文件
C盘突然在开了几个IDEA大项目后,缩减剧烈。原来是缓存文件都放在了C盘。可以改动如下:原本的配置文件在idea的安装目录下的bin目录下的idea.properties直接打开进行修改成idea.config.path=D:/IntelliJIdea/configidea.system.path=D:/IntelliJIdea/systemidea.plugins.path=${idea.config.path}/pluginsidea.log.path=${...原创 2020-06-04 09:16:57 · 929 阅读 · 0 评论 -
GSON 字符串转java对象无法忽略大小写,只好使用ObjectMapper 方案
直接上代码// //直接GSON转换,并不能解决忽略大小写问题// HotelAccountSettlementInfo detail = gson.fromJson(str, HotelAccountSettlementInfo.class); //这样的方法被放弃 //Json字符串转为java对象 com.fasterx...原创 2020-04-01 11:15:08 · 2147 阅读 · 4 评论 -
JAVA 字符串分割固定长度
调用: zckbgdTable.setValue("NOTES", getSubStr(bill.getNoteS(),250,1));//100 0 备注 //up 调用SAP 出口报关单 函数:ZRFC_TRANSEXPORTCUSTOMDECLARE public static String[] str_split(String str, int length) { ...原创 2019-11-06 16:54:29 · 1335 阅读 · 0 评论 -
JAVA idea 封装JAR 并运行
运行:cd到指定目录:java -jarAutoGetToken.jar原创 2019-07-21 10:23:59 · 812 阅读 · 0 评论 -
idea 导入项目后 左侧文件夹为空的解决办法
点击File→Project Structure在弹出的界面选择Modules→+→import Module,然后选择你导入文件点击OK,选择导入类型next→勾选Search for projects recursively(递归寻找项目)→next→Finish最后选择根目录点击OK即可。最后看到项目修好了:...原创 2019-04-18 14:45:26 · 4794 阅读 · 1 评论 -
spring boot batch处理时 reader部分的处理(含 stream ,filter 等功能代替for循环,含Reduce(汇聚))
直接先上一段代码: try{ lastApName= resp0287.getTrans().getTransRs().getB2e0287Rs().stream() .filter((Resp_b2e0287.B2E0287_RS r) -> r.getTranstype().equals("003") )...原创 2018-11-13 08:49:22 · 1564 阅读 · 0 评论 -
QUARZ 设置每5分钟执行
QUARZ 设置每5分钟执行原创 2016-09-14 08:29:48 · 23355 阅读 · 1 评论 -
spring boot调用SAP RFC
//本地仓库引入JAR文件mvn install:install-file -DgroupId=com.sap -DartifactId=jco3 -Dversion=3.0.8 -Dpackaging=jar -Dfile=E:\work\springboot\jco\sapjco3.jar com.sap jco3 3.0.8原创 2016-09-14 10:14:07 · 5599 阅读 · 2 评论 -
idear tomcat端口占用无法启动。cmd下 netstat -ano ;然后任务管理器下删除对应的PID
idear tomcat端口占用无法启动。cmd下 netstat -ano ;然后任务管理器下删除对应的PID原创 2016-10-26 10:10:55 · 847 阅读 · 0 评论 -
spring boot 报错:Exception in thread "main" java.lang.NoSuchMethodError 根源在pom.xml引用的包中的JAR有冲突
Exception in thread "main" java.lang.NoSuchMethodError突然发现一个spring boot项目tomcat启动不起来了。目录下:mvn dependency:tree查看是不是有依赖的JAR包有冲突了重新一个一个加dependency加一个,运行一个小程序,确保TOMCAT能梳理启动原创 2016-10-19 10:30:03 · 4936 阅读 · 0 评论 -
JAVA 枚举类型 根据代码得到中文
package ymTest;/** * Created by dbmaster on 2017/1/6. */public class test1 { public static void main(String[]args) { System.out.println(Trantype.T01.toString()); System.out.原创 2017-01-09 16:47:48 · 9395 阅读 · 0 评论 -
spring boot 自动装配 及xstream XML转为JAVA对象注意补充:xstream.setClassLoader(this.getClass().getClassLoader());
两个类,互相调用又不需要实例化的时候。每个类都需要注入,否则用NEW的办法, @value初始化赋值会失败1:启动的时候要扫描好对应包@SpringBootApplication@ComponentScan({"CXF.ccb", "com.itg.b2e"})2:单独的类要加注解 @componet @Profile("dev")@Compon原创 2017-03-16 09:41:23 · 3524 阅读 · 0 评论 -
Spring boot @Test的时候需要设置 环境变量:spring.profiles.active = dev
Spring boot @Test的时候需要设置 环境变量:spring.profiles.active = dev原创 2017-01-23 17:07:44 · 14239 阅读 · 9 评论 -
tomcat 远程访问 403 解决
1:tomcat_user.xml补充: 2:修改 /webapps/manager/META_INF/context.xml文件 <!--注释这里,去除对访问权限的设置 <Valve className="org.apache.catalina.valves.Remote原创 2017-12-15 15:56:17 · 2661 阅读 · 0 评论 -
浦发银行 调用的一些技巧
浦发银行前置机配置很像工商银行。来回请求的XML居然要加密和解密。。。。。太不人性,太啰嗦了。调试了一下,终于OK了。记录几个过程: //浦发银行签名及解签名 public static InputStream send_sign( byte[] content,// String contentType原创 2018-01-16 17:22:21 · 2120 阅读 · 4 评论 -
spring boot 注释了@Component 之后,可以用构造函数传递参数,但是@Autowired 自动失效
附图:@Autowired 要放在前面传递变量过来的类中原创 2018-09-27 14:59:25 · 19438 阅读 · 0 评论 -
idea 设置条件断点
今天同事反馈网银取数少了打款人信息。只好断点调试,根据单号:120251969999414877999414877 去设置断点。核心就是去设置condition废话不多说,先上图:这样整好走到断点,停在了61行,变量整好为:120251969999414877999414877 ...原创 2018-10-09 09:43:11 · 1363 阅读 · 0 评论 -
spring boot 报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default p
** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.Your ApplicationContext is unlikely to start due to a @ComponentScan of the defau原创 2016-09-13 09:37:43 · 16234 阅读 · 6 评论