Adding mappings to Configuration before FilterDefinition leads to NullPointerException
--------------------------------------------------------------------------------------
Key: HHH-2091
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2091
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr4
Environment: Hibernate 3.2.cr4 (r10506)
Java 5
Reporter: Josh Moore
Attachments: hbmbindertest.zip
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)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira