hibernate.cfg.xml
--------------------------------------------------------------------------------------------------------------------
<?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.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://user</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">root</property>
  </session-factory>
</hibernate-configuration>
--------------------------------------------------------------------------------------------------------------------net.test.bean.Country.java
--------------------------------------------------------------------------------------------------------------------
package net.test.bean;
public class Country {    private String CID;
    private String Country_cn;
    private String Country_en;
    private String Continent;
    private Short  TimeZone;
    private String Synopsis;
    private String ThreeCode;
    private String CurrencyCode;
    private String IMECode;    public String getCID() {
        return CID;
    }    public void setCID(String CID) {
        this.CID = CID;
    }    public String getContinent() {
        return Continent;
    }    public void setContinent(String Continent) {
        this.Continent = Continent;
    }    public String getCountry_cn() {
        return Country_cn;
    }    public void setCountry_cn(String Country_cn) {
        this.Country_cn = Country_cn;
    }    public String getCountry_en() {
        return Country_en;
    }    public void setCountry_en(String Country_en) {
        this.Country_en = Country_en;
    }    public String getCurrencyCode() {
        return CurrencyCode;
    }    public void setCurrencyCode(String CurrencyCode) {
        this.CurrencyCode = CurrencyCode;
    }    public String getIMECode() {
        return IMECode;
    }    public void setIMECode(String IMECode) {
        this.IMECode = IMECode;
    }    public String getSynopsis() {
        return Synopsis;
    }    public void setSynopsis(String Synopsis) {
        this.Synopsis = Synopsis;
    }    public String getThreeCode() {
        return ThreeCode;
    }    public void setThreeCode(String ThreeCode) {
        this.ThreeCode = ThreeCode;
    }    public Short getTimeZone() {
        return TimeZone;
    }    public void setTimeZone(Short TimeZone) {
        this.TimeZone = TimeZone;
    }
}
--------------------------------------------------------------------------------------------------------------------Country.hbm.xml
--------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
     <class name="net.test.bean.Country" table="Country" >
       <id name="cid" column="cid" >
             <generator class="assigned" />
         </id>
         <property name="Country_cn" column="country_cn" />
         <property name="Country_en" column="country_en" />
         <property name="Continent" column="Continent" />
         <property name="IMECode" column="IMECode" />
         <property name="CurrencyCode" column="CurrencyCode" />
         <property name="Synopsis" column="Synopsis" />
         <property name="ThreeCode" column="ThreeCode" />
         <property name="TimeZone" column="TimeZone" />
     </class>
</hibernate-mapping>
--------------------------------------------------------------------------------------------------------------------
net.test.servlte.outputCountry.java
--------------------------------------------------------------------------------------------------------------------
package net.test.servlte;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.test.bean.Country;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class outputCountry extends HttpServlet {
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=gb2312");
        response.setCharacterEncoding("gb2312");
        request.setCharacterEncoding("gb2312");
        PrintWriter out = response.getWriter();
        Configuration config=new Configuration().configure();
        SessionFactory sf=config.buildSessionFactory();
        Session session=sf.openSession();
        String strsql="select * from country ";
        Query query=session.createQuery(strsql);
        List list=query.list();
        Iterator it=list.iterator();
        while(it.hasNext())
        {
            Country c=(Country)it.next();
            out.println(c.getCID()+c.getCountry_cn()+c.getCountry_en()+c.getContinent()+c.getCurrencyCode()+c.getIMECode()+c.getSynopsis()+"</br>");
        }
        
        
    }     protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    } 
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }
}
我所导入的包
mysql-connector-java-5.1.5-bin.jar
acegi-security-0.8.2.jar
asm.jar
castor-1.0-xml.jar
cglib-2.1.jar
commons-beanutils.jar
commons-codec.jar
commons-collections-3.1.jar
commons-digester.jar
dom4j-1.6.jar
ehcache-1.1.jar
hibernate3.jar
hsqldb-1.7.3.0.jar
jaxen-1.1-beta-4.jar
jdom.jar
jstl.jar
jta.jar
portlet.jar
rome-0.8.jar
spring.jar
standard.jar
struts.jar
xerces-J-1.4.0.jarweb容器
GlassFish v2
运行时报错type ??????????????????? (), ?????????? javax.servlet.ServletException: PWC1244?Servlet ??????
???? java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
???? java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
? Sun Java System Application Server 9.1_02 ????????????????????高手帮我看一下到底是哪里出了问题 我己经找了一个星期了 

