解决weblogic12c启动时报java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener的问题。

【系统配置简述】

weblogic版本:weblogic12.2.1.3.0

Myfaces:2.3.2

SpringBoot: 1.5.13.RELEASE

Spring: 4.3.17.RELEASE

jdk: Java HotSpot(TM) 64-Bit Server VM 1.8.0_60

weblogic.xml配置如下:



	
		
			javax.faces.*
			com.sun.faces.*
			com.bea.faces.*
		
		
			javax.faces.*
			com.sun.faces.*
			com.bea.faces.*
			META-INF/services/javax.servlet.ServletContainerInitializer
			
			META-INF/services/com.sun.faces.*
		
	

在weblogic部署应用时,日志报以下异常:

####<2018-12-20 下午03时57分20,245秒 CST>     <[ACTIVE] ExecuteThread: '15' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <>  <1545292640245> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] >       <[ACTIVE] ExecuteThread: '15' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <>  <1545292641602> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] >   

 

【分析】

    The missing class is part of Mojarra, which is actually the competitor of MyFaces.
You shouldn't need that class at all when using MyFaces. This exception can have the following possible causes:
There's a manually definied entry in webapp's web.xml or the web-fragment.xml of any of the deployed JARs in /WEB-INF/lib which references this Mojarra-specific listener class.
    There's somewhere a loose Mojarra .tld file in the classpath (very unlikely, who would ever extract a JAR file and put its loose contents in the classpath?). TLD files get autoinitialized and can contain a entry which can trigger autoregistration of a ServletContextListener implementation (such as the Mojarra ConfigureListener).
Those conflicts can be fixed by just removing it.

    Mojarra是sun公司提供的jsf实现,而Myfaces是另一种jsf开源实现,本系统采用的Myfaces,根据上述英文描述,必须把Mojarra相关实现的com.sun.faces.*配置删除。

  【解决】

把com.sun.faces.*相关配置内容删除即可。

weblogic.xml



	
		
			javax.faces.*
			com.bea.faces.*
		
		
			javax.faces.*
			com.bea.faces.*
			META-INF/services/javax.servlet.ServletContainerInitializer
			
		
	

文章结束。

你可能感兴趣的:(Java,weblogic,jsf,myfaces)