não consigo usar hibernate no eclipse

Galera que manja de JAVA mais do que eu… faz três longos dias que to tentando usar o hibernate no eclipse, já li muuuuuito material disponivel na net mas nada… já fiz boa parte (coloquei o plugin no eclipse, já setei o classpath no eclipse com os jars do hibernate, criei os arquivos .hbm.xml e cfg.xml)…MAS NA HORA DE RODAR A APLICAÇÃO DÁ O SEGUINTE ERRO NO CONSOLE DO ECLIPSE:
Exception in thread “AWT-EventQueue-0” java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.reset(Configuration.java:168 )
at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
at persistencia.SaudeFactory.<clinit>(SaudeFactory.java:13)
at visao.Login$3.run(Login.java:206)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment.<clinit>(Environment.java:515)
… 13 more

PEGUEI UM EXEMPLO PRONTO DE UMA APLICAÇÃO QUE USA HIBERNATE E TÁ DANDO O MESMO ERRO NA HORA DE EXECUTAR.

[color=“red”]OBS: ESSE nullPointerException ocorre quando tento instanciar o objecto da classe Configuration() do Hibernate. Ex.:

Configuracao config = new Configuracao();[/color]
Se alguém souber o que está acontencendo e puder me dar uma força ficaria grato!

Tipo algumas dicas:

  • Na pagina do Hibernate tem umas “receitas de bolo” para configurar e como usar o mesmo;
    *Configure o Log4j que vem com o Hibernate para fazer um log dos erros, pq senao nem Deus descobre de onde eles estao sendo gerados.

De modo geral va na pagina do hibernate e boa, la explica como montar os arquivos de configuraçao e os arquivos de mapeamento de classes.
//exemplo de como montar uma conf.

public class HibernateUtil &#123;

    private static Log log = LogFactory.getLog&#40;HibernateUtil.class&#41;;
    private static final SessionFactory sessionFactory;

    static &#123;
        try &#123;
            // Create the SessionFactory                
            sessionFactory = new Configuration&#40;&#41;.configure&#40;&#41;.buildSessionFactory&#40;&#41;;
           
        &#125; catch &#40;Throwable ex&#41; &#123;
            
            log.error&#40;&quot;Initial SessionFactory creation failed.&quot;, ex&#41;;
            throw new ExceptionInInitializerError&#40;ex&#41;;
            
        &#125; // end of the try - catch block
        
    &#125; // end of static block

    public static final ThreadLocal session = new ThreadLocal&#40;&#41;;

    public static Session currentSession&#40;&#41; throws HibernateException &#123;
        
        Session s = &#40;Session&#41; session.get&#40;&#41;;
        
        // Open a new Session, if this Thread has none yet
        if &#40;s == null&#41; &#123;
            s = sessionFactory.openSession&#40;&#41;;
            session.set&#40;s&#41;;
        &#125;
        return s;
    &#125;

    public static void closeSession&#40;&#41; throws HibernateException &#123;
        Session s = &#40;Session&#41; session.get&#40;&#41;;
        session.set&#40;null&#41;;
        if &#40;s != null&#41;
            s.close&#40;&#41;;
    &#125; // end of the method

&#125; // end of the class 

//exemplo do Arquivo de configuraçao do banco de dados

&lt;!DOCTYPE hibernate-configuration PUBLIC
	&quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
	&quot;http&#58;//hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
&lt;hibernate-configuration&gt;
	&lt;session-factory&gt;
		&lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;
			org.apache.derby.jdbc.ClientDriver
		&lt;/property&gt;
		&lt;property name=&quot;hibernate.connection.url&quot;&gt;
			jdbc&#58;derby&#58;//localhost&#58;1527/D&#58;/tempEclipse/bancos/HerancaJPA;create=true
		&lt;/property&gt;
		&lt;property name=&quot;hibernate.connection.username&quot;&gt;
			utfpr
		&lt;/property&gt;
		&lt;property name=&quot;hibernate.connection.password&quot;&gt;
			utfpr
		&lt;/property&gt;
		&lt;property name=&quot;hibernate.dialect&quot;&gt;
			org.hibernate.dialect.DerbyDialect
		&lt;/property&gt;
		&lt;property name=&quot;hibernate.hbm2ddl.auto&quot;&gt;
			create
		&lt;/property&gt;
		&lt;property name=&quot;show_sql&quot;&gt;true&lt;/property&gt;
		&lt;property name=&quot;format_sql&quot;&gt;true&lt;/property&gt;
		&lt;property name=&quot;use_sql_comments&quot;&gt;false&lt;/property&gt;
		
		&lt;!-- TABLE_PER_CLASS --&gt;
		&lt;mapping class=&quot;pojo.Carga&quot;/&gt;
		&lt;mapping class=&quot;pojo.Pessoas&quot;/&gt;
		&lt;mapping class=&quot;pojo.Militar&quot;/&gt;
		&lt;mapping class=&quot;pojo.Passageiro&quot;/&gt; 
		
		&lt;!-- JOINED
		&lt;mapping class=&quot;pojo.Pessoa&quot;/&gt;
		&lt;mapping class=&quot;pojo.Fisica&quot;/&gt;  
		&lt;mapping class=&quot;pojo.Juridica&quot;/&gt; 
		--&gt;
		
		&lt;!-- SINGLE_TABLE 
		&lt;mapping class=&quot;pojo.Pessoa&quot;/&gt;
		&lt;mapping class=&quot;pojo.Fisica&quot;/&gt;  
		&lt;mapping class=&quot;pojo.Juridica&quot;/&gt; 
		--&gt;
		
	&lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;

Espero ter ajudado. Vlw