解决方案 »

  1.   

    java.lang.ClassNotFoundException
    缺包啊,缺少commons-logging.jar
    来这里下http://commons.apache.org/downloads/download_logging.cgi
      

  2.   

    我后来又多导入了 commons-logging-1.0.4.jar 和 commons-logging-api-1.1.jar 这两外包,hibernate.cfg.xml改了几处小错误  改了的文件如下
    <?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.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/express</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">root</property>
      </session-factory>
    </hibernate-configuration>
    用 tomcat6.0出现的错误如下
    type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.hibernate.hql.ast.QuerySyntaxError: unexpected token: * near line 1, column 8 [select * from country]
    org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
    org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:44)
    net.test.servlte.outputCountry.doGet(outputCountry.java:63)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause 
    line 1:8: unexpected token: *
    org.hibernate.hql.antlr.HqlBaseParser.selectClause(HqlBaseParser.java:945)
    org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:721)
    org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:599)
    org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:260)
    org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:150)
    org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:44)
    net.test.servlte.outputCountry.doGet(outputCountry.java:63)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
      

  3.   

    在Hibernate的hql中不支持 * ,你最好改一下!
      

  4.   

    select * from country的select *可以去掉
      

  5.   

    楼上的兄弟门,我己经把 select * from country 改成了 from country 了
    还是报如下的错误.type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.hibernate.hql.ast.QuerySyntaxError: country is not mapped. [from country]
    org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:42)
    net.test.servlte.outputCountry.doGet(outputCountry.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause  country is not mapped.
    org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
    org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
    org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)
    org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:217)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2830)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:42)
    net.test.servlte.outputCountry.doGet(outputCountry.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
      

  6.   

    我在outputCountry.java里面发现少写了一句话config.addClass(Country.class);但加了上去,还报如下错误,org.hibernate.MappingException: Error reading resource: net/test/bean/Country.hbm.xml
    org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
    org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
    org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:37)
    net.test.servlte.outputCountry.doGet(outputCountry.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause org.hibernate.PropertyNotFoundException: field not found: cid
    org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:96)
    org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:103)
    org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:111)
    org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:90)
    org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:78)
    org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
    org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
    org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
    org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
    org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
    org.hibernate.cfg.Configuration.add(Configuration.java:360)
    org.hibernate.cfg.Configuration.addInputStream(Configuration.java:397)
    org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
    org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
    org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
    org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:37)
    net.test.servlte.outputCountry.doGet(outputCountry.java:61)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
      

  7.   

    哎,没办法,我的第一个hibernate程序就没有跑起来!
      

  8.   

    org.hibernate.PropertyNotFoundException: field not found: cid 
    看有这个属性没
      

  9.   

    我己经把cid改成了CID,但还是报错type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.hibernate.hql.ast.QuerySyntaxError: country is not mapped. [from country]
    org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:43)
    net.test.servlte.outputCountry.doGet(outputCountry.java:62)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause  country is not mapped.
    org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
    org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
    org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)
    org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:217)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2830)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:43)
    net.test.servlte.outputCountry.doGet(outputCountry.java:62)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
      

  10.   

    我己经把cid改成了CID,但还是报错type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.hibernate.hql.ast.QuerySyntaxError: country is not mapped. [from country]
    org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:43)
    net.test.servlte.outputCountry.doGet(outputCountry.java:62)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause  country is not mapped.
    org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
    org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
    org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)
    org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:217)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2830)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
    org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
    org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
    org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
    org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
    org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
    org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:880)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    net.test.servlte.outputCountry.processRequest(outputCountry.java:43)
    net.test.servlte.outputCountry.doGet(outputCountry.java:62)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
      

  11.   

    country is not mapped. [from country] 
    把country改成Country,你前面的Country.hbm.xml 里的class标签写的是Country
      

  12.   

    HQL :select * from Country c 
    我在想你的Country这个类名是小写的?最好给Country写个别名 就想上面写的 Country c
      

  13.   

    org.hibernate.hql.ast.QuerySyntaxError: country is not mapped. [from country]说的是country没有这个类你应该把那个country的c大写才是吧,直接写成 from Country,不用select *
      

  14.   

    老兄:hibernate.cfg.xml 里面要设置加载Country.hbm.xml 才行啊<mapping resource="Country.hbm.xml"/>