
Java
雪漠山堂
这个作者很懒,什么都没留下…
展开
-
ERROR i.g.i.ManagedChannelOrphanWrapper Make sure to call shutdown()/shutdownNow()
在使用gRPC通讯时,遇到了问题,每个方法内初始化调用后未正确关闭,导致错误出现,必须正确使用shutdown()正确关闭。解决方案是在 catch 或 finally 块中使用shutdown()关闭订阅者。原创 2023-02-17 14:05:54 · 1824 阅读 · 1 评论 -
解决Chrome中调试JS提示“Uncaught (in promise) TypeError: Cannot use ‘in‘ operator to search for ‘”错误信息问题
使用Echarts-java类库在后端成功处理数据返回给前端时,报错Uncaught (in promise) TypeError: Cannot use 'in' operator to search for ' 最后查询得知服务端返回的json数据ConcentrationList,前端接收到这个json格式的字符串不可以直接用,要用JSON.parse()或$.parseJSON()处理成一个json对象才可以我使用的JSON.parse处理后页面显示正常。...原创 2022-07-07 16:45:02 · 4769 阅读 · 0 评论 -
There is no getter for property named ‘client_id‘ in ‘class com.aaa.model.device‘
关于 Java项目运行时,MyBatis出现There is no getter for property named 'client_id' in 'class com.aaa.model.实例类'错误。经过检查实体类并与数据表比较,发现在deviceMapper.xml代码中出错具体错误位置是下图所示,修改#{client_id,jdbcType=VARCHAR}为#{clientId,jdbcType=VARCHAR}我的原因是代码生成器中自动生成与数据表一致的字段名,导致原创 2022-02-15 16:16:18 · 868 阅读 · 0 评论 -
Type handler was null on parameter mapping for property ‘params‘. It was either not specified and/or
Java 项目出现Type handler was null on parameter mapping for property 'params'.原创 2022-02-15 11:14:40 · 8334 阅读 · 0 评论 -
解决Spring Boot 读取yml配置文件 属性为NULL的问题
搜索网上的各种解决方法,使用过配置类中添加@Component@ConfigurationProperties(prefix="myProps")原创 2021-06-17 14:37:13 · 7100 阅读 · 0 评论 -
Invalid bound statement (not found)解决方法
maven-springboot项目错误信息:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):是因为Mapper.xml文件没有正确映射导致的,在各使用项目和引用项目的pom.xml文件中添加如下配置代码即可:<build> <resources> <resource> <directory>src/main/j...原创 2021-01-06 11:58:51 · 2332 阅读 · 0 评论 -
静态方法调用spring注入的service类问题
问题:1.在静态方法中调用@Autowired或@Resource注解的Spring注入的service的方法问题。分析:1.首先,静态方法中不可调用非静态方法,这与JVM加载类的机制有关。2.spring自动注入,使用spring框架的很常用如果在静态方法中调用此注入类的方法,发现注入为'null';原因不是spring未注入,而是被static方法给'清空'了。解...转载 2019-12-30 16:15:38 · 451 阅读 · 0 评论 -
Java获取当前时间前24小时时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:00:00");//时间格式化 Calendar calendar=Calendar.getInstance(); Date date=new Date(); calendar.setTime(date);for(int i=0;...原创 2019-12-18 19:15:29 · 8069 阅读 · 2 评论 -
Parameter '****' not found. Available parameters are [0, 1, param1, param2]
传入多个值时,mybatis会自动将这些值转成类似map形式的值,以0,1,2…的序列为keyName。这里我们需要先简单了解一下mybatis的传值机制。Mybatis现在可以使用的parameterType有基本类型和Java负责类型基本数据类型:包含int,String,Date等。基本数据类型作为传参,只能传入一个。通过#{参数名}获取。复杂数据类型:包含Java实体类、Map...原创 2019-12-18 19:12:39 · 232 阅读 · 0 评论 -
Maven:Missing artifact com.sun:tools:jar:1.8.0
解决办法:在项目的partent的pom.xml中添加<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.8</version>...原创 2019-11-15 15:12:12 · 519 阅读 · 0 评论 -
Description Resource Path Location Type The project was not built since its
Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解觉方法:右击项目——>属性(Properties)——>找到Build Java Path——>右边有libraries选项,...原创 2019-11-14 16:42:37 · 4832 阅读 · 1 评论 -
Exception encountered during context initialization - cancelling refresh attempt org.springframewo
[11/04 15:02] Exception encountered during context initialization - cancelling refresh attemptorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactor...原创 2019-11-04 15:56:00 · 3074 阅读 · 0 评论 -
Shiro报错No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.
No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.启动项目报上述错误经查询是与...原创 2019-10-27 12:31:56 · 702 阅读 · 0 评论 -
Maven 运行项目报错Please ensure you are using JDK 1.4 or above and not a JRE In most cases you can change
在eclipse下用maven编译时,很有可能出现以下错误:Please ensure you are using JDK 1.4 or above andnot a JRE (the com.sun.tools.javac.Main class is required).//请确保您使用的是JDK 1.4或以上版本不是一个JRE(com.sun.tools.javac。主类是必需...原创 2019-10-24 11:58:01 · 447 阅读 · 1 评论 -
Eclipse配置mybatis-generator插件的2种方法
最近在做一个Mybatis的项目,学习到了一个插件mybatis-generator,即mybatis代码生成器,eclipse的配置方式有2种:离线和在线,2种方法我都尝试了,过程很波折,下面记录下自己的倒腾过程。离线安装第一步:下载Mybatis Generator插件将features和plugins这2个文件夹放到eclipse的安装目录下面,重启后即可第二步:验证是否配...转载 2019-10-22 16:35:57 · 209 阅读 · 0 评论 -
maven项目出错:One or more constraints have not been satisfied
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本文链接:https://blog.youkuaiyun.com/feinifi/article/details/81050636当我们在Eclipse中通过maven向导构建maven web项目后,一般需要修改一些环境变量。如果jdk使用的是1.8,那么我们需要设置buildpath,还需要修改Pr...转载 2019-10-21 16:50:08 · 383 阅读 · 0 评论 -
解决Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0问题
当我们项目中用到的数据库为sql server时 我们一般在maven项目的pom.xml只添加依赖:<dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>...转载 2019-10-21 15:56:04 · 8610 阅读 · 0 评论 -
Unparseable date: "2018-05-02"(SimpleDateFormat)格式问题
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); if (!begin_time.equals("")) { Date date = null; try { date = format.parse(begin_time); } catch (ParseException e...原创 2018-05-30 14:32:48 · 6987 阅读 · 0 评论