通过 putty 中的脚本创建 Weblogic 域时出错

Weblogic Domain creation error through script in putty

我正在尝试通过 putty 使用静默模式创建 weblogic 域。我使用了以下命令:

./config.sh -mode=silent -silent_xml=/home/ec2-user/createdomain.xml

我在执行时收到以下错误消息:

Exception in thread "Thread-1" java.lang.IllegalStateException: No able to create the instance of the template catalog class com.oracle.cie.domain.template.catalog.impl.GlobalTemplateCat
        at com.oracle.cie.domain.template.catalog.TemplateCatalogFactory.createGlobalTemplateCatalog(TemplateCatalogFactory.java:138)
        at com.oracle.cie.domain.template.catalog.TemplateCatalogFactory.getGlobalCatalog(TemplateCatalogFactory.java:78)
        at com.oracle.cie.domain.template.catalog.TemplateCatalogFactory.getGlobalCatalog(TemplateCatalogFactory.java:33)
        at com.oracle.cie.wizard.domain.silent.tasks.LoadTemplateCatalogTask.run(LoadTemplateCatalogTask.java:23)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.oracle.cie.domain.template.catalog.TemplateCatalogFactory.createGlobalTemplateCatalog(TemplateCatalogFactory.java:133)
        ... 4 more
Caused by: com.oracle.cie.domain.env.EnvironmentServiceException: Failed to get inventory for /home/ec2-user/oracle/middleware/oracle_common/common/bin
        at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:425)
        at com.oracle.cie.domain.env.EnvironmentServiceImpl.<init>(EnvironmentServiceImpl.java:89)
        at `com`.oracle.cie.domain.env.EnvironmentServiceImpl.getInstance(EnvironmentServiceImpl.java:364)
        at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:35)
        at com.oracle.cie.domain.template.catalog.impl.OracleHomeLocator.getProductInstalDirs(OracleHomeLocator.java:31)
        at com.oracle.cie.domain.template.catalog.impl.GlobalTemplateCat.populateProductCatalogs(GlobalTemplateCat.java:446)
        at com.oracle.cie.domain.template.catalog.impl.GlobalTemplateCat.<init>(GlobalTemplateCat.java:90)
        at com.oracle.cie.domain.template.catalog.impl.GlobalTemplateCat.<init>(GlobalTemplateCat.java:83)
        ... 9 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.oracle.cie.common.ReflectionHelper.process(ReflectionHelper.java:48)
        at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:384)
        ... 16 more
Caused by: com.oracle.cie.gdr.external.InventoryException: com.oracle.cie.gdr.utils.GdrException: The gdr meta-data directory /home/ec2-user/oracle/middleware/oracle_common/common/bin/inventory is invalid or does not exist.
        at com.oracle.cie.gdr.external.impl.OracleHomeInventoryImpl.<init>(OracleHomeInventoryImpl.java:55)
        at com.oracle.cie.gdr.external.impl.OracleHomeInventoryFactory.createInventory(OracleHomeInventoryFactory.java:60)
        at com.oracle.cie.gdr.external.InventoryFactory.getOracleHomeInventory(InventoryFactory.java:99)
        ... 22 more
Caused by: com.oracle.cie.gdr.utils.GdrException: The gdr meta-data directory /home/ec2-user/oracle/middleware/oracle_common/common/bin/inventory is invalid or does not exist.
        at com.oracle.cie.gdr.MetaDataHome.init(MetaDataHome.java:206)
        at com.oracle.cie.gdr.MetaDataHome.<init>(MetaDataHome.java:188)
        at com.oracle.cie.gdr.MetaDataHome.<init>(MetaDataHome.java:172)
        at com.oracle.cie.gdr.MetaDataHome.<init>(MetaDataHome.java:157)
        at com.oracle.cie.gdr.MetaDataHome.<init>(MetaDataHome.java:144)
        at com.oracle.cie.gdr.MetaDataHome.<init>(MetaDataHome.java:86)
        at com.oracle.cie.gdr.Home.getMetaDataHome(Home.java:619)

您使用的是哪个 Weblogic 版本?我有一段时间没有看到用于创建域的静默脚本。如果您尝试在 Weblogic 12c 上执行此操作,它将无法工作,因为据我所知,这种脚本曾经可用于旧版本,例如 8 和 9。

如果您想自动为 12c 等版本配置域,您应该使用更新的方法。在此,我提出两种方案。

  1. 您可以使用 Ansible、WLST 和 Python 创建域。您可以在此处查看示例 https://github.com/textanalyticsman/ansible-soa
  2. 您可以使用 Weblogic Deploy Tooling,这是 Oracle 提供的开源工具,您可以在此处找到它 https://github.com/oracle/weblogic-deploy-tooling
  3. Weblogic Deploy Tooling 和 Ansible 的组合也是一个不错的选择,如 https://github.com/textanalyticsman/ansible-soa-wldt
  4. 所示
  5. 您也可以试试 Weblogic Kubernetes Operator https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-resource/