1 2 3 4 5 Previous Next 62 Replies Latest reply on May 3, 2012 8:55 AM by steli89 Go to original post
      • 30. Re: Arquillian testing with JBoss
        aslak

        right, added ARQ-824

        • 31. Re: Arquillian testing with JBoss
          aslak

          Pushed a new SNAPSHOT of the jboss containers that should have this fixed, and also pushed a new SNAPSHOT of Arq core, 1.0.0.Final-SNAPSHOT that should fix a similar issue that you may or may not run into.

          1 of 1 people found this helpful
          • 32. Re: Arquillian testing with JBoss
            s3ppl

            Thanks for the fix. On my JBoss 4.2.1 server @home it works perfectly. Just have to try this tomorrow on 4.3 EAP

            • 33. Re: Arquillian testing with JBoss
              s3ppl

              Hi again. It worked wonderfully on JBoss 4.3 EAP this morning Just had a little problem with deploying an already existent ear-file using ShrinkWrap.createFromZipFile. The file itself looks exactly like the one I created for the earlier tests, but the following exception is thrown:

               

              -------------------------------------------------------------------------------

              Test set: test.testV4_2.AppTest

              -------------------------------------------------------------------------------

              Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 21.691 sec <<< FAILURE!

              testSayHello(test.testV4_2.AppTest)  Time elapsed: 0.02 sec  <<< ERROR!

              java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

                  at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:68)

                  at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:58)

                  at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:32)

                  at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:136)

                  at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:119)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

                  at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                  at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                  at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

                  at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                  at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                  at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                  at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                  at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

                  at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)

                  at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

                  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                  at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                  at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

                  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                  at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

                  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                  at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

                  at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)

                  at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)

                  at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:592)

                  at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)

                  at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)

                  at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)

                  at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)

                  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

              • 34. Re: Arquillian testing with JBoss
                aslak

                Hard to tell without having the ear file. It can't find the correct information to execute in container, which points to 'something' not going 100% correct in the metadata extraction during Deploy.

                • 35. Re: Arquillian testing with JBoss
                  s3ppl

                  The file is the I built before. See page 2. Now I just copied the deployed file to my workspace and tried this:

                   

                   


                  @Deployment

                  public static EnterpriseArchive createTestArchive() throws IOException

                  {





                  EnterpriseArchive arch = ShrinkWrap.createFromZipFile(EnterpriseArchive.class, new File("test.ear"));






                  return arch;

                  }

                   

                  Afterwards I compared the contents of the original file and the one created and both looked the same.

                   

                  By the way. Is it even possible to get the jbossas-remote-4.2 to work on 4.3 EAP? There seem to be some security issuesthat I could not fix up to now

                  (Caused by: java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console)

                   

                  Nachricht geändert durch Patrick T added ear-file

                  • 36. Re: Arquillian testing with JBoss
                    s3ppl

                    I solved the problem with the package. The actual problem was caused by the fact, that the ear-file I wanted to import already contained those "bonus" libs arquillian adds like the testenricher and the servletrunner etc. After removing them manually from the file, everything worked perfectly again

                    • 37. Re: Arquillian testing with JBoss
                      s3ppl

                      Maybe I should get a little more precise since this *could* be a bug, but I'm not sure. Maybe you're already working on it, but there was no answer, so I simply want to give a good explanation how this happend. I'm not even sure if this would be an Arquillian or ShrinkWrap issue

                       

                      What I did at first:

                      I deployed an ear file that was build in my @Deployment function using shrinkwrap (see page 2) successfully.

                       

                      What I tried to do later:

                      I copied the ear-file that was deployed to [..]/jboss/server/default/tmp/jsr88/test.ear to my workspace that was build during the test "What I did at first".

                      Afterwards I tried to deploy the file I just copied using "ShrinkWrap.createFromZipFile" without building it from scratch. This caused the error I posted above, which seems to be caused by the already existent lib-dir (didn't add own libs) and the other stuff added from Arquillian(?) during the deployment.

                       

                      Actually after I tried to run the test with this error, the file, that was deployed held the same files as the one I tried to "import". Thats at least what my impression was after browsing through the files. After checking the filesizes which held a slight difference I got curious. The error seems to lie in the web.xml of the arquillian-protocol.war that's added, since it seems to simply add the ArquillianServletRunner-lines without checking if they're already existent, which is why they double after this kind of call. Maybe there are some other differences, but I could only find these right now.

                      • 38. Re: Arquillian testing with JBoss
                        aslak

                        aa yes, that could be the problem. It's not really tested much with 'enrcihing' already enriched archives. please file a jira

                        • 39. Re: Arquillian testing with JBoss
                          s3ppl

                          Done.

                           

                          Just didn't have another ear-file at hand, so I tried to use the one from the earlier tests^^

                          • 40. Re: Arquillian testing with JBoss
                            aslak

                            Thank you! Nice catch..

                            • 41. Re: Arquillian testing with JBoss
                              s3ppl

                              Aww please.. You don't have get this sarcastic. I already knew that this is not some "great revolution" or sth^^

                               

                              Nevertheless, it's not essential for my task but it would be nice to have so there's the question

                              Is the current jbossas-remote-4.2 container capable of managing the security issues of an EAP server right now?

                              • 42. Re: Arquillian testing with JBoss
                                aslak

                                sarcastic? who's sarcastic?

                                 

                                 

                                The latest jbossas-remote-4.2 SNAPSHOT work with EAP 4.3 as far as I can tell. By default it will use username/password admin/admin which are the default in EAP if enabled, but you can override that via container configuraiton:

                                 

                                <container qualifier="eap4" default="true">
                                  <configuration>
                                    <property name="username">xxx</property>
                                    <property name="password">xxx</property>
                                  </configuraion>
                                </container>
                                

                                 

                                (assuming by "security issues" you mean deploy to a secured server)

                                • 43. Re: Arquillian testing with JBoss
                                  s3ppl

                                  Oh. Sorry then. Guess I simply misunderstood sth. Had no bad intention

                                   

                                   

                                  Caused by: java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
                                  

                                   

                                  That's the error I get trying to start the same test, as before, using a remote interface instead of local and the remote-container. admin/admin are the right values though.

                                   

                                  Patrick

                                  • 44. Re: Arquillian testing with JBoss
                                    s3ppl

                                    Hi again. After running the managed-test on a clean jboss 4.3 EAP successfully, I got some problems to run the test on our actual system. Let's start with the exception I get. It seems to occur after the deployment on the server, so I guess it's actually when it tries to run. But I'm not sure here since

                                     

                                    Caused by: java.net.SocketException: Unexpected end of file from server
                                        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:763)
                                        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:626)
                                        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:760)
                                        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:626)
                                        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:957)
                                        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
                                        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.execute(ServletMethodExecutor.java:202)
                                        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.executeWithRetry(ServletMethodExecutor.java:140)
                                        at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:118)
                                        ... 75 more
                                    

                                     

                                    According to the posts I read about this error and arquillian it's likely to be caused by either a timout or due to another services running on the same port. Actually I think that the second reason is the actual cause of this error, since the server.log shows this

                                     

                                    2012-03-27 11:42:15,060 INFO  [RMI TCP Connection(2)-127.0.0.1] org.jboss.deployment.EARDeployer.start:368 - Started J2EE application: file:/C:/Jboss/jboss-as/server/default/tmp/jsr88/RegressionTest.ear
                                    

                                     

                                    The problem is that I'm not allowed to change sth. at the current system. So I can't just disable the service using this port. Is it still possible to get this test working?

                                     

                                    Thx

                                     

                                    Patrick