简体   繁体   English

应用程序的Weblogic服务器上的Jar依赖项异常

[英]Jar dependency exceptions on weblogic servers for an application

I am getting an exception while deploying on Weblogic Server: 在Weblogic Server上部署时出现异常:

[2012-01-13 01:17:11,496] ERROR [org.springframework.web.servlet.DispatcherServlet] Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method
failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.

I have some jars as below: 我有一些罐子如下:

log4j-1.2.14.jar
spring-asm-3.0.3.RELEASE.jar
spring-beans-3.0.3.RELEASE.jar
spring-context-3.0.3.RELEASE.jar
spring-core-3.0.3.RELEASE.jar
spring-expression-3.0.3.RELEASE.jar
spring-web-3.0.3.RELEASE.jar
spring-webmvc-3.0.3.RELEASE.jar
servlet-2.3.jar
validation-api-1.0.0.GA.jar
commons-logging-1.1.1.jar
hibernate-validator-4.0.2.GA.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
standard.jar
commons-fileupload-1.1.1.jar
ESAPI-1.4.4.jar

I am guessing the issues can be but need guidance to solve it: 我猜可能是问题,但需要指导来解决:

After researching the issue, 2 likely scenarios came to the forefront: Hibernate Validator Library has a bug resulting in a dependency on JDK 6 Hibernate Validator has a dependency on the JAXBException Class, and the class is not present in the existing Weblogic Environment Upon further research, the hibernate-validator-4.0.2.jar build states a clear dependency on JDK 5. Digging deeper into the Hibernate Validator code, it appears that version 4.0.2 relies on JAXB API 2.1. 在研究了该问题之后,出现了两种可能的情况:Hibernate Validator库中的一个错误导致对JDK 6的依赖Hibernate Validator库中的一个依赖于JAXBException类,并且该类在现有的Weblogic Environment中不存在。 ,hibernate-validator-4.0.2.jar构建声明了对JDK 5的明确依赖性。深入研究Hibernate Validator代码后,似乎版本4.0.2依赖于JAXB API 2.1。

Weblogic servers are on java 1.5 and code is also compiled on java 1.5 then why the exceptions seems to pop up?? Weblogic服务器在Java 1.5上,代码也在Java 1.5上编译,那么为什么异常似乎会弹出?

You're being bitten by JAr incompatibilities. JAr的不兼容性让您很痛苦。 Your project has one version of the JAR, but WebLogic has another. 您的项目具有一个JAR版本,但WebLogic具有另一个版本。 The two don't match. 两者不匹配。 (This is what OSGi was born to solve.) (这是OSGi诞生的目的。)

You'll need to tell WebLogic which JAR you prefer. 您需要告诉WebLogic您更喜欢哪个JAR。 There's a setting in the weblogic.xml for "prefer WAR file JARs." weblogic.xml中有一个“首选WAR文件JAR”的设置。 I'm sorry, I can't recall the exact tag name; 抱歉,我不记得确切的标签名称; please Google for it. 请为它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM