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

Key: HHH-2091
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Josh Moore
Votes: 0
Watchers: 0
Operations

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

Adding mappings to Configuration before FilterDefinition leads to NullPointerException

Created: 21/Sep/06 02:29 PM   Updated: 13/Mar/07 04:22 AM
Component/s: core
Affects Version/s: 3.2.0.cr4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive hbmbindertest.zip (4 kb)

Environment:
Hibernate 3.2.cr4 (r10506)
Java 5
Issue Links:
Duplicate
 
Relates
 


 Description  « Hide
The exception below is thrown when a mapping file contains a reference to a filter which is not in that or another mapping file. The call to addFilterDefinition must be done first.

<code>
public class HbmBinderTest extends TestCase
{

// This throws a NPE unless the filter definition is included.
protected void addMappings(String[] files, Configuration cfg) {
// cfg.addFilterDefinition( new FilterDefinition(
// "securityFilter","true",new HashMap()) );
super.addMappings(files, cfg);
}
</code>


java.lang.NullPointerException
at org.hibernate.cfg.HbmBinder.parseFilter(HbmBinder.java:2935)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2110)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2031)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:424)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:465)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:494)
at org.hibernate.test.TestCase.addMappings(TestCase.java:230)
at org.hibernate.test.TestCase.buildSessionFactory(TestCase.java:180)
at org.hibernate.test.TestCase.setUp(TestCase.java:157)

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.