MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » net.sf.hibernate.JDBCException:   Could &nb

net.sf.hibernate.JDBCException:   Could   not   execute   query(2)

www.MyException.Cn  网友分享于:2013-12-12  浏览:340次

java.lang.NullPointerException
at   org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:374)
at   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at   weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at   weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
at   weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at   weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at   weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at   weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at   weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>  



User.hbm.xml文件
<?xml   version= '1.0 '   encoding= 'utf-8 '?>
<!DOCTYPE   hibernate-mapping
        PUBLIC   "-//Hibernate/Hibernate   Mapping   DTD//EN "
        "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd ">

<hibernate-mapping>
      <class   name= "ems.emsbean.hibernate.User "   table= "user ">
      <id   name= "id "   type= "integer ">
            <column   name= "id "   />
      <generator   class= "native "/>
      </id>

      <property   name= "name "   type= "string ">
            <column   name= "name "   />
      </property>

      <property   name= "engine_type "   type= "string ">
                    <column   name= "engine_type "   />
      </property>

    <property   name= "password "   type= "string ">
                    <column   name= "password "   />
    </property>
    </class>

</hibernate-mapping>


user.java文件
package   ems.emsbean.hibernate;

public   class   User   implements   java.io.Serializable{
    public   User()   {
    }
            //定义用户ID     分别对应数据表中相应的字段
            private   Integer   id;
            //定义用户名
            private   String   name;

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有