Java 初学者-Spring/hibernate集成,asm不兼容

Java 初学者-Spring/hibernate集成,asm不兼容,java,mysql,spring,hibernate,Java,Mysql,Spring,Hibernate,我是spring/hibernate的初学者,尝试运行一些简单的web应用程序来访问远程数据库上的数据 我使用的是Netbeans 7.2,数据库在Mysql 5.X上 我创建了一个虚拟的“User”表,其中包含“id”和“name”列以及少量条目。我从一个索引页面开始,该页面链接到从数据库获取用户信息的用户页面。单击“指向用户的链接”页面时,出现以下错误: org.springframework.web.util.NestedServletException:处理程序处理失败;嵌套异常为jav

我是spring/hibernate的初学者,尝试运行一些简单的web应用程序来访问远程数据库上的数据

我使用的是Netbeans 7.2,数据库在Mysql 5.X上

我创建了一个虚拟的“User”表,其中包含“id”和“name”列以及少量条目。我从一个索引页面开始,该页面链接到从数据库获取用户信息的用户页面。单击“指向用户的链接”页面时,出现以下错误:

org.springframework.web.util.NestedServletException:处理程序处理失败;嵌套异常为java.lang.ExceptionInInitializeError

有人能帮我吗

NB:首先,对不起,如果我做错了什么,对不起

代码:

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>redirect.jsp</welcome-file>
    </welcome-file-list>
</web-app>
User.java

package Model;
// Generated 13 nov. 2012 11:00:50 by Hibernate Tools 3.2.1.GA
/**
 * User generated by hbm2java
 */
public class User  implements java.io.Serializable {
     private Integer id;
     private String name;
    public User() {
    }
    public User(String name) {
       this.name = name;
    }
    public Integer getId() {
        return this.id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
}
User.hbm.xml:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 13 nov. 2012 11:00:50 by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
    <class name="Model.User" table="User" catalog="EPGV_Interface">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="identity" />
        </id>
        <property name="name" type="string">
            <column name="name" length="45" />
        </property>
    </class>
</hibernate-mapping>
redirect.jsp:

<%--
Views should be stored under the WEB-INF folder so that
they are not accessible except through controller process.

This JSP is here to provide a redirect to the dispatcher
servlet but should be the only JSP outside of WEB-INF.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("index.htm"); %>

index.jsp:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Portail</title>
    </head>

