spring-test依赖包 <!--Spring-test --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-test --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version&g…
Error:Failed to crunch file D:\Englis_installation_directory\AndroidStudio\AndroidWorkSpace\YoukAndroidApp\code\EduYiKeTang\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\res\drawable-xhdpi-v4\abc_textfield_search_activa…
科普篇 来自百度百科:Solr简介Solr是一个基于Lucene的Java搜索引擎服务器.Solr 提供了层面搜索.命中醒目显示并且支持多种输出格式(包括 XML/XSLT 和 JSON 格式).它易于安装和配置,而且附带了一个基于 HTTP 的管理界面.Solr已经在众多大型的网站中使用,较为成熟和稳定.Solr 包装并扩展了 Lucene,所以Solr的基本上沿用了Lucene的相关术语.更重要的是,Solr 创建的索引与 Lucene 搜索引擎库完全兼容.通过对 Solr 进行适当的配置,…
最近公司的项目和自己的项目中都用到了spring集成junit进行单元测试,总结一下几种基本的用法: 1.直接对spring中注入的bean进行测试(以DAO为例): 在测试类上添加@RunWith注解指定使用springJunit的测试运行器,@ContextConfiguration注解指定测试用的spring配置文件的位置 之后我们就可以注入我们需要测试的bean进行测试,Junit在运行测试之前会先解析spring的配置文件,初始化spring中配置的bean @RunWith(Spri…
spring junit 做单元测试,报 Failed to load ApplicationContext 错误. 查找了好一会,最后发现.@ContextConfiguration(locations = { "classpath:/spring/applicationContext.xml","classpath:/spring/app-config.xml", …… 改成 @ContextConfiguration(locations = { "c…
一.背景 其实很早的时候,就在项目中有使用到shiro做登陆认证,直到今天才又想起来这茬,自己抽空搭了一个spring+springmvc+mybatis和shiro进行集成的种子项目,当然里面还有很简单的测试.本文将讲述在maven下如何进行集成,希望对你有所帮助,喜欢请推荐.至于shiro相关的,最近也会写几篇介绍的,希望能够有一个主观的了解. 二.集成步骤 说明:关于spring+springmvc+mybatis的集成请移步另一篇博客:Spring+SpringMvc+Mybatis框架…
Spring系列之注解配置 Spring是轻代码而重配置的框架,配置比较繁重,影响开发效率,所以注解开发是一种趋势,注解代替xml配置文件可以简化配置,提高开发效率 你本来要写一段很长的代码来构造一个Beam对象,但是如果使用注解的话只要使用一个注解符号即可 下面我们来讲讲一些经常使用的注解符号 @Component 使用类上用于实例化Bean @Controller 使用web层类上用于实例化Bean @Service 使用在Service层类上用于实例化service @Repository…
创建maven项目后,毫不犹豫,超简单傻瓜式搞定dependencies(pom.xml 就是maven的依赖管理),这样你就有了所有你要的包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.…
http://blog.sina.com.cn/s/blog_43eb83b90102ds8w.html ClientAbortException 异常解决办法 当我们用Servlet导出图片,或用JSP导出excel时,会弹出一个下载窗口,这时不点下载而点取消,则报下面的异常:ClientAbortException  Caused by: java.net.SocketException: Connection reset by peer: socket write error 在网上查找了…
启动SpringCloud微服务,RabbitMQ报如下异常: 2019-08-12 18:15:49.543 ERROR 53096 --- [68.252.131:5672] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED -…
redis 异常解决办法 26069:M 08 Aug 17:06:58.858 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 26069:M 08 Aug 17:06:58.859 # Server started, Redis version 3.0.7 26069:M 08…
body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI",Tahoma,Helvetica,Sans-Serif,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLiU,serif; font-size: 10.5pt; line-height: 1.5;}…
Android HttpURLConnection.connect找不到源  HttpURLConnection连接失败 HttpURLConnection.connect IO异常 解决办法 以下代码为正常的Android访问PC本地电脑的Get请求,因为Android与PC不是同一设备,因此PC端不能使用localhost或者127.0.0.1等方式 需要使用内网或者外网IP地址进行访问,输入cmd:ipconfig即可查看PC端内网地址 但是以下代码虽然是毫无问题的,但是还是无法建立连接.…
PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决方法: yum -y install libxslt-devel 2.configure: error: Could not find net-snmp-config binary. Please check your net-snmp installa…
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session异常解决办法 为什么还会说已经存在相同的session了呢.然后每次将项目重启后第一次编辑的时候问题不会触发,只有当第二次操作的时候才会出现这个问题. 解决办法:关闭session.好好检查操作完成后有没有关闭会话.…
hadoop 集群常见错误解决办法 hadoop 集群常见错误解决办法: (一)启动Hadoop集群时易出现的错误: 1.   错误现象:Java.NET.NoRouteToHostException: No route to host.    原因:master服务器上的防火墙没有关闭.    解决方法: 在master上关闭防火墙: chkconfig iptables off. 2.    错误现象:org.apache.hadoop.ipc.RPC: Server at JMN/10.2…
ArchLinux--使用WINE-TIM头像异常解决办法 当使用WINE-TIM头像图片加载异常时,执行以下命令 sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 执行完毕重启TIM 写在最后 如果文档对你有帮助的话,请点击一下 推荐按钮 ,你的点击是我…
一.JUnit介绍 JUnit是Java中最有名的单元测试框架,用于编写和运行可重复的测试,多数Java的开发环境都已经集成了JUnit作为单元测试的工具.好的单元测试能极大的提高开发效率和代码质量. 测试类命名规则:被测试类+Test,如UserServiceTest测试用例命名规则:test+用例方法,如testGet Maven导入junit.sprint-test .json-path相关测试包,并配置maven-suerfire-plugin插件,编辑pom.xml <dependen…
在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 [plain] view plaincopy org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [com/…
1.程序中有Junit环境2.导入一个jar包.spring与junit整合jar包 spring-test-3.2.0.RELEASE.jar3.测试代码 @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="classpath:applicationContext.xml") public class SpringTest { @Autowired private UserService u…
在程序员生涯当中,提到最多的应该就是SSH三大框架了.作为第一大框架的Spring框架,我们经常使用. 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉. 一.找不到配置文件的异常 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [com/herman/ss/controller]; …
楼主今天在学习SpringBoot集成thymelaf的时候报了中文乱码的错误,经过网上的搜索,现在得到解决的办法,分享给大家: package com.imooc.config; import org.springframework.beans.BeansException; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context…
tomat在linux服务器上启动报The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_26/jre/lib/i386/server:/usr/local/jdk1.6.0_26/jre/lib/i386:/usr/local…
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind 此异常的原因是服务器端口被占用 所以解决办法是: 一:更改服务器的端口号: 二:关闭占用当前端口的进程 下边介绍第二种方法 1.首先进入命令行 查看端口是否被占用 使用命令: netstat -ano 我的服务器的端口是443 此端口已被PID为3432的进程占用 2.查看该PID为 3432 的进程 使用命令:tasklist|findstr "3…
1.问题回顾 按照ip2region项目的官方集成到springboot项目后,运行测试一切都ok,没有任何问题.但是当项目打成可执行的jar包后再运行,却显示找不到ip2region.db,无法找到资源文件的错误.异常代码如下: java.io.FileNotFoundException: class path resource [ip2region/ip2region.db] cannot be resolved to absolute file path because it does n…
1. 编译时出现/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searching for -lz PLATFORM_VERSION_CODENAME=AOSPPLATFORM_VERSION=AOSPTARGET_PRODUCT=genericTARGET_BUILD_VARIANT=engTARGET_SIMULATOR=TARGET_BUILD_TYPE…
原文网址:http://blog.sina.com.cn/s/blog_465bcfba01000ds7.html 1月30日java.util.ConcurrentModificationException异常(转)1. 今天在写一个带缓存功能的访问代理程序时出现了java.util.ConcurrentModificationException异常, 因为该异常是非捕获型异常而且很少见,所以费了些时间才找到问题所在,原来在通过Iterator进行遍历的时候,如果直接对HashMap进行操作后…
1.java.io.FileNotFoundException: Could not open ServletContext resource不能加载ServletContext的用法是配置到web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns=&quo…
org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="login" 原因: Spring Boot项目渲染html的时候,因默认使用是Thymeleaf模板引擎,遇到不闭合标签报错,日常在编写HTML代码时,一般标签都是闭合的,容易忽略的标签包括<meta/>, <link/>, <br/>, <hr/>等等 解决办法:…
原因:如果spring-quartz.xml文件,在Spring的配置文件spring-config.xml中被加载,那么定时任务会被Spring和SpringMVC扫描两次,所以会被执行两次. 解决办法:把spring-quartz.xml文件放在web.xml文件中加载. <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring…