hibernate中qurey查询 用Junit测试报错

我的工具 myeclipse 8.5 +oracle 10g
1.实体类映射文件Student.hbm.xml
[code="java"]<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">










[/code]
2.hibernate配置文件hibernate.cfg.xml
[code="java"]<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">



true

org.hibernate.dialect.Oracle9Dialect


oracle.jdbc.driver.OracleDriver


jdbc:oracle:thin:@localhost:1521:softeem

java1103
java1103

<mapping resource="com/softeem/pojo/Student.hbm.xml" />


[/code]
3.test测试类CURDTest.java
[code="java"]package com.softeem.test;

import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.softeem.pojo.Student;

import junit.framework.TestCase;

public class CURDTest extends TestCase{

//增
public void insertTest(){
    Configuration config=new Configuration().configure();
    SessionFactory sf=config.buildSessionFactory();
    Session session=sf.openSession();
    session.beginTransaction();
    //增加十条记录
    for(int i=0;i<10;i++){
        Student stu=new Student();
        stu.setSname("顾超");
        stu.setSsex("男");
        stu.setSage(21);
        stu.setStime(new Date());
        session.save(stu);
    }
    session.getTransaction().commit();
    session.close();
}

//删
public void deleteTest(){
    Configuration config=new Configuration().configure();
    SessionFactory sf=config.buildSessionFactory();
    Session session=sf.openSession();
    session.beginTransaction();
    Student stu=(Student) session.load(Student.class, 1);
    session.delete(stu);
    session.getTransaction().commit();
    session.close();
}

//改
public void updateTest(){
    Configuration config=new Configuration().configure();
    SessionFactory sf=config.buildSessionFactory();
    Session session=sf.openSession();
    session.beginTransaction();
    Student stu=(Student) session.load(Student.class, 2);
    stu.setSname("小强");
    stu.setSage(1);
    session.update(stu);
    session.getTransaction().commit();
    session.close();
}

//查
public void selectTest(){
    Configuration config=new Configuration().configure();
    SessionFactory sf=config.buildSessionFactory();
    Session session=sf.openSession();
    session.beginTransaction();
    Student stu=(Student) session.load(Student.class,2);
    System.out.println(stu.getSno()+" "+stu.getSname()+" "+stu.getSsex()+" "+stu.getSage()+" "+stu.getStime());
    //Query query=new Query("from tb_student");
    session.getTransaction().commit();
    session.close();
}

// //查找全部
// public void selectAllTest(){
// Configuration config=new Configuration().configure();
// SessionFactory sf=config.buildSessionFactory();
// Session session=sf.openSession();
// session.beginTransaction();
// Query query=session.createQuery("from tb_student");
// List<?> list=query.list();
// Iterator<?> it=list.iterator();
// while(it.hasNext()){
// Student stu=(Student) it.next();
// System.out.println(stu.getSno()+" "+stu.getSname()+" "+stu.getSsex()+" "+stu.getSage()+" "+stu.getStime());
// }
// session.getTransaction().commit();
// session.close();
// }
//

// //分页
// public void pagingTest(){
// Configuration config=new Configuration().configure();
// SessionFactory sf=config.buildSessionFactory();
// Session session=sf.openSession();
// session.beginTransaction();
// Query query=session.createQuery("form tb_student");
// query.setFirstResult(3);
// query.setMaxResults(3);
// List<?> list=query.list();
// for(int i=0;i // System.out.println(list.get(i));
// }
// session.getTransaction().commit();
// session.close();
// }
//
// //模糊查询
// public void blurTest(){
// Configuration config=new Configuration().configure();
// SessionFactory sf=config.buildSessionFactory();
// Session session=sf.openSession();
// session.beginTransaction();
// Query query=session.createQuery("form tb_student where sname like ?");
// query.setString(0, "%小%");
// List> list=query.list();
// for(int i=0;i<list.size();i++){
// System.out.println(list.get(i));
// }
// session.getTransaction().commit();
// session.close();
// }
}
[/code]

问题是:

[code="java"]Query query=session.createQuery("from tb_student");[/code]这条语句会报错
当我改成:
[code="java"]Query query=session.createSQLQuery("select * from tb_student");[/code]这条语句不会报错,但是
[code="java"]Student stu=(Student) it.next();
[/code]这条语句就会报错.

不知道什么原因,纠结了很久。请大家指点。

3个回答

1.Query query=session.createQuery("from tb_student"); 错误的原因是由于你使用的是HQL语句,你这样写肯定错误,应该写成:Query query=session.createQuery("from Student");
2.我感觉你的Student.hbm.xml 有问题,为什么所有的属性你都没有为他们指定类型啊。
:D

找本hibernate的书好好学习一下吧,这是最基本的用法,你都没有用对。

