我正致力于从weblogic到glassfish的迁移项目,
当我尝试在glassfish中部署我的应用程序时, 它抛出了以下错误
com.sun.faces.config.ConfigurationException: Factory 'javax.faces.render.RenderKitFactory' was not configured properly.
com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305)
com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
atorg.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
Caused by: javax.faces.FacesException: org.ajax4jsf.renderkit.ChameleonRenderKitFactory
javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:630)
javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509)
javax.faces.FactoryFinder.access$400(FactoryFinder.java:139)
javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993)
谷歌搜索后我发现我需要从我的webapp war文件中删除jsf jar ..
我删除并尝试了,即便如此也是同样的错误。
这是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>projectPartsListWar</artifactId>
<name>PTL war</name>
<packaging>war</packaging>
<parent>
<groupId>com.bmw.au</groupId>
<artifactId>standardReportingParent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../standardReportingParent/pom.xml</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<webXmlPath>src/main/webapp/WEB-INF/web_int_prod.xml</webXmlPath>
<maven.skippAuthorization.setting>skippAuthorization=false</maven.skippAuthorization.setting>
<preassembly.dir>${basedir}/target/preassembly</preassembly.dir>
<sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
<sonar.java.source>1.5</sonar.java.source>
<sonar.java.target>1.5</sonar.java.target>
</properties>
<dependencies>
<dependency>
<groupId>com.bmw.au</groupId>
<artifactId>auReportingCommonsWeb</artifactId>
</dependency>
<dependency>
<groupId>com.bmw.au</groupId>
<artifactId>au.core</artifactId>
</dependency>
<dependency>
<groupId>trove</groupId>
<artifactId>trove</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.bea.wls</groupId>
<artifactId>wlfullclient</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>projectPartsListEjb</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<!-- this should be overrided -->
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<!-- this should be overrided -->
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
</dependency>
<dependency>
<groupId>com.bmw.shared.grops</groupId>
<artifactId>grops</artifactId>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<profiles>
<profile>
<id>TEST</id>
<properties>
<webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath>
<maven.skippAuthorization.setting>skippAuthorization=true</maven.skippAuthorization.setting>
</properties>
</profile>
<profile>
<id>DEV</id>
<properties>
<webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath>
<maven.skippAuthorization.setting>skippAuthorization=true</maven.skippAuthorization.setting>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<!-- Use different web,xml depending on environment. Use profiles to
set web.xml to use. Antbuild also sets profile dependeing on environment. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${webXmlPath}</webXml>
<webResources>
<resource>
<!-- copy resources from this folder into the webapp before packaging -->
<directory>${preassembly.dir}</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/classes/au_reporting_web.properties</file>
<replacements>
<replacement>
<token>skippAuthorization=true</token>
<value>${maven.skippAuthorization.setting}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<!-- do some processing on your resources files -->
<phase>process-resources</phase>
<configuration>
<tasks>
<echo message="processing files..." />
<!-- copy the file to be processed -->
<property name="preassembly.dir" value="${basedir}/target/preassembly" />
<property name="resourceDir" value="${basedir}/src/main/webapp/templates" />
<property name="resource" value="default-footer.xhtml" />
<copy file="${resourceDir}/${resource}" todir="${preassembly.dir}/templates" />
<ant antfile="./replaceproperties.xml" target="replaceproperties" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
这是完整的堆栈跟踪
<com.sun.faces.config.ConfigurationException: Factory 'javax.faces.render.RenderKitFactory' was not configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.faces.FacesException: org.ajax4jsf.renderkit.ChameleonRenderKitFactory
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:630)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
... 45 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:623)
... 50 more
Caused by: java.lang.NoSuchMethodError: org.apache.commons.collections.ArrayStack: method <init>(I)V not found
at org.apache.commons.digester.Digester.<init>(Digester.java:166)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerConfig(ResourceBuilderImpl.java:171)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerResources(ResourceBuilderImpl.java:155)
at org.ajax4jsf.resource.ResourceBuilderImpl.init(ResourceBuilderImpl.java:226)
at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62)
... 55 more>