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
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.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.j
ava:290)
 at
test.com.bm.pcs.corporativo.actions.TestFamiliaDNCAction.testLoadPage(Te
stFamiliaDNCAction.java:46) <--- all i have here is the actionPerform();
on line 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)


Emmanouil Batsis <[EMAIL PROTECTED]> wrote:
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]



Luiz Octavio Godoy 

Desenvolvimento de Sistemas

                
---------------------------------
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.


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

Reply via email to