
| 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:
Andy Jefferson made changes - 06/Sep/12 11:32 AM
| Field |
Original Value |
New Value |
|
Issue Type
|
Bug
[ 1
]
|
Improvement
[ 4
]
|
|
Priority
|
Major
[ 3
]
|
Incomplete
[ 6
]
|
Andy Jefferson made changes - 09/Jan/13 02:53 PM
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Fix Version/s
|
|
3.2.0.m3
[ 11850
]
|
|
Resolution
|
|
Fixed
[ 1
]
|
Andy Jefferson made changes - 14/Jan/13 11:31 AM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|