History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UNI-107
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Tim Ducheyne
Reporter: Tim Ducheyne
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Unitils

Unable to load module exception when jars are missing in classpath

Created: 04/Dec/08 05:59 PM   Updated: 27/May/09 08:27 PM
Component/s: core
Affects Version/s: 2.0
Fix Version/s: 2.2


 Description  « Hide
When a certain module is not needed, it should not cause a problem when any of its dependencies are not in the classpath.
For example, if your not using JPA and therefor no JPA deps are in the classpath, following exception occurs:

java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/LocalSessionFactoryBean
at org.unitils.orm.hibernate.HibernateModule.createOrmPersistenceUnitLoader(HibernateModule.java:140)
at org.unitils.orm.common.OrmModule.init(OrmModule.java:83)
at org.unitils.orm.hibernate.HibernateModule.init(HibernateModule.java:83)

This should result in a simple warning and the module should be ignored.

For now, you can disable to the modules you don't need as a work-around, by adding the corresponding following properties

unitils.module.database.enabled=false
unitils.module.hibernate.enabled=false
unitils.module.dbunit.enabled=false
unitils.module.mock.enabled=false
unitils.module.easymock.enabled=false
unitils.module.inject.enabled=false
unitils.module.spring.enabled=false
unitils.module.jpa.enabled=false




 All   Comments   Change History      Sort Order:
Tim Ducheyne - 04/Dec/08 06:00 PM
If a module cannot be loaded, a warning is logged and the module is ignored