Olá,
Pessoal eu sei que existe milhares de tópicos para esse problema, porem nenhum consegui resolver.
Vou listar todas as minhas configurações:
CLASS-PATH:
[b]C:\Documents and Settings\tavarebr\My
Documents\NetBeans\TesteH\src\HibTest\hibernate.cfg.xml;[/b]
C:\hibernate-3.0\hibernate3.jar
Arquivo hibernate.cfg.xml:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property
name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property
name="hibernate.connection.url">
jdbc:mysql://localhost/hibernate?autoReconnect=true
</property>
<property
name="hibernate.connection.username">
root
</property>
<property
name="hibernate.connection.password">
</property>
<!-- Condiguração do c3p0 -->
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.c3p0.min_size">2</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.max_statements">10</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.acquire_increment">2</property>
<!-- Configurações de debug -->
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.use_sql_comments">true</property>
<mapping resource="Curso.hbm.xml"/>
<mapping resource="Disciplina.hbm.xml"/>
<mapping resource="Turma.hbm.xml"/>
<mapping resource="Pessoa.hbm.xml"/>
<mapping resource="Aluno.hbm.xml"/>
<mapping resource="Professor.hbm.xml"/>
<mapping resource="Endereco.hbm.xml"/>
</session-factory>
</hibernate-configuration>
ERRO:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1087)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1111)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at HibTest.HibernateUtility.<clinit>(HibernateUtility.java:28)
at HibTest.Teste.main(Teste.java:10)
Exception in thread "main" java.lang.NullPointerException
at HibTest.HibernateUtility.getSession(HibernateUtility.java:39)
at HibTest.Teste.main(Teste.java:10)
Java Result: 1
Já configurei os JAR’s no classpath do NetBeans.
Não sei mais o que fazer…
Alguém pode me ajudar?:???