12 Replies Latest reply: May 17, 2012 7:57 AM by Ken Finnigan RSS

Could not find artifact error with Arquillian Portal Extension

Thomas Delhoménie Newbie

Hi,

 

I try to test a portlet with the Arquillian Portal Extension, with the GateIn extension, but I have the following error when running the test :

 

 

Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.gatein.wci:wci-jboss7:jar:2.2.0-Beta01-SNAPSHOT

[code}

 

 

Here is my 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/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>

          <groupId>org.thomas</groupId>
          <artifactId>portlet-arquillian</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>jar</packaging>

          <name>portlet-arquillian</name>
          <url>http://maven.apache.org</url>


          <properties>
                    <!-- Testing versions -->
        <version.junit>4.10</version.junit>
        <version.arquillian>1.0.0.Final</version.arquillian>
        <version.shrinkwrap.resolver>2.0.0-alpha-1</version.shrinkwrap.resolver>
        <version.arquillian.extension.portal>1.0.0.Alpha1</version.arquillian.extension.portal>
        <version.gatein.portal.testing>1.0.0.Alpha1</version.gatein.portal.testing>
        <version.pluto.portal.testing>1.0.0.Alpha1</version.pluto.portal.testing>
        <version.hamcrest>1.3.RC2</version.hamcrest>
        <version.jbossas7.container>7.1.1.Final</version.jbossas7.container>
  
                    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          </properties>


          <build>
                    <plugins>
                              <plugin>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <version>2.3.2</version>
                                        <configuration>
                                                  <source>1.6</source>
                                                  <target>1.6</target>
                                        </configuration>
                              </plugin>
                              <plugin>
                                        <artifactId>maven-surefire-plugin</artifactId>
                                        <version>2.12</version>
                              </plugin>
                              <plugin>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <executions>
                                                  <execution>
                                                            <id>unpack</id>
                                                            <phase>process-test-classes</phase>
                                                            <goals>
                                                                      <goal>unpack</goal>
                                                            </goals>
                                                            <configuration>
                                                                      <artifactItems>
                                                                                <artifactItem>
                                                                                <groupId>org.jboss.as</groupId>
                                                                                <artifactId>jboss-as-dist</artifactId>
                                                                                <version>7.1.1.Final</version>
                                                                                <type>zip</type>
                                                                                <overWrite>false</overWrite>
                                                                                <outputDirectory>target</outputDirectory>
                                                                                </artifactItem>
                                                                      </artifactItems>
                                                            </configuration>
                                                  </execution>
                                        </executions>
                              </plugin>
                    </plugins>
          </build>
          <dependencies>
                    <dependency>
                              <groupId>javax.portlet</groupId>
                              <artifactId>portlet-api</artifactId>
                              <version>2.0</version>
                              <scope>provided</scope>
                    </dependency>
                    <dependency>
                              <groupId>junit</groupId>
                              <artifactId>junit</artifactId>
                              <version>${version.junit}</version>
                              <scope>test</scope>
                    </dependency>
                    <dependency>
                              <groupId>org.jboss.arquillian.junit</groupId>
                              <artifactId>arquillian-junit-container</artifactId>
                              <version>${version.arquillian}</version>
                              <scope>test</scope>
                    </dependency>
                    <dependency>
                              <groupId>org.jboss.shrinkwrap.resolver</groupId>
                              <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
                              <version>${version.shrinkwrap.resolver}</version>
                              <scope>compile</scope>
                    </dependency>
                    <dependency>
                              <groupId>org.jboss.arquillian.extension</groupId>
                              <artifactId>arquillian-portal-impl-base</artifactId>
                              <version>${version.arquillian.extension.portal}</version>
                              <scope>compile</scope>
                    </dependency>


                    <!-- JBoss AS 7 -->
                    <dependency>
                              <groupId>org.jboss.as</groupId>
                              <artifactId>jboss-as-arquillian-container-managed</artifactId>
                              <version>${version.jbossas7.container}</version>
                              <scope>test</scope>
                    </dependency>
                    <dependency>
                              <groupId>org.jboss.arquillian.protocol</groupId>
                              <artifactId>arquillian-protocol-servlet</artifactId>
                              <version>${version.arquillian}</version>
                              <scope>test</scope>
                    </dependency>
  
                    <!-- GateIn -->
                    <dependency>
                              <groupId>org.jboss.portletbridge.testing.gatein</groupId>
                              <artifactId>gatein-arquillian-extension</artifactId>
                              <version>${version.gatein.portal.testing}</version>
                              <scope>test</scope>
                    </dependency>
                    <dependency>
                              <groupId>org.jboss.portletbridge.testing.gatein</groupId>
                              <artifactId>gatein-portal-container</artifactId>
                              <classifier>jboss-as7</classifier>
                              <version>${version.gatein.portal.testing}</version>
                              <type>war</type>
                    </dependency>
          </dependencies>
</project>

 

 

