org.apache.xalan.processor.TransformerFactoryImpl Not Found

APPLIES TO:

Oracle WebLogic Server - Version 10.3.6 and later
Information in this document applies to any platform.

SYMPTOMS

After successfully deploying an application to the domain and bringing it to ACTIVE mode, subsequent changes in the admin console fail with the following error:

The prepare phase of the configuration update failed with an exception:
  at weblogic.management.provider.internal.RuntimeAccessDeploymentReceiverService.updateDeploymentContext(RuntimeAccessDeploymentReceiverService.java:670)
.....
Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found

CAUSE

The deployed application changes a system property like so:

javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

At some point in the application code, a call is made to -- see http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#setProperty%28java.lang.String,%20java.lang.String%29 for the Java SE 7 documentation on this method. So in this case, it would take the system property named "javax.xml.transform.TransformerFactory" and assign the value "org.apache.xalan.processor.TransformerFactoryImpl" to it. applies across the entire JVM, not just within the application, and that's why it ends up impacting the console app as well.System.setProperty(String key, String value)System.setProperty

The application has the xalan jar file in its lib directory, so it's able to deploy and activate without any problems, and it works fine. However, that changes the value for this property for the entire system, not just for the application. The console app doesn't have access to the Apache-specific Xalan class and that's why it throws the error that it cannot find it.

Generally speaking, any methods in the Java package will apply to the entire JVM, and they can cause problems if they change the state or properties of the entire JVM. Another example of the same problem is calling -- this will exit not only the current application, but the entire application server as well.SystemSystem.exit()

SOLUTION

Refactor your code so that you do not call . If the property is set only within the context of the application rather than JVM-wide, you won't see this problem.System.setProperty()

It is possible to work around the problem by adding the jar file containing the missing classes to the DOMAIN_HOME/lib directory. The DOMAIN_HOME/lib directory uses a special classloader which is a child of the system classloader and a parent of the application classloader. So classes in jar files in that directory are not available to the system as a whole, but are available to any applications running in that system, including both your applications and the WLS console application. However, there is a risk that you may break other apps in the system (like the console app) if they rely on a particular setting for the system property that the application is changing.

Therefore, the best solution is to avoid setting a property which applies to the entire JVM rather than to the application where it is actually needed. Refactoring the application code to avoid using will solve the issue.System.setProperty()

Please note that anytime that the application code is changed, it has to be redeployed, and any time a system property has been changed, that system property remains in effect until changed again or until a reboot. So a reboot is advisable when changing system properties to return to a clean environment.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值