[
http://jira.jboss.com/jira/browse/JBPM-630?page=all ]
Alejandro Guizar closed JBPM-630.
---------------------------------
jbpm should not go off when resource.hibernate.properties points to
inexistent resource
---------------------------------------------------------------------------------------
Key: JBPM-630
URL:
http://jira.jboss.com/jira/browse/JBPM-630
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Affects Versions: jBPM 3.1
Reporter: Alejandro Guizar
Assigned To: Alejandro Guizar
Fix For: jBPM 3.1.1
When running the testsuite against multiple databases, the ability to override the
default database connection properties in hibernate.cfg.xml with database-specific
settings in a separate hibernate.properties file is convenient.
All DB test cases use the jbpm config file src/java.jbpm.test/org/jbpm/jbpm.test.cfg.xml
as per the hard-coded resource path in AbstractDbTestCase. The setting
resource.hibernate.properties has to be uncommented for the above to work. This update
must be committed so that the change does not need to be manually applied every time QA
runs cruisecontrol. However, it has not been committed because doing so causes the local
tests (which do not require overriding any settings) to fail with:
org.jbpm.JbpmException: couldn't load hibernate properties from unexisting resource
'hibernate.properties'
at
org.jbpm.db.hibernate.HibernateHelper.loadPropertiesFromResource(HibernateHelper.java:171)
at org.jbpm.db.hibernate.HibernateHelper.createConfiguration(HibernateHelper.java:100)
at
org.jbpm.persistence.db.DbPersistenceServiceFactory.getConfiguration(DbPersistenceServiceFactory.java:68)
at
org.jbpm.persistence.db.DbPersistenceServiceFactory.getSchemaExport(DbPersistenceServiceFactory.java:76)
at
org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:107)
at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:383)
at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:375)
at org.jbpm.db.AbstractDbTestCase.createSchema(AbstractDbTestCase.java:121)
at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:55)
[...]
Caused by: java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:80)
at java.util.Properties.load(Properties.java:266)
at
org.jbpm.db.hibernate.HibernateHelper.loadPropertiesFromResource(HibernateHelper.java:168)
... 22 more
I understand you want to enforce that the properties resource exists when you explicitly
reference it from jbpm.cfg.xml, but this doesn't help QA. Here are the alternatives I
can think of:
a) Log a warning when the referenced resource does not exist, but do not throw an
exception.
b) Remove the hard-coded resource path in AbstractDbTestCase, so that QA can use an
alternate jbpm.cfg.xml file
c) Any other alternative?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira