String类下的contains()方法报错

package cn.itcast_03;

/*

  • 判断功能:
  • boolean equals(Object obj):比较字符串的内容是否相同,区分大小写
  • boolean equalsIgnoreCase(String str):比较字符串的内容是否相同,忽略大小写
  • boolean contains(String str):判断大字符串中是否包含小字符串
  • boolean startsWith(String str):判断字符串是否是否以某个指定的字符串开头
  • boolean endsWith(String str):判断字符串是否以某个指定的字符串结尾
  • boolean isEmpty():判断字符串是否为空。
  • 注意:
  • 字符串内容为空和字符串对象为空。
  • String s = "";
  •  String s = null;
    

    */
    public class StringDemo {
    public static void main(String[] args) {
    // 创建字符串对象
    String s1 = "helloworld";
    String s2 = "helloworld";
    String s3 = "Helloworld";

    // boolean equals(Object obj):比较字符串的内容是否相同,区分大小写
    System.out.println("equals:" + s1.equals(s2));
    System.out.println("equals:" + s1.equals(s3));
    System.out.println("--------------------");
    
    // boolean equalsIgnoreCase(String str):比较字符串的内容是否相同,忽略大小写
    System.out.println("equals:" + s1.equalsIgnoreCase(s2));
    System.out.println("equals:" + s1.equalsIgnoreCase(s3));
    System.out.println("--------------------");
    
    // boolean contains(String str):判断大字符串中是否包含小字符串
    System.out.println(s1.contains("hello"));//这行报错 
    

    }
    }

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
The method contains(CharSequence) from the type String refers to the missing type CharSequence

at cn.itcast_03.StringDemo.main(StringDemo.java:35)

2个回答

我试了下你的代码没有问题,可以运行并得到正确结果。

修改看下是否是jdk的问题,http://blog.csdn.net/xl553488213/article/details/40512633

setXxx_getXxx
setXxx_getXxx 回复极简: 对我装的jdk1.8,可能就是这个原因
大约 3 年之前 回复

