1

我在 weblogic 10.3.3 上部署了一个 war 文件,但遇到了这个错误。

    <May 7, 2012 2:40:10 PM ICT> <Error> <Deployer> <VIEAE747399> <AdminServer> <[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1336376410618> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1336376405480' for task '2'. Error is: 'weblogic.application.ModuleException: [HTTP:101216]Servlet: "quotation-service" failed to preload on startup in Web application: "service-quotation.war".
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in URL [zip:C:/Oracle/Middleware/user_projects/domains/a2_domain/servers/AdminServer/tmp/_WL_user/service-quotation/aio4oc/war/WEB-INF/lib/quotation-storage-2_0_0.jar!/config/quotation-storage-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [zip:C:/Oracle/Middleware/user_projects/domains/a2_domain/servers/AdminServer/tmp/_WL_user/service-quotation/aio4oc/war/WEB-INF/lib/quotation-storage-2_0_0.jar!/config/quotation-storage-context.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
...

Caused by: java.lang.ExceptionInInitializerError
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:130)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 70 more
Caused by: java.lang.IllegalStateException: org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:282)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:197)
... 76 more

在 service-quotation.war 的 WEB-INF/lib 中,包含以下文件

log4j-1.2.16.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar

我感谢任何建议,提示。

注意:我在 Tomcat 6 上成功部署了这场战争。

4

1 回答 1

0

谢谢大家,

最后我找到了修复 log4j 错误的解决方案。我将下面的 weblogic.xml 文件添加到 WEB-INF 文件夹中,以指示 weblogic 在 war 文件中使用 slf4j jar。我什至不需要将这些 jar 文件添加到 weblogic 安装文件夹中。

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
Systems, Inc.//DTD Web Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

然后,为了克服休眠问题,我将以下行添加到文件 setDomainEnv.cmd 的第一行代码中,以在 weblogic 中启用 hiberante 共享库

 set PRE_CLASSPATH=%PRE_CLASSPATH%;C:\Oracle\Middleware\modules\javax.persistence_1.1.0.0_2-0.jar;C:\Oracle\Middleware\modules\com.oracle.jpa2support_1.0.0.0_2-1.jar

(请先检查上面的文件路径是否存在)

希望这对需要的人有所帮助。

于 2012-05-07T10:08:03.827 回答