The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

brainbug (1) [Avatar] Offline
#1
Hi chris,
thank you for your great book. It helps us a lot to
evaluate which frameworks to use and how to design our application.

We would like to integrate your ormunit projects to validate mapping,...
Doing this there are two Problems:
1. Annotated Hibernate Classes
2. I can't adapt the spring configuration properly.

To 1)
I configured spring like this:
<bean id="commonSessionFactory" abstract="true" >
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="DataSource" />
</property>
<property name="annotatedClasses">
<list>
<value> ...
</value>
</list>
</property>
<property name="annotatedPackages">
<list>
<value>de....</value>
</list>
</property>
</bean>

To 2)
My following spring context file will be read, but the test can't get a connection.

ClassToTableMappingTest extends HibernateMappingTests
{
@Override
protected String[] getConfigLocations()
{
return new String[] { "classpath:spring-test-context.xml" };
}
...

results in:

java.sql.SQLException: org.apache.commons.dbcp.DelegatingStatement is closed.
at org.apache.commons.dbcp.DelegatingStatement.checkOpen(DelegatingStatement.java:136)
at ...

Do you have any ideas what went wrong. Did I understand it right, that all I have to do
in my specialized TestClass is:
overwrite the getConfigLocations() Method?

Thanks in advance.

Regards Jens
ceracm (113) [Avatar] Offline
#2
Re: ORMUnit for annotated Hibernate Objects
Jens

Sorry about the delay in replying.

I haven't tried using ORMUnit with Hibernate annotations.
I will have to investigate.

With regards to the error:
java.sql.SQLException: org.apache.commons.dbcp.DelegatingStatement is closed.
at org.apache.commons.dbcp.DelegatingStatement.checkOpen(DelegatingStatement.java:136)
at ..

What is the rest of the stack trace? Logging output etc ?

Chris