你可以关注下 ITIL先锋这个微信公众号 上面每天会更新IT行业最前沿资讯和各种类别的IT资料,感觉工作学习都比较有用

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
请问python中引起y contains previously unseen labels: 错误的可能原因都有什么?
``` import pandas as pd travel = pd.read_csv("travel insurance.csv", low_memory=False) def change(travel): string_colums_list = ['Agency','AgencyType','DistributionChannel','ProductName','Claim','Destination','Gender'] le = preprocessing.LabelEncoder() for string_colum in string_colums_list: le = le.fit(travel[string_colum].unique().tolist()) travel[string_colum] = le.transform(travel[string_colum].value_counts(dropna=False)) return travel change(travel) ``` 报错如下图![图片说明](https://img-ask.csdn.net/upload/201911/10/1573382107_492474.png) 由于csv中五千以上的数字只有index,我怀疑这是index,用travel.drop()删除了图中报错的那几行。结果再次报错,除最后一位数字由35119变成了35106之外其他没变。请问这有可能是哪里的错误?如何修复呢?
HashSet的remove方法报错问题求教
HashSet 包含某Object=true,但是remove该Object就报错。Object RecordNumber重写了toString hashCode equals 方法,估计是这里有问题。 请教如何解决HashSet的remove方法报错问题! 以下是代码,请帮忙测试更正remove报错问题,谢谢! import java.text.ParseException; import java.util.Date; //数据源 表名 时间 (记录数量) public class RecordNumber { public final static int CSUDF_SYS_CELL_HOUR_G = (int) 0; public final static int CSUDF_SYS_RTF_HOUR_G = (int) 1; public final static int CSUDF_SYS_GPROC_HOUR_G = (int) 2; private String OMC; private String TableName; private Date DateTime; public RecordNumber(String DataSource, String TableName, Date DateTime) { this.OMC = DataSource; this.TableName = TableName; this.DateTime = DateTime; } public String getOMC() { return this.OMC; } public String getTableName() { return this.TableName; } public Date getDateTime() { return this.DateTime; } public int getTableNameInt() { int x = 1000; if (TableName.equals("CSUDF_SYS_CELL_HOUR_G")) { x = (int) CSUDF_SYS_CELL_HOUR_G; } if (TableName.equals("CSUDF_SYS_RTF_HOUR_G")) { x = CSUDF_SYS_RTF_HOUR_G; } if (TableName.equals("CSUDF_SYS_GPROC_HOUR_G")) { x = CSUDF_SYS_GPROC_HOUR_G; } return x; } @Override public String toString() { return (this.OMC + "," + this.TableName + "," + this.DateTime); } @Override public boolean equals(Object o) { return (o instanceof RecordNumber) && toString().equals(((RecordNumber) o).toString()); } @Override public int hashCode() { int hash = 7; hash = 37 * hash + (this.OMC != null ? this.OMC.hashCode() : 0); hash = 37 * hash + (this.TableName != null ? this.TableName.hashCode() : 0); hash = 37 * hash + (this.DateTime != null ? this.DateTime.hashCode() : 0); return hash; } //单元测试 public static void main(String[] args) throws ParseException { java.text.DateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm"); RecordNumber rn = new RecordNumber("OMCSP9", "CSUDF_SYS_CELL_HOUR_G", df.parse("2010-10-26 07:00")); java.util.Set<RecordNumber> testSet = new java.util.LinkedHashSet<RecordNumber>(); testSet.add(rn); rn = new RecordNumber("OMCSP1", "CSUDF_SYS_CELL_HOUR_G", df.parse("2010-10-26 07:00")); testSet.add(rn); rn = new RecordNumber("OMCSP11", "CSUDF_SYS_CELL_HOUR_G", df.parse("2010-10-26 07:00")); testSet.add(rn); System.out.println(testSet.size()); for (RecordNumber x : testSet) { System.out.println(x); System.out.println("testSet包含该RecordNumber:" + testSet.contains(x)); testSet.remove(x); System.out.println(testSet.size()); } } } run: 3 OMCSP9,CSUDF_SYS_CELL_HOUR_G,Tue Oct 26 07:00:00 CST 2010 testSet包含该RecordNumber:true 2 Exception in thread "main" java.util.ConcurrentModificationException at java.util.LinkedHashMap$LinkedHash-terator.nextEntry(LinkedHashMap.java:373) at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384) at datatransfer.RecordNumber.main(RecordNumber.java:79) Java Result: 1 成功生成(总时间:0 秒)
java poi导出excel文档 后台报下标越界 但文档正常导出且损坏
public static SXSSFWorkbook createCSVUtil2(int startRow, String sheetName, SXSSFWorkbook wb, Map<String, List<CellModel>> cellListMap, Integer cellRowNum, List<LinkedHashMap> exportData, int[] columnWidth, int totalcolumn, GgreportingtemplateDto ggreportingtemplateDto, int countRow) throws Exception { // 设置表格名称 SXSSFSheet sheet = (SXSSFSheet) wb.createSheet(sheetName); sheet.trackAllColumnsForAutoSizing(); // 设置表格标题 一般都是第一行第一个格子 // 标题样式 if (ggreportingtemplateDto.getTitle() != null) { XSSFCellStyle cellStyleTitle = (XSSFCellStyle) wb.createCellStyle(); cellStyleTitle.setWrapText(true); SXSSFRow rowTitle = (SXSSFRow) sheet.createRow(0); XSSFFont fontTitle = (XSSFFont) wb.createFont(); fontTitle.setFontHeightInPoints((short) 16); cellStyleTitle.setFont(fontTitle); // 合并标题单元格 sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, totalcolumn - 1)); for (int i = 0; i < totalcolumn; i++) { if (i == 0) { SXSSFCell cell = (SXSSFCell) rowTitle.createCell(0); cell.setCellValue(ggreportingtemplateDto.getTitle()); cell.setCellStyle(cellStyleTitle); } else { SXSSFCell cell = (SXSSFCell) rowTitle.createCell(i); cell.setCellStyle(cellStyleTitle); } } } if (ggreportingtemplateDto.getCondition() != null) { // 设置筛选条件格子 一般是第二行第一列 // 条件样式 XSSFCellStyle cellStyleCondition = (XSSFCellStyle) wb.createCellStyle(); cellStyleCondition.setWrapText(true); SXSSFRow rowCondition = (SXSSFRow) sheet.createRow(1); XSSFFont fontCondition = (XSSFFont) wb.createFont(); fontCondition.setFontHeightInPoints((short) 16); cellStyleCondition.setFont(fontCondition); // 合并条件单元格 sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 4)); for (int i = 0; i < 4; i++) { if (i == 0) { SXSSFCell cell = (SXSSFCell) rowCondition.createCell(0); cell.setCellValue(ggreportingtemplateDto.getCondition()); cell.setCellStyle(cellStyleCondition); } else { SXSSFCell cell = (SXSSFCell) rowCondition.createCell(i); cell.setCellStyle(cellStyleCondition); } } } // 设置表格通用样式 XSSFCellStyle cellStyle = (XSSFCellStyle) wb.createCellStyle(); // 设置边框 // 设置单元格内容水平对齐 cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 设置单元格内容垂直对齐 cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER); // 设置自动换行 cellStyle.setWrapText(true); // 设置双边框 XSSFCellStyle cellStyleDouble = (XSSFCellStyle) wb.createCellStyle(); // 设置边框 // 设置单元格内容水平对齐 cellStyleDouble.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 设置单元格内容垂直对齐 cellStyleDouble.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER); // 设置自动换行 cellStyleDouble.setWrapText(true); // 合并单元格 for (int t = 0; t < cellRowNum; t++) { SXSSFRow row = (SXSSFRow) sheet.createRow(t + startRow); List<CellModel> cellNameList = cellListMap.get(String.valueOf(t)); for (CellModel cellModel : cellNameList) { // 如果被合并的元素只占用了一个单元格则不进行合并 if (cellModel.getStartColumn() == cellModel.getEndColumn() && cellModel.getEndRow() == cellModel.getStartRow()) { continue; } sheet.addMergedRegion(new CellRangeAddress(cellModel.getStartRow(), cellModel.getEndRow(), cellModel.getStartColumn(), cellModel.getEndColumn())); } // create的cell Set<Integer> create = new HashSet<Integer>(); for (int i = 0; i < cellNameList.size(); i++) { CellModel cellModel = cellNameList.get(i); // 遍历插入表头 SXSSFCell cell = (SXSSFCell) row.createCell(cellModel.getStartColumn()); // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); // 设置行高 if (i == 1) { row.setHeight((short) 500); } cellStyle.setFont(font); cell.setCellValue(cellModel.getCellName()); cell.setCellStyle(cellStyle); create.add(cellModel.getStartColumn()); } // 把所有没有create的cell都create for (int i = 0; i < totalcolumn; i++) { if (!(create.contains(i))) { // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); cellStyle.setFont(font); SXSSFCell cell = (SXSSFCell) row.createCell(i); cell.setCellStyle(cellStyle); } } } for (LinkedHashMap hashMap : exportData) { SXSSFRow rowValue = (SXSSFRow) sheet.createRow(cellRowNum + startRow); Iterator<Map.Entry> iteratorRow = hashMap.entrySet().iterator(); while (iteratorRow.hasNext()) { Map.Entry entryRow = iteratorRow.next(); Integer key = Integer.valueOf(entryRow.getKey().toString()); String value = ""; if (entryRow.getValue() != null) { value = entryRow.getValue().toString(); } else { value = ""; } SXSSFCell cellValue = (SXSSFCell) rowValue.createCell(key - 1); // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); cellValue.setCellValue(value); cellStyle.setFont(font); cellValue.setCellStyle(cellStyle); } cellRowNum++; } // 设置备注栏 List<String> reMarkList = ggreportingtemplateDto.getRemake(); if (reMarkList != null) { for (int i = 0; i < reMarkList.size() + 1; i++) { int rowNum = i + startRow + cellRowNum + 1; XSSFCellStyle cellStyleRemake = (XSSFCellStyle) wb.createCellStyle(); SXSSFRow rowRemake = (SXSSFRow) sheet.createRow(rowNum); XSSFFont fontRemake = (XSSFFont) wb.createFont(); fontRemake.setFontHeightInPoints((short) 8); cellStyleRemake.setFont(fontRemake); String cellValue = "Notes:"; // 合并条件单元格 if (i != 0) { sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, 4)); cellValue = reMarkList.get(i - 1); SXSSFCell cell = (SXSSFCell) rowRemake.createCell(0); cell.setCellValue(cellValue); cell.setCellStyle(cellStyleRemake); } else { SXSSFCell cell = (SXSSFCell) rowRemake.createCell(0); cell.setCellValue(cellValue); cell.setCellStyle(cellStyleRemake); } } } // 设置列宽 if (columnWidth != null) { for (int i = 0; i < columnWidth.length; i++) { sheet.setColumnWidth(i, columnWidth[i]); } } return wb; } 以上是我生成sheet表的内容 //exceptional Rpt public SXSSFWorkbook exceptionalRpt (GgreportingtemplateDto ggreportingtemplateDto, String startInputDate,String endInputDate) throws Exception { // 设置最大数据行数 SXSSFWorkbook wb = new SXSSFWorkbook(5050);//这里之前看到是说能设置这个表格最多能含有多少数据 Map<String, List<CellModel>> map = new HashMap<String, List<CellModel>>(); // 设置数据 // 第一级表头 List<CellModel> firstRow = new ArrayList<CellModel>(); CellModel cellModel1 = new CellModel(); // 总占用1行 Integer cellRow = 1; cellModel1.setCellName("Member English Name"); cellModel1.setStartRow(0); cellModel1.setEndRow(0); cellModel1.setStartColumn(0); cellModel1.setEndColumn(0); CellModel cellModel2 = new CellModel(); cellModel2.setCellName("Member Chinese Name"); cellModel2.setStartRow(0); cellModel2.setEndRow(0); cellModel2.setStartColumn(1); cellModel2.setEndColumn(1); CellModel cellModel3 = new CellModel(); cellModel3.setCellName("Staff No."); cellModel3.setStartRow(0); cellModel3.setEndRow(0); cellModel3.setStartColumn(2); cellModel3.setEndColumn(2); CellModel cellModel4 = new CellModel(); cellModel4.setCellName("HKID/Passport No."); cellModel4.setStartRow(0); cellModel4.setEndRow(0); cellModel4.setStartColumn(3); cellModel4.setEndColumn(3); CellModel cellModel5 = new CellModel(); cellModel5.setCellName("Sex"); cellModel5.setStartRow(0); cellModel5.setEndRow(0); cellModel5.setStartColumn(4); cellModel5.setEndColumn(4); CellModel cellModel6 = new CellModel(); cellModel6.setCellName("Plan Code"); cellModel6.setStartRow(0); cellModel6.setEndRow(0); cellModel6.setStartColumn(5); cellModel6.setEndColumn(5); CellModel cellModel7 = new CellModel(); cellModel7.setCellName("Plan Description"); cellModel7.setStartRow(0); cellModel7.setEndRow(0); cellModel7.setStartColumn(6); cellModel7.setEndColumn(6); CellModel cellModel8 = new CellModel(); cellModel8.setCellName("Effective Date"); cellModel8.setStartRow(0); cellModel8.setEndRow(0); cellModel8.setStartColumn(7); cellModel8.setEndColumn(7); CellModel cellModel9 = new CellModel(); cellModel9.setCellName("Status"); cellModel9.setStartRow(0); cellModel9.setEndRow(0); cellModel9.setStartColumn(8); cellModel9.setEndColumn(8); firstRow.add(cellModel1); firstRow.add(cellModel2); firstRow.add(cellModel3); firstRow.add(cellModel4); firstRow.add(cellModel5); firstRow.add(cellModel6); firstRow.add(cellModel7); firstRow.add(cellModel8); firstRow.add(cellModel9); map.put("0", firstRow); // 业务数据 List<LinkedHashMap> exportData = new ArrayList<LinkedHashMap>(); GuPolicyCopyItemMedgMembDto guPolicyCopyItemMedgMembDto = new GuPolicyCopyItemMedgMembDto(); List<GuPolicyCopyItemMedgMembDto> list = ServiceManager.prpall.getGuPolicyCopyItemMedgMembService().findALL(guPolicyCopyItemMedgMembDto, null);//这里查询出来是295条 //增加数据 用这端代码增加5000条数据 /*for (int i = 0; i < 5000; i++) { list.add((GuPolicyCopyItemMedgMembDto)list.get(0)); }*/ int countRow = 0; for (int i = 0; i < list.size(); i++) { GuPolicyCopyItemMedgMembDto data = (GuPolicyCopyItemMedgMembDto) list.get(i); LinkedHashMap<String,String> row = new LinkedHashMap<String,String>(); String struts = ""; String ename = ""; String cname = ""; String idno = ""; String staffno = ""; String sex = ""; String rationType = ""; String rationName = ""; String entryDate = ""; String chineseName = ""; String hKIDandPassportNo = ""; if(data.getFlag()==null||data.getFlag().equals("I")) { struts = "Add"; }else if(data.getFlag().equals("U")){ struts = "Amendment"; }else if(data.getFlag().equals("D")){ struts = "Deletion"; }else if(data.getFlag().equals("B")){ struts = "Cancellation"; } if(data.getClientEName() != null&&!(data.getClientEName().equals(""))) { ename = data.getClientEName(); } if(data.getClientCName() != null&&!(data.getClientCName().equals(""))) { cname = data.getClientCName(); } if(data.getIdNo() != null&&!(data.getIdNo().equals(""))) { idno = data.getIdNo(); } if(data.getStaffNo() != null&&!(data.getStaffNo().equals(""))) { staffno = data.getStaffNo(); } if(data.getSex() != null&&!(data.getSex().equals(""))) { sex = data.getSex(); } if(data.getRationType() != null&&!(data.getRationType().equals(""))) { rationType = data.getRationType(); } if(data.getRationName() != null&&!(data.getRationName().equals(""))) { rationName = data.getRationName(); } if(data.getEntryDate() != null) { entryDate = sim.format(data.getEntryDate()); } /*row.put("1", ""+ename+""); row.put("2", ""+cname+""); row.put("3", ""+staffno+""); row.put("4", ""+idno+""); row.put("5", ""+sex+""); row.put("6", ""+rationType+""); row.put("7", ""+rationName+""); row.put("8", ""+entryDate+""); row.put("9", ""+struts+"");*/ row.put("1", "1"); row.put("2", "2"); row.put("3", "3"); row.put("4", "4"); row.put("5", "5"); row.put("6", "6"); row.put("7", "7"); row.put("8", "8"); row.put("9", "9"); exportData.add(row); countRow++; } // 用于写入文件 // 列宽数组 int[] columnWidth = { 10000, 7500, 5000, 7500, 5000, 7500, 10000, 5000, 5000 }; // 报表标题 ggreportingtemplateDto.setTitle(null); List<String> remakeList = null; // 报表备注 ggreportingtemplateDto.setRemake(remakeList); ggreportingtemplateDto.setCondition(null); //数据分页 if(exportData.size()>5000) { double size = exportData.size(); double divisor = size/5000; int forNumber = (new Double(Math.ceil(divisor))).intValue(); for (int i = 0; i < forNumber; i++) { if((i+1)==forNumber) { List<LinkedHashMap> exportDataTemp = exportData.subList(0+(i*5000), exportData.size()-1); wb = this.createCSVUtil2(0, "Exceptional Rpt"+(i+1), wb, map, cellRow, exportDataTemp, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); }else { List<LinkedHashMap> exportDataTemp = exportData.subList(0+(i*5000), 5000+(i*5000 )); wb = this.createCSVUtil2(0, "Exceptional Rpt"+(i+1), wb, map, cellRow, exportDataTemp, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); } } }else { wb = this.createCSVUtil2(0, "Exceptional Rpt", wb, map, cellRow, exportData, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); } /*wb = this.createCSVUtil2(0, "Exceptional Rpt", wb, map, cellRow, exportData, columnWidth, columnWidth.length, ggreportingtemplateDto, 0);*/ return wb; } 一开始SXSSFWorkbook wb = new SXSSFWorkbook(5050)这里的值给的5000 ,然后当数据量大于5000时直接报错,文件不能正常导出,然后我把5000改成7000,会报错但是文件能导出,是损坏文件,一条数据都没有,后来修改成分页导出,自己测试的时候任然报了数组下标越界,且越界的下标为负值,文件能正常导出,但导出的文件显示已损坏,看不到数据。报错代码图片以上传,求大神解答,解答有效我微信转账请大神喝奶茶 java.lang.ArrayIndexOutOfBoundsException: -20527 at java.util.ArrayList.elementData(ArrayList.java:418) at java.util.ArrayList.get(ArrayList.java:431) at org.apache.poi.xssf.model.StylesTable.getFontAt(StylesTable.java:386) at org.apache.poi.xssf.usermodel.XSSFWorkbook.getFontAt(XSSFWorkbook.java:954) at org.apache.poi.xssf.streaming.SXSSFWorkbook.getFontAt(SXSSFWorkbook.java:857) at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:148) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.updateColumnWidth(AutoSizeColumnTracker.java:367) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.updateColumnWidths(AutoSizeColumnTracker.java:333) at org.apache.poi.xssf.streaming.SXSSFSheet.flushOneRow(SXSSFSheet.java:1892) at org.apache.poi.xssf.streaming.SXSSFSheet.flushRows(SXSSFSheet.java:1871) at org.apache.poi.xssf.streaming.SXSSFSheet.flushRows(SXSSFSheet.java:1882) at org.apache.poi.xssf.streaming.SXSSFWorkbook.write(SXSSFWorkbook.java:931) at com.sinosoft.application.platform.web.action.GgReportingTemplateAction.download(GgReportingTemplateAction.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sinosoft.application.common.BaseProcessAction.execute(BaseProcessAction.java:213) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:216) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:117) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.CAS_LANGUATE.doFilter(CAS_LANGUATE.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.sysframework.web.control.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.CompatibleFilter.doFilter(CompatibleFilter.java:29) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.ValidateSalt.doFilter(ValidateSalt.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:160) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.LoadSalt.doFilter(LoadSalt.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 此问题已解决,导致报错的原因是sheet.trackAllColumnsForAutoSizing();poi自动设置列宽的代码,注释这行之后问题解决。
C#用windows service 服务从云上下载照片,之前一直成功,后来报错如下
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. at System.Convert.FromBase64String(String s) 请问这个是什么原因引起的,之前一直是成功的,而且设置的是隔一段时间取一次,期间还有成功下载的,求原因 ?
Tomcat启动报错与HttpClient有关
**代码如下** @RequestMapping("/query") @ResponseBody public String getCount() { String LOGINURL = "http://ip/workspace/index.jsp?framed=true"; String HTTPURL = "http://ip/HyperionPlanning/servlet/HspLogOn"; HttpClient http = null; String userid = "admin"; String token = null; String sessionId = null; http = new DefaultHttpClient(); try { String url = LOGINURL + "&username=" + userid; HttpPost post = new HttpPost(url); // post.setHeader("HYPLOGIN", userid); HttpResponse response = http.execute(post); BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); StringBuffer result = new StringBuffer(); String line; while ((line = br.readLine()) != null) { result.append(line); } String string = result.toString(); // System.out.println(string); string = string.substring(0, 2500); // System.out.println(string); String regex = "sToken.*=.*\"(.+?)\";.*sCSRFToken"; Pattern p = Pattern.compile(regex); Matcher matcher = p.matcher(string); while (matcher.find()) { token = matcher.group(1); } post.abort(); // String mtoken = token.replace("\\n", "\\\n") + "="; // System.out.println(mtoken); HttpPost posthttp = new HttpPost(HTTPURL); List<NameValuePair> nvps = new ArrayList<NameValuePair>(); nvps.add(new BasicNameValuePair("Application", "FYCWYS")); nvps.add(new BasicNameValuePair("isContained", "true")); nvps.add(new BasicNameValuePair("isWorkspace", "true")); nvps.add(new BasicNameValuePair("LOCALE_LANGUAGE", "zh_CN")); nvps.add(new BasicNameValuePair("moduleid", "HyperionPlanning.planning.7")); nvps.add(new BasicNameValuePair("themeSelection", "BpmTadpole")); nvps.add(new BasicNameValuePair("upk_available", "false")); String mtoken = token.replace("\\n", "\\\n") + "="; nvps.add(new BasicNameValuePair("sso_token", mtoken)); posthttp.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); HttpResponse responseSession = http.execute(posthttp); posthttp.abort(); Header[] headers = responseSession.getHeaders("Set-Cookie"); for (Header header : headers) { if (header.toString().contains("SESSIONID")) { String str = header.toString(); // String reg = "Cookie:(.+?);.*path"; String reg = "JSESSIONID=(.+?);.*path"; Pattern pattern = Pattern.compile(reg); Matcher m = pattern.matcher(str); while (m.find()) { sessionId = m.group(1).trim(); } } } System.out.println(sessionId); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (UnsupportedOperationException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println(sessionId); return sessionId; } 启动tomcat 报错 Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/http/client/ClientProtocolException但是在public static void main(String[] args) { oaLoginLimitedServlet a=new oaLoginLimitedServlet(); System.out.println( "打印"+a.getCount()); }调用是正常的
springboot 整合mybatis 报错提示包扫描不进去
![图片说明](https://img-ask.csdn.net/upload/201908/14/1565777159_224084.png) ``` package com.liupeng; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication() @MapperScan(basePackages = "com.liupeng.mapper") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class,args); } } ``` ``` package com.liupeng.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.liupeng.mapper.UserMapper; import com.liupeng.pojo.User; @Service(value = "Userservice") public class UserServiceImpl implements Userservice { @Autowired private UserMapper userMapper; @Override public User getNamePassword(User user) { // TODO Auto-generated method stub return userMapper.selectgetNamePassword(user); } @Override public void saveUser(User user) { // TODO Auto-generated method stub } } ``` mapper.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.liupeng.mapper.UserMapper"> ``` ``` #------------------配置虚拟文件路径--start------------------------------ spring.http.multipart.location=E:\Java\java代码\Chaoyang\src\main\resources #-----------------------------------------数据库--start---------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Drive spring.datasource.url=jdbc:mysql://localhost:3306/ssm_mybatis?serverTimezone=GMT spring.datasource.username=root spring.datasource.password=liupeng.123 spring.datasource.druid.stat-view-servlet.allow=true #获取连接等待超时时间 spring.datasource.dbcp2.max-wait-millis=60000 #mybatis配置 mybatis.type-aliases-package=com.liupeng.pojo mybatis.mapper-locations=classpath:mapper/*.xml #通用Mapper配置 #mapper.mappers=com.liupeng.utils.MyMapper #mapper.not-empty=false #mapper.identity=MYSQL #分页插件配置 pagehelper.helperDialect=mysq1 pagehelper.reasonable=true pagehelper.supportMethodsArguments=true pagehelper.params=count=countSql #文件上传配置 spring.http.multipart.maxFileSize=100Mb spring.http.multipart.maxRequestSize=1000Mb #配置api端口号 server.port=8080 #tomcat的URI编码 server.tomcat.uri-encoding=UTF-8 ``` ``` ERROR [main] - Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'registLoginController': Unsatisfied dependency expressed through field 'userservice'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:123) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:666) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:353) at org.springframework.boot.SpringApplication.run(SpringApplication.java:300) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071) at com.liupeng.Application.main(Application.java:13) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Userservice': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 19 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\Java\java代码\Chaoyang\target\classes\com\liupeng\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1361) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1253) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ... 32 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:211) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1346) ... 43 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 55 more Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Java\java代码\Chaoyang\target\classes\mapper\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380) at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:547) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration.sqlSessionFactory(MapperAutoConfiguration.java:155) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.CGLIB$sqlSessionFactory$1(<generated>) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb$$FastClassBySpringCGLIB$$b0514ca6.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration$$EnhancerBySpringCGLIB$$90d064bb.sqlSessionFactory(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 56 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521) ... 69 more Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.liupeng.mapper.UserMapper.BaseResultMap at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872) at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844) at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:626) at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ... 71 more ```
报错:未将对象引用设置到对象的实例。下面是代码
public class Temporary { //public string Query_NAME { get; set; } public long Te_TC { get; set; } public long Te_MC { get; set; } public long Te_QC { get; set; } public long Te_WC { get; set; } public long Te_CC { get; set; } public long Te_EC { get; set; } public long Te_PC { get; set; } } private DataServiceCollection<Temporary> temporary; public DataServiceCollection<Temporary> AllTemporary { get { return temporary; } set { if (temporary != value) { temporary = value; this.OnPropertyChanged("AllTemporary"); } } } public object QueryInventoryInfo(string areaId) { if (string.IsNullOrEmpty(areaId)) { areaId = ""; } string locType = "2"; for (int i = 0; i < Areas.Count; i++) { Temporary tem = new Temporary(); tem.Te_TC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)).LongCount(); tem.Te_MC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("m")).LongCount(); tem.Te_QC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("q")).LongCount(); tem.Te_WC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("w")).LongCount(); tem.Te_CC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("c")).LongCount(); tem.Te_EC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("e")).LongCount(); tem.Te_PC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId) && c.STATUS.Contains("p")).LongCount(); if (tem != null) { this.AllTemporary.Add(tem); //此处报错 } } return AllTemporary; }
No provider available from registry ip for service com.zys.store.service.api.HelloServiceApi:1.0.0 on consumer ip use dubbo version 2.6.2
springboot整合zookeeper和dubbo报错 linux上zk版本号是3.4.14 项目用的zk包是3.4.9 dubbo用的是2.6.2 springboot是2.1.6 用main方式先运行store的模块 再运行order的模块 这个时候用浏览器去访问http://localhost:8088/hello?name=zys这个时候控制台就报错No provider available from registry 启动的时候不报错 浏览器访问就报错了 看zk日志有说是HelloServiceApi这个类的节点已经存在 但是我觉得跟这个问题不大 因为运行一次就会创建一个节点 多次的话肯定报节点存在的错 我的linux是虚拟机 并且已经关闭了防火墙 不存在端口跑不通的情况 1. 项目架构是maven的聚合项目![图片说明](https://img-ask.csdn.net/upload/201911/20/1574220333_973372.png) 2. 在zys-store-api写接口 package com.zys.store.service.api; public interface HelloServiceApi { String sayHello(String name); } 3.在zys-store暴露接口 package com.zys.store.service.provider; import com.alibaba.dubbo.config.annotation.Service; import com.zys.store.service.api.HelloServiceApi; @Service( version = "1.0.0", application = "zys-store", protocol = "dubbo", registry = "zys-store-registry" ) public class HelloServiceProvider implements HelloServiceApi{ @Override public String sayHello(String name) { return "hello" + name; } } 下面是zys-store的yml的配置 dubbo: application: id: zys-store name: zys-store qos-port: 22212 qos-enable: true scan: base-packages: com.zys.store.* protocol: id: dubbo name: dubbo port: 12343 registry: id: zys-store-registry address: zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181 4.在zys-order调用接口 package com.zys.order.controller; import com.alibaba.dubbo.config.annotation.Reference; import com.zys.store.service.api.HelloServiceApi; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @RestController public class HelloController { @Reference( version = "1.0.0", application = "zys-order", interfaceName = "com.zys.store.service.api.HelloServiceApi", check = false, timeout = 3000, retries = 0 //读请求3次 写请求不重复 ) private HelloServiceApi helloServiceApi; @RequestMapping("/hello") public String hello(@RequestParam("name") String name){ return helloServiceApi.sayHello(name); } } 下面是zys-order的yml的配置 ```dubbo: application: id: zys-order name: zys-order qos-port: 22211 qos-enable: true qos-accept-foreign-ip: false scan: base-packages: com.zys.order.* protocol: id: dubbo name: dubbo port: 12343 registry: id: zys-order-registry address: zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181 store端的启动日志 2019-11-20 10:18:35.426 INFO 50632 --- [ main] a.b.d.c.e.WelcomeLogoApplicationListener : :: Dubbo Spring Boot (v0.2.0) : https://github.com/apache/incubator-dubbo-spring-boot-project :: Dubbo (v2.6.2) : https://github.com/apache/incubator-dubbo :: Google group : dev@dubbo.incubator.apache.org 2019-11-20 10:18:35.430 INFO 50632 --- [ main] e.OverrideDubboConfigApplicationListener : Dubbo Config was overridden by externalized configuration {dubbo.application.id=zys-store, dubbo.application.name=zys-store, dubbo.application.qos-enable=true, dubbo.application.qos-port=22212, dubbo.protocol.id=dubbo, dubbo.protocol.name=dubbo, dubbo.protocol.port=12343, dubbo.registry.address=zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181, dubbo.registry.id=zys-store-registry, dubbo.scan.base-packages=com.zys.store.*} . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.6.RELEASE) 2019-11-20 10:18:35.488 INFO 50632 --- [ main] com.zys.store.ZysStoreApplication : Starting ZysStoreApplication on DESKTOP-O0S84K8 with PID 50632 (D:\ideaworkspace\zys-project\zys-store\target\classes started by Administrator in D:\ideaworkspace\zys-project) 2019-11-20 10:18:35.489 INFO 50632 --- [ main] com.zys.store.ZysStoreApplication : No active profile set, falling back to default profiles: default 2019-11-20 10:18:35.963 WARN 50632 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.store.dao, com.zys.store.mapper]' package. Please check your configuration. 2019-11-20 10:18:36.030 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-configs' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-properties' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-references' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-services' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-shutdown' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-store, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-store] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-store-registry, class : com.alibaba.dubbo.config.RegistryConfig] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-store-registry] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : dubbo, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered. 2019-11-20 10:18:36.038 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : dubbo] has been registered. 2019-11-20 10:18:36.060 WARN 50632 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.store]' package. Please check your configuration. 2019-11-20 10:18:36.307 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration' of type [com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$437665e0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.357 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.364 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$3474c06e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.382 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.383 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.657 INFO 50632 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8089 (http) 2019-11-20 10:18:36.675 INFO 50632 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-20 10:18:36.675 INFO 50632 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-11-20 10:18:36.770 INFO 50632 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-20 10:18:36.770 INFO 50632 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1249 ms 2019-11-20 10:18:37.038 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : dubbo] have been binding by prefix of configuration properties : dubbo.protocol 2019-11-20 10:18:37.568 INFO 50632 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-11-20 10:18:37.744 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-store] have been binding by prefix of configuration properties : dubbo.application 2019-11-20 10:18:37.747 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-store-registry] have been binding by prefix of configuration properties : dubbo.registry 2019-11-20 10:18:37.816 INFO 50632 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Starting... 2019-11-20 10:18:37.993 INFO 50632 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Start completed. order端的启动日志 ```2019-11-20 10:18:47.233 INFO 48096 --- [ main] a.b.d.c.e.WelcomeLogoApplicationListener : :: Dubbo Spring Boot (v0.2.0) : https://github.com/apache/incubator-dubbo-spring-boot-project :: Dubbo (v2.6.2) : https://github.com/apache/incubator-dubbo :: Google group : dev@dubbo.incubator.apache.org 2019-11-20 10:18:47.239 INFO 48096 --- [ main] e.OverrideDubboConfigApplicationListener : Dubbo Config was overridden by externalized configuration {dubbo.application.id=zys-order, dubbo.application.name=zys-order, dubbo.application.qos-accept-foreign-ip=false, dubbo.application.qos-enable=true, dubbo.application.qos-port=22211, dubbo.protocol.id=dubbo, dubbo.protocol.name=dubbo, dubbo.protocol.port=12343, dubbo.registry.address=zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181, dubbo.registry.id=zys-order-registry, dubbo.scan.base-packages=com.zys.order.*} . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.6.RELEASE) 2019-11-20 10:18:47.301 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : Starting ZysOrderApplication on DESKTOP-O0S84K8 with PID 48096 (D:\ideaworkspace\zys-project\zys-order\target\classes started by Administrator in D:\ideaworkspace\zys-project) 2019-11-20 10:18:47.302 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : No active profile set, falling back to default profiles: default 2019-11-20 10:18:47.803 WARN 48096 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.order.dao, com.zys.order.mapper]' package. Please check your configuration. 2019-11-20 10:18:47.868 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-configs' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.869 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-properties' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-references' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-services' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-shutdown' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-order, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-order] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-order-registry, class : com.alibaba.dubbo.config.RegistryConfig] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-order-registry] has been registered. 2019-11-20 10:18:47.876 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : dubbo, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered. 2019-11-20 10:18:47.876 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : dubbo] has been registered. 2019-11-20 10:18:47.894 WARN 48096 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.order]' package. Please check your configuration. 2019-11-20 10:18:48.164 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration' of type [com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$5fbcce96] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.239 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$50bb2924] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.261 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.263 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.264 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.482 INFO 48096 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http) 2019-11-20 10:18:48.496 INFO 48096 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-20 10:18:48.496 INFO 48096 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-11-20 10:18:48.596 INFO 48096 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-20 10:18:48.596 INFO 48096 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1268 ms 2019-11-20 10:18:48.847 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : dubbo] have been binding by prefix of configuration properties : dubbo.protocol 2019-11-20 10:18:49.338 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-order] have been binding by prefix of configuration properties : dubbo.application 2019-11-20 10:18:49.345 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-order-registry] have been binding by prefix of configuration properties : dubbo.registry 2019-11-20 10:18:49.919 INFO 48096 --- [ main] o.a.c.f.imps.CuratorFrameworkImpl : Starting 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:host.name=DESKTOP-O0S84K8 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.version=1.8.0_211 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.vendor=Oracle Corporation 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.home=C:\Program Files\Java\jdk1.8.0_211\jre 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.class.path=C:\Program Files\Java\jdk1.8.0_211\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\rt.jar;D:\ideaworkspace\zys-project\zys-order\target\classes;D:\repository\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;D:\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;D:\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;D:\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;D:\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\repository\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-actuator\2.1.6.RELEASE\spring-boot-starter-actuator-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.1.6.RELEASE\spring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-actuator\2.1.6.RELEASE\spring-boot-actuator-2.1.6.RELEASE.jar;D:\repository\io\micrometer\micrometer-core\1.1.5\micrometer-core-1.1.5.jar;D:\repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;D:\repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.6.RELEASE\spring-boot-starter-jdbc-2.1.6.RELEASE.jar;D:\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\repository\org\springframework\spring-jdbc\5.1.8.RELEASE\spring-jdbc-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-tx\5.1.8.RELEASE\spring-tx-5.1.8.RELEASE.jar;D:\repository\com\baomidou\mybatis-plus-boot-starter\3.1.1\mybatis-plus-boot-starter-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus\3.1.1\mybatis-plus-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-extension\3.1.1\mybatis-plus-extension-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-core\3.1.1\mybatis-plus-core-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-annotation\3.1.1\mybatis-plus-annotation-3.1.1.jar;D:\repository\com\github\jsqlparser\jsqlparser\1.2\jsqlparser-1.2.jar;D:\repository\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;D:\repository\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;D:\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;D:\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\repository\mysql\mysql-connector-java\6.0.6\mysql-connector-java-6.0.6.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-starter\0.2.0\dubbo-spring-boot-starter-0.2.0.jar;D:\repository\com\alibaba\dubbo\2.6.2\dubbo-2.6.2.jar;D:\repository\org\javassist\javassist\3.20.0-GA\javassist-3.20.0-GA.jar;D:\repository\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;D:\repository\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar;D:\repository\jline\jline\0.9.94\jline-0.9.94.jar;D:\repository\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;D:\repository\org\apache\curator\curator-framework\2.12.0\curator-framework-2.12.0.jar;D:\repository\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-autoconfigure\0.2.0\dubbo-spring-boot-autoconfigure-0.2.0.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-actuator\0.2.0\dubbo-spring-boot-actuator-0.2.0.jar;D:\repository\com\netflix\hystrix\hystrix-core\1.5.12\hystrix-core-1.5.12.jar;D:\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\repository\com\netflix\archaius\archaius-core\0.4.1\archaius-core-0.4.1.jar;D:\repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;D:\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;D:\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\repository\com\netflix\hystrix\hystrix-metrics-event-stream\1.5.12\hystrix-metrics-event-stream-1.5.12.jar;D:\repository\com\netflix\hystrix\hystrix-serialization\1.5.12\hystrix-serialization-1.5.12.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-afterburner\2.9.9\jackson-module-afterburner-2.9.9.jar;D:\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;D:\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\repository\com\netflix\hystrix\hystrix-javanica\1.5.12\hystrix-javanica-1.5.12.jar;D:\repository\org\aspectj\aspectjrt\1.9.4\aspectjrt-1.9.4.jar;D:\repository\org\apache\commons\commons-lang3\3.3.1\commons-lang3-3.3.1.jar;D:\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\repository\com\google\guava\guava\15.0\guava-15.0.jar;D:\repository\com\google\code\findbugs\jsr305\2.0.0\jsr305-2.0.0.jar;D:\repository\org\apache\rocketmq\rocketmq-client\4.3.0\rocketmq-client-4.3.0.jar;D:\repository\org\apache\rocketmq\rocketmq-common\4.3.0\rocketmq-common-4.3.0.jar;D:\repository\org\apache\rocketmq\rocketmq-remoting\4.3.0\rocketmq-remoting-4.3.0.jar;D:\repository\com\alibaba\fastjson\1.2.29\fastjson-1.2.29.jar;D:\repository\io\netty\netty-all\4.1.36.Final\netty-all-4.1.36.Final.jar;D:\repository\org\apache\rocketmq\rocketmq-logging\4.3.0\rocketmq-logging-4.3.0.jar;D:\repository\io\netty\netty-tcnative-boringssl-static\2.0.25.Final\netty-tcnative-boringssl-static-2.0.25.Final.jar;D:\repository\com\zys\zys-store-api\0.0.1-SNAPSHOT\zys-store-api-0.0.1-SNAPSHOT.jar;D:\repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;D:\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\idea\IntelliJ IDEA 2019.2\lib\idea_rt.jar 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.library.path=C:\Program Files\Java\jdk1.8.0_211\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\idea\IntelliJ IDEA 2019.2\jbr\\bin;D:\idea\IntelliJ IDEA 2019.2\jbr\\bin\server;D:\oracleClient\product\11.2.0\client_1\bin;D:\xshell\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Java\jdk1.8.0_211;D:\Git\cmd;C:\Program Files\MySQL\MySQL Server 5.7\bin;D:\TortoiseSVN1.10\bin;D:\apache-maven-idea\bin;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;. 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\ 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.compiler=<NA> 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.name=Windows 10 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.arch=amd64 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.version=10.0 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.name=Administrator 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.home=C:\Users\Administrator 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.dir=D:\ideaworkspace\zys-project 2019-11-20 10:18:58.932 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Initiating client connection, connectString=192.168.146.132:2181,192.168.146.131:2181,192.168.146.133:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@5a3a1bf9 2019-11-20 10:18:58.942 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Opening socket connection to server 192.168.146.132/192.168.146.132:2181. Will not attempt to authenticate using SASL (unknown error) 2019-11-20 10:18:58.942 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Socket connection established to 192.168.146.132/192.168.146.132:2181, initiating session 2019-11-20 10:18:58.953 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server 192.168.146.132/192.168.146.132:2181, sessionid = 0x200000235350000, negotiated timeout = 40000 2019-11-20 10:18:58.957 INFO 48096 --- [ain-EventThread] o.a.c.f.state.ConnectionStateManager : State change: CONNECTED 2019-11-20 10:18:59.030 INFO 48096 --- [ main] c.a.d.c.s.b.f.a.ReferenceBeanBuilder : <dubbo:reference object="com.alibaba.dubbo.common.bytecode.proxy0@3b5c665c" singleton="true" interface="com.zys.store.service.api.HelloServiceApi" uniqueServiceName="com.zys.store.service.api.HelloServiceApi:1.0.0" generic="false" version="1.0.0" check="false" timeout="3000" id="com.zys.store.service.api.HelloServiceApi" /> has been built. 2019-11-20 10:18:59.242 INFO 48096 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-11-20 10:18:59.420 INFO 48096 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Starting... 2019-11-20 10:18:59.592 INFO 48096 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Start completed. _ _ |_ _ _|_. ___ _ | _ | | |\/|_)(_| | |_\ |_)||_|_\ / | 3.1.1 2019-11-20 10:18:59.836 INFO 48096 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator' 2019-11-20 10:18:59.897 INFO 48096 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path '' 2019-11-20 10:18:59.899 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : Started ZysOrderApplication in 12.907 seconds (JVM running for 13.464) 2019-11-20 10:18:59.956 INFO 48096 --- [-192.168.255.54] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2019-11-20 10:18:59.956 INFO 48096 --- [-192.168.255.54] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2019-11-20 10:18:59.969 INFO 48096 --- [-192.168.255.54] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms ```
Javascript, html特殊字符问题:当这个@Name里有单引号,或者双引号,IE上现在在报错,怎么让他不报错
Javascript, html特殊字符问题:当这个@Name里有单引号,或者双引号,IE上现在在报错,怎么让他不报错 比如 test'test test"test 注意:若我输入普通的字符串,它能正常工作。 ``` <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <table cellpadding="0" cellspacing="0" class="LineItem"> <xsl:for-each select="//Cluster"> <xsl:sort select="@Name" order="ascending" data-type="text" /> <tr> <td width="20" nowrap="true"> <img src="../images/spacer.gif" /> <img src="../images/cluster.gif" /> </td> <td class="headerCell" width="100%" onclick="SelectSurveyItem('{@ClusterId}','{@Name}')"> <div class="pseudoLink"> <xsl:value-of select="@Name" /> </div> </td> </tr> <tr> <td colspan="4" class="break"></td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet> ``` Maybe I'm just thinking about this too hard, but I'm having a problem figuring out what escaping to use on a string in some JavaScript code inside a link's onClick handler. Example: ``` <td class="headerCell" width="100%" onclick="SelectSurveyItem('{@ClusterId}','{@Name}')"> <div class="pseudoLink"> <xsl:value-of select="@Name" /> </div> </td> ``` The '{@Name}' where template substitution occurs. My problem is that the item name can contain any character, including single and double quotes. Currently, if it contains single quotes it breaks the JavaScript code. My first thought was to use the template language's function to JavaScript-escape the item name, which just escapes the quotes. That will not fix the case of the string containing double quotes which breaks the HTML of the link. How is this problem normally addressed? Do I need to HTML-escape the entire onClick handler? If so, that would look really strange since the template language's escape function for that would also HTMLify the parentheses, quotes, and semicolons... This link is being generated for every result in a search results page, so creating a separate method inside a JavaScript tag is not possible, because I'd need to generate one per result. Also, I'm using a templating engine that was home-grown at the company I work for, so toolkit-specific solutions will be of no use to me. http://stackoverflow.com/questions/97578/how-do-i-escape-a-string-inside-javascript-code-inside-an-onclick-handler 这个英文版的问题差不多就是我的问题,但是我不知道如何破?
java为什么类体中不能创建对象并调用方法??
import java.util.*; public class TestMap{ String s; public static void main(String args[]){ TestMap tt=new TestMap(); System.out.println(tt.s); } Map map=new HashMap(); map.put(1,"wumin"); map.put(2,"donghuan"); map.put(3,"dong"); String s=(String)map.get(1); } 报错如下: D:\用户目录\桌面\java\contains\TestMap.java:21: 错误: 需要<标识符> map.put(1,"wumin"); ^ D:\用户目录\桌面\java\contains\TestMap.java:21: 错误: 非法的类型开始 map.put(1,"wumin"); ^ D:\用户目录\桌面\java\contains\TestMap.java:21: 错误: 非法的类型开始 map.put(1,"wumin"); ^ D:\用户目录\桌面\java\contains\TestMap.java:22: 错误: 需要<标识符> map.put(2,"donghuan"); ^ D:\用户目录\桌面\java\contains\TestMap.java:22: 错误: 非法的类型开始 map.put(2,"donghuan"); ^ D:\用户目录\桌面\java\contains\TestMap.java:22: 错误: 非法的类型开始 map.put(2,"donghuan"); ^ D:\用户目录\桌面\java\contains\TestMap.java:23: 错误: 需要<标识符> map.put(3,"dong"); ^ D:\用户目录\桌面\java\contains\TestMap.java:23: 错误: 非法的类型开始 map.put(3,"dong"); ^ D:\用户目录\桌面\java\contains\TestMap.java:23: 错误: 非法的类型开始 map.put(3,"dong"); ^ 9 个错误 <<< Process finished. (Exit code 1) ================ READY ================
使用了replace()函数,结果却没有变化?
我想把一个字符串'6,105.00'中的','去掉,方便后面转化为浮点数, 但是使用了.replace(',', '')后并没有效果,系统还是报错?求解原因,谢谢! 代码: ``` import pandas as pd import sys # input_file = sys.argv[1] # output_file = sys.argv[2] input_file = input() output_file = input() data_frame = pd.read_csv(input_file) data_frame['Cost'] = data_frame['Cost'].str.strip('$').replace(',', '').astype(float) data_frame_value_meets_condition = data_frame.loc[(data_frame['Supplier Name'].str.contains('Z')) | (data_frame['Cost'] > 600.0), :] ``` 报错: return arr.astype(dtype, copy=True) ValueError: could not convert string to float: '6,015.00 '
应用报错fatal错误,强制关闭
LOGCAT 错误: 05-16 07:16:24.503: E/AndroidRuntime(17625): FATAL EXCEPTION: main 05-16 07:16:24.503: E/AndroidRuntime(17625): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fdc/com.example.fdc.Medical_Record}: java.lang.NullPointerException 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.os.Handler.dispatchMessage(Handler.java:99) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.os.Looper.loop(Looper.java:123) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread.main(ActivityThread.java:3687) 05-16 07:16:24.503: E/AndroidRuntime(17625): at java.lang.reflect.Method.invokeNative(Native Method) 05-16 07:16:24.503: E/AndroidRuntime(17625): at java.lang.reflect.Method.invoke(Method.java:507) 05-16 07:16:24.503: E/AndroidRuntime(17625): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) 05-16 07:16:24.503: E/AndroidRuntime(17625): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 05-16 07:16:24.503: E/AndroidRuntime(17625): at dalvik.system.NativeStart.main(Native Method) 05-16 07:16:24.503: E/AndroidRuntime(17625): Caused by: java.lang.NullPointerException 05-16 07:16:24.503: E/AndroidRuntime(17625): at com.example.fdc.Medical_Record.onCreate(Medical_Record.java:84) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 05-16 07:16:24.503: E/AndroidRuntime(17625): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) 05-16 07:16:24.503: E/AndroidRuntime(17625): ... 11 more 代码: package com.example.fdc; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.util.Log; import android.view.Menu; import android.widget.TextView; public class Medical_Record extends Activity{ TextView Record1, Record2,Record3, Record4,Record5,Record6 ,Record7,Record8,Record9, Record10,Record11; String array_record []; String username =""; String id=""; String pname=""; String prel=""; String paddress=""; String pno=""; String poffice=""; String pmobile=""; String pbirth=""; String pcomment=""; String pcomplain = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_medical__record); Record1 = (TextView) findViewById(R.id.precord1); Record2 = (TextView) findViewById(R.id.precord2); Record3 = (TextView) findViewById(R.id.precord3); Record4 = (TextView) findViewById(R.id.precord4); Record5 = (TextView) findViewById(R.id.precord5); Record6 = (TextView) findViewById(R.id.precord6); Record7 = (TextView) findViewById(R.id.precord7); Record8 = (TextView) findViewById(R.id.precord8); Record9 = (TextView) findViewById(R.id.precord9); Record10 = (TextView) findViewById(R.id.precord10); Intent intent=getIntent(); String message =intent.getStringExtra("values"); if(message.contains(",")) { array_record=message.split(","); username =array_record[0]; id=array_record[1]; pname=array_record[2]; prel=array_record[3]; paddress=array_record[4]; pno=array_record[5]; poffice=array_record[6]; pmobile=array_record[7]; pbirth=array_record[8]; pcomment=array_record[9]; pcomplain = array_record[10]; Log.d("ijazzzz", prel); Record1.setText(username); Record2.setText(id); Record3.setText(pname); Record4.setText(prel); Record5.setText(paddress); Record6.setText(pno); Record7.setText(poffice); Record8.setText(pmobile); Record9.setText(pbirth); Record10.setText(pcomment); Record11.setText(pcomplain); } else { Log.d("ijazzzz", "sssssssssssssssss"); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.medical__record, menu); return true; } } 调试代码并没有错误,获取数据来自HttpPost,并且将长数据分割后存储在字符串中。 最后在Textview中设置时报错了。
opencv release下程序运行报错,求指教ORZ
多相机参数标定。VS2015+opencv2.4.13 代码运行到匹配关系那一部分就会崩。虽然找到了问题在哪,但不会解决,求大神指教。报错内容为:0x00007FF8DCE3D3D8 (ucrtbase.dll) (calib_stitch.exe 中)处有未经处理的异常: 将一个无效参数传递给了将无效参数视为严重错误的函数。 下面是代码: #include <iostream> #include <fstream> #include <string> #include "opencv2/core/core.hpp" #include "opencv2/opencv_modules.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/detail/autocalib.hpp" #include "opencv2/stitching/detail/blenders.hpp" #include "opencv2/stitching/detail/camera.hpp" #include "opencv2/stitching/detail/exposure_compensate.hpp" #include "opencv2/stitching/detail/matchers.hpp" #include "opencv2/stitching/detail/motion_estimators.hpp" #include "opencv2/stitching/detail/seam_finders.hpp" #include "opencv2/stitching/detail/util.hpp" #include "opencv2/stitching/detail/warpers.hpp" #include "opencv2/stitching/warpers.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/nonfree/nonfree.hpp" #include <opencv2/calib3d/calib3d.hpp> using namespace std; using namespace cv; using namespace cv::detail; // Default command line args bool preview = false; bool try_gpu = false; double work_megapix = -0.6; // 缩放参数 double seam_megapix = 0.1; double compose_megapix = -1; float conf_thresh = 1.f; string features_type = "sift"; //orb surf sift string ba_cost_func = "reproj"; //reproj ray string ba_refine_mask = "xxllx"; bool do_wave_correct = true; WaveCorrectKind wave_correct = detail::WAVE_CORRECT_HORIZ; bool save_graph = true; std::string save_graph_to; string warp_type = "spherical"; //spherical cylindrical plane int expos_comp_type = ExposureCompensator::GAIN_BLOCKS; //GAIN,OR NO float match_conf = 0.3f; string seam_find_type = "gc_color"; //no voronoi gc_color gc_colorgrad dp_color dp_colorgrad int blend_type = Blender::MULTI_BAND; // Blender::FEATHER Blender::MULTI_BAND float blend_strength = 5;//0就是关,默认5 string result_name = "result.jpg"; void detection(const vector<string> imagelist, vector<vector<Point2f>>& ransac_image_points_seq) { if (imagelist.size() % 2 != 0) { cout << "Error: the image list contains odd (non-even) number of elements\n"; return; } bool displayCorners = true;//true; const int maxScale = 2; const float squareSize = 1.f; // Set this to your actual square size // ARRAY AND VECTOR STORAGE: Size boardSize = Size(11, 8); vector<vector<Point2f>> imagePoints[2]; vector<vector<Point3f> > objectPoints; Size imageSize; int i, j, k, nimages = (int)imagelist.size() / 2; imagePoints[0].resize(nimages); imagePoints[1].resize(nimages); vector<string> goodImageList; for (i = j = 0; i < nimages; i++) { for (k = 0; k < 2; k++) { const string& filename = imagelist[i * 2 + k]; Mat img = imread(filename, 0); if (img.empty()) break; if (imageSize == Size()) imageSize = img.size(); else if (img.size() != imageSize) { cout << "The image " << filename << " has the size different from the first image size. Skipping the pair\n"; break; } bool found = false; vector<Point2f>& corners = imagePoints[k][j]; for (int scale = 1; scale <= maxScale; scale++) { Mat timg; if (scale == 1) timg = img; else resize(img, timg, Size(), scale, scale); found = findChessboardCorners(timg, boardSize, corners, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE); if (found) { if (scale > 1) { Mat cornersMat(corners); cornersMat *= 1. / scale; } break; } } if (displayCorners) { //cout << filename << endl; Mat cimg, cimg1; cvtColor(img, cimg, COLOR_GRAY2BGR); drawChessboardCorners(cimg, boardSize, corners, found); double sf = 640. / MAX(img.rows, img.cols); resize(cimg, cimg1, Size(), sf, sf); namedWindow("corners", 0); imshow("corners", cimg1); char c = (char)waitKey(1); if (c == 27 || c == 'q' || c == 'Q') //Allow ESC to quit exit(-1); } else putchar('.'); if (!found) break; cornerSubPix(img, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 30, 0.01)); /* 亚像素精确化 */ //find4QuadCornerSubpix(img, corners, Size(5, 5)); //对粗提取的角点进行精确化 } if (k == 2) { goodImageList.push_back(imagelist[i * 2]); goodImageList.push_back(imagelist[i * 2 + 1]); j++; } } cout << j << " pairs have been successfully detected.\n"; nimages = j; if (nimages < 2) { cout << "Error: too little pairs to run the calibration\n"; return; } imagePoints[0].resize(nimages); imagePoints[1].resize(nimages); vector<vector<Point2f>> image_points_seq; for (int i = 0; i < 2; i++) { vector<Point2f> buf; for (int j = 0; j < imagePoints[i].size(); j++) { for (int k = 0; k < imagePoints[i][j].size(); k++) { buf.push_back(imagePoints[i][j][k]); } } image_points_seq.push_back(buf); } //RANSAC cout << image_points_seq[0].size() << endl; cout << image_points_seq[1].size() << endl; vector<uchar> mask; Mat h = findHomography(image_points_seq[0], image_points_seq[1], mask, CV_FM_RANSAC); vector<Point2f> point1, point2; for (int i = 0; i < image_points_seq[0].size(); i++) { //if (mask[i] == 1) { point1.push_back(image_points_seq[0][i]); point2.push_back(image_points_seq[1][i]); } } ransac_image_points_seq.push_back(point1); ransac_image_points_seq.push_back(point2); //cout << imagePoints[0].size() << endl; //cout << imagePoints[1].size() << endl; //return imagePoints; } int main(int argc, char* argv[]) { int64 app_start_time = getTickCount(); string xml_name = "144-146-147-1481.yaml"; vector<vector<string>> img_names; vector<vector<string>> names; char file_name[256]; int num_pairs = 3; int nums_pairs_count[4] = { 23,23,20 }; for (int i =0; i <= num_pairs; i++) { vector<string> temp; for (int j = 1; j <= nums_pairs_count[i]; j++) { sprintf(file_name, "1234/%d/1/(%d).jpg", i, j); temp.push_back(file_name); sprintf(file_name, "1234/%d/2/(%d).jpg", i, j); temp.push_back(file_name); } names.push_back(temp); } //棋盘格检测 vector<vector<Point2f>> double_image_points_seq; int match_num[4][4] = {0}; int match_start[4][4][2] = {0}; //vector<vector<Point2f>> ransac_image_points_seq; //detection(names[0], ransac_image_points_seq); //match_num[0][1] = ransac_image_points_seq[0].size(); //match_num[1][0] = ransac_image_points_seq[0].size(); //match_start[0][1] = 0; //match_start[1][0] = 0; //match_num.push_back(ransac_image_points_seq[0].size()); //cout << ransac_image_points_seq[0].size() << endl; //cout << ransac_image_points_seq[1].size() << endl; for (int i = 0; i < num_pairs; i++) { vector<vector<Point2f>> ransac_image_points_seq; detection(names[i], ransac_image_points_seq); if (i != 0) { match_num[i][i + 1] = ransac_image_points_seq[0].size(); match_num[i+1][i] = ransac_image_points_seq[0].size(); match_start[i][i + 1][0] = match_num[i - 1][i]; match_start[i][i + 1][1] = 0; match_start[i+1][i][0] = 0; match_start[i+1][i][1] = match_num[i - 1][i]; for (int j = 0; j < ransac_image_points_seq[0].size(); j++) { double_image_points_seq[double_image_points_seq.size() - 1].push_back(ransac_image_points_seq[0][j]); } double_image_points_seq.push_back(ransac_image_points_seq[1]); } else { double_image_points_seq.push_back(ransac_image_points_seq[0]); double_image_points_seq.push_back(ransac_image_points_seq[1]); match_num[0][1] = ransac_image_points_seq[0].size(); match_num[1][0] = ransac_image_points_seq[0].size(); match_start[0][1][0] = 0; match_start[0][1][1] = 0; match_start[1][0][0] = 0; match_start[1][0][1] = 0; } } //特征点 vector<ImageFeatures> features(num_pairs + 1); for (int i = 0; i <= num_pairs; i++) { vector<KeyPoint> keypoints; for (int j = 0; j < double_image_points_seq[i].size(); j++) { KeyPoint point; point.pt = double_image_points_seq[i][j]; keypoints.push_back(point); } features[i].keypoints = keypoints; features[i].img_size = Size(2560, 1440); features[i].img_idx = i; } //匹配关系 vector<MatchesInfo> pairwise_matches; for (int i = 0; i <= num_pairs; i++) { for (int j = 0; j <= num_pairs; j++) { MatchesInfo matches_info; if(j==i+1 || j==i-1) { vector<DMatch> match(match_num[i][j]); vector<uchar> mask(match_num[i][j]); for (int n = 0; n < match_num[i][j]; n++) { match[n].queryIdx = match_start[i][j][0] + n; match[n].trainIdx = match_start[i][j][1] + n; mask[n] = 1; } matches_info.src_img_idx = i; matches_info.dst_img_idx = j; matches_info.matches = match; //info.inliers_mask = inliers_mask; //info.num_inliers = match_num[i][j]; //vector<Point2f> pts_src, pts_dst; Mat src_points(1, static_cast<int>(matches_info.matches.size()), CV_32FC2); Mat dst_points(1, static_cast<int>(matches_info.matches.size()), CV_32FC2); for (int n = 0; n < match_num[i][j]; n++) { const DMatch& m = matches_info.matches[n]; Point2f p = features[i].keypoints[m.queryIdx].pt; p.x -= features[i].img_size.width * 0.5f; p.y -= features[i].img_size.height * 0.5f; src_points.at<Point2f>(0, static_cast<int>(n)) = p; p = features[j].keypoints[m.trainIdx].pt; p.x -= features[j].img_size.width * 0.5f; p.y -= features[j].img_size.height * 0.5f; dst_points.at<Point2f>(0, static_cast<int>(n)) = p; //pts_src.push_back(features[i].keypoints[match[n].queryIdx].pt); //pts_dst.push_back(features[j].keypoints[match[n].trainIdx].pt); } //vector<uchar> mask; matches_info.H = findHomography(src_points, dst_points, matches_info.inliers_mask,CV_FM_RANSAC); //matches_info.H = h.clone(); matches_info.num_inliers = 0; for (size_t i = 0; i < matches_info.inliers_mask.size(); ++i) if (matches_info.inliers_mask[i]) matches_info.num_inliers++; //info.confidence = 2; matches_info.confidence = matches_info.num_inliers / (8 + 0.3 * matches_info.matches.size()); // Set zero confidence to remove matches between too close images, as they don't provide // additional information anyway. The threshold was set experimentally. matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence; //// Construct point-point correspondences for inliers only src_points.create(1, matches_info.num_inliers, CV_32FC2); dst_points.create(1, matches_info.num_inliers, CV_32FC2); int inlier_idx = 0; for (size_t n = 0; n < matches_info.matches.size(); ++n) { if (!matches_info.inliers_mask[n]) continue; const DMatch& m = matches_info.matches[n]; Point2f p = features[i].keypoints[m.queryIdx].pt; p.x -= features[i].img_size.width * 0.5f; p.y -= features[i].img_size.height * 0.5f; src_points.at<Point2f>(0, inlier_idx) = p; p = features[j].keypoints[m.trainIdx].pt; p.x -= features[j].img_size.width * 0.5f; p.y -= features[j].img_size.height * 0.5f; dst_points.at<Point2f>(0, inlier_idx) = p; inlier_idx++; } // Rerun motion estimation on inliers only matches_info.H = findHomography(src_points, dst_points, CV_RANSAC); } else { matches_info.src_img_idx = -1; matches_info.dst_img_idx = -1; } pairwise_matches.push_back(matches_info);//发现程序崩在哪一行了 } } cout << pairwise_matches.size() << endl; /*Mat img1 = imread(img_names[0], 1); Mat img2 = imread(img_names[1], 1); Mat out1, out2, out; drawKeypoints(img1, features[0].keypoints, out1); drawKeypoints(img1, features[0].keypoints, out2); drawMatches(img1, features[0].keypoints, img2, features[1].keypoints, pairwise_matches[0].matches, out); cv::namedWindow("out1", 0); cv::imshow("out1", out); cv::namedWindow("out2", 0); cv::imshow("out2", out); cv::namedWindow("out", 0); cv::imshow("out", out); cv::waitKey();*/ //for(int i=0; i<nu) HomographyBasedEstimator estimator; vector<CameraParams> cameras; estimator(features, pairwise_matches, cameras); for (size_t i = 0; i < cameras.size(); ++i) { Mat R; cameras[i].R.convertTo(R, CV_32F); cameras[i].R = R; //cout << "Initial intrinsics #" << indices[i] + 1 << ":\n" << cameras[i].K() << endl; } Mat K1(Matx33d( 1.2755404529239545e+03, 0., 1.3099971348805052e+03, 0., 1.2737998060528048e+03, 8.0764915313791903e+02, 0., 0., 1. )); Mat K2(Matx33d( 1.2832823446505638e+03, 0., 1.2250954954648896e+03, 0., 1.2831721912770793e+03, 7.1743301498758751e+02, 0., 0., 1. )); Mat K3(Matx33d( 1.2840711959594287e+03, 0., 1.2473666273838244e+03, 0., 1.2840499404560594e+03, 7.9051574509733359e+02, 0., 0., 1.)); Mat K4(Matx33d( 1.2865853945042952e+03, 0., 1.1876049192856492e+03, 0., 1.2869927339670007e+03, 6.2306976561458930e+02, 0., 0., 1. )); Mat K[4]; K[0] = K1.clone(); K[1] = K2.clone(); K[2] = K3.clone(); K[3] = K4.clone(); for (size_t i = 0; i < cameras.size(); ++i) { K[i].convertTo(K[i], CV_32F); } for (size_t i = 0; i < cameras.size(); ++i) { Mat R; cameras[i].R.convertTo(R, CV_32F); cameras[i].R = R; cameras[i].focal = 0.5*(K[i].at<float>(0, 0)+ K[i].at<float>(1, 1)); // Focal length cameras[i].ppx = K[i].at<float>(0,2); // Principal point X cameras[i].ppy = K[i].at<float>(1,2); ; // Principal point Y cout << cameras[i].K() << endl; //cout << "Initial intrinsics #" << indices[i] + 1 << ":\n" << cameras[i].K() << endl; } Ptr<detail::BundleAdjusterBase> adjuster; if (ba_cost_func == "reproj") adjuster = new detail::BundleAdjusterReproj(); else if (ba_cost_func == "ray") adjuster = new detail::BundleAdjusterRay(); else { cout << "Unknown bundle adjustment cost function: '" << ba_cost_func << "'.\n"; return -1; } adjuster->setConfThresh(conf_thresh); Mat_<uchar> refine_mask = Mat::zeros(3, 3, CV_8U); if (ba_refine_mask[0] == 'x') refine_mask(0, 0) = 1; if (ba_refine_mask[1] == 'x') refine_mask(0, 1) = 1; if (ba_refine_mask[2] == 'x') refine_mask(0, 2) = 1; if (ba_refine_mask[3] == 'x') refine_mask(1, 1) = 1; if (ba_refine_mask[4] == 'x') refine_mask(1, 2) = 1; adjuster->setRefinementMask(refine_mask); for (int i = 0; i < features.size(); i++) { features[i].descriptors = Mat(); } (*adjuster)(features, pairwise_matches, cameras); cout << "camera number: " << cameras.size() << endl; cv::FileStorage fs(xml_name, cv::FileStorage::WRITE); int num = cameras.size(); fs << "CameraNumber" << num; //char file_name[256]; for (int i = 0; i<cameras.size(); i++) { sprintf(file_name, "Focal_Camera%d", i); fs << file_name << cameras[i].focal; sprintf(file_name, "ppx_Camera%d", i); fs << file_name << cameras[i].ppx; sprintf(file_name, "ppy_Camera%d", i); fs << file_name << cameras[i].ppy; sprintf(file_name, "K_Camera%d", i); fs << file_name << cameras[i].K(); sprintf(file_name, "R_Camera%d", i); fs << file_name << cameras[i].R; } //fs << "indices" << indices; fs.release(); return 0; } ![图片说明](https://img-ask.csdn.net/upload/201904/12/1555002609_315025.png) ![图片说明](https://img-ask.csdn.net/upload/201904/12/1555002619_770672.png)
Spark scala 运行报错 .test$$anonfun$1
同样的写法再scala中执行报错,然而在java中能够正常执行 以下是报错内容 ``` helloOffSLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/zsts/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.5/log4j-slf4j-impl-2.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/zsts/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. 19:25:11.875 [main] ERROR org.apache.hadoop.util.Shell - Failed to locate the winutils binary in the hadoop binary path java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:355) ~[hadoop-common-2.6.4.jar:?] at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:370) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.util.Shell.<clinit>(Shell.java:363) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:79) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:116) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.Groups.<init>(Groups.java:93) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.Groups.<init>(Groups.java:73) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:293) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:283) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:260) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:789) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:774) [hadoop-common-2.6.4.jar:?] at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:647) [hadoop-common-2.6.4.jar:?] at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2198) [spark-core_2.10-1.6.2.jar:1.6.2] at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2198) [spark-core_2.10-1.6.2.jar:1.6.2] at scala.Option.getOrElse(Option.scala:120) [?:?] at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2198) [spark-core_2.10-1.6.2.jar:1.6.2] at org.apache.spark.SparkContext.<init>(SparkContext.scala:322) [spark-core_2.10-1.6.2.jar:1.6.2] at tarot.test$.main(test.scala:19) [bin/:?] at tarot.test.main(test.scala) [bin/:?] Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://tarot1:9000/sparkTest/hello at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:285) at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:228) at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:313) at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:199) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237) at scala.Option.getOrElse(Option.scala:120) at org.apache.spark.rdd.RDD.partitions(RDD.scala:237) at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237) at scala.Option.getOrElse(Option.scala:120) at org.apache.spark.rdd.RDD.partitions(RDD.scala:237) at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239) at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237) at scala.Option.getOrElse(Option.scala:120) at org.apache.spark.rdd.RDD.partitions(RDD.scala:237) at org.apache.spark.rdd.RDD$$anonfun$take$1.apply(RDD.scala:1307) at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150) at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:111) at org.apache.spark.rdd.RDD.withScope(RDD.scala:316) at org.apache.spark.rdd.RDD.take(RDD.scala:1302) at tarot.test$.main(test.scala:26) at tarot.test.main(test.scala) ``` scala代码 ``` package tarot import scala.tools.nsc.doc.model.Val import org.apache.spark.SparkConf import org.apache.spark.SparkContext import org.apache.spark.api.java.JavaSparkContext object test { def main(hello:Array[String]){ print("helloOff") val conf = new SparkConf() conf.setMaster("spark://tarot1:7077") .setAppName("hello_off") .set("spark.executor.memory", "4g") .set("spark.executor.cores", "4") .set("spark.cores.max", "4") .set("spark.sql.crossJoin.enabled", "true") val sc = new SparkContext(conf) sc.setLogLevel("ERROR") val file = sc.textFile("hdfs://tarot1:9000/sparkTest/hello") val filterRDD = file.filter { (ss:String) => ss.contains("hello") } val f=filterRDD.cache() // println(f) // filterRDD.count() for(x <- f.take(100)){ println(x) } } def helloingTest(jsc:SparkContext){ val sc = jsc val file = sc.textFile("hdfs://tarot1:9000/sparkTest/hello") val filterRDD = file.filter((ss:String) => ss.contains("hello")) val f=filterRDD.cache() println(f) val i = filterRDD.count() println(i) } // val seehello = def helloingTest(jsc:JavaSparkContext){ val sc = jsc val file = sc.textFile("hdfs://tarot1:9000/sparkTest/hello") val filterRDD = file.filter((ss:String) => ss.contains("hello")) val f=filterRDD.cache() println(f) val i = filterRDD.count() println(i) } } ``` java代码 ``` package com.tarot.sparkToHdfsTest; import org.apache.spark.SparkConf; import org.apache.spark.SparkContext; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.api.java.function.Function; import org.apache.spark.rdd.RDD; //import scalaModule.hello; public class App { public static void main( String[] args ) { SparkConf sparkConf = new SparkConf(); sparkConf.setMaster("spark://tarot1:7077") .setAppName("hello off") .set("spark.executor.memory","4g") .set("spark.executor.cores", "4") .set("spark.cores.max","4") .set("spark.sql.crossJoin.enabled", "true"); JavaSparkContext jsc = new JavaSparkContext(sparkConf); jsc.setLogLevel("ERROR"); text(jsc); // test.helloingTest(jsc); } /** * test * @param jsc */ private static void text(JavaSparkContext jsc){ // jsc.textFile("hdfs://tarot1:9000/sparkTest/hello"); JavaRDD<String> jr= jsc.textFile("hdfs://tarot1:9000/sparkTest/hello",1); jr.cache(); // test t = new test(); jr.filter(f); for (String string : jr.take(100)) { System.out.println(string); } System.out.println("hello off"); } public static Function<String, Boolean> f = new Function<String, Boolean>() { public Boolean call(String s) { return s.contains("hello"); } }; } ``` 坑了很久了,网上的解决办法不是让我去shell上就是让我上传jar包,但是java不用啊?都调用的JVM。 大神救命
WebClient UploadFile方法求教
public static void upLoad(string url, string path) { using (WebClient myWebClient = new WebClient()) { myWebClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); byte[] responseArray = myWebClient.UploadFile(url, "POST", path); string msg = Encoding.GetEncoding("UTF-8").GetString(responseArray); if (msg.Contains("成功")) { Console.WriteLine("ok"); } } } 上传MP4文件 大小都在1m以内 有的电脑可以上传成功 而有的电脑却直接报错 实在是想不明白 求指点!
weblogic 部署项目报错
同一个项目windows 虚拟机上部署运行成功 mac系统部署报错 报错信息如下 log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [zip:/Users/rui/Workspaces/MyEclipse 2016/ais/WEB-INF/lib/sso-1.0.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [zip:/Users/rui/Workspaces/MyEclipse 2016/ais/WEB-INF/lib/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6] SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details. <2018-10-16 ????04ʱ18??24?? GMT+08:00> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specialCharacter' defined in ServletContext resource [/WEB-INF/classes/ais/framework/applicationContext-acegi-security.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specialCharacter' defined in ServletContext resource [/WEB-INF/classes/ais/framework/applicationContext-acegi-security.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) Truncated. see log file for complete stacktrace Caused By: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:223) at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:198) at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:91) at dk.itst.oiosaml.sp.service.SPFilter.<clinit>(SPFilter.java:306) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) Truncated. see log file for complete stacktrace > <2018-10-16 ????04ʱ18??24?? GMT+08:00> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'ais'. weblogic.application.ModuleException: at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1520) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) Truncated. see log file for complete stacktrace Caused By: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:223) at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:198) at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:91) at dk.itst.oiosaml.sp.service.SPFilter.<clinit>(SPFilter.java:306) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) Truncated. see log file for complete stacktrace 求大神解答 感激不尽
DataTable 类型转换为 List 类型
报错内容 ![图片说明](https://img-ask.csdn.net/upload/201602/01/1454312285_670349.png) 要转换的实体类 ID int类型,Name string 类型,这样报错的那两句要怎么写 ? 方法如下: public static List<T> ConvertToList(DataTable dt) { // 定义集合 List<T> ts = new List<T>(); // 获得此模型的类型 Type type = typeof(T); //定义一个临时变量 string tempName = string.Empty; //遍历DataTable中所有的数据行 foreach (DataRow dr in dt.Rows) { T t = new T(); // 获得此模型的公共属性 PropertyInfo[] propertys = t.GetType().GetProperties(); //遍历该对象的所有属性 foreach (PropertyInfo pi in propertys) { tempName = pi.Name;//将属性名称赋值给临时变量 //检查DataTable是否包含此列(列名==对象的属性名) if (dt.Columns.Contains(tempName)) { // 判断此属性是否有Setter if (!pi.CanWrite) continue;//该属性不可写,直接跳出 //取值 object value = dr[tempName]; //如果非空,则赋给对象的属性 if (value != DBNull.Value) pi.SetValue(t, value.ToString(), null); } } //对象添加到泛型集合中 ts.Add(t); } return ts; }
C# 用UploadFile上传文件,保存到服务器中,但是在测试区正常,在正式去报错
测试区的web.config没有配置requestLengthDiskThreshold,正式区好像也没有,但是在 正式区上传附件报“Cannot access a closed file”,请问怎么解决? if (fupFile.PostedFile != null && fupFile.PostedFile.ContentLength > 0) { if (fupFile.HasFile) { ListItem item = new ListItem(); item.Value = item.Text = fupFile.PostedFile.FileName; if (!lbxFile.Items.Contains(item)) { lbxFile.Items.Add(item); files.Add(fupFile); } } if (files.Count > 0) { string WF_NO; string WF_Sale; string filename = ""; string path = "d:\\Lorom\\ProductCenter\\WorkFlow\\FTPFile\\" + Session["wf_sale"].ToString() + "\\" + Session["WF_NO"].ToString() + "\\"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } lblShow.Text = fupFile.PostedFile.FileName; WF_Sale = Session["UserNO"].ToString(); WF_NO = Session["WF_NO"].ToString(); WCFHelperBase wcfBase = new WCFHelperBase(); foreach (FileUpload fup in files) { if (fup.HasFile) filename = fup.FileName; //string extend = Path.GetExtension(filename); // fupFile.PostedFile.SaveAs(Server.MapPath(path)+"\\"+filename); // Directory.CreateDirectory(path); //myFile.SaveAs(path + fupFile); wcfBase.csHelper.GetUnsignFile(WF_NO, filename, WF_Sale); fup.SaveAs(path + "/" + fup.FileName);//无法访问已关闭的文件 } //Page.ClientScript.RegisterClientScriptBlock(typeof(string), "", @"<script>alert('上传成功!')</script>"); wcfBase.CloseWCF(); Response.AddHeader("Refresh", "0"); } }
vs2008编译报错如下,求助!
1>QAxContainerd.lib(qaxobject.obj) : warning LNK4217: 本地定义的符号 ?qt_metacall@QObject@@UAEHW4Call@QMetaObject@@HPAPAX@Z (public: virtual int __thiscall QObject::qt_metacall(enum QMetaObject::Call,int,void * *)) 在函数 "public: virtual int __thiscall QAxObject::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QAxObject@@UAEHW4Call@QMetaObject@@HPAPAX@Z) 中导入 1>qmfcapp.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static void __cdecl QCoreApplication::sendPostedEvents(void)" (__imp_?sendPostedEvents@QCoreApplication@@SAXXZ),该符号在函数 "long __stdcall QtFilterProc(int,unsigned int,long)" (?QtFilterProc@@YGJHIJ@Z) 中被引用 1>qwinwidget.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QChildEvent::removed(void)const " (__imp_?removed@QChildEvent@@QBE_NXZ),该符号在函数 "protected: virtual void __thiscall QWinWidget::childEvent(class QChildEvent *)" (?childEvent@QWinWidget@@MAEXPAVQChildEvent@@@Z) 中被引用 1>ui.lib(QYMainWindow.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromStdWString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_?fromStdWString@QString@@SA?AV1@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z),该符号在函数 "public: long __thiscall CQYMainWindow::Invoke(struct WebExternalObjectInvokeParam const &,class HtmlDialog *)" (?Invoke@CQYMainWindow@@QAEJABUWebExternalObjectInvokeParam@@PAVHtmlDialog@@@Z) 中被引用 1>libqyqtui.lib(HtmlDialog.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromStdWString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_?fromStdWString@QString@@SA?AV1@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>QAxContainerd.lib(qaxobject.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(struct _GUID const &)" (__imp_??0QUuid@@QAE@ABU_GUID@@@Z) 1>libqyqtui.lib(HtmlDialog.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(struct _GUID const &)" (__imp_??0QUuid@@QAE@ABU_GUID@@@Z),该符号在函数 "public: __thiscall HtmlDialog::HtmlDialog(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0HtmlDialog@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(struct _GUID const &)" (__imp_??0QUuid@@QAE@ABU_GUID@@@Z) 1>QAxContainerd.lib(qaxwidget.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(struct _GUID const &)" (__imp_??0QUuid@@QAE@ABU_GUID@@@Z) 1>QAxContainerd.lib(qaxtypes.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(struct _GUID const &)" (__imp_??0QUuid@@QAE@ABU_GUID@@@Z) 1>libqyqtui.lib(HtmlDialog.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall QString::toStdWString(void)const " (__imp_?toStdWString@QString@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ),该符号在函数 "private: void __thiscall HtmlDialog::OnWebNavigateComplete(class QString const &)" (?OnWebNavigateComplete@HtmlDialog@@AAEXABVQString@@@Z) 中被引用 1>libqyqtui.lib(QyQtUIDialog.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QPainter::drawPixmap(int,int,int,int,class QPixmap const &,int,int,int,int)" (__imp_?drawPixmap@QPainter@@QAEXHHHHABVQPixmap@@HHHH@Z),该符号在函数 "void __cdecl DrawNinePatch(class QPainter &,class QPixmap const &,class QSize const &,int)" (?DrawNinePatch@@YAXAAVQPainter@@ABVQPixmap@@ABVQSize@@H@Z) 中被引用 1>libqyqtui.lib(NcFramelessHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QRubberBand::move(class QPoint const &)" (__imp_?move@QRubberBand@@QAEXABVQPoint@@@Z),该符号在函数 "private: void __thiscall NcWidgetData::moveWidget(class QPoint const &)" (?moveWidget@NcWidgetData@@AAEXABVQPoint@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(unsigned short const *,int)" (__imp_?fromWCharArray@QString@@SA?AV1@PBGH@Z),该符号在函数 "public: class QByteArray __thiscall QAxEventSink::findProperty(long)" (?findProperty@QAxEventSink@@QAE?AVQByteArray@@J@Z) 中被引用 1>QAxContainerd.lib(qaxwidget.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(unsigned short const *,int)" (__imp_?fromWCharArray@QString@@SA?AV1@PBGH@Z) 1>QAxContainerd.lib(qaxtypes.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(unsigned short const *,int)" (__imp_?fromWCharArray@QString@@SA?AV1@PBGH@Z) 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class QString __thiscall QUuid::toString(void)const " (__imp_?toString@QUuid@@QBE?AVQString@@XZ),该符号在函数 "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QUuid::isNull(void)const " (__imp_?isNull@QUuid@@QBE_NXZ),该符号在函数 "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(class QString const &)" (__imp_??0QUuid@@QAE@ABVQString@@@Z),该符号在函数 "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::operator struct _GUID(void)const " (__imp_??BQUuid@@QBE?AU_GUID@@XZ),该符号在函数 "protected: virtual bool __thiscall QAxBase::initialize(struct IUnknown * *)" (?initialize@QAxBase@@MAE_NPAPAUIUnknown@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::QUuid(void)" (__imp_??0QUuid@@QAE@XZ),该符号在函数 "public: __thiscall MetaObjectGenerator::MetaObjectGenerator(class QAxBase *,class QAxBasePrivate *)" (??0MetaObjectGenerator@@QAE@PAVQAxBase@@PAVQAxBasePrivate@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: struct QUuid & __thiscall QUuid::operator=(struct _GUID const &)" (__imp_??4QUuid@@QAEAAU0@ABU_GUID@@@Z),该符号在函数 "private: void __thiscall MetaObjectGenerator::init(void)" (?init@MetaObjectGenerator@@AAEXXZ) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QMetaProperty::isValid(void)const " (__imp_?isValid@QMetaProperty@@QBE_NXZ),该符号在函数 "private: int __thiscall QAxBase::internalProperty(enum QMetaObject::Call,int,void * *)" (?internalProperty@QAxBase@@AAEHW4Call@QMetaObject@@HPAPAX@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QUuid::operator==(struct QUuid const &)const " (__imp_??8QUuid@@QBE_NABU0@@Z),该符号在函数 "public: class QBool __thiscall QList<struct QUuid>::contains(struct QUuid const &)const " (?contains@?$QList@UQUuid@@@@QBE?AVQBool@@ABUQUuid@@@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QUuid::operator class QString(void)const " (__imp_??BQUuid@@QBE?AVQString@@XZ),该符号在函数 "private: struct QHashNode<struct QUuid,class QMap<class QByteArray,class QList<struct QPair<class QByteArray,int> > > > * * __thiscall QHash<struct QUuid,class QMap<class QByteArray,class QList<struct QPair<class QByteArray,int> > > >::findNode(struct QUuid const &,unsigned int *)const " (?findNode@?$QHash@UQUuid@@V?$QMap@VQByteArray@@V?$QList@U?$QPair@VQByteArray@@H@@@@@@@@ABEPAPAU?$QHashNode@UQUuid@@V?$QMap@VQByteArray@@V?$QList@U?$QPair@VQByteArray@@H@@@@@@@@ABUQUuid@@PAI@Z) 中被引用 1>QAxContainerd.lib(qaxbase.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QUuid::operator<(struct QUuid const &)const " (__imp_??MQUuid@@QBE_NABU0@@Z),该符号在函数 "bool __cdecl qMapLessThanKey<struct QUuid>(struct QUuid const &,struct QUuid const &)" (??$qMapLessThanKey@UQUuid@@@@YA_NABUQUuid@@0@Z) 中被引用 1>C:\CC-trunk\vsproject\..\bin\CC.exe : fatal error LNK1120: 18 个无法解析的外部命令 1>生成日志保存在“file://c:\CC-trunk\vsproject\CC\Debug\BuildLog.htm” 1>CC - 26 个错误,1146 个警告 ========== 生成: 成功 0 个,失败 1 个,最新 54 个,跳过 0 个 ==========
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
源码阅读(19):Java中主要的Map结构——HashMap容器(下1)
(接上文《源码阅读(18):Java中主要的Map结构——HashMap容器(中)》) 3.4.4、HashMap添加K-V键值对(红黑树方式) 上文我们介绍了在HashMap中table数组的某个索引位上,基于单向链表添加新的K-V键值对对象(HashMap.Node&lt;K, V&gt;类的实例),但是我们同时知道在某些的场景下,HashMap中table数据的某个索引位上,数据是按照红黑树
c++制作的植物大战僵尸,开源,一代二代结合游戏
    此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材,少部分搜集于网络,以及自己制作。 此游戏为同人游戏而且仅供学习交流使用,任何人未经授权,不得对本游戏进行更改、盗用等,否则后果自负。 目前有六种僵尸和六种植物,植物和僵尸的动画都是本人做的。qq:2117610943 开源代码下载 提取码:3vzm 点击下载--&gt; 11月28日 新增四种植物 统一植物画风,全部修
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
深度学习图像算法在内容安全领域的应用
互联网给人们生活带来便利的同时也隐含了大量不良信息,防范互联网平台有害内容传播引起了多方面的高度关注。本次演讲从技术层面分享网易易盾在内容安全领域的算法实践经验,包括深度学习图
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程实用技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法,并会持续更新。
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
"狗屁不通文章生成器"登顶GitHub热榜,分分钟写出万字形式主义大作
GitHub 被誉为全球最大的同性交友网站,……,陪伴我们已经走过 10+ 年时间,它托管了大量的软件代码,同时也承载了程序员无尽的欢乐。 万字申请,废话报告,魔幻形式主义大作怎么写?兄dei,狗屁不通文章生成器了解一下。这个富有灵魂的项目名吸引了众人的目光。项目仅仅诞生一周,便冲上了GitHub趋势榜榜首(Js中文网 -前端进阶资源教程)、是榜首哦
推荐几款比较实用的工具,网站
1.盘百度PanDownload 这个云盘工具是免费的,可以进行资源搜索,提速(偶尔会抽风????) 不要去某站买付费的???? PanDownload下载地址 2.BeJSON 这是一款拥有各种在线工具的网站,推荐它的主要原因是网站简洁,功能齐全,广告相比其他广告好太多了 bejson网站 3.二维码美化 这个网站的二维码美化很好看,网站界面也很...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问