Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » MOXY problems with EntityResolver for DynamicJAXBContextFactory(Method resolveEntity of EntityResolver does not work if the output is null for schemas already loaded)
MOXY problems with EntityResolver for DynamicJAXBContextFactory [message #1753831] Fri, 10 February 2017 13:34
Sara Nieto is currently offline Sara NietoFriend
Messages: 1
Registered: February 2017
Junior Member
Dear colleagues,

I would like to use Moxy library and DynamicJAXBContextFactory to read my schema (several XSD files). The problem that I found is that my EntityResolver fails because it tries to import several times the same schema file. To solve this problem of duplicities, I modified the EntityResolver to return NULL, if the schema was already processed, but it still failing....

I tried the same with JAXB and it works perfectly. But I would like to use MOXY due to that I avoid the creation of the Java pojos from the schema.

Could you please let me know how Moxy can lead with a set of schema files and how to import files just once?

Code for EntityResolver:

public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {

// Grab only the filename part from the full path
String filename = new File(systemId).getName();

if (!pathMap.containsKey(filename)) {
// Now prepend the correct path

String correctedId = ROUTE + "/" + filename;

InputSource is = new InputSource(ClassLoader.getSystemResourceAsStream(correctedId));
is.setSystemId(correctedId);
pathMap.put(filename, is);

return is;
} else {
return null;
}
}

Thanks a lot in advance!!!
Best regards,
Sara.
Previous Topic:EclipseLink Moxy query by xpath using getValueByXPath
Next Topic:Error creating moxy jaxb context
Goto Forum:
  


Current Time: Thu Dec 14 10:25:10 GMT 2017

Powered by FUDForum. Page generated in 0.01671 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software