IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Java Discussion :

HibernateDaoSupport getHibernateTemplate retourne null [Data]


Sujet :

Spring Java

  1. #1
    Invité
    Invité(e)
    Par défaut HibernateDaoSupport getHibernateTemplate retourne null
    Bonjour,

    Je tente (vainement) de configurer un dao avec Spring et Hibernate. Mais lorsque je demande le HibernateTemplate je reçoit un null :

    Voci mon dao :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public class SpringHibernateStudentDao extends HibernateDaoSupport implements StudentDao {
     
        public Student getStudent(int id) throws DataAccessException {
            HibernateTemplate hibtemp = getHibernateTemplate();
            System.out.println("HibernateTemplate : " + hibtemp);
            Student student = (Student) hibtemp.get(Student.class, id);
            System.out.println("Student : " + student);
            return student;
        }
     
    }
    Mon manager, service :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    public class StudentManager {
     
        private DAOFactory daoFactory;
     
        public StudentManager(DAOFactory daoFactory) {
            this.daoFactory = daoFactory;
        }
     
        public Student getStudent(int id) {
            Student student = daoFactory.getStudentDao().getStudent(id);
            System.out.println("Student : " + student);
            return student;
        }
     
    }
    Mon applicationContext.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    ...
        <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName"><value>org.postgresql.Driver</value></property>
            <property name="url"><value>jdbc:postgresql://localhost:5432/MADB</value></property>
            <property name="username"><value>user</value></property>
            <property name="password"><value>admin</value></property>
        </bean>
     
        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
                <list>
                    <value>Student.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
                    <prop key="hibernate.hbm2ddl.auto">create</prop>
                </props>
            </property>
        </bean>
     
        <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
     
        <bean id="studentDAO" class="dao.impl.spring.hibernate.SpringHibernateStudentDao">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
     
        <bean id="daoFactory" class="dao.impl.spring.hibernate.SpringHibernateDaoFactory" />
     
        <bean id="studentManager" class="manager.StudentManager">
            <constructor-arg><ref bean="daoFactory" /></constructor-arg>
        </bean>
    ...
    Et ma classe d'entrée :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    public class StudentManagerTest {
     
        /** Creates a new instance of StudenteManagerTest */
        public StudentManagerTest() {
        }
     
        public static void main(String[] args) {
     
            ApplicationContext ctx = 
                    new FileSystemXmlApplicationContext("applicationContext.xml");
            StudentManager mngr = (StudentManager) ctx.getBean("studentManager");
     
            System.out.println("Student Manager :" + mngr);
            mngr.getStudent(3);
     
        }
    }
    et le résultat à la console (les logs d'hibrenate ne me sortent aucunes erreurs, que des TRACE, DEBUG et INFO) :
    Student Manager :manager.StudentManager@5e222e
    HibernateTemplate : null
    Exception in thread "main" java.lang.NullPointerException
    Je soupçone le fait de ne jamais injecter mon "HibernateTemplate" mais dans tous les fichiers de config que je trouve, je en vois jamais cette injection et je ne sais pas comment la créer.

    Merci de m'éclairer
    Dernière modification par Robin56 ; 05/08/2013 à 22h35. Motif: Ajout du préfixe

  2. #2
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    C'est assez bizarre en effet, apparement, l'HibernateTemplate est crée dans le setter de la sessionFactory de HibernateDaoSupport...

    Tu sais vérifier que la sessionFacotry est bien différente de null ? ( normaleme,nt oui vu que tu l'injecte mais bon ... )
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  3. #3
    Invité
    Invité(e)
    Par défaut
    Je viens de modifier mon dao :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public class SpringHibernateStudentDao extends HibernateDaoSupport implements StudentDao {
     
        public Student getStudent(int id) throws DataAccessException {
            System.out.println("Session factory :" + getSessionFactory());
            HibernateTemplate hibtemp = getHibernateTemplate();
            System.out.println("HibernateTemplate : " + hibtemp);
            Student student = (Student) hibtemp.get(Student.class, id);
            System.out.println("Student : " + student);
            return student;
        }
    ...
    mais le résultat ne vas te plaire :
    Student Manager :manager.StudentManager@5e222e
    Session factory :null
    HibernateTemplate : null
    Note : Je travaille avec NetBeans et j'ai divisé cela en plusieurs sous projets :
    - MoiCommons (Beans généraux : Personne, Contact,..)
    - ProjetCommons (Student)
    - ProjetDao (StudentDao,..)
    - ProjetServices (StudentManager, et Classe de test)
    Toutes mes archives sont présentes dans ProjetServices (sur lequel je fais mes tests). Lorsque j'ai voulu rajouter getSessionFactiry(), j'ai du également ajouter la jar d'hibernate dans ProjetDao. Je suppose que ça n'a pas d'importance, c'est juste des délires de NteBeans mais bon..
    Edit : Je viens de fusionner ProjetDao avec ProjetService et ça ne change pas. Donc ce n'est pa sle fait d'avoir de multiples sous projets
    Dernière modification par Invité ; 21/11/2007 à 16h44.

  4. #4
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Heu vi .. alors la, j'ai du mal a comprendre ce qu'il se passe ...

    As-tu possibilité de configurer log4j, et de mettre le niveau pour les classe org.spring à DEBUG voir TRACE?

    Histoire de voir ce qu'il configure
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  5. #5
    Invité
    Invité(e)
    Par défaut
    Waip :

    run:
    INFO [main] org.springframework.context.support.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@126e85f: display name [org.springframework.context.support.FileSystemXmlApplicationContext@126e85f]; startup date [Wed Nov 21 16:09:32 CET 2007]; root of context hierarchy
    DEBUG [main] org.springframework.util.ClassUtils - Class [edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap] or one of its dependencies is not present: java.lang.ClassNotFoundException: edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap
    INFO [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]
    DEBUG [main] org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
    DEBUG [main] org.springframework.beans.factory.xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]
    DEBUG [main] org.springframework.beans.factory.xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schem...g-lang-2.5.xsd, http://www.springframework.org/schem...g-lang-2.5.xsd, http://www.springframework.org/schem...ontext-2.5.xsd, http://www.springframework.org/schem...ng-jms-2.5.xsd, http://www.springframework.org/schem...ontext-2.5.xsd, http://www.springframework.org/schem...ng-aop-2.5.xsd, http://www.springframework.org/schem...g-util-2.0.xsd, http://www.springframework.org/schem...g-util-2.5.xsd, http://www.springframework.org/schem...g-tool-2.0.xsd, http://www.springframework.org/schem...ing-tx-2.0.xsd, http://www.springframework.org/schem...g-tool-2.5.xsd, http://www.springframework.org/schem...ing-tx-2.5.xsd, http://www.springframework.org/schem...-beans-2.0.xsd, http://www.springframework.org/schem...ng-jms-2.5.xsd, http://www.springframework.org/schem...-beans-2.5.xsd, http://www.springframework.org/schem...-beans-2.5.xsd, http://www.springframework.org/schem...ng-jee-2.5.xsd, http://www.springframework.org/schem...g-tool-2.5.xsd, http://www.springframework.org/schem...ing-tx-2.5.xsd, http://www.springframework.org/schem...ng-jee-2.0.xsd, http://www.springframework.org/schem...ng-aop-2.0.xsd, http://www.springframework.org/schem...ng-aop-2.5.xsd, http://www.springframework.org/schem...ng-jee-2.5.xsd, http://www.springframework.org/schem...g-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd}
    DEBUG [main] org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...ing-beans.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd
    DEBUG [main] org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions
    DEBUG [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 6 bean definitions from location pattern [applicationContext.xml]
    INFO [main] org.springframework.context.support.FileSystemXmlApplicationContext - Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext@126e85f]: org.springframework.beans.factory.support.DefaultListableBeanFactory@4f9fdc
    DEBUG [main] org.springframework.context.support.FileSystemXmlApplicationContext - 6 beans defined in org.springframework.context.support.FileSystemXmlApplicationContext@126e85f: display name [org.springframework.context.support.FileSystemXmlApplicationContext@126e85f]; startup date [Wed Nov 21 16:09:32 CET 2007]; root of context hierarchy
    DEBUG [main] org.springframework.context.support.FileSystemXmlApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@1385660]
    DEBUG [main] org.springframework.context.support.FileSystemXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@136a43c]
    INFO [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4f9fdc: defining beans [dataSource,sessionFactory,transactionManager,studentDAO,daoFactory,studentManager]; root of factory hierarchy
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dataSource'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'dataSource' with merged definition [Root bean: class [org.springframework.jdbc.datasource.DriverManagerDataSource]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'dataSource' to allow for resolving potential circular references
    INFO [main] org.springframework.jdbc.datasource.DriverManagerDataSource - Loaded JDBC driver: org.postgresql.Driver
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'sessionFactory'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'sessionFactory' with merged definition [Root bean: class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'sessionFactory' to allow for resolving potential circular references
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'dataSource'
    INFO [main] org.hibernate.cfg.Environment - Hibernate 3.2.5
    INFO [main] org.hibernate.cfg.Environment - hibernate.properties not found
    INFO [main] org.hibernate.cfg.Environment - Bytecode provider name : cglib
    INFO [main] org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
    DEBUG [main] org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hib...pping-3.0.dtd]
    DEBUG [main] org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
    DEBUG [main] org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hib...pping-3.0.dtd] in classpath
    INFO [main] org.hibernate.cfg.HbmBinder - Mapping class: be.gervaisb.sics.commons.beans.Student -> students
    DEBUG [main] org.hibernate.cfg.HbmBinder - Mapped property: id -> stuid
    DEBUG [main] org.hibernate.cfg.HbmBinder - Mapped property: firstName -> stuname
    DEBUG [main] org.hibernate.cfg.HbmBinder - Mapped property: lastName -> stulastname
    INFO [main] org.springframework.orm.hibernate3.LocalSessionFactoryBean - Building new Hibernate SessionFactory
    DEBUG [main] org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
    DEBUG [main] org.hibernate.cfg.Configuration - processing extends queue
    DEBUG [main] org.hibernate.cfg.Configuration - processing collection mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing association property references
    DEBUG [main] org.hibernate.cfg.Configuration - processing foreign key constraints
    INFO [main] org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
    DEBUG [main] org.springframework.jdbc.datasource.DriverManagerDataSource - Creating new JDBC Connection to [jdbc:postgresql://localhost:5432/SICS]
    INFO [main] org.hibernate.cfg.SettingsFactory - RDBMS: PostgreSQL, version: 8.2.5
    INFO [main] org.hibernate.cfg.SettingsFactory - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.2 JDBC3 with SSL (build 505)
    INFO [main] org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.PostgreSQLDialect
    INFO [main] org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
    INFO [main] org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    INFO [main] org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
    INFO [main] org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
    DEBUG [main] org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Connection release mode: on_close
    INFO [main] org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
    INFO [main] org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    INFO [main] org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
    INFO [main] org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
    INFO [main] org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Query cache: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
    INFO [main] org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
    TRACE [main] org.hibernate.exception.SQLExceptionConverterFactory - Using dialect defined converter
    INFO [main] org.hibernate.cfg.SettingsFactory - Statistics: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
    INFO [main] org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
    INFO [main] org.hibernate.cfg.SettingsFactory - Named query checking : enabled
    INFO [main] org.hibernate.impl.SessionFactoryImpl - building session factory
    DEBUG [main] org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
    DEBUG [main] org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Java\1.5\jdk1.5.0_08\jre\bin, java.vm.version=1.5.0_08-b03, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=BE, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices, java.runtime.version=1.5.0_08-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext, java.endorsed.dirs=C:\Java\1.5\jdk1.5.0_08\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\Gervais\LOCALS~1\Temp\, line.separator=
    , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Java\1.5\jdk1.5.0_08\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\PostgreSQL\8.2\bin;C:\Program Files\Subversion\bin, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Documents and Settings\Gervais, user.timezone=Europe/Paris, hibernate.connection.release_mode=on_close, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, java.class.path=C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\GervaisbCommons\dist\GervaisbCommons.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\SicsCommons\dist\SicsCommons.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Databases\PostgresSQL\postgresql-8.2-505.jdbc3.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Spring\spring-framework-2.5-with-dependencies\spring-framework-2.5\dist\spring.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\hibernate-3.2.5.ga\hibernate-3.2\hibernate3.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Spring\spring-framework-2.5-with-dependencies\spring-framework-2.5\lib\dom4j\dom4j-1.6.1.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Jta\jta-1_1-classes.zip;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\commons-collections-3.2\commons-collections-3.2.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Spring\spring-framework-2.5-with-dependencies\spring-framework-2.5\lib\cglib\cglib-nodep-2.1_3.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Log4J\commons-logging-1.1\commons-logging-1.1.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\Libs\Log4J\apache-log4j-1.2.15\log4j-1.2.15.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\SicsDao\dist\SchoolManagerDao.jar;C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\build\classes, user.name=Gervais, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\Java\1.5\jdk1.5.0_08\jre, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, java.specification.vendor=Sun Microsystems Inc., user.language=fr, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, java.version=1.5.0_08, java.ext.dirs=C:\Java\1.5\jdk1.5.0_08\jre\lib\ext, sun.boot.class.path=C:\Java\1.5\jdk1.5.0_08\jre\lib\rt.jar;C:\Java\1.5\jdk1.5.0_08\jre\lib\i18n.jar;C:\Java\1.5\jdk1.5.0_08\jre\lib\sunrsasign.jar;C:\Java\1.5\jdk1.5.0_08\jre\lib\jsse.jar;C:\Java\1.5\jdk1.5.0_08\jre\lib\jce.jar;C:\Java\1.5\jdk1.5.0_08\jre\lib\charsets.jar;C:\Java\1.5\jdk1.5.0_08\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.hbm2ddl.auto=create, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
    INFO [main] org.hibernate.tuple.PojoInstantiator - no default (no-argument) constructor for class: be.gervaisb.sics.commons.beans.Student (class must be instantiated by Interceptor)
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: be.gervaisb.sics.commons.beans.Student
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Version select: select stuid from students where stuid =?
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select student_.stuid, student_.stuname as stuname0_, student_.stulastname as stulastn3_0_ from students student_ where student_.stuid=?
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into students (stuname, stulastname, stuid) values (?, ?, ?)
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update students set stuname=?, stulastname=? where stuid=?
    DEBUG [main] org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from students where stuid=?
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=?
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=?
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=? for update
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=? for update
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=? for update
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=?
    DEBUG [main] org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity be.gervaisb.sics.commons.beans.Student: select student0_.stuid as stuid0_0_, student0_.stuname as stuname0_0_, student0_.stulastname as stulastn3_0_0_ from students student0_ where student0_.stuid=?
    DEBUG [main] org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
    DEBUG [main] org.hibernate.impl.SessionFactoryObjectFactory - registered: 2c90858a1662c1c1011662c1c2d50000 (unnamed)
    INFO [main] org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
    DEBUG [main] org.hibernate.impl.SessionFactoryImpl - instantiated session factory
    DEBUG [main] org.hibernate.cfg.Configuration - processing extends queue
    DEBUG [main] org.hibernate.cfg.Configuration - processing collection mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing association property references
    DEBUG [main] org.hibernate.cfg.Configuration - processing foreign key constraints
    DEBUG [main] org.hibernate.cfg.Configuration - processing extends queue
    DEBUG [main] org.hibernate.cfg.Configuration - processing collection mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
    DEBUG [main] org.hibernate.cfg.Configuration - processing association property references
    DEBUG [main] org.hibernate.cfg.Configuration - processing foreign key constraints
    INFO [main] org.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
    DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaExport - import file not found: /import.sql
    INFO [main] org.hibernate.tool.hbm2ddl.SchemaExport - exporting generated schema to database
    DEBUG [main] org.springframework.jdbc.datasource.DriverManagerDataSource - Creating new JDBC Connection to [jdbc:postgresql://localhost:5432/SICS]
    DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaExport - drop table students
    DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaExport - drop sequence hibernate_sequence
    DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaExport - create table students (stuid int4 not null, stuname varchar(255), stulastname varchar(255), primary key (stuid))
    DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaExport - create sequence hibernate_sequence
    INFO [main] org.hibernate.tool.hbm2ddl.SchemaExport - schema export complete
    DEBUG [main] org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
    DEBUG [main] org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'transactionManager'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'transactionManager' with merged definition [Root bean: class [org.springframework.orm.hibernate3.HibernateTransactionManager]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'transactionManager' to allow for resolving potential circular references
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory'
    INFO [main] org.springframework.orm.hibernate3.HibernateTransactionManager - Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@118958e] of Hibernate SessionFactory for HibernateTransactionManager
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentDAO'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'studentDAO' with merged definition [Root bean: class [be.gervaisb.sics.dao.impl.spring.hibernate.SpringHibernateStudentDao]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'studentDAO' to allow for resolving potential circular references
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'daoFactory'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'daoFactory' with merged definition [Root bean: class [be.gervaisb.sics.dao.impl.spring.hibernate.SpringHibernateDaoFactory]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'daoFactory' to allow for resolving potential circular references
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentManager'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'studentManager' with merged definition [Root bean: class [be.gervaisb.sics.manager.StudentManager]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [C:\Documents and Settings\Gervais\My Documents\My Projects\SicsServices\applicationContext.xml]]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'daoFactory'
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'studentManager' to allow for resolving potential circular references
    Exception in thread "main" java.lang.NullPointerException
    at be.gervaisb.sics.dao.impl.spring.hibernate.SpringHibernateStudentDao.getStudent(SpringHibernateStudentDao.java:22)
    at be.gervaisb.sics.manager.StudentManager.getStudent(StudentManager.java:24)
    at tests.StudentManagerTest.main(StudentManagerTest.java:41)
    DEBUG [main] org.springframework.context.support.FileSystemXmlApplicationContext - Publishing event in context [org.springframework.context.support.FileSystemXmlApplicationContext@126e85f]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.FileSystemXmlApplicationContext@126e85f: display name [org.springframework.context.support.FileSystemXmlApplicationContext@126e85f]; startup date [Wed Nov 21 16:09:32 CET 2007]; root of context hierarchy]
    DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentManager'
    Student Manager :be.gervaisb.sics.manager.StudentManager@aa0877
    DaoFactiry : be.gervaisb.sics.dao.impl.spring.hibernate.SpringHibernateDaoFactory@111ded2
    Session factory :null
    HibernateTemplate : null

  6. #6
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    MM j'ai une piste.

    Montre le code de ton DaoFactory :p

    Car tu récupere le StudentDao par la, mais si c'est la DaoFactory qui te retourne le StudentDao sans passer par l'ApplicationContext, ce n'est pas Spring qui gere, donc la SessionFactory n'est simplement pas injectée
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  7. #7
    Invité
    Invité(e)
    Par défaut
    Fidèle au principe du DAO, j'ai une classe abstraite :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    public abstract class DAOFactory {
     
        private static DAOFactory factory;
     
        public static DAOFactory getDaoFactry() {
            return factory;
        }
     
        public abstract StudentDao getStudentDao();
     
    }
    et une implémentation :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    public class SpringHibernateDaoFactory extends DAOFactory {
     
        public StudentDao getStudentDao() {
            return new SpringHibernateStudentDao();
        }
     
    }
    C'est vrai que maintenant que tu le dis il me semble qu'un truc manque. Si c'est bien ce que tu dis, veux tu bien détailler parce que je ne cerne pas encire le problème

    Edit : Ha oui ok, j'ai pigé mon erreur. je devrais Faire des appels à ApplicationContext dans SpringHibernateDaoFactory. C'est ça ?

  8. #8
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Ok, c'est la qu'est le problème :-)

    vu que c'est Spring qui s'occupe de la gestion des DAO, l'utilisation des Factory n'est plus vraiment nécessaire. C'est Spring qui joue ce role via l'injection.


    Donc voici une possibilité :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
     
    public class StudentManager {
     
        private StudentDao studentdao;
     
       public void setStudentDao(StudentDao dao){ 
       this.studentDao = dao;
    }
     
     
     
     
        public Student getStudent(int id) {
            Student student = studentDao.getStudent(id);
            System.out.println("Student : " + student);
            return student;
        }
     
    }
    et ton fichier de config xml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
     
    <bean id="studentManager" class="manager.StudentManager">
     
      <property name="studentDao">
    <ref local="studentDAO"/>
    </property>
        </bean>
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  9. #9
    Invité
    Invité(e)
    Par défaut
    Oui, mais je veux pouvoir conserver un DAO à l'ancienne au cas ou un jour j'en aurais marre de Spring (en fait mon "projet" est un travail de fin d'étude ou je compte montrer le fonctionnemeent avec et sans Spring, idem pour Hibernate), je veux pouvoir continuer à faire DAOFactory.getStudentDao()

  10. #10
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Ok :-)

    solution :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    public class SpringHibernateDaoFactory extends DAOFactory implement ApplicationContextAware {
     
       ApplicationContext context;
     
       public void setApplicationContext(ApplicationContext context ){
       this.context = context;
     }
     
        public StudentDao getStudentDao() {
            return (StudentDAO ) context.getBean("studentDAO");
        }
     
    }

    Cela devrait fonctioner comme ca
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  11. #11
    Invité
    Invité(e)
    Par défaut
    Heuu et c'est quoi cet "ApplicationContextAware" ? Comment il fonctionne ?

    Ca marche !!!
    Student Manager :be.gervaisb.sics.manager.StudentManager@aa0877
    DaoFactory : be.gervaisb.sics.dao.impl.spring.hibernate.SpringHibernateDaoFactory@111ded2
    Session factory :org.hibernate.impl.SessionFactoryImpl@3bc20e
    HibernateTemplate : org.springframework.orm.hibernate3.HibernateTemplate@1415056
    Student : null
    Student : null
    Student : null -> Wai bon, reste plus qu'a trouver comment dire à Hibernate de ne pas recréer les tables à cahque fois..

  12. #12
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    En fait, c'est une interface propre a Spring, et qui est detecté par celui-ci.

    Dès qu'une classe implémente cett interface, et qu'elle est définie dans un contexte Spring, automatiquement Spring lui fourni une référence à l'applicationContext :-)

    De la, tu peux récupérer n'importe quel bean défini dans le context en question
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  13. #13
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Pour Hibernate :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
                <list>
                    <value>Student.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
                    <prop key="hibernate.hbm2ddl.auto">update</prop>
                </props>
            </property>
        </bean>
    ;-)
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  14. #14
    Invité
    Invité(e)
    Par défaut
    Ok, merci.

    J'avais essaué de faire un ew FileSystemXmlApplicationContext("applicationContext.xml"); dans le constructuer de SpringHibernateDaoFactory mais évidemment ça bouclait un peu..

    Merci beaucoup beaucoup.

    Edit : Pour hibernate : Merci. (J'avait commenté la ligne sinon.. de toutes façon je n'ai pas trop envie qu'il vienne mettre à jour ou créer mes tables, ça risque d'amener des problèmes si je fais des erreurs dans mon mapping.)

  15. #15
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    365
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Janvier 2006
    Messages : 365
    Par défaut
    Citation Envoyé par Blaise1 Voir le message
    Oui, mais je veux pouvoir conserver un DAO à l'ancienne au cas ou un jour j'en aurais marre de Spring (en fait mon "projet" est un travail de fin d'étude ou je compte montrer le fonctionnemeent avec et sans Spring, idem pour Hibernate), je veux pouvoir continuer à faire DAOFactory.getStudentDao()
    Je pense que ça n'est pas aussi simple que ça en a l'air de pouvoir virer Spring par la suite, à partir du moment où tes DAOs étendent HibernateDaoSupport et qu'également ton DAOFactory implémente une interface spécifique à Spring. Il faudrait donc les réécrire pour se débarrasser de Spring. Tu risques ainsi de compliquer inutilement ton application pour un gain plus que douteux. A mon avis la première solution que te propope Hikage est meilleure : pas besoin de DAOFactory, laisse Spring injecter les DAOs dans les Manager. Ou alors il faudrait revoir un peu l'ensemble pour rendre l'application moins dépendante de Spring.
    Quelles alternatives à Spring tu prévois de mettre en place ?

  16. #16
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par manblaizo Voir le message
    à partir du moment où tes DAOs étendent HibernateDaoSupport et qu'également ton DAOFactory implémente une interface spécifique à Spring.
    Justement, ce n'est pas le cas, c'est moi.projet.truc.dao.impl.spring.hibernate.* qui implémentent/étendent des choses propres à Spring. Mais il étendent/implémentant aussi des interfaces et classes abstraites (comme tout DAO)

    Citation Envoyé par manblaizo Voir le message
    Tu risques ainsi de compliquer inutilement ton application pour un gain plus que douteux.
    Bien sur que je compliqué pour un gain certainement null mais c'est pour le plaisir de le faire et surtout montrer l'avantage de Spring.

    Citation Envoyé par manblaizo Voir le message
    Quelles alternatives à Spring tu prévois de mettre en place ?
    Aucunes alternatives à Spring, si je le vire il n'y auras que du POJO en modifiant un peu les managers

  17. #17
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    365
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Janvier 2006
    Messages : 365
    Par défaut
    Citation Envoyé par Blaise1 Voir le message
    Aucunes alternatives à Spring, si je le vire il n'y auras que du POJO en modifiant un peu les managers
    Et la gestion des transactions que permet Spring, tu la feras comment ?
    Bon, bien sûr, c'est juste pour le plaisir, j'ai compris !
    Une bonne façon de tester l'indépendance de ton application par rapport à Spring de manière tout aussi robuste serait de la passer à la sauce EJB3.

  18. #18
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par manblaizo Voir le message
    Et la gestion des transactions que permet Spring, tu la feras comment ?
    Ben justement, ce seras un avantage de plus à Spring. Sinon en pensant bien les choses et avec les managers (qui sont en fait des facades) je devrais pouvoir arriver à quelque cjose de correct.

    Citation Envoyé par manblaizo Voir le message
    Une bonne façon de tester l'indépendance de ton application par rapport à Spring de manière tout aussi robuste serait de la passer à la sauce EJB3.
    Ha oui tiens, c'est un super idée. Lorsque j'aurais fini de développer le truc, d'installer et configurer les serveurs, et de rédiger les rapports et autres documents que personne ne liras je me pencherais bien sur l'idée (quitte à ne réécrire qu'une partie de l'application)

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Findcontrol retourne null
    Par Kiwi_violet dans le forum ASP.NET
    Réponses: 1
    Dernier message: 13/04/2007, 13h21
  2. TTF_OpenFont() retournant NULL
    Par FabaCoeur dans le forum SDL
    Réponses: 4
    Dernier message: 11/04/2007, 17h30
  3. GetDC retourne NULL Oo
    Par Groove dans le forum OpenGL
    Réponses: 3
    Dernier message: 02/03/2007, 18h46
  4. Réponses: 3
    Dernier message: 02/03/2007, 12h41
  5. opérateur + dans SELECT retourne null ?
    Par david_chardonnet dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 19/01/2007, 11h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo