- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
is caused by the presence of a JSF API inside a dependency .我渴望在我的 Java EE 应用程序的 WAR 或 EAR 中提供依赖项,而不是使用服务器提供的依赖项 Artifact ,因为根据我的经验,这会增加必要更新(假设更新服务器 Artifact )时的灵 active 。这使得将 Payara 4.1.2.181 上的部署与 Arquillian 完成的嵌入式版本进行比较变得容易。我用 <class-loader delegate="false"/>
控制类加载添加到 /WEB-INF/glassfish-web.xml
.
不幸的是,错误消息没有帮助,而且 afaik 必须通过试错法检查 Maven 依赖项和测试排除项。我从不同的帖子中收集了一些值得尝试的“常见嫌疑人”:jsf-impl.jar
, javax.faces.jar
, jsf-api.jar
, javaee.jar
.
给定一个相当简单的 JSF 项目,其中包含 1 个支持 bean 生成 "Hello world!"
对于 h:outputLabel
该部署适用于 Payara,但不适用于 Arquillian 的功能测试
@RunWith(Arquillian.class)
@RunAsClient
public class FunctionalIT {
private final static Logger LOGGER = LoggerFactory.getLogger(FunctionalIT.class);
@Deployment(testable = false)
public static Archive<?> createDeployment0() throws TransformerException, XPathExpressionException, ParserConfigurationException, SAXException, IOException {
WebArchive retValue = Maven.configureResolver().workOffline().resolve("richtercloud:arquillian-assertt-statements-web:war:1.0-SNAPSHOT")
.withoutTransitivity().asSingle(WebArchive.class);
ByteArrayOutputStream archiveContentOutputStream = new ByteArrayOutputStream();
retValue.writeTo(archiveContentOutputStream, Formatters.VERBOSE);
LOGGER.info(archiveContentOutputStream.toString());
return retValue;
}
@Drone
private WebDriver browser;
@ArquillianResource
private URL deploymentUrl;
@FindBy(id = "helloWorldLabel")
private WebElement helloWorldLabel;
@Test
public void testAll() {
browser.get(deploymentUrl.toExternalForm()+"/index.xhtml");
LOGGER.info(browser.getPageSource());
new WebDriverWait(browser, 10).until(ExpectedConditions.visibilityOf(helloWorldLabel));
}
}
由于 Arquillian 部署失败(功能测试使用 maven-failsafe-plugin
运行)
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:541)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:374)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1435)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1243)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5468)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5713)
at com.sun.enterprise.web.WebModule.start(WebModule.java:609)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:900)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2057)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1703)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:526)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:510)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:549)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:545)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:544)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:575)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:567)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:566)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1474)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1856)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1732)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:134)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:110)
at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:193)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:151)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:118)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:239)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:92)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:77)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:232)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:212)
at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:179)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:384)
at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:193)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:148)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:369)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:275)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:239)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:160)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
现在,我似乎无法应用上面链接中提供的解决方案,因为似乎没有依赖项匹配或与上面列出的类似:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] arquillian-assertt-statements
[INFO] arquillian-assertt-statements-web
[INFO] arquillian-assertt-statements-it
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building arquillian-assertt-statements 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ arquillian-assertt-statements ---
[INFO] richtercloud:arquillian-assertt-statements:pom:1.0-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building arquillian-assertt-statements-web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ arquillian-assertt-statements-web ---
[INFO] richtercloud:arquillian-assertt-statements-web:war:1.0-SNAPSHOT
[INFO] +- org.primefaces:primefaces:jar:6.1:compile
[INFO] \- javax:javaee-web-api:jar:7.0:provided
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building arquillian-assertt-statements-it 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ arquillian-assertt-statements-it ---
[INFO] richtercloud:arquillian-assertt-statements-it:jar:1.0-SNAPSHOT
[INFO] +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-javaee:jar:2.0.0:test
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0:compile
[INFO] +- org.jboss.arquillian.junit:arquillian-junit-container:jar:1.2.0.Final:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-api:jar:1.2.0.Final:compile
[INFO] | | \- org.jboss.arquillian.core:arquillian-core-api:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.2.0.Final:compile
[INFO] | | \- org.jboss.arquillian.core:arquillian-core-spi:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.2.0.Final:compile
[INFO] | | \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.2.6:compile
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.2.0.Final:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.2.0.Final:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-impl-base:jar:1.2.0.Final:test
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-api:jar:1.2.0.Final:compile
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.2.0.Final:compile
[INFO] | | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0:compile
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-impl-base:jar:1.2.0.Final:compile
[INFO] | \- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.2.6:test
[INFO] | \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.2.6:test
[INFO] +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:pom:2.2.6:test
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:jar:2.2.6:compile
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi:jar:2.2.6:test
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven:jar:2.2.6:test
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven-archive:jar:2.2.6:test
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:2.2.6:test
[INFO] | | +- org.eclipse.aether:aether-api:jar:1.0.0.v20140518:test
[INFO] | | +- org.eclipse.aether:aether-impl:jar:1.0.0.v20140518:test
[INFO] | | +- org.eclipse.aether:aether-spi:jar:1.0.0.v20140518:test
[INFO] | | +- org.eclipse.aether:aether-util:jar:1.0.0.v20140518:test
[INFO] | | +- org.eclipse.aether:aether-connector-basic:jar:1.0.0.v20140518:test
[INFO] | | +- org.eclipse.aether:aether-transport-wagon:jar:1.0.0.v20140518:test
[INFO] | | +- org.apache.maven:maven-aether-provider:jar:3.2.5:test
[INFO] | | +- org.apache.maven:maven-model:jar:3.2.5:test
[INFO] | | +- org.apache.maven:maven-model-builder:jar:3.2.5:test
[INFO] | | | \- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] | | +- org.apache.maven:maven-repository-metadata:jar:3.2.5:test
[INFO] | | +- org.apache.maven:maven-settings:jar:3.2.5:test
[INFO] | | +- org.apache.maven:maven-settings-builder:jar:3.2.5:test
[INFO] | | +- org.codehaus.plexus:plexus-interpolation:jar:1.21:test
[INFO] | | +- org.codehaus.plexus:plexus-utils:jar:3.0.20:test
[INFO] | | +- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:test
[INFO] | | | \- org.sonatype.plexus:plexus-cipher:jar:1.4:test
[INFO] | | +- org.apache.maven.wagon:wagon-provider-api:jar:2.6:test
[INFO] | | +- org.apache.maven.wagon:wagon-file:jar:2.6:test
[INFO] | | | \- commons-lang:commons-lang:jar:2.6:test
[INFO] | | \- org.apache.maven.wagon:wagon-http-lightweight:jar:2.6:test
[INFO] | | \- org.apache.maven.wagon:wagon-http-shared:jar:2.6:test
[INFO] | \- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-archive:jar:2.2.6:test
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven-archive:jar:2.2.6:test
[INFO] | +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.0.M1:test
[INFO] | | \- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.0.M1:test
[INFO] | \- org.codehaus.plexus:plexus-compiler-javac:jar:2.3:test
[INFO] | \- org.codehaus.plexus:plexus-compiler-api:jar:2.3:test
[INFO] +- org.jboss.arquillian.graphene:graphene-webdriver:pom:2.3.2:test
[INFO] | +- org.jboss.arquillian.graphene:graphene-webdriver-api:jar:2.3.2:test
[INFO] | +- org.jboss.arquillian.graphene:graphene-webdriver-spi:jar:2.3.2:test
[INFO] | +- org.jboss.arquillian.graphene:graphene-webdriver-impl:jar:2.3.2:test
[INFO] | | +- org.jboss.arquillian.extension:arquillian-drone-impl:jar:2.5.0:test
[INFO] | | +- org.jboss.arquillian.extension:arquillian-drone-configuration:jar:2.5.0:test
[INFO] | | +- cglib:cglib-nodep:jar:3.2.5:compile
[INFO] | | \- org.objenesis:objenesis:jar:1.2:compile
[INFO] | \- org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain:pom:2.5.0:test
[INFO] | +- org.jboss.arquillian.extension:arquillian-drone-spi:jar:2.5.0:test
[INFO] | \- org.jboss.arquillian.extension:arquillian-drone-webdriver:jar:2.5.0:test
[INFO] | +- org.arquillian.spacelift:arquillian-spacelift:jar:1.0.2:test
[INFO] | | \- org.arquillian.spacelift:arquillian-spacelift-api:jar:1.0.2:test
[INFO] | +- org.jsoup:jsoup:jar:1.8.3:test
[INFO] | \- org.awaitility:awaitility:jar:3.0.0:test
[INFO] | \- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- com.codeborne:phantomjsdriver:jar:1.4.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:3.9.1:compile
[INFO] | \- org.seleniumhq.selenium:selenium-remote-driver:jar:3.9.1:compile
[INFO] +- org.seleniumhq.selenium:htmlunit-driver:jar:2.28:compile
[INFO] | \- org.seleniumhq.selenium:selenium-support:jar:3.9.1:compile
[INFO] +- net.sourceforge.htmlunit:htmlunit:jar:2.24:compile
[INFO] | +- xalan:xalan:jar:2.7.2:compile
[INFO] | | \- xalan:serializer:jar:2.7.2:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.23:compile
[INFO] | +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.24:compile
[INFO] | | \- xerces:xercesImpl:jar:2.11.0:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | +- net.sourceforge.cssparser:cssparser:jar:0.9.21:compile
[INFO] | | \- org.w3c.css:sac:jar:1.3:compile
[INFO] | +- commons-io:commons-io:jar:2.5:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.20.v20161216:compile
[INFO] | +- org.eclipse.jetty:jetty-util:jar:9.2.20.v20161216:compile
[INFO] | +- org.eclipse.jetty:jetty-io:jar:9.2.20.v20161216:compile
[INFO] | \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.20.v20161216:compile
[INFO] | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.20.v20161216:compile
[INFO] +- org.seleniumhq.selenium:selenium-java:jar:3.9.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:3.9.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-edge-driver:jar:3.9.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-ie-driver:jar:3.9.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-opera-driver:jar:3.9.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-safari-driver:jar:3.9.1:compile
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.7.9:compile
[INFO] | +- org.apache.commons:commons-exec:jar:1.3:compile
[INFO] | +- com.google.code.gson:gson:jar:2.8.2:compile
[INFO] | +- com.google.guava:guava:jar:23.6-jre:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | | +- org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[INFO] | | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
[INFO] | +- com.squareup.okhttp3:okhttp:jar:3.9.1:compile
[INFO] | \- com.squareup.okio:okio:jar:1.13.0:compile
[INFO] +- org.seleniumhq.selenium:selenium-firefox-driver:jar:3.9.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.2:compile
[INFO] +- richtercloud:selenium-tools:jar:1.0-SNAPSHOT:compile
[INFO] | +- junit:junit:jar:4.12:compile
[INFO] | | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.apache.commons:commons-compress:jar:1.11:compile
[INFO] | +- ru.yandex.qatools.ashot:ashot:jar:1.5.3:compile
[INFO] | | \- com.googlecode.lambdaj:lambdaj:jar:2.3.3:compile
[INFO] | | \- org.hamcrest:hamcrest-all:jar:1.1:compile
[INFO] | \- org.junit.jupiter:junit-jupiter-engine:jar:5.0.3:compile
[INFO] | +- org.apiguardian:apiguardian-api:jar:1.0.0:compile
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.0.3:compile
[INFO] | | +- org.junit.platform:junit-platform-commons:jar:1.0.3:compile
[INFO] | | \- org.opentest4j:opentest4j:jar:1.0.0:compile
[INFO] | \- org.junit.jupiter:junit-jupiter-api:jar:5.0.3:compile
[INFO] +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:2.2.6:compile
[INFO] +- org.jboss.arquillian.extension:arquillian-drone-api:jar:2.5.0:compile
[INFO] +- org.jboss.arquillian.junit:arquillian-junit-core:jar:1.2.0.Final:compile
[INFO] +- org.jboss.arquillian.container:arquillian-glassfish-embedded-3.1:jar:1.0.2:compile
[INFO] | +- org.jboss.arquillian.container:arquillian-container-spi:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.testenricher:arquillian-testenricher-cdi:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.testenricher:arquillian-testenricher-ejb:jar:1.2.0.Final:compile
[INFO] | +- org.jboss.arquillian.testenricher:arquillian-testenricher-resource:jar:1.2.0.Final:compile
[INFO] | \- org.jboss.arquillian.testenricher:arquillian-testenricher-initialcontext:jar:1.2.0.Final:compile
[INFO] \- fish.payara.extras:payara-embedded-all:jar:5.0.0.Alpha3:test
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] arquillian-assertt-statements ...................... SUCCESS [ 0.864 s]
[INFO] arquillian-assertt-statements-web .................. SUCCESS [ 0.060 s]
[INFO] arquillian-assertt-statements-it ................... SUCCESS [ 0.904 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.254 s
[INFO] Finished at: 2018-03-05T11:24:55+01:00
[INFO] Final Memory: 17M/303M
[INFO] ------------------------------------------------------------------------
用maven-surefire-plugin
运行测试时会出现同样的错误2.21.0。该问题也发生在嵌入式 Payara 5.182 和 4.1.2.181 上,它们是 5.x 和 4.x 分支中的最新版本。
SSCCE 不包含比上述 MCVE 更多的信息,但有助于克隆实验,可以在 https://gitlab.com/krichter/arquillian-assertt-statements 找到。和完整运行的示例输出 https://gitlab.com/krichter/arquillian-assertt-statements/-/jobs/75705830 .
最佳答案
这似乎可以通过添加来解决
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
到web-app
节web.xml
.因为您可能不想污染您的生产 web.xml
您可以使用以下内容插入 listener
以编程方式(例如在 Arquillian @Deployment
方法中):
@Deployment(testable = false)
public static Archive<?> createDeployment0() throws ParserConfigurationException,
SAXException,
IOException,
XPathExpressionException,
TransformerConfigurationException,
TransformerException {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
//namespace awareness is necessary in order to avoid an empty
//`xmlns` attribute to be added to the persistence-unit element in
//the output which causes failure of the functional test due to
//`java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 108; Deployment descriptor file META-INF/persistence.xml in archive [project1-jar-1.0-SNAPSHOT.jar]. cvc-complex-type.2.4.a: Invalid content was found starting with element 'persistence-unit'. One of '{"http://xmlns.jcp.org/xml/ns/persistence":persistence-unit}' is expected.`
//see
//https://stackoverflow.com/questions/48362284/how-to-avoid-xmlns-to-be-added-to-a-manipulated-xml-root-element
//for details and an explanation
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document webXmlDocument = documentBuilder.parse(new File("src/main/webapp/WEB-INF/web.xml"));
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xPath = xPathfactory.newXPath();
XPathExpression expr = xPath.compile("//*[local-name()='web-app']");
Node webAppNode = (Node) expr.evaluate(webXmlDocument,
XPathConstants.NODE);
Element listenerNode = webXmlDocument.createElementNS(webAppNode.getNamespaceURI(),
"listener");
//use `createElementNS` instead of `createElement` in order to avoid
//empty `xmlns` attribute on the created `listener` element which
//is otherwise added even if the document builder is namespace aware
Element listenerClassNode = webXmlDocument.createElementNS(webAppNode.getNamespaceURI(),
"listener-class");
listenerClassNode.setTextContent("com.sun.faces.config.ConfigureListener");
listenerNode.appendChild(listenerClassNode);
webAppNode.appendChild(listenerNode);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
StringWriter writer = new StringWriter();
transformer.transform(new DOMSource(webXmlDocument), new StreamResult(writer));
String webXml = writer.toString();
StringAsset webXmlAsset = new StringAsset(webXml);
WebArchive archive = ShrinkWrap.create(WebArchive.class)
.setWebXML(webXmlAsset)
...;
return archive;
}
使用 org.jboss.shrinkwrap.api.Node webXml = mavenArtifact.get("/WEB-INF/web.xml")
并解析 webXml.getAsset().openStream()
与 DocumentBuilder
检索 web.xml
如果您在单独的项目中使用完整的 WAR 存档进行功能测试,如上例所示。
我在 Payara bug report 1105 中找到了解决方案我在这里链接了此处提供的信息,希望能触发进一步调查并由 Payara 开发人员修复。
我在 fix
上添加了修复程序SSCCE 分会。
关于java - arquillian 中的 “IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49110296/
BACKUP 无法完成命令 BACKUP DATABASE ... WITH DIFFERENTIAL。检查备份应用程序日志以获取详细消息。 我在 SQL Server 日志文件查看器中看到了这条消息
备份 VMWare 服务器 (1.0.x) 的最佳方法是什么? 有问题的虚拟机是我们的开发环境,与主网络隔离运行(因此您不能只是将数据从虚拟服务器复制到真实服务器)。 镜像文件通常在使用中,并且在服务
正如问题所述,我有一个实际 iPhone 的备份。现在我想要模拟器中内容的“副本”。原因是我的真实 iPhone 包含第三方应用程序数据,我也希望在模拟器中拥有这些数据。 这可能吗? 谢谢,诺伯特 最
我在 Debian 系统上工作,其中运行着 PostgreSQL 服务器。我修改了一个备份脚本并安装了一个 cron 作业来对我们的数据库进行每小时备份,并将其存储在一个文件夹中。与此同时,还会执行一
我正在尝试从备份 (.bak) 文件恢复数据库,该文件[保存]在 ZIP 文件内,但到目前为止尚未成功。不过,我可以在从 ZIP 文件中解压后恢复它。 这个MS page表示 SQL Server 2
我想在同一台机器内创建我的 sql server 2008 r2 数据库(名为 ERP)的副本。所以我做了以下步骤:- 我右键单击原始数据库 ERP,然后选择 Tasks>>Backup。 然后我创建
我尝试使用我的应用程序,其中包含 Android Backup Service 的用法在 Android Emulator 上使用我自己的 BackupAgent。但是备份不起作用,尽管在 And
当我尝试使用 pyodbc 和 freetds 从 Linux 主机备份 MSSQL 数据库时,我目前遇到了一些问题。版本如下: Python 2.7.6、pyodbc 3.0.7、freetds 0
我正在使用 rsync 运行备份,在此期间创建了一个日志文件。但是,我不知道缩写是什么意思。这是日志文件的示例: 2016/11/15 15:17:53 [4906] building file li
我有一个问题。 Duplicity 非常适合备份,我非常喜欢能够进行增量 diff tars,但是......当恢复 duplicity 时似乎不适用相同的概念。 基本上我只需要恢复更改的文件(显然是
问题: 客户 X 正在(考虑)将他以前“仅限 Windows”的共享软件应用程序之一移植到 Mac OS X。他关心的问题之一是如何强制执行 30 天试用期并使其不受“系统回滚”软件的影响比如时光机。
我一直试图让口是心非的备份到谷歌驱动器。但看起来它仍在使用旧的客户端 API。 我发现一些线程说应该支持新的 API,但没有太多关于如何让它工作的细节。 我编译和使用了duplicity 7.0.3,
我们正在寻求为ouchdb数据库创建常规备份,以备不时之需。获取这些内容的最不侵入方式是什么?理想情况下,不中断或不显着降低现有数据库服务器的性能? 最佳答案 您可以只复制CouchDB数据库文件。阅
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-topic
我知道--ignore-existing选项,想知道是否有些不同。 我的情况是:我有一个带有大量用户上传图片的Web服务器。现在大约2TB。通常,这些文件根本不会被修改。我使用rsync并将其备份到其
我对docker compose文件中的命名卷的功能有些困惑,特别是在备份/还原我的应用程序时。 我实际上正在测试此dockercompose文件: version: '2'
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 9 年前。 Improv
我们使用的是 Teamcity 6.5.6 专业版,它为我提供了运行备份的选项,但我没有看到任何将其安排到特定时间的选项。 我不确定这个版本的 teamcity 是否支持计划备份。如果通过teamci
我正在阅读 Keycloak 的 export operation 的文档为了设置备份操作(例如通过 cron 作业),它所说的是在服务器启动期间发生导出: Export and import is
对于允许将单个 riak 存储桶备份[通过流式传输或快照]到文件的解决方案,您有何建议? 最佳答案 在 Riak 中仅备份单个存储桶将是一项困难的操作。 所有解决方案都归结为以下两个步骤: 列出存储桶
我是一名优秀的程序员,十分优秀!