Re: Struts Hibernate error

2005-08-23 Thread Emmanouil Batsis

Luiz Godoy wrote:



java.lang.RuntimeException: Exception building SessionFactory: null



Search the hibernate forums, could be anything from your 
hibernate.cfg.xml location to your JDK version. In any case, it has 
nothing to do with struts.


hth,

Manos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts Hibernate error

2005-08-23 Thread Marco Mistroni
hELLO,
how r you initializing your SessionFactory?
Specifically, how are you integrating Hibernate inside Struts?
Are you using a struts plugin for hibernate?
If you check www.hibernate.org, there are FAQ for how to properly use
A SessionFactory
Proper way was using a ServletFilter if I remember correctly...

If you want to avoid headaches, try to use Spring for managing
Hibernate session

HTH
marco


-Original Message-
From: Luiz Godoy [mailto:[EMAIL PROTECTED] 
Sent: 23 August 2005 14:48
To: Struts Users Mailing List
Subject: Re: Struts Hibernate error

Here is it, i´m trying to test an action, but the error seem to come
from Hibernate.
testLoadPage(test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction)
servletunit.struts.ExceptionDuringTestError: An uncaught exception was
thrown during actionExecute()
 at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.j
ava:305)
 at
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(Te
stFamiliaDNCAction.java:46)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at junit.framework.TestCase.runTest(TestCase.java:154)
 at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
 at junit.framework.TestSuite.run(TestSuite.java:203)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:436)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:311)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:192)

Root Cause:

javax.servlet.ServletException: Exception building SessionFactory: null
 at
org.apache.struts.action.RequestProcessor.processException(RequestProces
sor.java:523)
 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:421)
 at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
224)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.j
ava:290)
 at
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(Te
stFamiliaDNCAction.java:46)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at junit.framework.TestCase.runTest(TestCase.java:154)
 at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
 at junit.framework.TestSuite.run(TestSuite.java:203)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:436)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:311)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:192)

Root Cause:

java.lang.RuntimeException: Exception building SessionFactory: null
 at
com.bm.infra.persistence.hibernate.SessionManager.currentSession(Session
Manager.java:34)
 at
com.bm.infra.persistence.hibernate.HibernatePersistenceManager.find(Hibe
rnatePersistenceManager.java:185)
 at
com.bm.infra.persistence.hibernate.HibernatePersistenceManager.find(Hibe
rnatePersistenceManager.java:175)
 at com.ccne.dao.FamiliaDNCDAO.findByCodigo(FamiliaDNCDAO.java:41)
 at
com.ccne.bs.CadastroFamiliaDNC.findByCodigo(CadastroFamiliaDNC.java:34)
 at
com.bm.pcs.corporativo.actions.FamiliaDNCAction.excluir(FamiliaDNCAction
.java:118)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.j
ava:274)
 at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194
)
 at com.bm.infra.web.action.BasicAction.execute(BasicAction.java:142)
 at

Re: Struts Hibernate error

2005-08-23 Thread Luiz Godoy
Here is it, i´m trying to test an action, but the error seem to come from 
Hibernate.
testLoadPage(test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction)
servletunit.struts.ExceptionDuringTestError: An uncaught exception was thrown 
during actionExecute()
 at 
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:305)
 at 
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(TestFamiliaDNCAction.java:46)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at junit.framework.TestCase.runTest(TestCase.java:154)
 at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
 at junit.framework.TestSuite.run(TestSuite.java:203)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Root Cause:

javax.servlet.ServletException: Exception building SessionFactory: null
 at 
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
 at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 at 
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
 at 
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(TestFamiliaDNCAction.java:46)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at junit.framework.TestCase.runTest(TestCase.java:154)
 at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
 at junit.framework.TestSuite.run(TestSuite.java:203)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Root Cause:

java.lang.RuntimeException: Exception building SessionFactory: null
 at 
com.bm.infra.persistence.hibernate.SessionManager.currentSession(SessionManager.java:34)
 at 
com.bm.infra.persistence.hibernate.HibernatePersistenceManager.find(HibernatePersistenceManager.java:185)
 at 
com.bm.infra.persistence.hibernate.HibernatePersistenceManager.find(HibernatePersistenceManager.java:175)
 at com.ccne.dao.FamiliaDNCDAO.findByCodigo(FamiliaDNCDAO.java:41)
 at com.ccne.bs.CadastroFamiliaDNC.findByCodigo(CadastroFamiliaDNC.java:34)
 at 
com.bm.pcs.corporativo.actions.FamiliaDNCAction.excluir(FamiliaDNCAction.java:118)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at 
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
 at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
 at com.bm.infra.web.action.BasicAction.execute(BasicAction.java:142)
 at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 at 
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
 at 
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(TestFamiliaDNCAction.java:46)
 <--- all i have here is the actionPerform(); on line 46
 at sun.reflect.Nativ

Re: Struts Hibernate error

2005-08-23 Thread Emmanouil Batsis

Luiz Godoy wrote:


I´m having this error using eclipse, with struts and hibernate, any clue ?



Not without the stacktrace.

Manos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts Hibernate error

2005-08-23 Thread Luiz Godoy

I´m having this error using eclipse, with struts and hibernate, any clue ?

INFO: using CGLIB reflection optimizer

23/08/2005 10:12:25 org.hibernate.cfg.Environment 

INFO: using JDK 1.4 java.sql.Timestamp handling

23/08/2005 10:12:25 org.apache.struts.action.RequestProcessor processException

WARNING: Unhandled Exception thrown: class java.lang.RuntimeException

Thanks 


Luiz Octavio Godoy 

Desenvolvimento de Sistemas


-
 Start your day with Yahoo! - make it your home page