楼上的正确了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
hibernate4 提示user is not mapper
maven 项目 spring4 springmvc hibernate4 框架,实体类的映射文件是xml格式,我在junit 上用hibernate query接口测试查询没有问题,但是在实际的web项目中,我用的是hql查询,而且我看他那个报错,查询的也是我的那个实体类的类名,而且我也确定我的映射文件的路径也没有问题,不知道还有没有其他原因导致报这个错~
hibernate连接数据库报错
这是hibernate.cfg.xml配置文件,用户名和密码都用jdbc测试过可以连接上 ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.uesrname">root</property> <property name="hibernate.connection.password">liangqichan</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/cql1</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property> <mapping resource="com/cql/crm/domain/SysUserGroup.hbm.xml"/> </session-factory> </hibernate-configuration> ``` 这是报错信息: 2016-6-30 11:56:43 org.hibernate.cfg.Environment <clinit> 信息: Hibernate 3.5.6-Final 2016-6-30 11:56:43 org.hibernate.cfg.Environment <clinit> 信息: hibernate.properties not found 2016-6-30 11:56:43 org.hibernate.cfg.Environment buildBytecodeProvider 信息: Bytecode provider name : javassist 2016-6-30 11:56:43 org.hibernate.cfg.Environment <clinit> 信息: using JDK 1.4 java.sql.Timestamp handling 2016-6-30 11:56:43 org.hibernate.cfg.Configuration configure 信息: configuring from resource: /hibernate.cfg.xml 2016-6-30 11:56:43 org.hibernate.cfg.Configuration getConfigurationInputStream 信息: Configuration resource: /hibernate.cfg.xml 2016-6-30 11:56:43 org.hibernate.cfg.Configuration addResource 信息: Reading mappings from resource : com/cql/crm/domain/SysUserGroup.hbm.xml 2016-6-30 11:56:43 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues 信息: Mapping class: com.cql.crm.domain.SysUserGroup -> sys_user_group 2016-6-30 11:56:43 org.hibernate.cfg.Configuration doConfigure 信息: Configured SessionFactory: null 2016-6-30 11:56:43 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: Using Hibernate built-in connection pool (not for production use!) 2016-6-30 11:56:43 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: Hibernate connection pool size: 20 2016-6-30 11:56:43 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: autocommit mode: false 2016-6-30 11:56:43 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/cql1 2016-6-30 11:56:43 org.hibernate.connection.DriverManagerConnectionProvider configure 信息: connection properties: {uesrname=root, password=****} 2016-6-30 11:56:43 org.hibernate.cfg.SettingsFactory buildSettings 警告: Could not obtain connection to query metadata java.sql.SQLException: Access denied for user ''@'localhost' (using password: YES 补充: 这是我测试hibernate时的代码 package junit; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.junit.Test; import com.cql.crm.domain.SysUserGroup; public class TestHibernate { @Test public void testHibernateConf(){ Configuration config=new Configuration(); //config.configure("hibernate.cfg.xml"); config.configure(); SessionFactory sf=config.buildSessionFactory(); Session s=sf.openSession(); Transaction tx=s.beginTransaction(); SysUserGroup sysUserGroup=new SysUserGroup(); sysUserGroup.getName(); sysUserGroup.getPrincipal(); sysUserGroup.getIncumbent(); s.save(sysUserGroup); tx.commit(); s.close(); } } 这是我jdbc连接时的代码: public class jdbc { public static void main(String[] args) { String url="jdbc:mysql://localhost:3306/cql"; String user="root"; String password="liangqichan"; String sql="Select * from sys_user_group"; Connection conn=null; Statement st=null; ResultSet rs=null; try { conn=(Connection) DriverManager.getConnection(url, user, password); st=(Statement) conn.createStatement(); rs=st.executeQuery(sql); while(rs.next()){ System.out.println(rs.getString("id")); System.out.println(rs.getString("name")); System.out.println(rs.getString("remark")); } rs.close(); st.close(); conn.close(); } catch (SQLException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } }
关于Hibernate映射子类的问题
报错如下 Hibernate: select muser0_.id as id2_, muser0_.password as password2_, muser0_.email as email2_, muser0_.username as username2_, muser0_.type as type2_ from mysql.muser muser0_ where muser0_.id=? org.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: com.study.dao.Muser (Discriminator: Guest) at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1477) at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308) at org.hibernate.loader.Loader.getRow(Loader.java:1230) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603) at org.hibernate.loader.Loader.doQuery(Loader.java:724) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2232) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) at org.hibernate.loader.Loader.list(Loader.java:2124) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.study.test.hqltest.test(hqltest.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995784_29915.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995800_306146.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995813_518047.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995777_297880.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995732_448814.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995743_685026.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995750_872812.png) UserDao: ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995789_589837.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995894_346457.png) UserServlet: ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995821_27147.png) ![图片说明](https://img-ask.csdn.net/upload/201511/08/1446995917_199693.png)
用hibernate的uuid注解生成主键, save时提示id出错
使用hibernate uuid注解 自动生成id值,在students和courses多对多的级联保存时, id保存出错 报错代码如下 ``` log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version). log4j:WARN Please initialize the log4j system properly. Hibernate: insert into students (sname, id) values (?, ?) Hibernate: insert into courses (cname, id) values (?, ?) Hibernate: insert into courses (cname, id) values (?, ?) Hibernate: insert into students_courses (sid, cid) values (?, ?) Hibernate: insert into students_courses (sid, cid) values (?, ?) org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at com.caidi.Test.TestManyToManyEach.test01(TestManyToManyEach.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:292) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.sql.BatchUpdateException: Field 'id' doesn't have a default value at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1693) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1108) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 31 more ``` 1. Students类 ``` package com.caidi.beans; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.GenericGenerator; @Entity @Table(name="students") public class Students { @Id @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid.hex") @Column(name="id") private String id; @Column(name="sname") private String sname; @ManyToMany @Cascade(value={CascadeType.SAVE_UPDATE}) @JoinTable(name="students_courses",joinColumns={@JoinColumn(name="sid",referencedColumnName="id")},inverseJoinColumns={@JoinColumn(name="cid",referencedColumnName="id")}) private List<Courses> courses; public Students() { super(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public List<Courses> getCourses() { return courses; } public void setCourses(List<Courses> courses) { this.courses = courses; } } ``` 2. Courses类 ``` package com.caidi.beans; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.GenericGenerator; @Entity @Table(name="courses") public class Courses { @Id @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid.hex") @Column(name="id") private String id; @Column(name="cname") private String cname; @ManyToMany(mappedBy="courses")//ManyToMany默认lazy加载 @Cascade(value={CascadeType.SAVE_UPDATE}) private List<Students> students; public Courses() { super(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getCname() { return cname; } public void setCname(String cname) { this.cname = cname; } public List<Students> getStudents() { return students; } public void setStudents(List<Students> students) { this.students = students; } } ``` 3. Students_Courses.java ``` package com.caidi.beans; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table(name="students_courses") public class Students_Courses { private String id; @Column(name="sid") private String sid; @Column(name="cid") private String cid; public Students_Courses() { super(); } @Id @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid.hex") @Column(name="id") public String getId() { return id; } public void setId(String id) { this.id = id; } public String getSid() { return sid; } public void setSid(String sid) { this.sid = sid; } public String getCid() { return cid; } public void setCid(String cid) { this.cid = cid; } } ``` 4. 测试代码 ``` package com.caidi.Test; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import org.junit.Test; import com.caidi.beans.Courses; import com.caidi.beans.Students; import com.caidi.utils.HibernateTools; public class TestManyToManyEach { @Test public void test01(){ Session session = HibernateTools.getSession(); //开启事物 Transaction tr = session.beginTransaction(); try{ Courses c1 = new Courses();Courses c2 = new Courses(); c1.setCname("数学课"); c2.setCname("语文课"); List list1 = new ArrayList(); list1.add(c1);list1.add(c2); Students s1 = new Students(); s1.setSname("小明"); s1.setCourses(list1); session.save(s1); tr.commit(); System.out.println("finsh"); }catch(Exception e){ tr.rollback(); e.printStackTrace(); }finally{ if(session.isOpen() ==true){ session.close(); } } } } ``` mysql数据库 ![课程表courses](https://img-ask.csdn.net/upload/201802/26/1519657880_228265.png) ![学生表students](https://img-ask.csdn.net/upload/201802/26/1519657916_358265.png) ![中间表students_courses](https://img-ask.csdn.net/upload/201802/26/1519657943_981379.png)
关于hibernate一个类和多个类有关联关系
``` hibernate一个类和两个类有关联关系,但是第二个类的数组实例化是,我的代码如下 ------------------------------------------------------------------ @Entity @Table(name="user") public class User { @Id @GenericGenerator(name="uid",strategy="increment") @GeneratedValue(generator="uid") private Integer id; private String number; private String name; private String password; @OneToMany @JoinColumn(name="uid") @Cascade(org.hibernate.annotations.CascadeType.ALL) private List<Scart> scart=new ArrayList<Scart>(); @OneToMany @JoinColumn(name="uuid") @Cascade(org.hibernate.annotations.CascadeType.ALL) private List<Order> order=new ArrayList<Order>(); public List<Order> getOrder() { return order; } public void setOrder(List<Order> order) { this.order = order; } public User(String number, String name, String password) { super(); this.number = number; this.name = name; this.password = password; } public User() { // TODO Auto-generated constructor stub } public List<Scart> getScart() { return scart; } public void setScart(List<Scart> scart) { this.scart = scart; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } ---------------------------------------------------------- @Entity @Table(name="order") public class Order { @Id @GenericGenerator(name="sid",strategy="increment") @GeneratedValue(generator="sid") private Integer id; private String name; private String url; private String number; private String price; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } } ------------------------------------------------------------------------------------- @Entity @Table(name="scart") public class Scart { @Id @GenericGenerator(name="sid",strategy="increment") @GeneratedValue(generator="sid") private Integer id; private String name; private String url; private String price; private String number; public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } } -------------------------------------------------------------- public class Test2 { @Test public void test(){ org.hibernate.Session session=HibernateUtil.openSession(); Transaction tx=session.beginTransaction(); String hql="from User u where u.number='20177720378'"; Query query=session.createQuery(hql); User user=(User) query.list().get(0); Scart scart=new Scart(); scart.setName("计算机组成原理第二版"); user.getScart().add(scart); tx.begin(); session.save(user); tx.commit(); } @Test public void test2(){ Session session=HibernateUtil.openSession(); Transaction tx=session.beginTransaction(); String hql="from User u where u.number='20177720378'"; Query query=session.createQuery(hql); User user=(User) query.list().get(0); System.out.println(user.getName()); Order order=new Order(); order.setName("计算机"); user.getOrder().add(order); tx.begin(); session.save(user); tx.commit(); } } -------------------------------------------------------------- 运行结果就是第一个测试成功,第二个测试失败了 运行结果如下 Hibernate: select user0_.id as id0_, user0_.name as name0_, user0_.number as number0_, user0_.password as password0_ from user user0_ where user0_.number='20177720378' 周小坡 Hibernate: select order0_.uuid as uuid0_1_, --------------------------------------------------------------------- 报错信息如下 org.hibernate.exception.SQLGrammarException: could not initialize a collection: [users.User.order#1] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.loadCollection(Loader.java:2173) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369) at org.hibernate.collection.AbstractPersistentCollection.write(AbstractPersistentCollection.java:208) at org.hibernate.collection.PersistentBag.add(PersistentBag.java:297) at test.Test2.test2(Test2.java:40) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order order0_ where order0_.uuid=1' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) at org.hibernate.loader.Loader.doQuery(Loader.java:802) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.loadCollection(Loader.java:2166) ... 31 more ```
关于表单提交,日期类型处理 报错信息不支持从 UNKNOWN 到 UNKNOWN 的转换。
c3p0连接已测,其他正常 只有添加功能报错 数据库中birthday为datetime类型 报错信息和关键代码贴出 ``` java.sql.SQLException: 不支持从 UNKNOWN 到 UNKNOWN 的转换。 Query: insert into stu (sname,sex,sphone,sbirthday,shobby,sinfo) values(?,?,?,?,?,?) Parameters: [aa, 男, 21332132, Sun Dec 30 17:21:15 CST 2018, 游泳, s] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.dao.impl.StudentDaoImpl.insert(StudentDaoImpl.java:32) at com.service.impl.StudentServiceImpl.insert(StudentServiceImpl.java:30) at com.servlet.AddStudentServlet.doGet(AddStudentServlet.java:57) at com.servlet.AddStudentServlet.doPost(AddStudentServlet.java:82) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) ``` ``` AddStudentServlet.java package com.servlet; import java.io.IOException; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.damain.Student; import com.service.StudentService; import com.service.impl.StudentServiceImpl; /** * Servlet implementation class AddStudentServlet */ @WebServlet("/AddStudentServlet") public class AddStudentServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AddStudentServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub try { //获取数据 request.setCharacterEncoding("UTF-8"); String name = request.getParameter("sname"); String sex = request.getParameter("sex"); String phone = request.getParameter("sphone"); String birthday = request.getParameter("sbirthday"); String hobby = request.getParameter("shobby"); String info = request.getParameter("sinfo"); //String转为date SimpleDateFormat sdf1 =new SimpleDateFormat("YYYY-MM-dd hh:mm:ss"); //添加到数据库 Date date; try { date = sdf1.parse(birthday); StudentService service = new StudentServiceImpl(); Student student = new Student(name,sex,phone,date,hobby,info); service.insert(student); //跳转到列表页 request.getRequestDispatcher("StudentListServlet").forward(request, response); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } } ``` ``` Student.java package com.damain; import java.util.Date; /* * 这是学生封装的对象bean */ public class Student { private int sid; private String sname; private String sex; private String sphone; private Date sbirthday; private String shobby; private String sinfo; public Student() { super(); } public Student( String sname, String sex, String sphone, Date sbirthday, String shobby, String sinfo) { super(); this.sname = sname; this.sex = sex; this.sphone = sphone; this.sbirthday = sbirthday; this.shobby = shobby; this.sinfo = sinfo; } public int getSid() { return sid; } public void setSid(int sid) { this.sid = sid; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getSphone() { return sphone; } public void setSphone(String sphone) { this.sphone = sphone; } public Date getSbirthday() { return sbirthday; } public void setSbirthday(Date sbirthday) { this.sbirthday = sbirthday; } public String getShobby() { return shobby; } public void setShobby(String shobby) { this.shobby = shobby; } public String getSinfo() { return sinfo; } public void setSinfo(String sinfo) { this.sinfo = sinfo; } } ``` ``` package com.dao.impl; import java.sql.SQLException; import java.util.List; import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.handlers.BeanListHandler; import org.junit.Test; import com.damain.Student; import com.dao.StudentDao; import com.util.JDBCUtil; /* * 这是StudentDao的实现 */ public class StudentDaoImpl implements StudentDao { @Override public List<Student> findall() throws SQLException { // TODO Auto-generated method stub QueryRunner runner = new QueryRunner(JDBCUtil.getDataSource()); List<Student> list =runner.query("Select * from stu",new BeanListHandler<Student>(Student.class)); return list; } @Override public void insert(Student student) throws SQLException { // TODO Auto-generated method stub QueryRunner runner = new QueryRunner(JDBCUtil.getDataSource()); runner.update("insert into stu (sname,sex,sphone,sbirthday,shobby,sinfo) values(?,?,?,?,?,?)", student.getSname(), student.getSex(), student.getSphone(), student.getSbirthday(), student.getShobby(), student.getSinfo() ); } ```
spring data jpa的误将方法名当成属性名称的问题
项目中使用了spring data jpa,自己扩展了一个全局接口AbstractJxetRepository [code="java"]public interface AbstractJxetRepository<T> { public void batchInster(List<T> list, int size) throws Exception; public void batchUpdate(List<T> list, int size) throws Exception; }[/code] 实现类AbstractDao [code="java"]@NoRepositoryBean public abstract class AbstractDao<T> implements AbstractJxetRepository<T> { @PersistenceContext protected EntityManager em; @Transactional public void batchInster(List<T> list, int size) throws Exception{ for (int i = 0; i < list.size(); i++) { em.persist(list.get(i)); if (i % size == 0) { em.flush(); em.clear(); } } } @Transactional public void batchUpdate(List<T> list, int size) { for (int i = 0; i < list.size(); i++) { em.merge(list.get(i)); if (i % size == 0) { em.flush(); em.clear(); } } } }[/code] 在一个模块接口中继承AbstractJxetRepository [code="java"]public interface EduUnitLevelDao extends PagingAndSortingRepository<EduUnitLevel, Integer>, JpaSpecificationExecutor<EduUnitLevel> { public List<EduUnitLevel> getBySchoolId(Integer schoolId); @SuppressWarnings("unchecked") public EduUnitLevel save(EduUnitLevel eduUnitLevel); public List<EduUnitLevel> save(List<EduUnitLevel> eduUnitLevels);[/code] 现在的问题是,在service中调用EduUnitLevelDao ,会将batchInster方法中的batch当做EduUnitLevel的属性,提示No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel 全部的报错信息 [code="java"]org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.com.jxet.datalayer.service.EduUnitLevelServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.jxet.datalayer.service.EduUnitLevelService cn.com.jxet.datalayer.service.EduUnitLevelServiceTest.eduUnitLevelService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void cn.com.jxet.datalayer.service.EduUnitLevelService.setEduUnitLevelDao(cn.com.jxet.datalayer.dao.EduUnitLevelDao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelDao': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:379) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.jxet.datalayer.service.EduUnitLevelService cn.com.jxet.datalayer.service.EduUnitLevelServiceTest.eduUnitLevelService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void cn.com.jxet.datalayer.service.EduUnitLevelService.setEduUnitLevelDao(cn.com.jxet.datalayer.dao.EduUnitLevelDao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelDao': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) ... 26 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void cn.com.jxet.datalayer.service.EduUnitLevelService.setEduUnitLevelDao(cn.com.jxet.datalayer.dao.EduUnitLevelDao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelDao': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486) ... 28 more Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void cn.com.jxet.datalayer.service.EduUnitLevelService.setEduUnitLevelDao(cn.com.jxet.datalayer.dao.EduUnitLevelDao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelDao': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:601) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) ... 39 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eduUnitLevelDao': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1448) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:558) ... 41 more Caused by: org.springframework.data.mapping.PropertyReferenceException: No property batch found for type cn.com.jxet.datalayer.entity.EduUnitLevel at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245) at org.springframework.data.repository.query.parser.Part.<init>(Part.java:72) at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180) at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260) at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240) at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:68) at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:57) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:90) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:162) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:68) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:279) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:153) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:43) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 49 more[/code]
求WebLogic10.3下运行velocity出错的解决办法
<p>本人现在有一个项目(SSH)</p> <p>在Windows+Tomcat6上部署</p> <p>运行皆正常.</p> <p> </p> <p>但迁移到Linux(RedHat Server 5.5)+WebLogic10.3上</p> <p>部署报错.</p> <p> </p> <p>错误信息如下:</p> <p> </p> <p><span style="background-color: #ff0000;"><span style="color: #000000; background-color: #ffffff;">- - Servlet Engine: WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967 <br>- - Java Version:   1.6.0_05<br>- - Java Vendor:    Sun Microsystems Inc.<br>- VelocityViewServlet: Using custom properties at '/WEB-INF/config/velocity.properties'<br>- LogSystem has been deprecated. Please use a LogChute implementation.<br>- Velocimacro : added #getCnWeek(  num ) : source = /WEB-INF/vmLib/common.vm<br>- Velocimacro : allowInlineLocal = true : VMs defined inline will be local to their defining templat<br>e only.<br>- Velocimacro : autoload on : VM system will automatically reload global library macros<br>- Using config file '/WEB-INF/config/toolbox.xml'<br>- Digester.getParser: <br>java.lang.UnsupportedOperationException: This parser does not support specification "null" version "<br>null"<br> at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448)<br> at org.apache.commons.digester.Digester.getFactory(Digester.java:534)<br> at org.apache.commons.digester.Digester.getParser(Digester.java:786)<br> at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)<br> at org.apache.commons.digester.Digester.parse(Digester.java:1887)<br> at org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.java:211)<br> at org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(ServletToolboxManager.j<br>ava:169)<br> at org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(VelocityViewServlet.java:<br>323)<br> at org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:212)<br> at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)<br> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)<br> at weblogic.security.service.SecurityManager.runAs(Unknown Source)<br> at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)<br> at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)<br> at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:48)<br> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)<br> at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1893)<br> at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1<br>870)<br> at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1790)<br> at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)<br> at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)<br> at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)<br> at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)<br> at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)<br> at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)<br> at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)<br> at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)<br> at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)<br> at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)<br> at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)<br> at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)<br> at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)<br> at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeploymen<br>t.java:361)<br> at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)<br> at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)<br> at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.j<br>ava:233)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:16<br>9)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)<br> at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:<br>173)<br> at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:8<br>9)<br> at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)<br> at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)<br> at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)<br>- Problem loading toolbox '/WEB-INF/config/toolbox.xml'<br>java.lang.NullPointerException<br> at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)<br> at org.apache.commons.digester.Digester.parse(Digester.java:1887)<br> at org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.java:211)<br> at org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(ServletToolboxManager.j<br>ava:169)<br> at org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(VelocityViewServlet.java:<br>323)<br> at org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:212)<br> at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)<br> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)<br> at weblogic.security.service.SecurityManager.runAs(Unknown Source)<br> at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)<br> at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)<br> at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:48)<br> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)<br> at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1893)<br> at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1<br>870)<br> at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1790)<br> at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)<br> at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)<br> at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)<br> at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)<br> at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)<br> at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)<br> at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)<br> at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)<br> at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)<br> at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)<br> at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)<br> at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)<br> at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)<br> at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)<br> at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)<br> at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeploymen<br>t.java:361)<br> at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)<br> at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)<br> at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.j<br>ava:233)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:16<br>9)<br> at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)<br> at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:<br>173)<br> at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:8<br>9)<br> at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)<br> at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)<br> at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)<br>- VelocityViewServlet: Default content-type is: text/html; charset=utf-8<br>- Root WebApplicationContext: initialization started</span></span></p> <p><span style="color: #000000; background-color: #c0c0c0;"> </span></p> <p> </p> <p> </p> <p>这是我项目中用到的包<br>E:\workspace\ot\BM_LIB\antlr-2.7.6rc1.jar<br>E:\workspace\ot\BM_LIB\axis.jar<br>E:\workspace\ot\BM_LIB\axis-ant.jar<br>E:\workspace\ot\BM_LIB\axis-schema.jar<br>E:\workspace\ot\BM_LIB\backport-util-concurrent-3.0.jar<br>E:\workspace\ot\BM_LIB\c3p0-0.9.0.jar<br>E:\workspace\ot\BM_LIB\cglib-nodep-2.1_3.jar<br>E:\workspace\ot\BM_LIB\commons-beanutils-1.7.0.jar<br>E:\workspace\ot\BM_LIB\commons-collections-3.2.jar<br>E:\workspace\ot\BM_LIB\commons-digester-2.0.jar<br>E:\workspace\ot\BM_LIB\commons-discovery-0.2.jar<br>E:\workspace\ot\BM_LIB\commons-fileupload-1.2.1.jar<br>E:\workspace\ot\BM_LIB\commons-io-1.3.2.jar<br>E:\workspace\ot\BM_LIB\commons-lang-2.3.jar<br>E:\workspace\ot\BM_LIB\commons-logging-1.0.4.jar<br>E:\workspace\ot\BM_LIB\commons-logging-api-1.1.jar<br>E:\workspace\ot\BM_LIB\commons-pool-1.3.jar<br>E:\workspace\ot\BM_LIB\commons-validator-1.3.1.jar<br>E:\workspace\ot\BM_LIB\dom4j-1.6.jar<br>E:\workspace\ot\BM_LIB\dwr.jar<br>E:\workspace\ot\BM_LIB\ehcache-1.5.0.jar<br>E:\workspace\ot\BM_LIB\ezmorph-1.0.4.jar<br>E:\workspace\ot\BM_LIB\freem a r k er-2.3.15.jar<br>E:\workspace\ot\BM_LIB\hibernate3.jar<br>E:\workspace\ot\BM_LIB\java-core-2.4.1.jar<br>E:\workspace\ot\BM_LIB\jaxrpc.jar<br>E:\workspace\ot\BM_LIB\jdom.jar<br>E:\workspace\ot\BM_LIB\json-lib-2.2.1.jar<br>E:\workspace\ot\BM_LIB\jstl.jar<br>E:\workspace\ot\BM_LIB\jta.jar<br>E:\workspace\ot\BM_LIB\jtds-1.2.jar<br>E:\workspace\ot\BM_LIB\junit.jar<br>E:\workspace\ot\BM_LIB\jxl.jar<br>E:\workspace\ot\BM_LIB\log4j-1.2.12.jar<br>E:\workspace\ot\BM_LIB\mail.jar<br>E:\workspace\ot\BM_LIB\mr.jar<br>E:\workspace\ot\BM_LIB\ognl-2.7.3.jar<br>E:\workspace\ot\BM_LIB\ojdbc14.jar<br>E:\workspace\ot\BM_LIB\opf-template.jar<br>E:\workspace\ot\BM_LIB\oscache-2.4.1.jar<br>E:\workspace\ot\BM_LIB\quartz-all-1.6.0.jar<br>E:\workspace\ot\BM_LIB\saaj.jar<br>E:\workspace\ot\BM_LIB\SecuInter.jar<br>E:\workspace\ot\BM_LIB\slf4j-api-1.5.5.jar<br>E:\workspace\ot\BM_LIB\slf4j-simple-1.5.5.jar<br>E:\workspace\ot\BM_LIB\spring.jar<br>E:\workspace\ot\BM_LIB\sqljdbc.jar<br>E:\workspace\ot\BM_LIB\standard.jar<br>E:\workspace\ot\BM_LIB\struts2-core-2.1.8.jar<br>E:\workspace\ot\BM_LIB\struts2-dojo-plugin-2.1.6.jar<br>E:\workspace\ot\BM_LIB\struts2-spring-plugin-2.1.8.jar<br>E:\workspace\ot\BM_LIB\wfclient.jar<br>E:\workspace\ot\BM_LIB\wsdl4j-1.5.1.jar<br>E:\workspace\ot\BM_LIB\xpp3_min-1.1.3.4.O.jar<br>E:\workspace\ot\BM_LIB\xstream-1.2.2.jar<br>E:\workspace\ot\BM_LIB\xwork-core-2.1.6.jar<br>E:\workspace\ot\BM_LIB\yalesso.jar<br>E:\workspace\ot\BM_LIB\velocity-1.5.jar<br>E:\workspace\ot\BM_LIB\velocity-tools-1.4.jar</p> <p> </p> <p> </p> <p>WebLogic下的包(bea\modules)</p> <p>E:\bea\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar<br>E:\bea\modules\com.bea.adaptive.harvester.utils_1.2.0.0.jar<br>E:\bea\modules\com.bea.cie.bsu_5.2.0.0.jar<br>E:\bea\modules\com.bea.cie.comdev_5.6.0.0.jar<br>E:\bea\modules\com.bea.cie.comdev_5.9.0.0.jar<br>E:\bea\modules\com.bea.cie.common-plugin_2.2.0.0.jar<br>E:\bea\modules\com.bea.cie.config_5.2.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr_2.3.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr_2.8.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr-impl_2.3.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr-impl_2.8.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr-xbean_2.3.0.0.jar<br>E:\bea\modules\com.bea.cie.gpr-xbean_2.8.0.0.jar<br>E:\bea\modules\com.bea.cie.instinfo_5.7.0.0.jar<br>E:\bea\modules\com.bea.cie.paf_1.1.0.0.jar<br>E:\bea\modules\com.bea.cie.paf-impl_1.1.0.0.jar<br>E:\bea\modules\com.bea.cie.patch-client_3.1.0.0.jar<br>E:\bea\modules\com.bea.cie.patch-common_3.1.0.0.jar<br>E:\bea\modules\com.bea.cie.plugin_2.1.0.0.jar<br>E:\bea\modules\com.bea.cie.plugin-wizard_2.1.2.0.jar<br>E:\bea\modules\com.bea.cie.quickstart_10.3.0.0.jar<br>E:\bea\modules\com.bea.cie.uninstall_5.9.0.0.jar<br>E:\bea\modules\com.bea.cie.wizard_5.6.0.0.jar<br>E:\bea\modules\com.bea.cie.wlw-plaf_5.2.0.0.jar<br>E:\bea\modules\com.bea.cie.xmldh_2.2.0.0.jar<br>E:\bea\modules\com.bea.cie.xmldh_2.3.0.0.jar<br>E:\bea\modules\com.bea.core.annogen_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.antlr.runtime_2.7.7.jar<br>E:\bea\modules\com.bea.core.antlr_2.7.7.jar<br>E:\bea\modules\com.bea.core.apache.commons.collections_3.2.0.jar<br>E:\bea\modules\com.bea.core.apache.commons.lang_2.1.0.jar<br>E:\bea\modules\com.bea.core.apache.commons.logging.api_1.1.0.jar<br>E:\bea\modules\com.bea.core.apache.commons.logging_1.1.0.jar<br>E:\bea\modules\com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar<br>E:\bea\modules\com.bea.core.apache.commons.pool_1.3.0.jar<br>E:\bea\modules\com.bea.core.apache.dom_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.apache.log4j_1.0.0.0_1-2-13.jar<br>E:\bea\modules\com.bea.core.apache.log4j_1.2.13.jar<br>E:\bea\modules\com.bea.core.apache.logging_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.apache.oro_1.0.0.0_2-0-8.jar<br>E:\bea\modules\com.bea.core.apache.regexp_1.0.0.0_1-4.jar<br>E:\bea\modules\com.bea.core.apache.xalan_2.7.0.jar<br>E:\bea\modules\com.bea.core.apache.xml.security_1.3.0.jar<br>E:\bea\modules\com.bea.core.apache.xml.serializer_2.7.0.jar<br>E:\bea\modules\com.bea.core.bea.opensaml2_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.bea.opensaml_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.beangen_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.beaninfo_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.binxml_0.9.6.0.jar<br>E:\bea\modules\com.bea.core.certj_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.common.engine.api_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.engine.impl_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.api_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.i18n_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.impl_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.jdkutils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.providers.env_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.providers.utils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.saml2.manage_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.saml2.utils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.saml2_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.saml.utils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.utils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.xacml_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.common.security.xacmlproviders.utils_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.compat.wl.90_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.datasource6.binding_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.datasource6_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.datasource_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor.j2ee.binding_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor.j2ee_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor.settable.binding_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor.wl.binding_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor.wl_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.descriptor_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.accessor.binding_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.accessor_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.core_2.1.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.instrumentor_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.logging_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.notifications_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.query_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.diagnostics.snmp_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.ejbgen_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.http.pubsub.binding_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.http.pubsub.mbean_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.http.pubsub_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.i18n.generator_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.i18n.tools_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.i18n_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.jarbuilder_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.jatmi_1.2.0.3.jar<br>E:\bea\modules\com.bea.core.jmspool_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.jsafe_3.5.0.jar<br>E:\bea\modules\com.bea.core.kodo.integration.binding_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.kodo.integration.tools_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.kodo.integration_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar<br>E:\bea\modules\com.bea.core.ldapjdk_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.logging_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.management.core.binding_2.3.0.0.jar<br>E:\bea\modules\com.bea.core.management.core_2.3.0.0.jar<br>E:\bea\modules\com.bea.core.management.jmx_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.mbean.maker_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.mbean.support_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.messaging.kernel_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.monitoring.harvester.api_2.1.0.0.jar<br>E:\bea\modules\com.bea.core.monitoring.harvester.jmx_2.1.0.0.jar<br>E:\bea\modules\com.bea.core.nodemanager.plugin_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.process_5.4.0.0.jar<br>E:\bea\modules\com.bea.core.redef.binding_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.redef_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.redefagent_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.repackaged.apache.bcel_5.2.1.0.jar<br>E:\bea\modules\com.bea.core.repackaged.apache.commons.logging_1.2.0.jar<br>E:\bea\modules\com.bea.core.repackaged.asm.commons_3.0.jar<br>E:\bea\modules\com.bea.core.repackaged.asm.tree_3.0.jar<br>E:\bea\modules\com.bea.core.repackaged.asm.util_3.0.jar<br>E:\bea\modules\com.bea.core.repackaged.asm_3.0.jar<br>E:\bea\modules\com.bea.core.repackaged.aspectj.aspectjweaver_5.1.0.jar<br>E:\bea\modules\com.bea.core.repackaged.jdt_3.2.2.0.jar<br>E:\bea\modules\com.bea.core.repackaged.springframework.pitchfork_1.1.0.0_1-0.jar<br>E:\bea\modules\com.bea.core.repackaged.springframework.spring_2.0.3.jar<br>E:\bea\modules\com.bea.core.resourcepool_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.serp_1.14.2.0.jar<br>E:\bea\modules\com.bea.core.store.admintool_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.store.gxa_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.store.jdbc_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.store_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.timers_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.transaction_2.5.0.0.jar<br>E:\bea\modules\com.bea.core.utils.agent_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.utils.classloaders_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.utils.compiler_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.utils.expressions_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.utils.full_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.utils.wrapper_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.utils_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.commons.logging_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.lifecycle_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.rmi.client_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.saaj_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.security.auth_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.security.digest_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.security.identity_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.security.logger_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.security.wls_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.weblogic.security_1.0.0.0_5-0-2-0.jar<br>E:\bea\modules\com.bea.core.weblogic.socket.api_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.stax_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.web.api_1.2.0.0.jar<br>E:\bea\modules\com.bea.core.weblogic.workmanager_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.woodstox_1.0.0.0_3-2-4.jar<br>E:\bea\modules\com.bea.core.workarea_1.4.0.0.jar<br>E:\bea\modules\com.bea.core.ws.axis_1.0.0.0.jar<br>E:\bea\modules\com.bea.core.ws.wsdl4j_1.5.1.jar<br>E:\bea\modules\com.bea.core.xml.beaxmlbeans_1.0.0.0_2-4-0.jar<br>E:\bea\modules\com.bea.core.xml.beaxmlbeans_2.2.0.0.jar<br>E:\bea\modules\com.bea.core.xml.stax_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.xml.staxb.buildtime_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.xml.staxb.runtime_1.3.0.0.jar<br>E:\bea\modules\com.bea.core.xml.weblogic.xpath_1.1.0.0.jar<br>E:\bea\modules\com.bea.core.xml.xmlbeans_1.0.0.0_2-4-0.jar<br>E:\bea\modules\com.bea.core.xml.xmlbeans_2.2.0.0.jar<br>E:\bea\modules\com.bea.core.xquery.beaxmlbeans-interop_0.9.6.0.jar<br>E:\bea\modules\com.bea.core.xquery.xmlbeans-interop_0.9.6.0.jar<br>E:\bea\modules\com.bea.core.xquery_0.9.6.0.jar<br>E:\bea\modules\com.bea.mbean.typing.util_1.2.0.0.jar<br>E:\bea\modules\com.bea.web.pubsub.jms_1.2.0.0.jar<br>E:\bea\modules\com.bea.web.pubsub.security_1.2.0.0.jar<br>E:\bea\modules\com.sun.jimi_1.0.0.0.jar<br>E:\bea\modules\glassfish.el_2.1.0.jar<br>E:\bea\modules\glassfish.jaxb_2.1.6.jar<br>E:\bea\modules\glassfish.jaxws.fastinfoset_2.1.3.jar<br>E:\bea\modules\glassfish.jaxws.mimepull_1.0.144.jar<br>E:\bea\modules\glassfish.jaxws.resolver_2.1.3.jar<br>E:\bea\modules\glassfish.jaxws.rt_2.1.3.jar<br>E:\bea\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar<br>E:\bea\modules\glassfish.jstl_1.2.0.1.jar<br>E:\bea\modules\glassfish.stax.ex_1.0.0.0_1-2.jar<br>E:\bea\modules\glassfish.xmlstreambuffer_0.5.221.jar<br>E:\bea\modules\javax.activation_1.1.0.0_1-1.jar<br>E:\bea\modules\javax.activation_1.1.jar<br>E:\bea\modules\javax.annotation_1.1.jar<br>E:\bea\modules\javax.ejb_3.0.1.jar<br>E:\bea\modules\javax.enterprise.deploy_1.2.jar<br>E:\bea\modules\javax.interceptor_1.0.jar<br>E:\bea\modules\javax.jdo_2.0.1.jar<br>E:\bea\modules\javax.jms_1.1.1.jar<br>E:\bea\modules\javax.jsf_1.2.0.0.jar<br>E:\bea\modules\javax.jsp_1.1.0.0_2-1.jar<br>E:\bea\modules\javax.jws_2.0.jar<br>E:\bea\modules\javax.mail_1.1.0.0_1-1.jar<br>E:\bea\modules\javax.mail_1.4.jar<br>E:\bea\modules\javax.management.j2ee_1.0.jar<br>E:\bea\modules\javax.management.remote_1.0.1.3.jar<br>E:\bea\modules\javax.management_1.2.1.jar<br>E:\bea\modules\javax.persistence_1.0.0.0_1-0.jar<br>E:\bea\modules\javax.resource_1.5.1.jar<br>E:\bea\modules\javax.security.jacc_1.0.0.0_1-1.jar<br>E:\bea\modules\javax.servlet_1.0.0.0_2-5.jar<br>E:\bea\modules\javax.transaction_1.0.0.0_1-1.jar<br>E:\bea\modules\javax.xml.bind_2.1.1.jar<br>E:\bea\modules\javax.xml.registry_1.0.0.0_1-0.jar<br>E:\bea\modules\javax.xml.rpc_1.1.jar<br>E:\bea\modules\javax.xml.rpc_1.2.1.jar<br>E:\bea\modules\javax.xml.soap_1.3.0.0.jar<br>E:\bea\modules\javax.xml.soap_1.3.1.0.jar<br>E:\bea\modules\javax.xml.stream_1.0.0.0.jar<br>E:\bea\modules\javax.xml.stream_1.1.1.0.jar<br>E:\bea\modules\javax.xml.ws_2.1.1.jar<br>E:\bea\modules\javolution_3.7.19.0.jar<br>E:\bea\modules\joda.time_1.2.1.0.jar<br>E:\bea\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar<br>E:\bea\modules\org.apache.ant.patch_1.1.0.0_1-6-5.jar</p> <p> </p> <p>注:本来这里面还有这几个包</p> <p>但我在网上找了一下</p> <p>有的说可能是包有重复</p> <p>我就把哪几个包去掉了.</p> <p>但去掉后还是照样报错.</p> <p> </p> <p>如下:</p> <p>com.bea.core.apache.velocity.dep_1.4.jar</p> <p>com.bea.core.apache.velocity_1.4.jar</p> <p>com.bea.core.apache.xerces.resolver_2.8.1.jar</p> <p>com.bea.core.apache.xercesImpl_2.8.1.jar</p> <p>com.bea.core.apache_1.2.0.0.jar</p> <p>com.bea.core.apache.xerces.xml-apis_2.8.1.jar</p> <p>glassfish.jaxb.xjc_2.1.6.jar</p> <p> </p> <p>如有知道问题解决办法者,望真诚相告,非常感谢!</p>
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
深析Synchronized关键字(小白慎入,深入jvm源码,两万字长文)
目录一、synchronized基础1.1synchronized的使用1.1示例1.2验证1.2.1 普通方法和代码块中使用this是同一个监视器(锁),即某个具体调用该代码的对象1.2.2 静态方法和代码块中使用该类的class对象是同一个监视器,任何该类的对象调用该段代码时都是在争夺同一个监视器的锁定1.2、synchronized的特点二、synchronized进阶2.1对象头2.2sy
GitHub 总星 4w+!删库?女装?表情包?这些沙雕中文项目真是我每天快乐的源泉!
大家好,我是 Rocky0429,一个喜欢在 GitHub 上瞎逛的蒟蒻… 好看的皮囊千篇一律,有趣的灵魂没有底线。作为全球最大的同性交友网站,GayHub GitHub 上不止有鲜活的代码,秃头的算法,还有很多拥有有(sha)趣(diao)灵魂的宝藏。 还记得我之前给大家介绍的 Sorry 项目嘛,一个可以自己做表情包的项目,这个的沙雕程度在下面这些项目面前只能算弟弟。虽然说沙雕不分国...
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
20道你必须要背会的微服务面试题,面试一定会被问到
这篇博客总结了面试中最常见的微服务面试题,相信对你有所帮助。
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
C语言数字图像处理---1.4直方图拉伸和直方图均衡化
本篇将延续上一篇的内容,对直方图进行扩展,讲述直方图拉伸和直方图均衡化两个内容,并通过简单的C语言来实现这两个基础功能,让初学者通俗易懂。
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
没用过这些 IDEA 插件?怪不得写代码头疼
使用插件,可以提高开发效率。对于开发人员很有帮助。这篇博客介绍了IDEA中最常用的一些插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
推荐一些有趣的在线编程游戏
1.Robocode 让坦克们互相博弈的游戏,你可以看到它们飞奔,碾碎一切挡道的东西。机器人配有雷达与火炮,选手在躲避对手进攻的同时攻击对手,以此来较量得分的多少。这个游戏很有意思,曾经令我沉迷… 你可以用Java、Scala、C#等编程语言,编写人工智能程序,驱动机器人。 2.Code Combat Code Combat是一款学习编程的角色扮演游戏。每一关都用任务的形式设立目标,用实时的反馈...
工作十年的数据分析师被炒,没有方向,你根本躲不过中年危机
2020年刚刚开始,就意味着离职潮高峰的到来,我身边就有不少人拿着年终奖离职了,而最让我感到意外的,是一位工作十年的数据分析师也离职了,不同于别人的主动辞职,他是被公司炒掉的。 很多人都说数据分析是个好饭碗,工作不累薪资高、入门简单又好学。然而今年34的他,却真正尝到了中年危机的滋味,平时也有不少人都会私信问我: 数据分析师也有中年危机吗?跟程序员一样是吃青春饭的吗?该怎么保证自己不被公司淘汰...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
张朝阳回应迟到 1 分钟罚 500:资本家就得剥削员工
loonggg读完需要2分钟速读仅需 1 分钟大家我,我是你们的校长。前几天,搜狐的董事局主席兼 CEO 张朝阳和搜狐都上热搜了。原因很简单,就是搜狐出了“考勤新规”。一封搜狐对员工发布...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
世界上有哪些代码量很少,但很牛逼很经典的算法或项目案例?
点击上方蓝字设为星标下面开始今天的学习~今天分享四个代码量很少,但很牛逼很经典的算法或项目案例。1、no code 项目地址:https://github.com/kelseyhight...
​两年前不知如何编写代码的我,现在是一名人工智能工程师
全文共3526字,预计学习时长11分钟 图源:Unsplash 经常有小伙伴私信给小芯,我没有编程基础,不会写代码,如何进入AI行业呢?还能赶上AI浪潮吗? 任何时候努力都不算晚。 下面,小芯就给大家讲一个朋友的真实故事,希望能给那些处于迷茫与徘徊中的小伙伴们一丝启发。(下文以第一人称叙述) 图源:Unsplash 正如Elsa所说,职业转换是...
强烈推荐10本程序员必读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
作为一个程序员,内存的这些硬核知识你必须懂!
我们之前讲过CPU,也说了CPU和内存的那点事儿,今天咱就再来说说有关内存,作为一个程序员,你必须要懂的哪那些硬核知识! 大白话聊一聊,很重要! 先来大白话的跟大家聊一聊,我们这里说的内存啊,其实就是说的我们电脑里面的内存条,所以嘞,内存就是内存条,数据要放在这上面才能被cpu读取从而做运算,还有硬盘,就是电脑中的C盘啥的,一个程序需要运行的话需要向内存申请一块独立的内存空间,这个程序本身是存放在...
非典逼出了淘宝和京东,新冠病毒能够逼出什么?
loonggg读完需要5分钟速读仅需 2 分钟大家好,我是你们的校长。我知道大家在家里都憋坏了,大家可能相对于封闭在家里“坐月子”,更希望能够早日上班。今天我带着大家换个思路来聊一个问题...
牛逼!一行代码居然能解决这么多曾经困扰我半天的算法题
春节假期这么长,干啥最好?当然是折腾一些算法题了,下面给大家讲几道一行代码就能解决的算法题,当然,我相信这些算法题你都做过,不过就算做过,也是可以看一看滴,毕竟,你当初大概率不是一行代码解决的。 学会了一行代码解决,以后遇到面试官问起的话,就可以装逼了。 一、2 的幂次方 问题描述:判断一个整数 n 是否为 2 的幂次方 对于这道题,常规操作是不断这把这个数除以 2,然后判断是否有余数,直到 ...
Spring框架|JdbcTemplate介绍
文章目录一、JdbcTemplate 概述二、创建对象的源码分析三、JdbcTemplate操作数据库 一、JdbcTemplate 概述 在之前的web学习中,学习了手动封装JDBCtemplate,其好处是通过(sql语句+参数)模板化了编程。而真正的JDBCtemplete类,是Spring框架为我们写好的。 它是 Spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单...
谁说程序员不懂浪漫——我的C语言结婚请柬(附源码)
前言:但行好事,莫问前程——《增广贤文》 从上学起开始学C++,后面也做过H5,现在做Android。无论是学习用的,还是工作用的,上百个软件不止。但最另我骄傲的是,我用程序烂漫了一把。 用C++语言,利用WIN32框架写一个结婚请柬,文末附源码和使用方法,大家可以自行修改,记得帮我点赞哦。 点开程序,你的电脑像中毒一般,漫天的樱花从屏幕上方,伴随着歌声《今天你要嫁给我》,缓缓落下。 ...
为什么说程序员做外包没前途?
之前做过不到3个月的外包,2020的第一天就被释放了,2019年还剩1天,我从外包公司离职了。我就谈谈我个人的看法吧。首先我们定义一下什么是有前途 稳定的工作环境 不错的收入 能够在项目中不断提升自己的技能(ps:非技术上的认知也算) 找下家的时候能找到一份工资更高的工作 如果你目前还年轻,但高不成低不就,只有外包offer,那请往下看。 外包公司你应该...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
终于!疫情之下,第一批企业没能熬住面临倒闭,员工被遣散,没能等来春暖花开!
先来看一个图: 这个春节,我同所有人一样,不仅密切关注这次新型肺炎,还同时关注行业趋势和企业。在家憋了半个月,我选择给自己看书充电。因为在疫情之后,行业竞争会更加加剧,必须做好未雨绸缪,时刻保持充电。 看了今年的情况,突然想到大佬往年经典语录: 马云:未来无业可就,无工可打,无商可务 李彦宏:人工智能时代,有些专业将被淘汰,还没毕业就失业 马化腾:未来3年将大洗牌,迎21世界以来最大失业潮 王...
立即提问