HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("sheet1"); sheet1.createRow(0).createCell((short) 0).setCellValue("AAAA");
sheet1.createRow(1).createCell((short) 0).setCellValue("BBBB");
sheet1.createRow(2).createCell((short) 0).setCellValue("CCCC");
HSSFName range = wb.createName();
range.setReference("sheet1!$A$1:$A$3");
range.setNameName("dicRange");
CellRangeAddressList regions = new CellRangeAddressList(0, 65535, 0, 0); DVConstraint constraint = DVConstraint.createFormulaListConstraint("dicRange");
HSSFDataValidation dataValidate = new HSSFDataValidation(regions,constraint);

HSSFSheet sheet2 = wb.createSheet("sheet2");
sheet2.addValidationData(dataValidate);
只要到sheet2.addValidationData(dataValidate)步就跳到InvocationTargetException.java是为什么
而且报错java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [excelFile] in the invocation stack. Check the <param name="inputName"> tag specified for this action不加sheet2.addValidationData(dataValidate);这句话就没事。