hi all,
i have developed a webapplication that consists of two modules, a backend.jar module that contains backend code (uses hib & spring) and a WebApp (webwork based) that uses the backend.jar for interacting with the database.
I wanted to configure my SessionFactory dynamically, without hardcoding the mapping files that i was going to use in appconfig.xml, so i wrote this in the appContext.xml
Now, when i run my jUnit tests for backend.jar module, everything is fine, i can insert/delete etc..Code:<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="mappingLocations"> <value>classpath*:**/*.hbm.xml</value> </property> .....
However when i run my app in JBoss/Tomcat, when the web module is trying to insert something in the database i got a big exception stating that it cannot find Entity <myobjectconfiguredinhbm.xmlfile>, so it's like it is not able to see the hbm.xml files
now, i am pretty sure the web module is configured properly regarding spring xml files...... i am going to do some integration tests between web and backend modules, but i was wondering if anyone has encountered this problem before..
When i replaced the above configuratin with this one
everything works like a charmCode:<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="mappingResources"> <list> <value>bus/dto/AgencyImpl.hbm.xml</value> <value>bus/dto/JobApplicationImpl.hbm.xml</value> </list> </property>
i am including spring.jar version 2.0, i was wondering if anyone has encountered this problem before......
Since everything works in the lattter configuration, my guess is that the problem is in the former configuration...
any help?
thanks in advance and regards
marco


Reply With Quote
