Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.1
-
Fix Version/s: JiBX 1.2.2
-
Component/s: CodeGen
-
Labels:None
-
Number of attachments :
Description
Trying to generate binding for HR-XML schemas (http://ns.hr-xml.org/AllHRXML/200704/HRXML200704.zip) following exception is raised:
Exception in thread "main" java.lang.NullPointerException
at org.jibx.schema.codegen.CodeGen.applyAndNormalize(CodeGen.java:610)
at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1646)
I realized that CodeGen has problem to distinguish between schemas with the same file name in different directories. For example HR-XML has these two schemas among others:
HR-XML-2_5/Indicative/US/USLocalizations.xsd
HR-XML-2_5/CPO/US/USLocalizations.xsd
I found that the problem could be in the class org.jibx.schema.UrlResolver. There is the property:
private final String m_name;
which is set with only file name (without path). When I tried to change the constructor like this:
public UrlResolver(String path, URL url)
{ m_url = url; m_id = url.getProtocol().toLowerCase() + "://" + url.getHost().toLowerCase() + url.getFile(); path.replace('\\', '/'); m_name = path; }then CodeGen worked as expected. The solution was to store the whole path into the name property. I'm not sure if this fix is suitable and could not have other consequencies.
Jirka
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Dennis Sosnoski [ dsosnoski ] | |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Fixed in current code by passing full identifier for schema in various methods (rather than just the schema name).