    <body>
        <a href="user.htm">Go to user</a>
    </body>
</html>

波尔塔伊
user.jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>test</title>
    </head>
    <body>
        <br>
        <table>
            <tr>
                <td>Id</td>
                <td>Name</td>
            </tr>
            <c:forEach items="${users}" var="user">
            <tr>
                <td><c:out value="${user.id}"></c:out></td>
                <td><c:out value="${user.name}"></c:out></td>
            </tr>
            </c:forEach>
        </table>
    </body>
</html>

测验

身份证件 名称
编辑:来自glassfish服务器管理控制台的日志

我的管理员授予我登录glassfish管理控制台的权限,以下是我获得的“会话”权限

2740    INFO    Redirecting to /index.jsf(details)  org.glassfish.admingui  13 nov. 2012 17:49:17.005   _ThreadID=2631;_ThreadName=Thread-2;

2741    INFO    Admin Console: Initializing Session Attributes...(details)  org.glassfish.admingui  13 nov. 2012 17:49:17.025   _ThreadID=2635;_ThreadName=Thread-2;

2742    INFO    WebModule[null] ServletContext.log():Destroying Spring FrameworkServlet 'dispatcher'(details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:51.886   _ThreadID=2632;_ThreadName=Thread-2;

2743    INFO    Closing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Nov 13 17:45:18 ... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:51.886   _ThreadID=2632;_ThreadName=Thread-2;

2744    INFO    Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44442f... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:51.887   _ThreadID=2632;_ThreadName=Thread-2;

2745    INFO    WebModule[null] ServletContext.log():Closing Spring root WebApplicationContext(details)     javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:51.890   _ThreadID=2632;_ThreadName=Thread-2;

2746    INFO    Closing Root WebApplicationContext: startup date [Tue Nov 13 17:45:18 CET 2012]; root of context hie... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:51.890   _ThreadID=2632;_ThreadName=Thread-2;

2747    INFO    Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@176be9... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:51.891   _ThreadID=2632;_ThreadName=Thread-2;

2748    INFO    WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath(details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.256   _ThreadID=2256;_ThreadName=Thread-2;

2749    INFO    WebModule[null] ServletContext.log():Initializing Spring root WebApplicationContext(details)    javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.312   _ThreadID=2256;_ThreadName=Thread-2;

2750    INFO    Root WebApplicationContext: initialization started(details)     org.springframework.web.context.ContextLoader   13 nov. 2012 17:49:54.312   _ThreadID=2256;_ThreadName=Thread-2;

2751    INFO    Refreshing Root WebApplicationContext: startup date [Tue Nov 13 17:49:54 CET 2012]; root of context ... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:54.432   _ThreadID=2256;_ThreadName=Thread-2;

2752    INFO    Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml](details)    org.springframework.beans.factory.xml.XmlBeanDefinitionReader   13 nov. 2012 17:49:54.503   _ThreadID=2256;_ThreadName=Thread-2;

2753    INFO    Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:54.572   _ThreadID=2256;_ThreadName=Thread-2;

2754    INFO    Root WebApplicationContext: initialization completed in 262 ms(details)     org.springframework.web.context.ContextLoader   13 nov. 2012 17:49:54.574   _ThreadID=2256;_ThreadName=Thread-2;

2755    INFO    WebModule[null] ServletContext.log():Initializing Spring FrameworkServlet 'dispatcher'(details)     javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.607   _ThreadID=2256;_ThreadName=Thread-2;

2756    INFO    FrameworkServlet 'dispatcher': initialization started(details)  org.springframework.web.servlet.DispatcherServlet   13 nov. 2012 17:49:54.607   _ThreadID=2256;_ThreadName=Thread-2;

2757    INFO    Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Nov 13 17:49:... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:54.611   _ThreadID=2256;_ThreadName=Thread-2;

2758    INFO    Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml](details)    org.springframework.beans.factory.xml.XmlBeanDefinitionReader   13 nov. 2012 17:49:54.612   _ThreadID=2256;_ThreadName=Thread-2;

2759    INFO    Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:54.651   _ThreadID=2256;_ThreadName=Thread-2;

2760    INFO    Mapped URL path [/user*] onto handler 'userController'(details)     org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping   13 nov. 2012 17:49:54.670   _ThreadID=2256;_ThreadName=Thread-2;

2761    INFO    Mapped URL path [/index.htm] onto handler 'indexController'(details)    org.springframework.web.servlet.handler.SimpleUrlHandlerMapping     13 nov. 2012 17:49:54.739   _ThreadID=2256;_ThreadName=Thread-2;

2762    INFO    Mapped URL path [/user.htm] onto handler 'userController'(details)  org.springframework.web.servlet.handler.SimpleUrlHandlerMapping     13 nov. 2012 17:49:54.740   _ThreadID=2256;_ThreadName=Thread-2;

2763    INFO    FrameworkServlet 'dispatcher': initialization completed in 205 ms(details)  org.springframework.web.servlet.DispatcherServlet   13 nov. 2012 17:49:54.813   _ThreadID=2256;_ThreadName=Thread-2;

2764    INFO    Loading application [SpringHibernateTuto2] at [/SpringHibernateTuto2](details)  javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.816   _ThreadID=2256;_ThreadName=Thread-2;

2765    INFO    SpringHibernateTuto2 was successfully deployed in 1,007 milliseconds.(details)  javax.enterprise.system.tools.admin.org.glassfish.deployment.admin  13 nov. 2012 17:49:54.823   _ThreadID=2256;_ThreadName=Thread-2;

2766    INFO    Hibernate Annotations 3.3.1.GA(details)     org.hibernate.cfg.annotations.Version   13 nov. 2012 17:50:01.078   _ThreadID=189;_ThreadName=Thread-2;

2767    INFO    Hibernate 3.2.5(details)    org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.093   _ThreadID=189;_ThreadName=Thread-2;

2768    INFO    hibernate.properties not found(details)     org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.097   _ThreadID=189;_ThreadName=Thread-2;

2769    INFO    Bytecode provider name : cglib(details)     org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.099   _ThreadID=189;_ThreadName=Thread-2;

2770    INFO    using JDK 1.4 java.sql.Timestamp handling(details)  org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.103   _ThreadID=189;_ThreadName=Thread-2;

2771    INFO    configuring from resource: /hibernate.cfg.xml(details)  org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.175   _ThreadID=189;_ThreadName=Thread-2;

2772    INFO    Configuration resource: /hibernate.cfg.xml(details)     org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.175   _ThreadID=189;_ThreadName=Thread-2;

2773    INFO    Reading mappings from resource : Model/User.hbm.xml(details)    org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.241   _ThreadID=189;_ThreadName=Thread-2;

2774    INFO    Configured SessionFactory: null(details)    org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.253   _ThreadID=189;_ThreadName=Thread-2;

2775    INFO    Mapping class: Model.User -> User(details)  org.hibernate.cfg.HbmBinder     13 nov. 2012 17:50:01.323   _ThreadID=189;_ThreadName=Thread-2;

2776    INFO    Hibernate Validator not found: ignoring(details)    org.hibernate.cfg.AnnotationConfiguration   13 nov. 2012 17:50:01.342   _ThreadID=189;_ThreadName=Thread-2;

2777    INFO    Using Hibernate built-in connection pool (not for production use!)(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.407   _ThreadID=189;_ThreadName=Thread-2;

2778    INFO    Hibernate connection pool size: 20(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.407   _ThreadID=189;_ThreadName=Thread-2;

2779    INFO    autocommit mode: false(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2780    INFO    using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://inra3.seq.cng.fr:3306/EPGV_Interface?zeroDa... (details)   org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2781    INFO    connection properties: {user=mathieu, password=****}(details)   org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2782    INFO    MySQL, version: 5.1.61(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.417   _ThreadID=189;_ThreadName=Thread-2;

2783    INFO    JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.417   _ThreadID=189;_ThreadName=Thread-2;

2784    INFO    Using dialect: org.hibernate.dialect.MySQLDialect(details)  org.hibernate.dialect.Dialect   13 nov. 2012 17:50:01.435   _ThreadID=189;_ThreadName=Thread-2;

2785    INFO    Using default transaction strategy (direct JDBC transactions)(details)  org.hibernate.transaction.TransactionFactoryFactory     13 nov. 2012 17:50:01.440   _ThreadID=189;_ThreadName=Thread-2;

2786    INFO    No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional secon... (details)   org.hibernate.transaction.TransactionManagerLookupFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2787    INFO    Automatic flush during beforeCompletion(): disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2788    INFO    Automatic session close at end of transaction: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2789    INFO    JDBC batch size: 15(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2790    INFO    JDBC batch updates for versioned data: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.444   _ThreadID=189;_ThreadName=Thread-2;

2791    INFO    Scrollable result sets: enabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2792    INFO    JDBC3 getGeneratedKeys(): enabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2793    INFO    Connection release mode: auto(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2794    INFO    Maximum outer join fetch depth: 2(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.446   _ThreadID=189;_ThreadName=Thread-2;

2795    INFO    Default batch fetch size: 1(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.446   _ThreadID=189;_ThreadName=Thread-2;

2796    INFO    Generate SQL with comments: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2797    INFO    Order SQL updates by primary key: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2798    INFO    Order SQL inserts for batching: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2799    INFO    Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2800    INFO    Using ASTQueryTranslatorFactory(details)    org.hibernate.hql.ast.ASTQueryTranslatorFactory     13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2801    INFO    Query language substitutions: {}(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2802    INFO    JPA-QL strict compliance: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2803    INFO    Second-level cache: enabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2804    INFO    Query cache: disabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2805    INFO    Cache provider: org.hibernate.cache.NoCacheProvider(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2806    INFO    Optimize cache for minimal puts: disabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2807    INFO    Structured second-level cache entries: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2808    INFO    Statistics: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2809    INFO    Deleted entity synthetic identifier rollback: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2810    INFO    Default entity-mode: pojo(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2811    INFO    Named query checking : enabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2812    INFO    building session factory(details)   org.hibernate.impl.SessionFactoryImpl   13 nov. 2012 17:50:01.487   _ThreadID=189;_ThreadName=Thread-2;

2813    SEVERE  Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<i... (details)   javax.enterprise.system.std.com.sun.enterprise.server.logging   13 nov. 2012 17:50:01.626   _ThreadID=189;_ThreadName=Thread-2;

2814    WARNING     StandardWrapperValve[dispatcher]: PWC1406: Servlet.service() for servlet dispatcher threw exception ... (details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:50:01.627   _ThreadID=189;_ThreadName=Thread-2;

2815    INFO    cleaning up connection pool: jdbc:mysql://*****:3306/EPGV_Interface?zeroDateTimeBehavior=... (details)  org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:12.421   _ThreadID=3;_ThreadName=Thread-2;
2740信息重定向到/index.jsf(details)org.glassfish.admingui 2012年11月13日17:49:17.005_ThreadID=2631_ThreadName=Thread-2;
2741信息管理控制台:初始化会话属性…(详细信息)org.glassfish.admingui 2012年11月13日17:49:17.025 _ThreadID=2635_ThreadName=Thread-2;
2742 INFO WebModule[null]ServletContext.log():销毁Spring FrameworkServlet“dispatcher”(详细信息)javax.enterprise.system.container.web.com.sun.enterprise.web 2012年11月13日17:49:51.886_ThreadID=2632_ThreadName=Thread-2;
2743关闭命名空间“dispatcher servlet”的WebApplicationContext的信息:启动日期[11月13日星期二17:45:18…(详细信息)org.springframework.web.context.support.XmlWebApplicationContext 2012年11月13日17:49:51.886_ThreadID=2632;_ThreadName=Thread-2;
2744信息销毁org.springframework.beans.factory.support中的单例。DefaultListableBeanFactory@44442f...(详情)org.springframework.beans.factory.support.DefaultListableBeanFactory 2012年11月13日17:49:51.887_ThreadID=2632;_ThreadName=Thread-2;
2745 INFO WebModule[null]ServletContext.log():关闭Spring根WebApplicationContext(详细信息)javax.enterprise.system.container.web.com.sun.enterprise.web 2012年11月13日17:49:51.890_ThreadID=2632;_ThreadName=Thread-2;
2746信息关闭根WebApplicationContext:启动日期[Tue Nov 13 17:45:18 CET 2012];根上下文hie…(详细信息)org.springframework.web.context.support.XmlWebApplicationContext 2012年11月13日17:49:51.890_ThreadID=2632;_ThreadName=Thread-2;
2747信息销毁org.springframework.beans.factory.support中的单例。DefaultListableBeanFactory@176be9...(详情)org.springframework.beans.factory.support.DefaultListableBeanFactory 2012年11月13日17:49:51.891_ThreadID=2632;_ThreadName=Thread-2;
2748 INFO WebModule[null]ServletContext.log():在类路径(详细信息)javax.enterprise.system.container.web.com.sun.enterprise.web 2012年11月13日17:49:54.256 _ThreadID=2256;_ThreadName=Thread-2;
2749 INFO WebModule[null]ServletContext.log():初始化Spring根WebApplicationContext(详细信息)javax.enterprise.system.container.web.com.sun.enterprise.web 2012年11月13日17:49:54.312_ThreadID=2256;_ThreadName=Thread-2;
2750信息根WebApplicationContext:初始化已开始(详细信息)org.springframework.web.context.ContextLoader 2012年11月13日17:49:54.312_ThreadID=2256;_ThreadName=Thread-2;
2751信息刷新根WebApplicationContext:启动日期[Tue Nov 13 17:49:54 CET 2012];根上下文…(详细信息)org.springframework.web.context.support.XmlWebApplicationContext 2012年11月13日17:49:54.432_ThreadID=2256;_ThreadName=Thread-2;
2752信息从ServletContext资源[/WEB-INF/applicationContext.XML](详细信息)org.springframework.beans.factory.XML.XmlBeanDefinitionReader 2012年11月13日17:49:54.503_ThreadID=2256;_ThreadName=Thread-2;
2753信息预实例化org.springframework.beans.factory.support.DefaultListableBeanFactory中的单例…(详细信息)org.springframework.beans.factory.support.DefaultListableBeanFactory 2012年11月13日17:49:54.572 _ThreadID=2256;_ThreadName=Thread-2;
2754信息根WebApplicationContext:初始化在262毫秒内完成(详细信息)org.springframework.web.context.ContextLoader 2012年11月13日17:49:54.574_ThreadID=2256;_ThreadName=Thread-2;
2755 INFO WebModule[null]ServletContext.log():初始化Spring FrameworkServlet“dispatcher”(详细信息)javax.enterprise.system.container.web.com.sun.enterprise.web 2012年11月13日17:49:54.607_ThreadID=2256;_ThreadName=Thread-2;
2756 INFO FrameworkServlet“dispatcher”:初始化已开始(详细信息)org.springframework.web.servlet.DispatcherServlet 2012年11月13日17:49:54.607 _ThreadID=2256;_ThreadName=Thread-2;
2757刷新命名空间“dispatcher servlet”的WebApplicationContext的信息:启动日期[11月13日星期二17:49:…(详细信息)org.springframework.web.context.support.XmlWebApplicationContext 2012年11月13日17:49:54.611_ThreadID=2256;_ThreadName=Thread-2;
2758从ServletContext资源[/WEB-INF/dispatcher servlet.XML](详细信息)org.springframework.beans.factory.XML.XmlBeanDefinitionReader 2012年11月13日17:49:54.612_ThreadID=2256;_ThreadName=Thread-2;
2759信息在org.springframework.beans.factory.support.DefaultListableBeanFactory中预实例化单例…(详细信息)org.springframework.beans.fact
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 13 nov. 2012 11:00:50 by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
    <class name="Model.User" table="User" catalog="EPGV_Interface">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="identity" />
        </id>
        <property name="name" type="string">
            <column name="name" length="45" />
        </property>
    </class>
</hibernate-mapping>
package Controller;

import Model.HibernateUtil;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hibernate.Session;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class UserController implements Controller {

    @Override
    public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
        ModelAndView mv = new ModelAndView("user");
        try 
        {
            Session session = HibernateUtil.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            List result = session.createQuery(" from User").list();
            mv.addObject("users", result);
            session.getTransaction().commit();
        } 
        catch (Exception e) 
        {
               e.printStackTrace();
        }    
        return mv; 
    }
}
<%--
Views should be stored under the WEB-INF folder so that
they are not accessible except through controller process.

This JSP is here to provide a redirect to the dispatcher
servlet but should be the only JSP outside of WEB-INF.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("index.htm"); %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Portail</title>
    </head>

    <body>
        <a href="user.htm">Go to user</a>
    </body>
</html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>test</title>
    </head>
    <body>
        <br>
        <table>
            <tr>
                <td>Id</td>
                <td>Name</td>
            </tr>
            <c:forEach items="${users}" var="user">
            <tr>
                <td><c:out value="${user.id}"></c:out></td>
                <td><c:out value="${user.name}"></c:out></td>
            </tr>
            </c:forEach>
        </table>
    </body>
</html>
2740    INFO    Redirecting to /index.jsf(details)  org.glassfish.admingui  13 nov. 2012 17:49:17.005   _ThreadID=2631;_ThreadName=Thread-2;

2741    INFO    Admin Console: Initializing Session Attributes...(details)  org.glassfish.admingui  13 nov. 2012 17:49:17.025   _ThreadID=2635;_ThreadName=Thread-2;

2742    INFO    WebModule[null] ServletContext.log():Destroying Spring FrameworkServlet 'dispatcher'(details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:51.886   _ThreadID=2632;_ThreadName=Thread-2;

2743    INFO    Closing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Nov 13 17:45:18 ... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:51.886   _ThreadID=2632;_ThreadName=Thread-2;

2744    INFO    Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44442f... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:51.887   _ThreadID=2632;_ThreadName=Thread-2;

2745    INFO    WebModule[null] ServletContext.log():Closing Spring root WebApplicationContext(details)     javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:51.890   _ThreadID=2632;_ThreadName=Thread-2;

2746    INFO    Closing Root WebApplicationContext: startup date [Tue Nov 13 17:45:18 CET 2012]; root of context hie... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:51.890   _ThreadID=2632;_ThreadName=Thread-2;

2747    INFO    Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@176be9... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:51.891   _ThreadID=2632;_ThreadName=Thread-2;

2748    INFO    WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath(details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.256   _ThreadID=2256;_ThreadName=Thread-2;

2749    INFO    WebModule[null] ServletContext.log():Initializing Spring root WebApplicationContext(details)    javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.312   _ThreadID=2256;_ThreadName=Thread-2;

2750    INFO    Root WebApplicationContext: initialization started(details)     org.springframework.web.context.ContextLoader   13 nov. 2012 17:49:54.312   _ThreadID=2256;_ThreadName=Thread-2;

2751    INFO    Refreshing Root WebApplicationContext: startup date [Tue Nov 13 17:49:54 CET 2012]; root of context ... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:54.432   _ThreadID=2256;_ThreadName=Thread-2;

2752    INFO    Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml](details)    org.springframework.beans.factory.xml.XmlBeanDefinitionReader   13 nov. 2012 17:49:54.503   _ThreadID=2256;_ThreadName=Thread-2;

2753    INFO    Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:54.572   _ThreadID=2256;_ThreadName=Thread-2;

2754    INFO    Root WebApplicationContext: initialization completed in 262 ms(details)     org.springframework.web.context.ContextLoader   13 nov. 2012 17:49:54.574   _ThreadID=2256;_ThreadName=Thread-2;

2755    INFO    WebModule[null] ServletContext.log():Initializing Spring FrameworkServlet 'dispatcher'(details)     javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.607   _ThreadID=2256;_ThreadName=Thread-2;

2756    INFO    FrameworkServlet 'dispatcher': initialization started(details)  org.springframework.web.servlet.DispatcherServlet   13 nov. 2012 17:49:54.607   _ThreadID=2256;_ThreadName=Thread-2;

2757    INFO    Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Nov 13 17:49:... (details)   org.springframework.web.context.support.XmlWebApplicationContext    13 nov. 2012 17:49:54.611   _ThreadID=2256;_ThreadName=Thread-2;

2758    INFO    Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml](details)    org.springframework.beans.factory.xml.XmlBeanDefinitionReader   13 nov. 2012 17:49:54.612   _ThreadID=2256;_ThreadName=Thread-2;

2759    INFO    Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory... (details)   org.springframework.beans.factory.support.DefaultListableBeanFactory    13 nov. 2012 17:49:54.651   _ThreadID=2256;_ThreadName=Thread-2;

2760    INFO    Mapped URL path [/user*] onto handler 'userController'(details)     org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping   13 nov. 2012 17:49:54.670   _ThreadID=2256;_ThreadName=Thread-2;

2761    INFO    Mapped URL path [/index.htm] onto handler 'indexController'(details)    org.springframework.web.servlet.handler.SimpleUrlHandlerMapping     13 nov. 2012 17:49:54.739   _ThreadID=2256;_ThreadName=Thread-2;

2762    INFO    Mapped URL path [/user.htm] onto handler 'userController'(details)  org.springframework.web.servlet.handler.SimpleUrlHandlerMapping     13 nov. 2012 17:49:54.740   _ThreadID=2256;_ThreadName=Thread-2;

2763    INFO    FrameworkServlet 'dispatcher': initialization completed in 205 ms(details)  org.springframework.web.servlet.DispatcherServlet   13 nov. 2012 17:49:54.813   _ThreadID=2256;_ThreadName=Thread-2;

2764    INFO    Loading application [SpringHibernateTuto2] at [/SpringHibernateTuto2](details)  javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:49:54.816   _ThreadID=2256;_ThreadName=Thread-2;

2765    INFO    SpringHibernateTuto2 was successfully deployed in 1,007 milliseconds.(details)  javax.enterprise.system.tools.admin.org.glassfish.deployment.admin  13 nov. 2012 17:49:54.823   _ThreadID=2256;_ThreadName=Thread-2;

2766    INFO    Hibernate Annotations 3.3.1.GA(details)     org.hibernate.cfg.annotations.Version   13 nov. 2012 17:50:01.078   _ThreadID=189;_ThreadName=Thread-2;

2767    INFO    Hibernate 3.2.5(details)    org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.093   _ThreadID=189;_ThreadName=Thread-2;

2768    INFO    hibernate.properties not found(details)     org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.097   _ThreadID=189;_ThreadName=Thread-2;

2769    INFO    Bytecode provider name : cglib(details)     org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.099   _ThreadID=189;_ThreadName=Thread-2;

2770    INFO    using JDK 1.4 java.sql.Timestamp handling(details)  org.hibernate.cfg.Environment   13 nov. 2012 17:50:01.103   _ThreadID=189;_ThreadName=Thread-2;

2771    INFO    configuring from resource: /hibernate.cfg.xml(details)  org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.175   _ThreadID=189;_ThreadName=Thread-2;

2772    INFO    Configuration resource: /hibernate.cfg.xml(details)     org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.175   _ThreadID=189;_ThreadName=Thread-2;

2773    INFO    Reading mappings from resource : Model/User.hbm.xml(details)    org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.241   _ThreadID=189;_ThreadName=Thread-2;

2774    INFO    Configured SessionFactory: null(details)    org.hibernate.cfg.Configuration     13 nov. 2012 17:50:01.253   _ThreadID=189;_ThreadName=Thread-2;

2775    INFO    Mapping class: Model.User -> User(details)  org.hibernate.cfg.HbmBinder     13 nov. 2012 17:50:01.323   _ThreadID=189;_ThreadName=Thread-2;

2776    INFO    Hibernate Validator not found: ignoring(details)    org.hibernate.cfg.AnnotationConfiguration   13 nov. 2012 17:50:01.342   _ThreadID=189;_ThreadName=Thread-2;

2777    INFO    Using Hibernate built-in connection pool (not for production use!)(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.407   _ThreadID=189;_ThreadName=Thread-2;

2778    INFO    Hibernate connection pool size: 20(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.407   _ThreadID=189;_ThreadName=Thread-2;

2779    INFO    autocommit mode: false(details)     org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2780    INFO    using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://inra3.seq.cng.fr:3306/EPGV_Interface?zeroDa... (details)   org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2781    INFO    connection properties: {user=mathieu, password=****}(details)   org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:01.408   _ThreadID=189;_ThreadName=Thread-2;

2782    INFO    MySQL, version: 5.1.61(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.417   _ThreadID=189;_ThreadName=Thread-2;

2783    INFO    JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.417   _ThreadID=189;_ThreadName=Thread-2;

2784    INFO    Using dialect: org.hibernate.dialect.MySQLDialect(details)  org.hibernate.dialect.Dialect   13 nov. 2012 17:50:01.435   _ThreadID=189;_ThreadName=Thread-2;

2785    INFO    Using default transaction strategy (direct JDBC transactions)(details)  org.hibernate.transaction.TransactionFactoryFactory     13 nov. 2012 17:50:01.440   _ThreadID=189;_ThreadName=Thread-2;

2786    INFO    No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional secon... (details)   org.hibernate.transaction.TransactionManagerLookupFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2787    INFO    Automatic flush during beforeCompletion(): disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2788    INFO    Automatic session close at end of transaction: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2789    INFO    JDBC batch size: 15(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.443   _ThreadID=189;_ThreadName=Thread-2;

2790    INFO    JDBC batch updates for versioned data: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.444   _ThreadID=189;_ThreadName=Thread-2;

2791    INFO    Scrollable result sets: enabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2792    INFO    JDBC3 getGeneratedKeys(): enabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2793    INFO    Connection release mode: auto(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.445   _ThreadID=189;_ThreadName=Thread-2;

2794    INFO    Maximum outer join fetch depth: 2(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.446   _ThreadID=189;_ThreadName=Thread-2;

2795    INFO    Default batch fetch size: 1(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.446   _ThreadID=189;_ThreadName=Thread-2;

2796    INFO    Generate SQL with comments: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2797    INFO    Order SQL updates by primary key: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2798    INFO    Order SQL inserts for batching: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2799    INFO    Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.447   _ThreadID=189;_ThreadName=Thread-2;

2800    INFO    Using ASTQueryTranslatorFactory(details)    org.hibernate.hql.ast.ASTQueryTranslatorFactory     13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2801    INFO    Query language substitutions: {}(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2802    INFO    JPA-QL strict compliance: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2803    INFO    Second-level cache: enabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2804    INFO    Query cache: disabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.451   _ThreadID=189;_ThreadName=Thread-2;

2805    INFO    Cache provider: org.hibernate.cache.NoCacheProvider(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2806    INFO    Optimize cache for minimal puts: disabled(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2807    INFO    Structured second-level cache entries: disabled(details)    org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.452   _ThreadID=189;_ThreadName=Thread-2;

2808    INFO    Statistics: disabled(details)   org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2809    INFO    Deleted entity synthetic identifier rollback: disabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2810    INFO    Default entity-mode: pojo(details)  org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2811    INFO    Named query checking : enabled(details)     org.hibernate.cfg.SettingsFactory   13 nov. 2012 17:50:01.459   _ThreadID=189;_ThreadName=Thread-2;

2812    INFO    building session factory(details)   org.hibernate.impl.SessionFactoryImpl   13 nov. 2012 17:50:01.487   _ThreadID=189;_ThreadName=Thread-2;

2813    SEVERE  Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<i... (details)   javax.enterprise.system.std.com.sun.enterprise.server.logging   13 nov. 2012 17:50:01.626   _ThreadID=189;_ThreadName=Thread-2;

2814    WARNING     StandardWrapperValve[dispatcher]: PWC1406: Servlet.service() for servlet dispatcher threw exception ... (details)   javax.enterprise.system.container.web.com.sun.enterprise.web    13 nov. 2012 17:50:01.627   _ThreadID=189;_ThreadName=Thread-2;

2815    INFO    cleaning up connection pool: jdbc:mysql://*****:3306/EPGV_Interface?zeroDateTimeBehavior=... (details)  org.hibernate.connection.DriverManagerConnectionProvider    13 nov. 2012 17:50:12.421   _ThreadID=3;_ThreadName=Thread-2;
2813    SEVERE  Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<i... (details)