Did I miss something ?

  • 1. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    Thomas,

     

    Sorry about that.

     

    That is a snapshot build, as it hasn't made it into the main codebase for GateIn yet.

     

    To resolve it, you'll need to build the project yourself.  The source can be found at https://github.com/mstruk/gatein-wci/tree/as7-support

     

    I expect this to be in the main gatein-wci repository soon, but I don't know how long it will be before a new release is made.

     

    Any other problems with it let me know.

     

    Regards

    Ken

  • 2. Re: Could not find artifact error with Arquillian Portal Extension
    Thomas Delhoménie Newbie

    Thanks for your quick answer Ken !

     

    After building this project, it is much better.

    But I still have an issue when executing the test :

     

    java.lang.ClassNotFoundException: javax.portlet.GenericPortlet
    

     

     

    If I add the portlet-api library in my deployment :

     

        @Deployment
        public static WebArchive createDeployment() {
            return ShrinkWrap.create(WebArchive.class)
                    .addClass(MyPortlet.class)
                    .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class).loadEffectivePom("pom.xml")
                        .artifacts("javax.portlet:portlet-api").resolveAsFiles())
                    .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
                    .addAsWebInfResource("WEB-INF/portlet.xml", "portlet.xml")
                    .addAsWebResource("view.jsp");
        }
    

     

     

    I have the following error :

     

    23:28:03,809 ERROR [stderr] (MSC service thread 1-4) 2765 [MSC service thread 1-4] ERROR org.gatein.pc.portlet.impl.container.LifeCycle - Cannot start object
    23:28:03,810 ERROR [stderr] (MSC service thread 1-4) org.gatein.pc.portlet.container.PortletInitializationException: The portlet my-portlet threw a runtime exception during init
    23:28:03,810 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:289)
    23:28:03,811 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle.invokeStart(PortletContainerLifeCycle.java:76)
    23:28:03,811 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:93)
    23:28:03,812 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle.startDependents(PortletApplicationLifeCycle.java:351)
    23:28:03,812 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:129)
    23:28:03,826 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployment.install(PortletApplicationDeployment.java:153)
    23:28:03,827 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployer.add(PortletApplicationDeployer.java:199)
    23:28:03,828 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployer.onEvent(PortletApplicationDeployer.java:168)
    23:28:03,828 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.impl.DefaultServletContainer.safeFireEvent(DefaultServletContainer.java:200)
    23:28:03,830 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.impl.DefaultServletContainer.fireEvent(DefaultServletContainer.java:219)
    23:28:03,830 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.impl.DefaultServletContainer.access$400(DefaultServletContainer.java:60)
    23:28:03,831 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.impl.DefaultServletContainer$RegistrationImpl.registerWebApp(DefaultServletContainer.java:338)
    23:28:03,832 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.jboss.JB7ServletContainerContext.start(JB7ServletContainerContext.java:407)
    23:28:03,832 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.wci.jboss.JB7ServletContainerContext.lifecycleEvent(JB7ServletContainerContext.java:261)
    23:28:03,833 ERROR [stderr] (MSC service thread 1-4)           at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
    23:28:03,834 ERROR [stderr] (MSC service thread 1-4)           at org.apache.catalina.core.StandardContext.start(StandardContext.java:3845)
    23:28:03,834 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
    23:28:03,835 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    23:28:03,836 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    23:28:03,836 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    23:28:03,837 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    23:28:03,837 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Thread.run(Thread.java:662)
    23:28:03,838 ERROR [stderr] (MSC service thread 1-4) Caused by: java.lang.ClassCastException: org.thomas.MyPortlet cannot be cast to javax.portlet.Portlet
    23:28:03,841 ERROR [stderr] (MSC service thread 1-4)           at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:255)
    23:28:03,842 ERROR [stderr] (MSC service thread 1-4)           ... 21 more
    23:28:03,849 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/2253f176-729a-4587-ac93-27d6eaf56cba]] (MSC service thread 1-4) La servlet TomcatGateInServlet est marqué comme indisponible
    23:28:03,851 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/2253f176-729a-4587-ac93-27d6eaf56cba]] (MSC service thread 1-4) La servlet /2253f176-729a-4587-ac93-27d6eaf56cba a généré une exception "load()": java.lang.ClassNotFoundException: org.gatein.wci.command.CommandServlet from [Module "deployment.2253f176-729a-4587-ac93-27d6eaf56cba.war:main" from Service Module Loader]
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
              at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]
    
    
    23:28:03,860 INFO  [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /2253f176-729a-4587-ac93-27d6eaf56cba
    23:28:03,960 INFO  [org.jboss.as.server] (management-handler-thread - 4) JBAS018559: Deployed "2253f176-729a-4587-ac93-27d6eaf56cba.war"
    23:28:04,290 INFO  [org.jboss.arquillian.testenricher.cdi.container.BeanManagerProducer] (pool-5-thread-1) BeanManager not found.
    23:28:04,318 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-1) Failed: org.thomas.PortletTest.should_deployed_portlet: java.lang.RuntimeException: Could not lookup value for field java.net.URL org.thomas.PortletTest.portalURL
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:61) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]
              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240) [arquillian-service:]
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) [arquillian-service:]
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) [arquillian-service:]
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) [arquillian-service:]
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [arquillian-service:]
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [arquillian-service:]
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [arquillian-service:]
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [arquillian-service:]
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199) [arquillian-service:]
              at org.junit.runners.ParentRunner.run(ParentRunner.java:300) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147) [arquillian-service:]
              at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [arquillian-service:]
              at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [arquillian-service:]
              at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65) [arquillian-service:]
              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]
              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]
              at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [rt.jar:1.6.0_22]
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [rt.jar:1.6.0_22]
              at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:498)
              at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:246)
              at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)
              at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]
    Caused by: java.lang.RuntimeException: Provider for type class java.net.URL returned a null value: org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider@b3ea0f
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.lookup(ArquillianResourceTestEnricher.java:115) [arquillian-service:]
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:57) [arquillian-service:]
              ... 74 more
    
    

     

  • 3. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    Thomas,

     

    You don't need to include the portlet api in the test, but there is something else you need to do (which I need to actually blog about!).

     

    Basically you need to include as WEB-INF resource in the test a jboss-deployment-structure.xml file like this one and include it in your test, like this.

     

    Any more problems, let me know.

     

    Ken

  • 4. Re: Could not find artifact error with Arquillian Portal Extension
    Thomas Delhoménie Newbie

    Thanks again Ken, that's better, but guess what

     

    I have now this error :

     

    22:11:29,187 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-4-thread-1) Failed: org.thomas.PortletTest.should_deployed_portlet: java.lang.RuntimeException: Could not lookup value for field java.net.URL org.thomas.PortletTest.portalURL
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:61) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]
              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]
              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240) [arquillian-service:]
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) [arquillian-service:]
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) [arquillian-service:]
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) [arquillian-service:]
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [arquillian-service:]
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [arquillian-service:]
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [arquillian-service:]
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [arquillian-service:]
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199) [arquillian-service:]
              at org.junit.runners.ParentRunner.run(ParentRunner.java:300) [arquillian-service:]
              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147) [arquillian-service:]
              at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [arquillian-service:]
              at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [arquillian-service:]
              at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65) [arquillian-service:]
              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]
              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]
              at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [rt.jar:1.6.0_22]
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [rt.jar:1.6.0_22]
              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [rt.jar:1.6.0_22]
              at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:498)
              at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:246)
              at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)
              at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]
    Caused by: java.lang.RuntimeException: Provider for type class java.net.URL returned a null value: org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider@13806b6
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.lookup(ArquillianResourceTestEnricher.java:115) [arquillian-service:]
              at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:57) [arquillian-service:]
              ... 74 more
    
    

     

     

    I debugged and saw that the PortalURLResourceProvider does not seem to be well registered. I can't see it in the resourcesProviders in org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.lookup().

  • 5. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    Thomas,

     

    Does the pom.xml for your test project include the following dependencies:

     

            <dependency>
              <groupId>org.jboss.portletbridge.testing.gatein</groupId>
              <artifactId>gatein-arquillian-extension</artifactId>
              <scope>test</scope>
            </dependency>
            <dependency>
              <groupId>org.jboss.portletbridge.testing.gatein</groupId>
              <artifactId>gatein-portal-container</artifactId>
              <classifier>jboss-as7</classifier>
              <type>war</type>
            </dependency>
    

     

    It sounds like the gatein-arquillian-extension dependency may be missing.

     

    Regards

    Ken

  • 6. Re: Could not find artifact error with Arquillian Portal Extension
    Thomas Delhoménie Newbie

    Yes, these dependencies are included. I attach my pom.xml.

  • 7. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    Well that looks ok.

     

    Can you attach the console or server log of AS7 when running the test?

     

    Thanks

    Ken

  • 9. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    Thomas,

     

    It looks like the URLProvider that the portal extension provides isn't being registered with Arquillian.

     

    Can you put a breakpoint in https://github.com/arquillian/arquillian-extension-portal/blob/master/impl-base/src/main/java/org/jboss/arquillian/portal/impl/PortalExtension.java to see if the Extension is correctly loaded?

     

    Thanks

    Ken

  • 10. Re: Could not find artifact error with Arquillian Portal Extension
    Thomas Delhoménie Newbie

    Yes, it is correctly loaded, the register method of org.jboss.arquillian.portal.impl.PortalExtension is called. Weird

  • 11. Re: Could not find artifact error with Arquillian Portal Extension
    Thomas Delhoménie Newbie

    Got it !

    Everything works fine when I add the @RunAsClient annotation on my test method.

     

    Thanks for your help Ken.

  • 12. Re: Could not find artifact error with Arquillian Portal Extension
    Ken Finnigan Master

    That's great Thomas, apologies for the problems.

     

    Will be blogging about using the extension very soon!

     

    Ken