I think this may be a problem with Surefire and the way spring uses classloaders :

http://jira.codehaus.org/browse/SUREFIRE-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

If you find a solution please post....

Thanks


Marco Mistroni wrote:
hi all,
i know i should post this to maven list but it is about spring and i am
sure someone here is using maven for building its environment

I have an app composed of 3 project:
- domain OBjects  , contains domain objects used by web and backend project
- backend project contains hibernate code
- webapp contains webwork code that uses hibernate to access database

i have been searching for solutions for not hardcoding hibernate mapping
files.. i came across mappingJarLocations where you can specify jars where
hbm.xml file are located.
this is fine, however i am building my project using maven2 and i am setting
the dependency scope for domainObjects.jar on my backend project..
if i use
<scope>test</scope>

test will fail because spring won't be able to find hbm.xml file (jar is not
in classpath)

if  i use
<scope>compile</scope>

jar won't be in test classpath....
i was wondering if anyone on this forum came across same situation...

here's my spring context...

<bean id="sessionFactory" class="
org.springframework.orm.hibernate3.LocalSessionFactoryBean">
       <property name="dataSource">
           <ref bean="dataSource"/>
       </property>
       <property name="mappingJarLocations">
           <value>classpath*:domainObjects-1.0-SNAPSHOT.jar</value>
       </property>
       <property name="hibernateProperties">
        <ref bean="exampleHibernateProperties" />
       </property>
   </bean>




thanks in advancea nd regards
marco



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

Reply via email to