
| Key: |
NUCAPIJDO-40
|
| Type: |
Improvement
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Incomplete
|
| Assignee: |
Unassigned
|
| Reporter: |
Chris Colman
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
When an XML syntax error is present in the persistence.xml file a parser exception is thrown that explains the error but as you can see in the source of JDOPersistenceManagerFactory.java below, that useful information in the exception is ignored and a new exception is thrown saying that the persistence unit could not be found - which is true but not as useful as conveying the reason why it could not be found:
try
{
// Obtain any props defined for the persistence-unit
pumd = nucleusContext.getMetaDataManager().getMetaDataForPersistenceUnit(persistenceUnitName);
if (pumd != null)
{
// Add the properties for the unit
if (pumd.getProperties() != null)
{
pmfProps.putAll(pumd.getProperties());
}
}
else
{
throw new JDOUserException(LOCALISER.msg("012004", persistenceUnitName));
}
}
catch (NucleusException jpe)
{
throw new JDOUserException(LOCALISER.msg("012005", persistenceUnitName));
}
|
|
Description
|
When an XML syntax error is present in the persistence.xml file a parser exception is thrown that explains the error but as you can see in the source of JDOPersistenceManagerFactory.java below, that useful information in the exception is ignored and a new exception is thrown saying that the persistence unit could not be found - which is true but not as useful as conveying the reason why it could not be found:
try
{
// Obtain any props defined for the persistence-unit
pumd = nucleusContext.getMetaDataManager().getMetaDataForPersistenceUnit(persistenceUnitName);
if (pumd != null)
{
// Add the properties for the unit
if (pumd.getProperties() != null)
{
pmfProps.putAll(pumd.getProperties());
}
}
else
{
throw new JDOUserException(LOCALISER.msg("012004", persistenceUnitName));
}
}
catch (NucleusException jpe)
{
throw new JDOUserException(LOCALISER.msg("012005", persistenceUnitName));
} |
Show » |
Sort Order:
|