Toplink essentials NullPointerException

4 respostas
leonardobhbr

Pessoal estou usando o eclipse3.2 junto com o plugin dali o criei ate minha entidades tudo certo só que na hora que eu vou instancia-lo na minha aplicaçõa desktop esta dando o erro :shock:

[color=red]

java.lang.NullPointerException

at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:120)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)

at br.com.financeiro.Financeiro.initialize(Financeiro.java:583)

at br.com.financeiro.Financeiro.(Financeiro.java:557)

at br.com.financeiro.Financeiro$6.run(Financeiro.java:547)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)

java.lang.NullPointerException

at br.com.financeiro.CadEmpresa.leRegistro(CadEmpresa.java:548)

at br.com.financeiro.CadEmpresa.initialize(CadEmpresa.java:486)

at br.com.financeiro.CadEmpresa.(CadEmpresa.java:470)

at br.com.financeiro.Financeiro$1.actionPerformed(Financeiro.java:176)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.AbstractButton.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)

at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)

[\color]

[color=green]
detalhe meu arquivo persistence.xml existe e o persistence-unit name =“financeiro”
[\color]

Desde já grato…

4 Respostas

indivito

iai cara, encontrou soluçao? tambem estou com este problema.

cado

Poste seu codigo pra gente tentar te ajudar. :wink:

tcljava

Caro amigo

Você tem algum exemplo de uma aplicacao web utilizando ejb 3.0 JPA com toplink e o jboss?

A

Olá Leonardo,

Como você cria a factory?

Lembre-se que a anotação @PersistenceUnit não funciona sem um container JEE 5.

Se você não estiver usando um container (ou seu container não for JEE 5), você deverá fazer algo assim:

[]'s

Andre

Criado 24 de setembro de 2006
Ultima resposta 9 de nov. de 2006
Respostas 4
Participantes 5