[
http://jira.jboss.com/jira/browse/JBPORTAL-1927?page=comments#action_1240... ]
Antoine Herzog commented on JBPORTAL-1927:
------------------------------------------
There is also a bug : it is a light bug, that occurs only if there is an error.
in the method : createConfiguration()
in this code :
TermBeforeSetParentCallback componentCallback = new TermBeforeSetParentCallback() {
public Object beforeSetParent(Object o, UnmarshallingContext ctx) {
UIComponentConfiguration uiComponent = null;
ElementBinding eb = (ElementBinding) ctx.getParticle()
.getTerm();
String localPart = eb.getQName().getLocalPart();
if ("ui-component".equals(localPart)) {
uiComponent = (UIComponentConfiguration) o;
try {
// Getting property reference
PropertyInfo propertyInfo = getUserProfileModule()
.getProfileInfo().getPropertyInfo(
uiComponent.getPropertyRef());
uiComponent.setPropertyInfo(propertyInfo);
} catch (IdentityException e) {
uiComponent = null;
throw new IllegalArgumentException(
"cannot resolve property: "
+ uiComponent.getPropertyRef(), e);
}
}
return uiComponent;
}
};
This is wrong :
} catch (IdentityException e) {
uiComponent = null;
throw new IllegalArgumentException(
"cannot resolve property: "
+ uiComponent.getPropertyRef(), e);
}
=> the uiComponent = null; is wrong
it is used just after in the uiComponent.getPropertyRef()
so, this line should be remove... the exception will any way prevent the method from
returning the uiComponent value.
Then, the IllegalArgumentException can be thrown properly, and the debugging of the
configuration can be done...
IdentityUIConfigurationServiceImpl : better logs of exception, for
better config debugging
------------------------------------------------------------------------------------------
Key: JBPORTAL-1927
URL:
http://jira.jboss.com/jira/browse/JBPORTAL-1927
Project: JBoss Portal
Issue Type: Task
Security Level: Public(Everyone can see)
Components: Portal Identity
Affects Versions: 2.6.4 Final
Environment: JBP 2.6.4
Reporter: Antoine Herzog
Priority: Minor
Fix For: 2.6.5 Final
Original Estimate: 20 minutes
Remaining Estimate: 20 minutes
In class : IdentityUIConfigurationServiceImpl
the exception handling is not re throwing the cause of the exception.
hence, the error (in config) are quite difficult to understant and debug.
would be great to add the cause exception in the "throw new xxxException('bla
bla');"
example :
line 337
catch (JBossXBException e)
{
throw new CoreIdentityConfigurationException("Could not parse configuration
file.");
}
would be better :
catch (JBossXBException e)
{
throw new CoreIdentityConfigurationException("Could not parse configuration
file.", e);
}
everywhere in the file : add the ", e);" in all the new exception throw
Thanks,
--
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