weblogic 服务启动报错|weblogic 包加载与冲突等问题

问题1(org.apache.commons.lang.ClassUtils.getClass)

?

Caused by: org.springframework.beans.factory.BeanCreationException: **Error creating bean with name 'dorado.dataParser'** defined in class path resource [com/bstek/dorado/data/xml-parser-context.xml]: **Cannot resolve reference to bean 'dorado.listParser'** while setting bean property 'subParsers' with key [List]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creatingbean with name 'dorado.listParser' defined in class path resource [com/bstek/dorado/data/xml-parser-context.xml]: Error setting property values; nested exceptio

n is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException:

Property 'collectionType' threw exception; nested exception is **java.lang.ClassNotFoundException: org.apache.commons.lang.ClassUtils.getClass(Ljava/lang/String;)**

**Ljava/lang/Class;**

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)

解决办法

在WEB-INF文件夹下,加上weblogic.xml,让WebLogic 10先引用WEB-INF下面的jar,内容如下:

?

<?xml version="1.0" encoding="UTF-8"?>

<weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">

    <weblogic-version>10.3.1</weblogic-version>

    <context-root>xxxx_for_weblogic</context-root>

    <container-descriptor>

        <prefer-web-inf-classes>true</prefer-web-inf-classes>

        <show-archived-real-path-enabled>true</show-archived-real-path-enabled>

    </container-descriptor>

</weblogic-web-app>

 

问题原因说明

http://hi.baidu.com/tk_ayj/blog/item/b5865bce25339a2df9dc61a4.html

这里解释了xml-api.jar的问题 
http://stackoverflow.com/questions/4925901/classcastexception-while-parsing-xml-with-weblogic

这篇文档再次印证了那两个问题
http://www.liferay.com/community/wiki/-/wiki/Main/Weblogic+tips

问题2(java.lang.ClassCastException: **weblogic.xml.jaxp.RegistryDocumentBuilderFactory)

?

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [com/bstek/dorado/core/context.xml]; nested exception is java.lang.ClassCastException: **weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory**

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)

解决办法

删掉war包中的xml-apis就可以了

问题原因说明

因为我们刚在weblogic.xml里设置了优先加载WEB-INF中的jar,那么要删掉冲突的jar。
http://www.liferay.com/community/wiki/-/wiki/Main/Weblogic+tips 里说的很清楚:

 

The weblogic.xml Web application deployment descriptor contains a <prefer-web-inf-classes> element (a sub-element of the <container-descriptor> element). By default, this element is set to false. **Setting this element to true subverts the classloader delegation model so that class definitions from the Web application are loaded in preference to class definitions in higher-level classloaders.** This allows a Web application to use its own version of a third-party class, which might also be part of WebLogic Server. 

**When this setting is enabled in weblogic.xml, the following jars has to be removed from portal WEB-INF/lib** (jars withjavax.xml package): 

jaxrpc.jar

stax.jar

wstx.jar

xml-apis.jar

问题3(java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval())

?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/dorado-home/app-context.xml]: Invocation of init method failed; nested exception is **java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z**

        at org.springframework.beans.factory.support.AbstractAutowireCapableBean

Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBean

Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

解决办法

把war中的hibernate-jpa-2.0-api-1.0.0.Final.jar删掉。

问题原因说明

war和Weblogic 10本身都有jpa的jar包,冲突。

问题4(**java.lang.NoClassDefFoundError: javax/persistence/Cacheable**)

?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/dorado-home/app-context.xml]: Invocation of init method failed; nested exception is **java.lang.NoClassDefFoundError: javax/persistence/Cacheable**

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

解决办法

将hibernate-jpa-2.0-api-1.0.0.Final.jar放到%WEBLOGIC_HOME%\jdk160_11\jre\lib\ext中,让它在Weblogic 10的JPA jar之前引用。

如果使用的是jrockit,则应该将这个jar放在%WEBLOGIC_HOME%\jrockit_160_05\jre\lib\ext中

问题原因说明

Weblogic 10.3里的jpa是1.0的(%WEBLOGIC_HOME%\modules\javax.persistence_1.0.0.0_1-0-2.jar),而我们使用的是2.0版本的。而JPA 1.0好像不支持缓存,所以,单纯的删除hibernate-jpa-2.0-api-1.0.0.Final.jar是不行的。

问题5(**Cannot resolve reference to bean 'dorado.velocityHelper' while setting bean property 'velocityHelper';**)

?

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.bstek.dorado.view.resolver.HtmlViewResolver#199d183' defined in class path resource [com/bstek/dorado/view/servlet-context.xml]: **Cannot resolve reference to bean 'dorado.velocityHelper' while setting bean property 'velocityHelper';** nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dorado.velocityHelper': FactoryBean threw exception on object creation; nested exception is **java.lang.NullPointerException**

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

解决办法

把velocity-tools-2.0.jar删掉

问题6(Bad date header)

?

java.lang.IllegalArgumentException: Bad date header: 'Mon, 04 Jul 2011 06:33:24 GMT'        at weblogic.servlet.internal.ServletRequestImpl.getDateHeader(ServletRequestImpl.java:983)

解决办法

安装WebLogic 10gR3版本的CR380042_103GA.jar补丁,具体办法:

首先将CR380042_103GA.jar(点击下载)拷贝到WebLogic的domain的lib目录下;

然后修改setDomainEnv.sh/setDomainEnv.bat(前者对应linux系统,后者为windows系统),在最后设置的CLASSPATH中增加,如下:

 

?

CLASSPATH=.../mydomain/lib/CR380042_103GA.jar;${CLASSPATH} 

相关说明文档参考:https://forums.oracle.com/forums/thread.jspa?threadID=705412 

 

问题7(javassist.util.proxy.ProxyFactory.setUseCache(Z))

?

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: javassist.util.proxy.ProxyFactory.setUseCache(Z)V

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

xwork-core-2.1.6.jar导致的

参考ISSUE: http://www.bsdn.org/projects/dorado7/issue/dorado7-1157

问题8:(weblogic.application.ModuleException)

?

weblogic.application.ModuleException:

com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory

 

这是因为包冲突了,如果项目的lib里有wstx-asl-xxx.jar,部署之前先从war包里删除这些jar包,再部署就可以了。
注意还要在WEB-INF目录下添加一个weblogic.xml,设置属性优先使用当前应用的包文件。配置内容参考问题1

 问题9:No bean named 'dorado.packagesConfigLoader' is defined

解决办法就是在WEB-INF目录下添加weblogic.xml文件,配置内容参考问题1

转载于:https://my.oschina.net/u/3648110/blog/1843472

  • 1
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值