Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:maven-resources-test:twitter_storm_new: java.lang.NegativeArraySizeException

I'm trying to run a storm topology using intellij. Up until today, the topology ran perfectly fine but today everytime I try to run it I keep getting the following error:

Error:maven-resources-test:twitter_storm_new: java.lang.NegativeArraySizeException

Can anyone tell if there is a way to resolve it and how?

Here's my code for the topology:

public class AuthorsAndFeaturesTopology {
   public static final String PATH_TO_AUTHORS_AND_FEATURES_FILE="/home/christina/twitter_storm_new/CSV/features.csv";
public static final String PATH_TO_AUTHORS_AND_NEW_FEATURES_FILE="/home/christina/twitter_storm_new/CSV/featuresnew.csv";

public static final String keyword1="#blacklivesmatter";
public static final String keyword2="#germanwings";
public static final String keyword3="#bigdata";

public static void main(String[]args ) throws Exception {
    TopologyBuilder topologyBuilder = new TopologyBuilder();

    //topologyBuilder.setSpout("PROCESS_AUTHORS_AND_FEATURES_FILE", new ProcessAuthorsAndFeaturesFromCSVFileSpout(PATH_TO_AUTHORS_AND_FEATURES_FILE,keyword1,keyword2,keyword3),4);




    Config config = new Config();
    if (args != null && args.length > 0) {
        config.setNumWorkers(10);
        config.setMaxSpoutPending(100);
        StormSubmitter.submitTopology(args[0], config, topologyBuilder.createTopology());
    } else {
        LocalCluster localCluster = new LocalCluster();
        localCluster.submitTopology("Test", config, topologyBuilder.createTopology());
        Utils.sleep(2*10000);
        localCluster.killTopology("Test");
        localCluster.shutdown();
    }
  }
}
like image 603
cy_sar_0001 Avatar asked Nov 27 '22 04:11

cy_sar_0001


1 Answers

I just hit similar error with maven-resources-test:...:java.lang.NegativeArraySizeException but I haven't found any solution anywhere.

Maven compile worked ok, only build from IntelliJ was throwing such error.

Tried to:

  • maven clean - didn't help
  • invalidating cache and restart - didn't help
  • removing whole .idea folder and iml files and creating project again - didn't help
  • change codebase to older - didn't help - reverted
  • removing test folder - didn't help - reverted

What solved my issue was Build->Rebuild Project (maybe together with some of above)

like image 72
Gregzki Avatar answered Mar 15 '23 18:03

Gregzki