摘要:
1 for(int i = 0;i<array.size();i++){ 2 Goods g = array.get(i); 3 File file = new File("d://goodsInfo.txt"); 4 FileOutputStream fos1 = new FileOutputStream(file, true); 5 // 创建FileOutputStream对应的PrintStream,方便操作。PrintStream的写入接口更便利 6 ... 阅读全文
摘要:
hibernate4整合spring3 时出现nested exception is java.lang.NoClassDefFoundError:org/hibernate/engine/SessionFactoryImplementor异常原因:3中这样配置 View Code 原因:4中该这样配置 hibernate4 阅读全文
摘要:
异常:java.lang.NoSuchMethodError:ognl.SimpleNode.isEvalChain(Lognl/OgnlContext;)Z原因:ognl.jar版本bug,或者跟struts 的版本不匹配解决办法:更换为匹配的包 阅读全文
摘要:
异常:java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils原因:commons-lang.jar版本低了解决办法:下载高版本的包,如commons-lang3-3.1.ja 阅读全文
摘要:
报此异常:java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z原因:hibernate-jpa-2.0-api-1.0.0.Final.jar会和ejb3-persistence.jar里很多重复,难免会出现冲突情况。解决办法:把ejb3-persistence.jar包删掉, 阅读全文
摘要:
public String substring(int beginIndex,int length)。 返回一个新字符串,它是此字符串的一个子字符串。该子字符串从指定的 beginIndex 处开始, length:表示子字符串的长度。 参数: beginIndex - 开始处的索引(包括)。 endindex 结尾处索引(不包括)。 返回: 指定的子字符串。 示例: String str = "ABCDEF";String str1 = str.substring(2, 4); 返回 CD 阅读全文
摘要:
public class StringTest {public static void main(String[] args) {StringBuffer i = new StringBuffer("abc");String j = i.reverse().toString();System.out.println(j); }} 阅读全文