Slt tout le monde,

je suis confronté à un probleme que je ne m'explique pas. je voudrais me connecter à ma base de données SQLServer, et à chaque fois que je lance une session, un message d'erreur apparait:
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
10:23:19,015  INFO Environment:500 - Hibernate 3.2 cr3
10:23:19,015  INFO Environment:533 - hibernate.properties not found
10:23:19,031  INFO Environment:667 - Bytecode provider name : cglib
10:23:19,046  INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
10:23:19,171  INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml
10:23:19,171  INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml
10:23:19,359  INFO Configuration:507 - Reading mappings from resource: org/DAO/UniteMesure.hbm.xml
10:23:19,781  INFO HbmBinder:299 - Mapping class: org.DAO.UniteMesure -> UniteMesure
10:23:19,812  INFO Configuration:1465 - Configured SessionFactory: CommercialFactory
10:23:19,953  INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
10:23:19,953  INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
10:23:19,953  INFO DriverManagerConnectionProvider:45 - autocommit mode: false
10:23:20,187  INFO DriverManagerConnectionProvider:80 - using driver: com.microsoft.sqlserver.jdbc.SQLServerDriver at URL: jdbc:sqlserver://localhost:1433
10:23:20,234  INFO DriverManagerConnectionProvider:86 - connection properties: {user=sa, password=****}
10:23:20,421  INFO SettingsFactory:81 - RDBMS: Microsoft SQL Server, version: 8.00.194
10:23:20,421  INFO SettingsFactory:82 - JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.1.1320.0
10:23:20,468  INFO Dialect:141 - Using dialect: org.hibernate.dialect.SQLServerDialect
10:23:20,500  INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
10:23:20,500  INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
10:23:20,500  INFO SettingsFactory:134 - Automatic flush during beforeCompletion(): disabled
10:23:20,500  INFO SettingsFactory:138 - Automatic session close at end of transaction: disabled
10:23:20,500  INFO SettingsFactory:153 - Scrollable result sets: enabled
10:23:20,500  INFO SettingsFactory:161 - JDBC3 getGeneratedKeys(): enabled
10:23:20,531  INFO SettingsFactory:169 - Connection release mode: auto
10:23:20,531  INFO SettingsFactory:188 - Default catalog: Commercial2005
10:23:20,531  INFO SettingsFactory:196 - Default batch fetch size: 1
10:23:20,531  INFO SettingsFactory:200 - Generate SQL with comments: disabled
10:23:20,531  INFO SettingsFactory:204 - Order SQL updates by primary key: disabled
10:23:20,531  INFO SettingsFactory:369 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
10:23:20,531  INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
10:23:20,531  INFO SettingsFactory:212 - Query language substitutions: {}
10:23:20,531  INFO SettingsFactory:217 - JPA-QL strict compliance: disabled
10:23:20,531  INFO SettingsFactory:222 - Second-level cache: enabled
10:23:20,531  INFO SettingsFactory:226 - Query cache: disabled
10:23:20,531  INFO SettingsFactory:356 - Cache provider: org.hibernate.cache.NoCacheProvider
10:23:20,531  INFO SettingsFactory:241 - Optimize cache for minimal puts: disabled
10:23:20,531  INFO SettingsFactory:250 - Structured second-level cache entries: disabled
10:23:20,531  INFO SettingsFactory:277 - Statistics: disabled
10:23:20,531  INFO SettingsFactory:281 - Deleted entity synthetic identifier rollback: disabled
10:23:20,531  INFO SettingsFactory:296 - Default entity-mode: pojo
10:23:20,593  INFO SessionFactoryImpl:161 - building session factory
10:23:21,187  INFO SessionFactoryObjectFactory:86 - Factory name: CommercialFactory
10:23:21,203  INFO NamingHelper:26 - JNDI InitialContext properties:{}
10:23:21,203  WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
	at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
	at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
	at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
	at javax.naming.InitialContext.getNameParser(Unknown Source)
	at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
	at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
	at org.DAO.HibernateUtil.<clinit>(HibernateUtil.java:20)
	at MainClass.main(MainClass.java:21)
le plus bizard dans l'histoire est que je ne l'execute meme pas sur un serveur d'app, etant donner que c'est une application java normal. je crois que c'est un probleme de configuration, mais comment regler le problemes ??????

voila mon fichier de config:

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
 
<?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 name="CommercialFactory">
        <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
        <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
        <property name="hibernate.connection.password">******</property>
        <property name="hibernate.connection.url">jdbc:sqlserver://localhost:1433</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.default_catalog">Commercial2005</property>
        <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
        <mapping resource="org/DAO/UniteMesure.hbm.xml" />
    </session-factory>
</hibernate-configuration>
Remarque : j'utitlise
  1. Eclipse 3.2;
  2. Hibernate 3.2 RC3
  3. JDK 1.5