1. 程式人生 > >出現java.lang.CharSequence cannot be resolved異常

出現java.lang.CharSequence cannot be resolved異常

  1. 我修改了專案的jdk包,改為jdk6,無效,可能是我的jdk6並沒有安到本地上。
  2. 我把專案的pom.xml中的jdk版本改為1.8,專案的jdk包改為1.8版本的,還修改了idea中setting裡對於專案的設定,繼續報錯:target\generated-sources \annotations does not exist -> [Help 1]

於是我建立了專案下的annotations檔案,重新install繼續報同樣的錯誤,我發現當我install的時候我建好的annotations檔案會消失,再觀察我其他專案annotations檔案都存在,我猜想是compiler-plugin版本的問題,於是修改了maven-compiler-plugin從老到新版本3.1,繼續報錯:

An API incompatibility was encountered while executing org.apache.maven.plugins:maven-complier-plugin:3.1 

3.因為我的complier-plugin是這樣配置的,猜想是org.codehaus.plexus包版本的問題,將其從低版本更新為2.5,再次打包,問題解決

4.我配置了idea的tomcat,準備執行專案,報錯:javax.servlet.http、archer.crazylab包找不到,最開始只看到javax.servlet.http找不到,我以為是tomcat配置的有問題,按照網上設定了之後還是不能解決,然後重新檢視錯誤資訊,再pom.xml中搜索archer.crazylab包,找到如下的pom.xml配置

5.我檢視專案的Libraries,發現好多需要的包沒有從倉庫匯入,仔細一看,maven這邊配置的還有問題,因為之前換過maven,可能在idea中沒配置好,重新配置idea中的maven設定,問題徹底解決。

總結,專案的jdk版本跟本地的jdk版本不對應,肯定是pom.xml中匯入的包版本有問題。

相關推薦

出現java.lang.CharSequence cannot be resolved異常

我修改了專案的jdk包,改為jdk6,無效,可能是我的jdk6並沒有安到本地上。 我把專案的pom.xml中的jdk版本改為1.8,專案的jdk包改為1.8版本的,還修改了idea中setting裡對於專案的設定,繼續報錯:target\generated-source

The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

it is miss ati refers () imp -s tar pre 問題描述 Exception in thread "main" java.lang.Error: Unresolved compilation problems: The t

[Error!]the type java.lang.object cannot be resolved. it is indirectly reference

MyEclipse 匯入專案時出現如下錯誤,檢查過,包的匯入都正常Error!]the type java.lang.object cannot be resolved. it is indirectly referenced from required .class files找了半天,才發現,原來是jdk

2類型轉換異常:Exception in thread "main" java.lang.ClassCastException:java.lang.Object cannot be cast to java.lang.Integer

cnblogs color pan rgs main string [] 類型 style public class TestException { public static void main(String[] args) { Object obj

連接Mysql時出現java.math.BigInteger cannot be cast to java.lang.Long問題

類型 spa integer 一個 lan jar包版本 連接 mysql8 family   今天遇見這樣一個坑。在連接數據庫進行查詢數據時,大家可能會遇見這樣一個問題:java.math.BigInteger cannot be cast to java.lang.Lo

“無效數字” ;java.lang.Integer cannot be cast to java.lang.String

現在 類型 bsp 字段 ann 不難 esc ger ring 今天頁面上突然查詢不出數據,大致的sql語句是 select xx ,xxx from table a where a.lrmb in ( 6101060033, 6101

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

protocol lang base arr ava ebs reat rac context 1、錯誤描寫敘述java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Str

在Servlet使用getServletContext()獲取ServletContext對象出現java.lang.NullPointerException(空指針)異常的解決辦法

是我 沒有 AS pre 代碼 erl fig post exceptio 今天遇到了一個在servlet的service方法中獲取ServletContext對象出現java.lang.NullPointerException(空指針)異常,代碼如下 //獲取Se

java.lang.Integer cannot be cast to java.lang.String

.com ger 調用 str 覆蓋 方法 pan 解決辦法 ava 錯誤原因是類型轉換! 說Integer 類型不能轉成String類型。 解決辦法:   將錯誤中的(String)強制轉換類型修改為 object.toString()   

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

在開發中,遇到這麼一個錯誤: 報錯的意思: Long 無法轉化成Integer型別. 網上的解釋是:     這裡在Hibernate2.0之前版本list.get(0)返回的是Integer型別.但是在Hibernate3.0以後版本list.ge

Cause: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.ibatis.mapping.MappedStatement

 我用的是pagehelper 4.2.0,利用其進行表單的分頁處理並進行展示,在第一次執行的時候能夠看到分頁後的結果,重新整理一下第二次就顯示不出來,控制檯出現:  Cause: java.lang.ClassCastException: java.lang.String cannot

java.lang.String cannot be cast to java.lang.Long at android.app.SharedPreferencesImpl.getLong(Share

今天在開發過程中遇到一個問題:從Git上拉下程式碼後,點選登入程式就崩潰了,而且是必現。貼下列印的Log 打碼的地方是公司程式碼中的包名,不影響顯示問題。 可以看到最關鍵的兩句: java.lang.ClassCastException: java.lang.Str

java lang ClassCastException java lang Integer cannot be ca

                1、錯誤描述java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String service.impl.ArrivalBillServiceImpl.exportBillExce

Android 報錯 Value br of type java.lang.String cannot be converted to JSONObject

博主是使用Android + php + apache + tomcat 做資料處理時出現的這個問題; 報錯內容:Value <br of type java.lang.String cannot be converted to JSONObject (因為CSDN文章標題不能有非法字

ArrayMap java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]

錯誤堆疊: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[] at android.support.v4.util.SimpleArra

Android開發中出現java.lang.IllegalStateException: Cannot perform this operation because the connection。。。

最近在開發一個 App 的時候用到了資料庫,可是在使用資料庫的時候就出現了一些問題,在我查詢表中的一些資訊時出現了一下問題: Caused by: java.lang.IllegalStateException: Cannot perform this operation because

java 錯誤:The type java.util.Comparator cannot be resolved. It is indirectly referenced from required

The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files 1、錯誤描述: 源專案編譯環境為jdk1.7 後來換成了jd

java.lang.Integer cannot be cast to java.lang.String Java int,double向String的轉化和String向int,double的轉換

 count=Integer.parseInt( (String)all.get(0)); 執行時報錯:java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String 解決方

java.lang.String cannot be cast to java.lang.Integer解決辦法

今天寫SSM框架時候,後臺介面報錯,控制檯輸出java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer,如下圖: 報錯原因是因為型別轉換錯誤,不能將String型別轉化成Intege

Exception:java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType

最近開始著手做一個專案,專案環境用的是spring4.2,struts2.3.1,hibernate4.3.0....一切都配置正常,所有的POJO類都佈置好。service層和dao層也抽取了,可是在測試的時候,竟然報以一個錯誤 ,java.lang.ClassCastException: java.lan