我要求我需要将xsd文件转换为POJO文件。虽然使用tomcat我没有遇到任何问题,但当我使用weblogic时,我收到错误
无法找到捆绑java.util.PropertyResouceBundle的资源,密钥JAXPSupportedProperty
File tmpDir = util.createTempPOJODirectory();
String xsdFilePath = convertToXSD(xmlResponse, tmpDir); // The xml response will be converted to XML file and then converted to XSD file
if (StringUtils.isNotBlank(xsdFilePath)) {
log("XSD location ::" + xsdFilePath + " and output location :: " + tmpDir);
// Setup schema compiler
SchemaCompiler sc = XJC.createSchemaCompiler();
sc.forcePackageName("");
// Setup SAX InputSource
File schemaFile = new File(xsdFilePath);
InputSource is = new InputSource(schemaFile.toURI().toString());
// is.setSystemId(schemaFile.getAbsolutePath());
// Parse & build
sc.parseSchema(is);
log("after parsing and building");
log("sc :: " + sc);
S2JJAXBModel model = null;
try {
model = sc.bind();
}
catch (Exception e1) {
log("Exception :: " + ExceptionUtils.getFullStackTrace(e1));
}
log("model :: " + model);
try {
JCodeModel jCodeModel = model.generateCode(null, null);
jCodeModel.build(tmpDir);
log("generation POJO's is success");
return "POJO are created under " + tmpDir + " successfully.";
}
catch (IOException e) {
log("unable to generate POJO's");
log("IOException occurs :: " + ExceptionUtils.getFullStackTrace(e));
}
catch (Exception e) {
log("Exception occurs :: " + ExceptionUtils.getFullStackTrace(e));
}`
为此,我使用了以下罐子: -
答案 0 :(得分:0)
谢谢大家,我已经通过删除jaxb jar解决了这个问题。