使用weblogic在java中缺少资源包异常

时间:2017-08-31 07:24:50

标签: xsd jaxb pojo xjc jaxp

我要求我需要将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));
        }`

为此,我使用了以下罐子: -

  • XSD-GEN-0.2.1.jar
  • XOM-1.2.5.jar
  • wiztools-公地-LIB-0.4.1.jar
  • JAXB-XJC-2.2.11.jar
  • JAXB核-2.2.11.jar
  • CLI-7.jar

1 个答案:

答案 0 :(得分:0)

谢谢大家,我已经通过删除jaxb jar解决了这个问题。