jPOS 和 Weblogic 的兼容性 [英] Compatibility of jPOS and Weblogic
本文介绍了jPOS 和 Weblogic 的兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我在尝试配置 jPOS 以在 weblogic 中运行时遇到了困难.
jPOS 1.9.8 版
weblogic 10.3.6.0
我收到此错误:
14:01:12 [[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)'] (T0100.java:31)org.jpos.iso.ISOException: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl 不能转换为 javax.xml.parsers.SAXParserFactory (java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl不能转换为 javax.xml.parsers.SAXParserFactory)在 org.jpos.iso.packager.GenericPackager.readFile(GenericPackager.java:223)在 org.jpos.iso.packager.GenericPackager.(GenericPackager.java:130)在 ums.expy.ulink.T0100.<clinit>(T0100.java:28)在 ums.expy.ws.service.T0100Service.doJob(T0100Service.java:75)
代码:
私有静态ISOPackager T0100Packager;静止的 {尝试 {T0100Packager = 新的 GenericPackager(T0100.class.getResourceAsStream("/ulink0100.xml"));} catch (ISOException e) {logger.error("", e);}}
有人说去掉xml-apis.jar就可以了,但是jPOS需要xml-apis.jar.
我已经配置了 WEB-INF/weblogic.xml
<?xml version="1.0" encoding="UTF-8"?><weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"><容器描述符><prefer-web-inf-classes>true</prefer-web-inf-classes></容器描述符></weblogic-web-app>
我的 maven pom.xml
<依赖><groupId>org.jpos</groupId><artifactId>jpos</artifactId><version>1.9.8</version></依赖><依赖><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId><version>1.7.7</version></依赖><依赖><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>1.2.2</version></依赖><依赖><groupId>com.oracle</groupId><artifactId>ojdbc14</artifactId><version>10.2.0.5.0</version></依赖><依赖><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.2.3</version></依赖><依赖><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>3.2.6.RELEASE</version></依赖><依赖><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>3.2.6.RELEASE</version></依赖><依赖><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>3.2.6.RELEASE</version></依赖><依赖><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.9</version></依赖><依赖><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version></依赖><依赖><groupId>commons-beanutils</groupId><artifactId>commons-beanutils</artifactId><version>1.9.1</version></依赖><依赖><groupId>commons-lang</groupId><artifactId>commons-lang</artifactId><version>2.6</version></依赖><依赖><groupId>xalan</groupId><artifactId>xalan</artifactId><version>2.7.1</version></依赖>
为什么它不起作用?
解决方案
在您的 weblogic.xml 中添加以下内容
<package-name>org.apache.xerces.*</package-name></prefer-application-packages>
如果您在其中使用了 preferred-web-inf-classes,请将其删除或注释掉.
Hello I'm having hard time trying to configure jPOS to run in weblogic.
jPOS version 1.9.8
weblogic 10.3.6.0
I got this error:
14:01:12 [[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)'] (T0100.java:31)
org.jpos.iso.ISOException: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory (java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory)
at org.jpos.iso.packager.GenericPackager.readFile(GenericPackager.java:223)
at org.jpos.iso.packager.GenericPackager.<init>(GenericPackager.java:130)
at ums.expy.ulink.T0100.<clinit>(T0100.java:28)
at ums.expy.ws.service.T0100Service.doJob(T0100Service.java:75)
Code:
private static ISOPackager T0100Packager;
static {
try {
T0100Packager = new GenericPackager(
T0100.class.getResourceAsStream("/ulink0100.xml"));
} catch (ISOException e) {
logger.error("", e);
}
}
Somebody says it will be OK when remove xml-apis.jar, but jPOS needs xml-apis.jar.
I have configed WEB-INF/weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
My maven pom.xml
<dependency>
<groupId>org.jpos</groupId>
<artifactId>jpos</artifactId>
<version>1.9.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.5.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
Why it's not workig?
解决方案
In your weblogic.xml add the following
<prefer-application-packages>
<package-name>org.apache.xerces.*</package-name>
</prefer-application-packages>
If you have prefer-web-inf-classes in it, remove or comment it out.
这篇关于jPOS 和 Weblogic 的兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文