一.MyBatis相關
java.lang.NoClassDefFoundError: org/apache/ibatis/session/RowBounds
/*這個問題的原因是:在使用ssm框架時,在web端引入了pagehelper插件,刪除pagehelper即可,
若刪除後控制檯報異常,但不影響程序運行的話,可以將dao層的mybatis相關包引入到web端,
這樣就沒有異常了*/
二.響應問題
問題:註冊功能檢驗用戶名是否存在,請求響應碼爲302
原因:因爲沒有用戶登錄所以請求被攔截,修改攔截配置即可。
三.前端相關
flag=false;
//檢查用戶名是否已被註冊
$scope.checkUserExsit=function(){
sellerService.findOne($scope.entity.sellerId).success(
function(response){
if(response.sellerId!=null){
$scope.tip="用戶名已被註冊";
flag=false;
}else{
$scope.tip="用戶名可用";
flag=true;
}
}
);
}
//註冊
$scope.add=function(){
$scope.checkUserExsit();
setTimeout(function(){
if(flag){
sellerService.add( $scope.entity ).success(
function(response){
if(response.success){
location.href='shoplogin.html';
}else{
alert(response.message);
}
}
);
}else{
alert("請檢查輸入項");
}
},300);
}
問題:上述add方法執行時不按代碼順序來,總是先執行if語句再執行checkUserExsit()
原因:checkUserExsit()發送了一個ajax請求,需要響應時間,add方法本身爲異步操作,不會被上面的ajax請求阻塞,所以每次都是if()先執行,然後再執行了checkUserExsit();
四.緩存相關
問題:通過springdataredis設置的key,在客戶端查看時,key和value都帶有亂碼
解決:修改redis的配置文件如下
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="JedisConnectionFactory" />
<property name="keySerializer">
<bean class="org.springframework.data.redis.serializer.StringRedisSerializer"></bean>
</property>
<property name="valueSerializer">
<bean class="org.springframework.data.redis.serializer.StringRedisSerializer"></bean>
</property>
</bean>
五.Dubbo框架
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.pinyougou.page.service.ItemPageService. No provider available for the service com.pinyougou.page.service.ItemPageService from the url zookeeper://IP:2181/com.alibaba.dubbo.registry.RegistryService?application=pinyougou-manager-web&default.timeout=300000&dubbo=2.8.4&interface=com.pinyougou.page.service.ItemPageService&methods=genItemHtml&pid=15104&revision=0.0.1-SNAPSHOT&side=consumer×tamp=1552103055145 to the consumer 169.254.103.128 use dubbo version 2.8.4
原因:未檢測到所調用服務
解決:查看配置文件、包名類名是否配置正確
六.配置MavenProfile
Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字節的 UTF-8 序列的字節 3 無效。
方案一:在配置文件的註釋中出現了中文註釋和中文空格 ,將其刪除或改成英文註釋即可
方案二:檢查xml的頭文件和右鍵屬性裏面的編碼是否一致
方案三:嘗試在pom.xml加入如下配置:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>