通过domain template builder.jar创建域后WebLogic启动报config.xml Schema校验错误
启动WebLogic Admin Server时的报错日志如下:
<Jul 20, 2021 9:44:51 AM EDT> <Schema validation errors while parsing /oracle/user_projects/domains/awt-dv/config/config.xml<43:7> - Invalid xsi:type qname: 'ext:ashland-authenticatorType' in element realm@http://xmlns.oracle.com/weblogic/domain.> <Jul 20, 2021 9:44:51 AM EDT> <Schema validation errors while parsing /oracle/user_projects/domains/awt-dv/config/config.xml - /oracle/user_projects/domains/awt-dv/:43:7: error: failed to load java type corresponding to t=ashland-authenticatorType@http://www.ashland.com/weblogic12c/security/extension.> <Jul 20, 2021 9:44:51 AM EDT> <Schema validation errors while parsing /oracle/user_projects/domains/awt-dv/config/config.xml<53:7> - Invalid xsi:type qname: 'ext:ashland-authorizerType' in element realm@http://xmlns.oracle.com/weblogic/domain.> <Jul 20, 2021 9:44:51 AM EDT> <Schema validation errors while parsing /oracle/user_projects/domains/awt-dv/config/config.xml - /oracle/user_projects/domains/awt-dv/:53:7: error: failed to load java type corresponding to t=ashland-authorizerType@http://www.ashland.com/weblogic12c/security/extension.>
错误原因
- 该报错核心是WebLogic启动加载域配置文件
config.xml时,无法识别自定义的安全提供商配置:- 原始域中配置了第三方开发的
ashland-authenticator(自定义身份认证器)和ashland-authorizer(自定义权限授权器),这两个组件不属于WebLogic原生内置的安全模块 - 使用
domain template builder.jar打包域模板时,未将这两个自定义组件对应的实现Jar包、XMLSchema校验文件一同纳入模板,导致新域创建后缺少对应依赖 - 新域的类加载路径中没有放置自定义安全组件的Jar包,启动时无法加载
ashland-authenticatorType、ashland-authorizerType对应的Java类,触发Schema校验失败
- 原始域中配置了第三方开发的
修复方案
- 常规修复步骤:
- 从原始正常运行的域中,找到自定义安全组件对应的依赖Jar包、XMLSchema定义文件(
.xsd后缀) - 将Jar包复制到新域的
$DOMAIN_HOME/lib目录下;如果是自定义安全提供商,建议放到WebLogic专属的安全扩展目录$WL_HOME/server/lib/mbeantypes,该目录的Jar会被优先加载用于安全组件初始化 - 检查新域
config.xml头部的命名空间声明,确保已正确引入自定义安全组件的命名空间,示例配置如下:
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:ext="http://www.ashland.com/weblogic12c/security/extension" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/domain/1.0/domain.xsd http://www.ashland.com/weblogic12c/security/extension ashland-security-extension.xsd">- 重启Admin Server即可正常加载配置
- 从原始正常运行的域中,找到自定义安全组件对应的依赖Jar包、XMLSchema定义文件(
- 模板复用场景优化:
重新使用domain template builder.jar打包域模板,在添加文件步骤将自定义安全组件的Jar、xsd文件添加到模板对应目录下,后续通过该模板创建的新域会自动携带依赖,无需手动修改 - 临时应急方案:
若暂时不需要使用该自定义安全组件,可直接编辑config.xml,删除ashland-authenticator和ashland-authorizer对应的配置段,替换为WebLogic原生的DefaultAuthenticator配置即可直接启动
内容的提问来源于stack exchange,提问作者Harish
相关产品推荐
相关产品推荐

