按有几个群,你不妨加进去,可以和大家一起讨论啊.........46986340,28039577,4804620                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
在那里看看有无能回答你的,谢谢,LZ,甭忘了给俺分哦,谢谢LZ

解决方案 »

  1.   

    不知道你查询的时候能不能正常查询出数据,
    看你的报错信息感觉是包冲突,跟踪调试不行吗?另外你的tx是不是为null啊?
      

  2.   

    登录的时候也不行,所以不能正常查询。
    对于debug这个功能不是很了解
    同时,在注册的页面,对email和user没有进行验证,就直接跳回到主页了,也就是return   actionMapping.findForward(target); 
      

  3.   

    对于包的问题,在tomcat启动时有这样一句话:
    信息: validateJarFile(E:\apache-tomcat-5.5.25\webapps\ygweb\WEB-INF\lib\servlet-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class不知道是不是这个原因?ps:这个项目我是直接从同事那拷贝过来的,在他那里能够跑起来,可在我这里就出现了这个问题。我那同事已经辞职了,所以找不到他,所以发帖问了
      

  4.   

    debug功能很好用;
    设置断点调试,F6执行、F5进入方法执行、F7跳出方法。你先写个测试连接数据库的类,看看能不能正常查询数据库,总感觉报错信息怪怪的
    try   { 
                s   =   HibernateUtil.currentSession(); 
                tx   =   s.beginTransaction(); 
               //在这个位置看看tx是否为null        
               s.save(obj); 
                tx.commit(); 
            } 
    ...
      

  5.   

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    <hibernate-mapping>
    <class name="com.sunyard.approve.bean.EssUser" table="ESSUSER">
    <id name="userId" column="userid" type="string" length="32">
    <generator class="assigned"/>
    </id>
    <property name="email" column="email" type="string" length="50" />
    <property column="climecode" length="20" name="climecode" type="string"/>
    <property column="climename" length="32" name="climename" type="string"/>
    <property name="question" column="question" type="string" length="200"/>
    <property name="answer" column="answer" type="string" length="200"/>
    <property name="nickname" column="nickname" type="string" length="50"/>
    <property name="name" column="name" type="string" length="100"/>
    <property name="sex" column="sex" type="string" length="50"/>
    <property name="birth" column="birth" type="string" length="50"/>
    <property name="address" column="address" type="string" length="200"/>
    <property name="msn" column="msn" type="string" length="50"/>
    <property name="mobile" column="mobile" type="string" length="50"/>
    <property name="qq" column="qq" type="string" length="50"/>
    <property name="province" column="province" type="string" length="50"/>
    <property name="city" column="city" type="string" length="50"/>
    <property name="company" column="company" type="string" length="100"/>
    <property name="companyaddress" column="companyaddress" type="string" length="100"/>
    <property name="postalcode" column="postalcode" type="string" length="50"/>
    <property name="contractphone" column="contractphone" type="string" length="50"/>
    <property name="officephone" column="officephone" type="string" length="50"/>
    <property name="homephone" column="homephone" type="string" length="50"/>
    <property name="otherphone" column="otherphone" type="string" length="50"/>
    <property name="nationality" column="nationality" type="string" length="50"/>
    <property name="nativeplace" column="nativeplace" type="string" length="50"/>
    <property name="culture" column="culture" type="string" length="50"/>
    <property name="othermail" column="othermail" type="string" length="100"/>
    <property name="idcard" column="idcard" type="string" length="50"/>
    <property name="idcardtype" column="idcardtype" type="string" length="50"/>
    <property name="othername" column="othername" type="string" length="50"/>
    <property name="depname" column="depname" type="string" length="100"/>
    <property name="umadminid" column="umadminid" type="string" length="50"/>
    <property name="depid" column="depid" type="string" length="20"/>
    <property name="canusemail" column="canusemail" type="string" length="100"/>
    <property name="username" column="username" type="string" length="50"/>
    <property name="password" column="password" type="string" length="50"/>
    <property name="status" column="status" type="string" length="1"/></class>
    </hibernate-mapping>
      

  6.   

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    <hibernate-mapping>
    <class name="com.sunyard.approve.bean.EssUser" table="ESSUSER">
    <id name="userId" column="userid" type="string" length="32">
    <generator class="assigned"/>
    </id>
    <property name="email" column="email" type="string" length="50" />
    <property column="climecode" length="20" name="climecode" type="string"/>
    <property column="climename" length="32" name="climename" type="string"/>
    <property name="question" column="question" type="string" length="200"/>
    <property name="answer" column="answer" type="string" length="200"/>
    <property name="nickname" column="nickname" type="string" length="50"/>
    <property name="name" column="name" type="string" length="100"/>
    <property name="sex" column="sex" type="string" length="50"/>
    <property name="birth" column="birth" type="string" length="50"/>
    <property name="address" column="address" type="string" length="200"/>
    <property name="msn" column="msn" type="string" length="50"/>
    <property name="mobile" column="mobile" type="string" length="50"/>
    <property name="qq" column="qq" type="string" length="50"/>
    <property name="province" column="province" type="string" length="50"/>
    <property name="city" column="city" type="string" length="50"/>
    <property name="company" column="company" type="string" length="100"/>
    <property name="companyaddress" column="companyaddress" type="string" length="100"/>
    <property name="postalcode" column="postalcode" type="string" length="50"/>
    <property name="contractphone" column="contractphone" type="string" length="50"/>
    <property name="officephone" column="officephone" type="string" length="50"/>
    <property name="homephone" column="homephone" type="string" length="50"/>
    <property name="otherphone" column="otherphone" type="string" length="50"/>
    <property name="nationality" column="nationality" type="string" length="50"/>
    <property name="nativeplace" column="nativeplace" type="string" length="50"/>
    <property name="culture" column="culture" type="string" length="50"/>
    <property name="othermail" column="othermail" type="string" length="100"/>
    <property name="idcard" column="idcard" type="string" length="50"/>
    <property name="idcardtype" column="idcardtype" type="string" length="50"/>
    <property name="othername" column="othername" type="string" length="50"/>
    <property name="depname" column="depname" type="string" length="100"/>
    <property name="umadminid" column="umadminid" type="string" length="50"/>
    <property name="depid" column="depid" type="string" length="20"/>
    <property name="canusemail" column="canusemail" type="string" length="100"/>
    <property name="username" column="username" type="string" length="50"/>
    <property name="password" column="password" type="string" length="50"/>
    <property name="status" column="status" type="string" length="1"/></class>
    </hibernate-mapping>
      

  7.   

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
              "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
              "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"><!-- Generated by MyEclipse Hibernate Tools.                   -->
    <hibernate-configuration>    <session-factory>
            <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
            <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
            <property name="connection.username">aaaa</property>
            <property name="connection.password">aaaa</property>        <property name="connection.url">jdbc:oracle:thin:@127.0.0.1:1521:ORADB</property>     <property name="connection.pool.size">1</property>
            <property name="statement_cache.size">25</property>
            <property name="jdbc.fetch_size">50</property>
            <property name="jdbc.batch_size">1</property>
            <property name="show_sql">false</property>        <!-- 浠ヤ笅鏄熀鏈敤渚嬫ā鍧� -->
            <mapping resource="com/sunyard/qsis/bean/caseinfo/QsCaseinfo.hbm.xml"/>
            <mapping resource="com/sunyard/qsis/bean/caseinfo/QsCaseex.hbm.xml"/>
            <mapping resource="com/sunyard/qsis/bean/caseinfo/QsNodeinfo.hbm.xml"/>
            <mapping resource="com/sunyard/qsis/bean/caseinfo/QsNodeex.hbm.xml"/>
            <mapping resource="com/sunyard/qsis/bean/caseinfo/QsBusiflow.hbm.xml"/>
            <mapping resource="com/sunyard/qsis/bean/caseinfo/CaseNodeInfo.hbm.xml"/>
    .........
           </session-factory></hibernate-configuration>
      

  8.   

    错误信息不完整,不能判断,另外最好也看看DTO,初步判断可能是数据库没开之类问题
      

  9.   

    数据库已经确定开了,同时user and password is right,oracle是放在另外一台机器上的,非本机上
      

  10.   

    数据库放到另一台机器那么
    <property   name="connection.url"> jdbc:oracle:thin:@127.0.0.1:1521:ORADB </property>
    这样行吗?
    要写成那台机器的IP吧
      

  11.   

    错误信息:
    2008-1-18 9:35:36 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Sun\SDK\jdk\bin;E:\apache-tomcat-5.5.25\bin
    2008-1-18 9:35:36 org.apache.coyote.http11.Http11BaseProtocol init
    信息: Initializing Coyote HTTP/1.1 on http-3030
    2008-1-18 9:35:36 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 1282 ms
    2008-1-18 9:35:36 org.apache.catalina.core.StandardService start
    信息: Starting service Catalina
    2008-1-18 9:35:36 org.apache.catalina.core.StandardEngine start
    信息: Starting Servlet Engine: Apache Tomcat/5.5.25
    2008-1-18 9:35:36 org.apache.catalina.core.StandardHost start
    信息: XML validation disabled
    2008-1-18 9:35:37 org.apache.catalina.core.ApplicationContext log
    信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    2008-1-18 9:35:38 org.apache.catalina.core.ApplicationContext log
    信息: ContextListener: contextInitialized()
    2008-1-18 9:35:38 org.apache.catalina.core.ApplicationContext log
    信息: SessionListener: contextInitialized()
    2008-1-18 9:35:38 org.apache.catalina.core.ApplicationContext log
    信息: ContextListener: contextInitialized()
    2008-1-18 9:35:38 org.apache.catalina.core.ApplicationContext log
    信息: SessionListener: contextInitialized()
    2008-1-18 9:35:39 org.apache.catalina.loader.WebappClassLoader validateJarFile
    信息: validateJarFile(E:\apache-tomcat-5.5.25\webapps\ygweb\WEB-INF\lib\servlet-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
    log4j:WARN Please initialize the log4j system properly.
    09:35:43,046 DEBUG SunFormInitPlugIn:154 - Init xslt resource...
    09:35:43,609 DEBUG SunFormInitPlugIn:193 - Add 0 xslt to Context
    09:35:43,609 DEBUG SunFormInitPlugIn:199 - Init constant table ...
    09:35:43,609  INFO SunFormInitPlugIn:218 - Init GlobaleDataSrc Definition ...
    09:35:43,625  INFO SunFormInitPlugIn:238 - srcFileName is: E:\apache-tomcat-5.5.25\webapps\ygweb\WEB-INF\configs\global_datasrc_init.xml
    09:35:43,625 ERROR GlobalDataSrcDef:87 - SrcFile:  is not exist!
    09:35:43,625  INFO GlobalDataSrcDef:96 - Reload Global DataSrc file...
    09:35:43,906 DEBUG MethodValueDefImpl:68 - Get 0 parameter definitions!
    09:35:43,906 DEBUG MethodValueDefImpl:68 - Get 0 parameter definitions!
    09:35:43,953 DEBUG MethodValueDefImpl:68 - Get 2 parameter definitions!
    .........
    09:35:44,953 DEBUG MethodValueDefImpl:68 - Get 2 parameter definitions!
    09:35:44,953 DEBUG MethodValueDefImpl:68 - Get 1 parameter definitions!
    09:35:44,953 DEBUG MethodValueDefImpl:68 - Get 1 parameter definitions!
    09:35:45,015 DEBUG DataSrcUtils:130 - Get 212 datasrc definitions!
    09:35:45,015  INFO GlobalDataSrcDef:104 - Reload Global DataSrc file, OK!
    09:35:45,015  INFO SunFormInitPlugIn:240 - Init GlobaleDataSrc Definition, OK!
    服务器启动时@创建数据库索引 @
    2008-1-18 9:35:45 org.apache.coyote.http11.Http11BaseProtocol start
    信息: Starting Coyote HTTP/1.1 on http-3030
    2008-1-18 9:35:46 org.apache.jk.common.ChannelSocket init
    信息: JK: ajp13 listening on /0.0.0.0:8009
    2008-1-18 9:35:46 org.apache.jk.server.JkMain start
    信息: Jk running ID=0 time=0/235  config=null
    2008-1-18 9:35:46 org.apache.catalina.storeconfig.StoreLoader load
    信息: Find registry server-registry.xml at classpath resource
    2008-1-18 9:35:46 org.apache.catalina.startup.Catalina start
    信息: Server startup in 10235 ms
    ------正在E:\apache-tomcat-5.5.25\webapps\ygweb\index下建立索引-----
    09:36:30,281 DEBUG EssUserDAOHibernate:47 - net.sf.hibernate.JDBCException: could not load: [com.sunyard.approve.bean.EssUser#[email protected]]
    09:39:41,265 DEBUG EssUserDAOHibernate:84 - net.sf.hibernate.JDBCException: could not insert: [com.sunyard.approve.bean.EssUser#[email protected]]