【问题标题】:missing resource bundle exception in java using weblogic使用weblogic在java中缺少资源包异常
【发布时间】:2017-08-31 07:24:50
【问题描述】:

我需要将 xsd 文件转换为 POJO 文件。在使用 tomcat 时我没有遇到任何问题,但是当我使用 weblogic 时出现错误

找不到资源包 java.util.PropertyResouceBundle,key 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-commons-lib-0.4.1.jar
  • jaxb-xjc-2.2.11.jar
  • jaxb-core-2.2.11.jar
  • cli-7.jar

【问题讨论】:

    标签: xsd jaxb pojo xjc jaxp


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2010-10-17
      • 1970-01-01
      • 2011-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多