SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-750
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Shay Banon
Reporter: Michal Perlik
Votes: 0
Watchers: 0
Operations

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

NullPointerException in CompassEventListener when trying to configure an HibernateMirrorFilter

Created: 21/Oct/08 04:29 PM   Updated: 22/Oct/08 06:08 PM
Component/s: Compass::Gps
Affects Version/s: None
Fix Version/s: 2.1.0 GA


 Description  « Hide
Hi,

I tried to implement HibernateMirrorFilter and got a NullPointerException during initialization in
org.compass.gps.device.hibernate.embedded.CompassEventListener. In a closer look I realized that is caused by this line:

compassHolder.mirrorFilter = (HibernateMirrorFilter) ClassUtils.forName(mirrorFilterClass, compassHolder.compass.getSettings().getClassLoader()).newInstance();

since compassHolder.compass is null at this time. It is set after this code block:

compassHolder.compass = compassConfiguration.buildCompass();

Moving this statement in front of the class loader solved it. Please update in trunk.

Thanks



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 22/Oct/08 06:08 PM
Fixed. Note that it is preferable to implements Compass built in event listener (for example PreCreateEventListener) if there is no need for the actual Hibernate event objects. This works better when using cascading with Compass as well as does not tie you to Hibernate specifically.