Gradle - Execution failed for task 'sonarAnalyze' - java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String


beginner99
HOME » Java

I have this error when running sonar with my gradle build script.


gradle sonarAnalyze


15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter]
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarAnalyze'.
15:41:02.934 [ERROR] [org.gradle.BuildExceptionReporter] > java.util.ArrayList cannot be cast to java.lang.String
My sonar
sonar {
server {

Related to : Gradle - Execution failed for task 'sonarAnalyze' - java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
Gradle - Execution failed for task 'sonarAnalyze' - java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
Java

I have this error when running sonar with my gradle build script.


gradle sonarAnalyze


15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter]
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarAnalyze'.
15:41:02.934 [ERROR] [org.gradle.BuildExceptionReporter] > java.util.ArrayList cannot be cast to java.lang.String
My sonar
sonar {
server {

java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List
23/11/2014 10:00 am Java

I have a List, which I am trying to use in 2 different ways...

private List<List<List<String>>>
mListSelectedsWeekDAY;

// technique 1
for(int t = 0; t < mListSelectedsWeekDAY.get(0).get(0).size();t++){
    ...
}

// technique 2
List<String> tmpList = mListSelectedsWeekDAY.get(0).get(0);

And my list is populated like this...

mListSelectedsSDAY = new
ArrayList<List<List<String>>>(); 
for (int i = 0; i < mListTimeBand.size(); i++) { 
    List<List<String>> tmp2 = new
ArrayList<List<String>>(); 
    for (int j = 0; j <
mListTimeBand.get(i).getTimeBandDefList().getTimeBandDefini().size();
j++) { 
        List<String> tmp1 = new ArrayList<String>(); 
        if
(mListTimeBand.get(i).getTimeBandDefList().getTimeBandDefini().get(j).isAllSpeci‌​alDays())
{ 
            for (int t = 0; t < mListSDayType.size(); t++) { 
                tmp1.add(mListSDayType.get(t).getSpecialDayName()); 
            } 
        }
        tmp2.add(tmp1); 
    }

    mListSelectedsSDAY.add(tmp2); 
}

However my code it always giving the following error...

java.lang.ClassCastException: [Ljava.lang.String; cannot be
cast to java.util.List

Could someone please help me understand why this is happening.


Retrieving SQL enum causes java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.String
Java

I have a query like this


Query importQuery = advertiserDao.getEntityManager().createNativeQuery(
"select matching_type from group_key where key_id = " + Key.getkeyId());
String match = (String) importQuery.getSingleResult();

The matching_type is a enum('good', 'bad', 'repared') type. This gives an exception as following:


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

What does it mean, the actual value is a string. How can I solve this?


swap! atom and then: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
Java

So, in my core.clj file I have:


(def page-buffer (BufferedReader. (InputStreamReader. (clojure.java.io/input-stream (clojure.java.io/resource "mitochondria.html")))))
(def parsed-page (atom ""))

and then later:


(defn -main [& args]
(let [port (Integer/parseInt (first args))]
(swap! parsed-page (with-open []
(.toString (reduce #(.append %1 %2)
(StringBuffer.) (line-seq page-buffer)))))
(println "Server is starting")
(println "port: " port)
(run-server port)))



HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .