You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Benson Margulies <be...@basistech.com> on 2015/07/24 18:07:01 UTC

testing web page points to possibly obsolete information for 4.0.0

https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html

This talks about

org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container

which has not been released since a 3.0.0 RC. Are the coordinates wrong?

Re: testing web page points to possibly obsolete information for 4.0.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
FYI,

It's already documented in the update notes since Karaf 3.0.0 release:

http://karaf.apache.org/manual/latest-3.0.x/update-notes.html

See:
"Test tooling

Apache Karaf 3.0.x is fully supported by OPS4J Pax Exam and "previous" 
karaf-pax-exam module is no more maintained."

Regards
JB

On 07/27/2015 06:24 PM, Achim Nierbeck wrote:
> The karaf container moved from the karaf project to pax-exam where it
> actually fits better.
> Therefore the right artifact to use is:
>
> <dependency>
>      <groupId>org.ops4j.pax.exam</groupId>
>      <artifactId>pax-exam-container-karaf</artifactId>
>      <version>4.5.0</version>
>      <scope>test</scope>
> </dependency>
>
> regarding the provision of a kar in a test.
> As a KAR is a specialized deployment for features there is no extra way
> of testing a standalone KAR.
> Actually it should be enough to test the feature which defines the
> content of the KAR file.
>
> regards, Achim
>
>
> 2015-07-27 17:51 GMT+02:00 <development@mobigov.com
> <ma...@mobigov.com>>:
>
>     __
>
>     Was there ever an answer for what repo to point to in order to get
>     the 4.0 version of
>     org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container or
>     should we be using the 3.0 version for karaf 4.0 as well.
>
>     Thanks for any help,
>
>        David
>
>     On 2015-07-24 12:12, Benson Margulies wrote:
>
>>     The answer is:
>>
>>     <dependency>
>>          <groupId>org.ops4j.pax.exam</groupId>
>>          <artifactId>pax-exam-container-karaf</artifactId>
>>          <version>4.5.0</version>
>>          <scope>test</scope>
>>     </dependency>
>>
>>     The next question is: how do I provision a kar into here?
>>
>>     On Fri, Jul 24, 2015 at 12:07 PM, Benson Margulies <benson@basistech.com  <ma...@basistech.com>> wrote:
>>>     https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html
>>>     This talks about
>>>     org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container
>>>     which has not been released since a 3.0.0 RC. Are the coordinates
>>>     wrong?
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
> & Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Feature depenedencies

Posted by de...@mobigov.com.
 

Thank you and thank you for your patience and time today Achim. 

On 2015-07-28 16:05, Achim Nierbeck wrote: 

> Hi, 
> 
> if you need the wrap feature, make sure you define this dependency in your own feature file and 
> make sure it is marked as a prerequisite feature. 
> 
> <feature prerequisite=true>wrap</feature> 
> 
> With this the feature resolve will know it first needs to install this feature before actually installing your own feature descriptor. 
> This is especially needed in the case with testing, because all features defined in the configuration of the test are automatically 
> used as bootfeatures, and therefore the wrap and your own features are started at the same time. 
> 
> regards, Achim 
> 
> 2015-07-28 21:58 GMT+02:00 <de...@mobigov.com>:
> 
> Hello all, 
> 
> I am trying to add a custom feature to my test instance (Karaf 4.0.0 Pax Exam 4.5). It seems to be trying to add my custom feature before it adds the wrap feature even though I have wrap as a dependency to my custom feature. I have tried it as is and with dependency=true. 
> 
> <feature name="file-ingestion-server" description="file-ingestion-server" install="auto" version="1.0.0.SNAPSHOT">
> <feature>wrap</feature> 
> 
> KarafDistributionOption.features(karafStandardRepo, "wrap"),
> KarafDistributionOption.features(karafStandardRepo, "aries-blueprint"),
> KarafDistributionOption.features(karafStandardRepo, "shell"),
> KarafDistributionOption.features(karafStandardRepo, "shell-compat"),
> KarafDistributionOption.features(karafStandardRepo, "feature"),
> KarafDistributionOption.features(karafStandardRepo, "jaas"),
> KarafDistributionOption.features(karafStandardRepo, "ssh"),
> KarafDistributionOption.features(karafStandardRepo, "management"),
> KarafDistributionOption.features(karafStandardRepo, "bundle"),
> KarafDistributionOption.features(karafStandardRepo, "config"),
> KarafDistributionOption.features(karafStandardRepo, "deployer"),
> KarafDistributionOption.features(karafStandardRepo, "diagnostic"),
> KarafDistributionOption.features(karafStandardRepo, "feature"),
> KarafDistributionOption.features(karafStandardRepo, "instance"),
> KarafDistributionOption.features(karafStandardRepo, "kar"),
> KarafDistributionOption.features(karafStandardRepo, "log"),
> KarafDistributionOption.features(karafStandardRepo, "package"),
> KarafDistributionOption.features(karafStandardRepo, "service"),
> KarafDistributionOption.features(karafStandardRepo, "system"),
> KarafDistributionOption.features(karafStandardRepo, "war"),
> KarafDistributionOption.features(karafStandardRepo, "webconsole"),
> KarafDistributionOption.features(karafStandardRepo, "scr"),
> KarafDistributionOption.features(karafStandardRepo, "transaction"),
> KarafDistributionOption.features(karafCxfRepo, "cxf-jaxrs"),
> KarafDistributionOption.features(karafFitRepo, "file-ingestion-server") 
> 
> Some excerpts from the log are below 
> 
> Caused by: java.net.MalformedURLException: unknown protocol: wrap
> at java.net.URL.<init>(URL.java:592)[:1.7.0_71]
> at java.net.URL.<init>(URL.java:482)[:1.7.0_71]
> at java.net.URL.<init>(URL.java:431)[:1.7.0_71]
> at org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[8:org.apache.karaf.features.core:4.0.0] 
> 
> 2015-07-28 15:49:24,888 | INFO | pool-1-thread-1 | FeaturesServiceImpl | 8 - org.apache.karaf.features.core - 4.0.0 | Adding features: shell/[4.0.0,4.0.0], scr/[4.0.0,4.0.0], transaction/[1.1.1,1.1.1], package/[4.0.0,4.0.0], ssh/[4.0.0,4.0.0], war/[4.0.0,4.0.0], config/[4.0.0,4.0.0], bundle/[4.0.0,4.0.0], feature/[4.0.0,4.0.0], deployer/[4.0.0,4.0.0], instance/[4.0.0,4.0.0], diagnostic/[4.0.0,4.0.0], aries-blueprint/[4.0.0,4.0.0], wrap/[0,0.0.0], kar/[4.0.0,4.0.0], test-dependencies/[0,0.0.0], cxf-jaxrs/[3.1.1,3.1.1], shell-compat/[4.0.0,4.0.0], file-ingestion-server/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT], webconsole/[4.0.0,4.0.0], log/[4.0.0,4.0.0], jaas/[4.0.0,4.0.0], system/[4.0.0,4.0.0], service/[4.0.0,4.0.0], exam/[4.5.0,4.5.0], management/[4.0.0,4.0.0]
> 2015-07-28 15:51:19,324 | ERROR | pool-1-thread-1 | BootFeaturesInstaller | 8 - org.apache.karaf.features.core - 4.0.0 | Error installing boot features
> org.apache.karaf.features.internal.util.MultiException: Error
> at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)[8:org.apache.karaf.features.core:4.0.0] 
> 
> On 2015-07-28 13:48, Achim Nierbeck wrote: 
> Ahh, 
> with those options the test will wait for the debugger to attach. 
> But actually there is a much simpler way of attaching a debugger to it. 
> Just add the following to your test-configuration: 
> KarafDistributionOption.debugConfiguration("5005", true)
> 
> regards, Achim 
> 
> 2015-07-28 19:30 GMT+02:00 <de...@mobigov.com>:
> 
> When I removed the debug part and the systemtimeout the test ran. Would be nice to debug but I can always do that in a different manner. 
> 
> On 2015-07-28 07:56, development@mobigov.com wrote: 
> 
> I believe I have switched it but still recieve the same error. When I run netstat I can see 21000 is opened and listening while the test runs. The new log is as follows. 
> 
> Running com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner for class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory: org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe hook found
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb] args=[Ljava.lang.Object;@5e48a0e1
> [org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with probes: 1 using strategy: org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] args=[Ljava.lang.Object;@4f4f4ec4
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @ [TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments: [Ljava.lang.Object;@28adcd81
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using RMI registry at port 21000
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.url.mvn.internal.Connection] : Resolving [mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
> [shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider] : Using manager SimpleLocalRepositoryManager with priority 0.0 for /home/david/.m2/repository Ignored FQCN: shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
> [org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved (org.apache.karaf:apache-karaf:tar.gz:4.0.0) as /home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager is shutting down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager shut down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test Container started in 3 millis
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait for test container to finish its initialization [ RelativeTimeout value = 0 ]
> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for remote bundle context.. on 21000 name: 1269041e-ec7f-41d2-8c45-5147836cc4bb timout: [ RelativeTimeout value = 0 ]
> Listening for transport dt_socket at address: 5005
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892 sec <<< FAILURE! - in com.orbis.ingestion.models.FileTest
> simpleTest(com.orbis.ingestion.models.FileTest) Time elapsed: 36.886 sec <<< ERROR!
> java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
> at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
> at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
> at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
> at sun.rmi.transport.Transport$1.run(Transport.java:177)
> at sun.rmi.transport.Transport$1.run(Transport.java:174)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
> at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
> at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
> at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
> at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> 
> Results :
> 
> Tests in error: 
> FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb 
> 
> Here is my test code 
> 
> @SuppressWarnings("deprecation")
> @RunWith(PaxExam.class)
> @ExamReactorStrategy(PerMethod.class)
> public class FileTest {
> private static final Logger LOGGER = LoggerFactory.getLogger(FileTest.class);
> 
> @Inject
> protected BundleContext bundleContext;
> 
> @Configuration
> public Option[] config() {
> 
> MavenArtifactUrlReference karafUrl = CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");
> 
> return new Option[]{ KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").
> unpackDirectory(new File("target/paxexam/unpack")).useDeployFolder(false),
> KarafDistributionOption.keepRuntimeFolder(),
> 
> CoreOptions.keepCaches(),
> CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
> 
> // TODO define settings.xml if behind a proxy
> 
> CoreOptions.systemTimeout(0),
> CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
> KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox"),
> // disable JMX RBAC security, thanks to the KarafMBeanServerBuilder
> KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
> KarafDistributionOption.logLevel(LogLevel.INFO)
> };
> }
> 
> @Test
> public void simpleTest() {
> try {
> Thread.sleep(5000);
> } catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> LOGGER.info("++++ Executing the test!!!!");
> Assert.assertNotNull(bundleContext);
> }
> } 
> 
> On 2015-07-28 07:31, Achim Nierbeck wrote: 
> Hi David, 
> 
> taken from your stacktrace I can see you seem to use TestNG, 
> could you try convert the test to JUnit. I'm not so sure about how good TestNG always runs with Pax-Exam. 
> 
> regards, Achim

 -- 

Apache Member

Apache Karaf <http://karaf.apache.org/ [1]> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ [2]>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/ [3]> 
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS [4]> 

Software Architect / Project Manager / Scrum Master 

 -- 

Apache Member

Apache Karaf <http://karaf.apache.org/ [1]> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ [2]>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/ [3]> 
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS [4]> 

Software Architect / Project Manager / Scrum Master 
 

Links:
------
[1] http://karaf.apache.org/
[2] http://wiki.ops4j.org/display/paxweb/Pax+Web/
[3] http://notizblog.nierbeck.de/
[4] http://bit.ly/1ps9rkS

Re: Feature depenedencies

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

if you need the wrap feature, make sure you define this dependency in your
own feature file and
make sure it is marked as a prerequisite feature.

<feature prerequisite=true>wrap</feature>

With this the feature resolve will know it first needs to install this
feature before actually installing your own feature descriptor.
This is especially needed in the case with testing, because all features
defined in the configuration of the test are automatically
used as bootfeatures, and therefore the wrap and your own features are
started at the same time.

regards, Achim


2015-07-28 21:58 GMT+02:00 <de...@mobigov.com>:

>  Hello all,
>
>   I am trying to add a custom feature to my test instance (Karaf 4.0.0 Pax
> Exam 4.5).  It seems to be trying to add my custom feature before it adds
> the wrap feature even though I have wrap as a dependency to my custom
> feature.  I have tried it as is and with dependency=true.
>
>     <feature name="file-ingestion-server"
> description="file-ingestion-server" install="auto"
> version="1.0.0.SNAPSHOT">
>         <feature>wrap</feature>
>
>                 KarafDistributionOption.features(karafStandardRepo,
> "wrap"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "aries-blueprint"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "shell"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "shell-compat"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "feature"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "jaas"),
>                 KarafDistributionOption.features(karafStandardRepo, "ssh"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "management"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "bundle"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "config"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "deployer"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "diagnostic"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "feature"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "instance"),
>                 KarafDistributionOption.features(karafStandardRepo, "kar"),
>                 KarafDistributionOption.features(karafStandardRepo, "log"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "package"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "service"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "system"),
>                 KarafDistributionOption.features(karafStandardRepo, "war"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "webconsole"),
>                 KarafDistributionOption.features(karafStandardRepo, "scr"),
>                 KarafDistributionOption.features(karafStandardRepo,
> "transaction"),
>                 KarafDistributionOption.features(karafCxfRepo,
> "cxf-jaxrs"),
>                 KarafDistributionOption.features(karafFitRepo,
> "file-ingestion-server")
>
> Some excerpts from the log are below
>
> Caused by: java.net.MalformedURLException: unknown protocol: wrap
>     at java.net.URL.<init>(URL.java:592)[:1.7.0_71]
>     at java.net.URL.<init>(URL.java:482)[:1.7.0_71]
>     at java.net.URL.<init>(URL.java:431)[:1.7.0_71]
>     at
> org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[8:org.apache.karaf.features.core:4.0.0]
>
> 2015-07-28 15:49:24,888 | INFO  | pool-1-thread-1  |
> FeaturesServiceImpl              | 8 - org.apache.karaf.features.core -
> 4.0.0 | Adding features: shell/[4.0.0,4.0.0], scr/[4.0.0,4.0.0],
> transaction/[1.1.1,1.1.1], package/[4.0.0,4.0.0], ssh/[4.0.0,4.0.0],
> war/[4.0.0,4.0.0], config/[4.0.0,4.0.0], bundle/[4.0.0,4.0.0],
> feature/[4.0.0,4.0.0], deployer/[4.0.0,4.0.0], instance/[4.0.0,4.0.0],
> diagnostic/[4.0.0,4.0.0], aries-blueprint/[4.0.0,4.0.0], wrap/[0,0.0.0],
> kar/[4.0.0,4.0.0], test-dependencies/[0,0.0.0], cxf-jaxrs/[3.1.1,3.1.1],
> shell-compat/[4.0.0,4.0.0],
> file-ingestion-server/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT],
> webconsole/[4.0.0,4.0.0], log/[4.0.0,4.0.0], jaas/[4.0.0,4.0.0],
> system/[4.0.0,4.0.0], service/[4.0.0,4.0.0], exam/[4.5.0,4.5.0],
> management/[4.0.0,4.0.0]
> 2015-07-28 15:51:19,324 | ERROR | pool-1-thread-1  |
> BootFeaturesInstaller            | 8 - org.apache.karaf.features.core -
> 4.0.0 | Error installing boot features
> org.apache.karaf.features.internal.util.MultiException: Error
>     at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)[8:org.apache.karaf.features.core:4.0.0]
>
>
>
>
> On 2015-07-28 13:48, Achim Nierbeck wrote:
>
> Ahh,
> with those options the test will wait for the debugger to attach.
> But actually there is a much simpler way of attaching a debugger to it.
> Just add the following to your test-configuration:
>
> KarafDistributionOption.debugConfiguration("5005", true)
>
>
> regards, Achim
>
> 2015-07-28 19:30 GMT+02:00 <de...@mobigov.com>:
>
>>  When I removed the debug part and the systemtimeout the test ran.
>> Would be nice to debug but I can always do that in a different manner.
>>
>>
>>
>>
>> On 2015-07-28 07:56, development@mobigov.com wrote:
>>
>> I believe I have switched it but still recieve the same error.  When I
>> run netstat I can see 21000 is opened and listening while the test runs.
>> The new log is as follows.
>>
>> Running com.orbis.ingestion.models.FileTest
>> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner for
>> class com.orbis.ingestion.models.FileTest
>> [org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory:
>> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
>> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe
>> hook found
>> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
>> PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null
>> root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb
>> root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb]
>> args=[Ljava.lang.Object;@5e48a0e1
>> [org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with
>> probes: 1 using strategy: org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
>> [org.ops4j.store.intern.TemporaryStore] : Storage Area is
>> /tmp/1438084276075-0
>> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
>> PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
>> parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
>> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
>> root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
>> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
>> args=[Ljava.lang.Object;@4f4f4ec4
>> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class
>> com.orbis.ingestion.models.FileTest
>> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @
>> [TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
>> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments:
>> [Ljava.lang.Object;@28adcd81
>> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using
>> RMI registry at port 21000
>> [org.ops4j.store.intern.TemporaryStore] : Storage Area is
>> /tmp/1438084276075-0
>> [org.ops4j.pax.url.mvn.internal.Connection] : Resolving
>> [mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
>> [shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider]
>> : Using manager SimpleLocalRepositoryManager with priority 0.0 for
>> /home/david/.m2/repository Ignored FQCN:
>> shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
>> [org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved
>> (org.apache.karaf:apache-karaf:tar.gz:4.0.0) as
>> /home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
>> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
>> Connection manager is shutting down Ignored FQCN:
>> shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
>> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
>> Connection manager shut down Ignored FQCN:
>> shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
>> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test
>> Container started in 3 millis
>> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait
>> for test container to finish its initialization [ RelativeTimeout value = 0
>> ]
>> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for
>> remote bundle context.. on 21000 name: 1269041e-ec7f-41d2-8c45-5147836cc4bb
>> timout: [ RelativeTimeout value = 0 ]
>> Listening for transport dt_socket at address: 5005
>> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892
>> sec <<< FAILURE! - in com.orbis.ingestion.models.FileTest
>> simpleTest(com.orbis.ingestion.models.FileTest)  Time elapsed: 36.886
>> sec  <<< ERROR!
>> java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
>>     at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
>>     at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
>>     at
>> sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
>>     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
>>     at sun.rmi.transport.Transport$1.run(Transport.java:177)
>>     at sun.rmi.transport.Transport$1.run(Transport.java:174)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
>>     at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
>>     at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
>>     at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
>>     at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>     at java.lang.Thread.run(Thread.java:745)
>>     at
>> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
>>     at
>> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
>>     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
>>     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>>     at
>> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
>>     at
>> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
>>     at
>> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
>>     at
>> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
>>     at
>> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
>>     at
>> org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
>>     at
>> org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
>>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>     at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>     at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>>     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>     at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
>>     at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
>>     at
>> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
>>     at
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
>>     at
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>>     at
>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
>>     at
>> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>>     at
>> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>>     at
>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
>>
>>
>> Results :
>>
>> Tests in error:
>>   FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb
>>
>> Here is my test code
>>
>>
>>
>> @SuppressWarnings("deprecation")
>> @RunWith(PaxExam.class)
>> @ExamReactorStrategy(PerMethod.class)
>> public class FileTest {
>>     private static final Logger LOGGER =
>> LoggerFactory.getLogger(FileTest.class);
>>
>>     @Inject
>>     protected BundleContext bundleContext;
>>
>>     @Configuration
>>     public Option[] config() {
>>
>>         MavenArtifactUrlReference karafUrl =
>> CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");
>>
>>         return new Option[]{
>> KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache
>> Karaf").
>>                 unpackDirectory(new
>> File("target/paxexam/unpack")).useDeployFolder(false),
>>                 KarafDistributionOption.keepRuntimeFolder(),
>>
>>                 CoreOptions.keepCaches(),
>>
>>  CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
>>
>>                 // TODO define settings.xml if behind a proxy
>>
>>                 CoreOptions.systemTimeout(0),
>>
>>  CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
>>
>>  KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK,
>> "equinox"),
>>                 // disable JMX RBAC security, thanks to the
>> KarafMBeanServerBuilder
>>
>>  KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
>>                 KarafDistributionOption.logLevel(LogLevel.INFO)
>>         };
>>     }
>>
>>     @Test
>>     public void simpleTest() {
>>         try {
>>             Thread.sleep(5000);
>>         } catch (InterruptedException e) {
>>             // TODO Auto-generated catch block
>>             e.printStackTrace();
>>         }
>>         LOGGER.info("++++ Executing the test!!!!");
>>         Assert.assertNotNull(bundleContext);
>>     }
>> }
>>
>>
>>
>>
>> On 2015-07-28 07:31, Achim Nierbeck wrote:
>>
>> Hi David,
>>
>> taken from your stacktrace I can see you seem to use TestNG,
>> could you try convert the test to JUnit. I'm not so sure about how good
>> TestNG always runs with Pax-Exam.
>>
>> regards, Achim
>>
>>
>>
>>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Feature depenedencies

Posted by de...@mobigov.com.
 

Hello all, 

 I am trying to add a custom feature to my test instance (Karaf 4.0.0
Pax Exam 4.5). It seems to be trying to add my custom feature before it
adds the wrap feature even though I have wrap as a dependency to my
custom feature. I have tried it as is and with dependency=true. 

 <feature name="file-ingestion-server"
description="file-ingestion-server" install="auto"
version="1.0.0.SNAPSHOT">
 <feature>wrap</feature> 

 KarafDistributionOption.features(karafStandardRepo, "wrap"),
 KarafDistributionOption.features(karafStandardRepo, "aries-blueprint"),
 KarafDistributionOption.features(karafStandardRepo, "shell"),
 KarafDistributionOption.features(karafStandardRepo, "shell-compat"),
 KarafDistributionOption.features(karafStandardRepo, "feature"),
 KarafDistributionOption.features(karafStandardRepo, "jaas"),
 KarafDistributionOption.features(karafStandardRepo, "ssh"),
 KarafDistributionOption.features(karafStandardRepo, "management"),
 KarafDistributionOption.features(karafStandardRepo, "bundle"),
 KarafDistributionOption.features(karafStandardRepo, "config"),
 KarafDistributionOption.features(karafStandardRepo, "deployer"),
 KarafDistributionOption.features(karafStandardRepo, "diagnostic"),
 KarafDistributionOption.features(karafStandardRepo, "feature"),
 KarafDistributionOption.features(karafStandardRepo, "instance"),
 KarafDistributionOption.features(karafStandardRepo, "kar"),
 KarafDistributionOption.features(karafStandardRepo, "log"),
 KarafDistributionOption.features(karafStandardRepo, "package"),
 KarafDistributionOption.features(karafStandardRepo, "service"),
 KarafDistributionOption.features(karafStandardRepo, "system"),
 KarafDistributionOption.features(karafStandardRepo, "war"),
 KarafDistributionOption.features(karafStandardRepo, "webconsole"),
 KarafDistributionOption.features(karafStandardRepo, "scr"),
 KarafDistributionOption.features(karafStandardRepo, "transaction"),
 KarafDistributionOption.features(karafCxfRepo, "cxf-jaxrs"),
 KarafDistributionOption.features(karafFitRepo, "file-ingestion-server")


Some excerpts from the log are below 

Caused by: java.net.MalformedURLException: unknown protocol: wrap
 at java.net.URL.<init>(URL.java:592)[:1.7.0_71]
 at java.net.URL.<init>(URL.java:482)[:1.7.0_71]
 at java.net.URL.<init>(URL.java:431)[:1.7.0_71]
 at
org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[8:org.apache.karaf.features.core:4.0.0]


2015-07-28 15:49:24,888 | INFO | pool-1-thread-1 | FeaturesServiceImpl |
8 - org.apache.karaf.features.core - 4.0.0 | Adding features:
shell/[4.0.0,4.0.0], scr/[4.0.0,4.0.0], transaction/[1.1.1,1.1.1],
package/[4.0.0,4.0.0], ssh/[4.0.0,4.0.0], war/[4.0.0,4.0.0],
config/[4.0.0,4.0.0], bundle/[4.0.0,4.0.0], feature/[4.0.0,4.0.0],
deployer/[4.0.0,4.0.0], instance/[4.0.0,4.0.0],
diagnostic/[4.0.0,4.0.0], aries-blueprint/[4.0.0,4.0.0], wrap/[0,0.0.0],
kar/[4.0.0,4.0.0], test-dependencies/[0,0.0.0], cxf-jaxrs/[3.1.1,3.1.1],
shell-compat/[4.0.0,4.0.0],
file-ingestion-server/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT],
webconsole/[4.0.0,4.0.0], log/[4.0.0,4.0.0], jaas/[4.0.0,4.0.0],
system/[4.0.0,4.0.0], service/[4.0.0,4.0.0], exam/[4.5.0,4.5.0],
management/[4.0.0,4.0.0]
2015-07-28 15:51:19,324 | ERROR | pool-1-thread-1 |
BootFeaturesInstaller | 8 - org.apache.karaf.features.core - 4.0.0 |
Error installing boot features
org.apache.karaf.features.internal.util.MultiException: Error
 at
org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)[8:org.apache.karaf.features.core:4.0.0]


On 2015-07-28 13:48, Achim Nierbeck wrote: 

> Ahh, 
> with those options the test will wait for the debugger to attach. 
> But actually there is a much simpler way of attaching a debugger to it. 
> Just add the following to your test-configuration: 
> KarafDistributionOption.debugConfiguration("5005", true)
> 
> regards, Achim 
> 
> 2015-07-28 19:30 GMT+02:00 <de...@mobigov.com>:
> 
> When I removed the debug part and the systemtimeout the test ran. Would be nice to debug but I can always do that in a different manner. 
> 
> On 2015-07-28 07:56, development@mobigov.com wrote: 
> 
> I believe I have switched it but still recieve the same error. When I run netstat I can see 21000 is opened and listening while the test runs. The new log is as follows. 
> 
> Running com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner for class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory: org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe hook found
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb] args=[Ljava.lang.Object;@5e48a0e1
> [org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with probes: 1 using strategy: org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] args=[Ljava.lang.Object;@4f4f4ec4
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @ [TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments: [Ljava.lang.Object;@28adcd81
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using RMI registry at port 21000
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.url.mvn.internal.Connection] : Resolving [mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
> [shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider] : Using manager SimpleLocalRepositoryManager with priority 0.0 for /home/david/.m2/repository Ignored FQCN: shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
> [org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved (org.apache.karaf:apache-karaf:tar.gz:4.0.0) as /home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager is shutting down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager shut down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test Container started in 3 millis
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait for test container to finish its initialization [ RelativeTimeout value = 0 ]
> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for remote bundle context.. on 21000 name: 1269041e-ec7f-41d2-8c45-5147836cc4bb timout: [ RelativeTimeout value = 0 ]
> Listening for transport dt_socket at address: 5005
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892 sec <<< FAILURE! - in com.orbis.ingestion.models.FileTest
> simpleTest(com.orbis.ingestion.models.FileTest) Time elapsed: 36.886 sec <<< ERROR!
> java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
> at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
> at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
> at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
> at sun.rmi.transport.Transport$1.run(Transport.java:177)
> at sun.rmi.transport.Transport$1.run(Transport.java:174)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
> at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
> at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
> at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
> at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> 
> Results :
> 
> Tests in error: 
> FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb 
> 
> Here is my test code 
> 
> @SuppressWarnings("deprecation")
> @RunWith(PaxExam.class)
> @ExamReactorStrategy(PerMethod.class)
> public class FileTest {
> private static final Logger LOGGER = LoggerFactory.getLogger(FileTest.class);
> 
> @Inject
> protected BundleContext bundleContext;
> 
> @Configuration
> public Option[] config() {
> 
> MavenArtifactUrlReference karafUrl = CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");
> 
> return new Option[]{ KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").
> unpackDirectory(new File("target/paxexam/unpack")).useDeployFolder(false),
> KarafDistributionOption.keepRuntimeFolder(),
> 
> CoreOptions.keepCaches(),
> CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
> 
> // TODO define settings.xml if behind a proxy
> 
> CoreOptions.systemTimeout(0),
> CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
> KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox"),
> // disable JMX RBAC security, thanks to the KarafMBeanServerBuilder
> KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
> KarafDistributionOption.logLevel(LogLevel.INFO)
> };
> }
> 
> @Test
> public void simpleTest() {
> try {
> Thread.sleep(5000);
> } catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> LOGGER.info("++++ Executing the test!!!!");
> Assert.assertNotNull(bundleContext);
> }
> } 
> 
> On 2015-07-28 07:31, Achim Nierbeck wrote: 
> Hi David, 
> 
> taken from your stacktrace I can see you seem to use TestNG, 
> could you try convert the test to JUnit. I'm not so sure about how good TestNG always runs with Pax-Exam. 
> 
> regards, Achim

 -- 

Apache Member

Apache Karaf <http://karaf.apache.org/ [1]> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ [2]>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/ [3]> 
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS [4]> 

Software Architect / Project Manager / Scrum Master 
 

Links:
------
[1] http://karaf.apache.org/
[2] http://wiki.ops4j.org/display/paxweb/Pax+Web/
[3] http://notizblog.nierbeck.de/
[4] http://bit.ly/1ps9rkS

Re: Pax Exam testing error

Posted by Achim Nierbeck <bc...@googlemail.com>.
Ahh,
with those options the test will wait for the debugger to attach.
But actually there is a much simpler way of attaching a debugger to it.
Just add the following to your test-configuration:

KarafDistributionOption.debugConfiguration("5005", true)


regards, Achim

2015-07-28 19:30 GMT+02:00 <de...@mobigov.com>:

>  When I removed the debug part and the systemtimeout the test ran.  Would
> be nice to debug but I can always do that in a different manner.
>
>
>
>
> On 2015-07-28 07:56, development@mobigov.com wrote:
>
> I believe I have switched it but still recieve the same error.  When I run
> netstat I can see 21000 is opened and listening while the test runs.  The
> new log is as follows.
>
> Running com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner for
> class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory:
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe
> hook found
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
> PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null
> root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb
> root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb]
> args=[Ljava.lang.Object;@5e48a0e1
> [org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with probes:
> 1 using strategy: org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is
> /tmp/1438084276075-0
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
> PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
> parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
> root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
> args=[Ljava.lang.Object;@4f4f4ec4
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class
> com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @
> [TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
> root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments:
> [Ljava.lang.Object;@28adcd81
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using
> RMI registry at port 21000
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is
> /tmp/1438084276075-0
> [org.ops4j.pax.url.mvn.internal.Connection] : Resolving
> [mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
> [shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider] :
> Using manager SimpleLocalRepositoryManager with priority 0.0 for
> /home/david/.m2/repository Ignored FQCN:
> shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
> [org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved
> (org.apache.karaf:apache-karaf:tar.gz:4.0.0) as
> /home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
> Connection manager is shutting down Ignored FQCN:
> shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
> Connection manager shut down Ignored FQCN:
> shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test
> Container started in 3 millis
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait
> for test container to finish its initialization [ RelativeTimeout value = 0
> ]
> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for
> remote bundle context.. on 21000 name: 1269041e-ec7f-41d2-8c45-5147836cc4bb
> timout: [ RelativeTimeout value = 0 ]
> Listening for transport dt_socket at address: 5005
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892 sec
> <<< FAILURE! - in com.orbis.ingestion.models.FileTest
> simpleTest(com.orbis.ingestion.models.FileTest)  Time elapsed: 36.886 sec
> <<< ERROR!
> java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
>     at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
>     at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
>     at
> sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
>     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
>     at sun.rmi.transport.Transport$1.run(Transport.java:177)
>     at sun.rmi.transport.Transport$1.run(Transport.java:174)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
>     at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
>     at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
>     at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:745)
>     at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
>     at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
>     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
>     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>     at
> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
>     at
> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
>     at
> org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
>     at
> org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>     at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>     at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>     at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
>     at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
>     at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
>     at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
>     at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>     at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
>
>
> Results :
>
> Tests in error:
>   FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb
>
> Here is my test code
>
>
>
> @SuppressWarnings("deprecation")
> @RunWith(PaxExam.class)
> @ExamReactorStrategy(PerMethod.class)
> public class FileTest {
>     private static final Logger LOGGER =
> LoggerFactory.getLogger(FileTest.class);
>
>     @Inject
>     protected BundleContext bundleContext;
>
>     @Configuration
>     public Option[] config() {
>
>         MavenArtifactUrlReference karafUrl =
> CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");
>
>         return new Option[]{
> KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache
> Karaf").
>                 unpackDirectory(new
> File("target/paxexam/unpack")).useDeployFolder(false),
>                 KarafDistributionOption.keepRuntimeFolder(),
>
>                 CoreOptions.keepCaches(),
>
>  CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
>
>                 // TODO define settings.xml if behind a proxy
>
>                 CoreOptions.systemTimeout(0),
>
>  CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
>
>  KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK,
> "equinox"),
>                 // disable JMX RBAC security, thanks to the
> KarafMBeanServerBuilder
>
>  KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
>                 KarafDistributionOption.logLevel(LogLevel.INFO)
>         };
>     }
>
>     @Test
>     public void simpleTest() {
>         try {
>             Thread.sleep(5000);
>         } catch (InterruptedException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>         LOGGER.info("++++ Executing the test!!!!");
>         Assert.assertNotNull(bundleContext);
>     }
> }
>
>
>
>
> On 2015-07-28 07:31, Achim Nierbeck wrote:
>
> Hi David,
>
> taken from your stacktrace I can see you seem to use TestNG,
> could you try convert the test to JUnit. I'm not so sure about how good
> TestNG always runs with Pax-Exam.
>
> regards, Achim
>
>
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Pax Exam testing error

Posted by de...@mobigov.com.
 

When I removed the debug part and the systemtimeout the test ran. Would
be nice to debug but I can always do that in a different manner. 

On 2015-07-28 07:56, development@mobigov.com wrote: 

> I believe I have switched it but still recieve the same error. When I run netstat I can see 21000 is opened and listening while the test runs. The new log is as follows. 
> 
> Running com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner for class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory: org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe hook found
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb] args=[Ljava.lang.Object;@5e48a0e1
> [org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with probes: 1 using strategy: org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS= PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] args=[Ljava.lang.Object;@4f4f4ec4
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class com.orbis.ingestion.models.FileTest
> [org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @ [TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293 root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments: [Ljava.lang.Object;@28adcd81
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using RMI registry at port 21000
> [org.ops4j.store.intern.TemporaryStore] : Storage Area is /tmp/1438084276075-0
> [org.ops4j.pax.url.mvn.internal.Connection] : Resolving [mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
> [shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider] : Using manager SimpleLocalRepositoryManager with priority 0.0 for /home/david/.m2/repository Ignored FQCN: shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
> [org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved (org.apache.karaf:apache-karaf:tar.gz:4.0.0) as /home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager is shutting down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] : Connection manager shut down Ignored FQCN: shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test Container started in 3 millis
> [org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait for test container to finish its initialization [ RelativeTimeout value = 0 ]
> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for remote bundle context.. on 21000 name: 1269041e-ec7f-41d2-8c45-5147836cc4bb timout: [ RelativeTimeout value = 0 ]
> Listening for transport dt_socket at address: 5005
> [org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892 sec <<< FAILURE! - in com.orbis.ingestion.models.FileTest
> simpleTest(com.orbis.ingestion.models.FileTest) Time elapsed: 36.886 sec <<< ERROR!
> java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
> at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
> at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
> at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
> at sun.rmi.transport.Transport$1.run(Transport.java:177)
> at sun.rmi.transport.Transport$1.run(Transport.java:174)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
> at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
> at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
> at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
> at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
> at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
> at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> 
> Results :
> 
> Tests in error: 
> FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb 
> 
> Here is my test code 
> 
> @SuppressWarnings("deprecation")
> @RunWith(PaxExam.class)
> @ExamReactorStrategy(PerMethod.class)
> public class FileTest {
> private static final Logger LOGGER = LoggerFactory.getLogger(FileTest.class);
> 
> @Inject
> protected BundleContext bundleContext;
> 
> @Configuration
> public Option[] config() {
> 
> MavenArtifactUrlReference karafUrl = CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");
> 
> return new Option[]{ KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").
> unpackDirectory(new File("target/paxexam/unpack")).useDeployFolder(false),
> KarafDistributionOption.keepRuntimeFolder(),
> 
> CoreOptions.keepCaches(),
> CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
> 
> // TODO define settings.xml if behind a proxy
> 
> CoreOptions.systemTimeout(0),
> CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
> KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox"),
> // disable JMX RBAC security, thanks to the KarafMBeanServerBuilder
> KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
> KarafDistributionOption.logLevel(LogLevel.INFO)
> };
> }
> 
> @Test
> public void simpleTest() {
> try {
> Thread.sleep(5000);
> } catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> LOGGER.info("++++ Executing the test!!!!");
> Assert.assertNotNull(bundleContext);
> }
> } 
> 
> On 2015-07-28 07:31, Achim Nierbeck wrote: 
> 
>> Hi David, 
>> 
>> taken from your stacktrace I can see you seem to use TestNG, 
>> could you try convert the test to JUnit. I'm not so sure about how good TestNG always runs with Pax-Exam. 
>> 
>> regards, Achim
 

Re: Pax Exam testing error

Posted by de...@mobigov.com.
 

I believe I have switched it but still recieve the same error. When I
run netstat I can see 21000 is opened and listening while the test runs.
The new log is as follows. 

Running com.orbis.ingestion.models.FileTest
[org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner
for class com.orbis.ingestion.models.FileTest
[org.ops4j.pax.exam.spi.PaxExamRuntime] : Found TestContainerFactory:
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory
[org.ops4j.pax.exam.spi.reactors.ReactorManager] : No User defined probe
hook found
[org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb parent=null
root=[TestAddress:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb
root:PaxExam-e3f5d499-1bf8-4f12-b813-93d8c14e18fb]
args=[Ljava.lang.Object;@5e48a0e1
[org.ops4j.pax.exam.spi.DefaultExamReactor] : Staging reactor with
probes: 1 using strategy:
org.ops4j.pax.exam.spi.reactors.PerMethod@723a4422
[org.ops4j.store.intern.TemporaryStore] : Storage Area is
/tmp/1438084276075-0
[org.ops4j.pax.exam.spi.intern.DefaultTestAddress] : NEW ADDRESS=
PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
parent=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
root=[TestAddress:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482
root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482]
args=[Ljava.lang.Object;@4f4f4ec4
[org.ops4j.pax.exam.junit.impl.ProbeRunner] : running test class
com.orbis.ingestion.models.FileTest
[org.ops4j.pax.exam.junit.impl.ProbeRunner] : Invoke simpleTest @
[TestAddress:PaxExam-a9b61633-92c4-44dc-8588-5dd21bd13293
root:PaxExam-843362dd-4547-489c-ad3f-ebed4aa2c482] Arguments:
[Ljava.lang.Object;@28adcd81
[org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : using
RMI registry at port 21000
[org.ops4j.store.intern.TemporaryStore] : Storage Area is
/tmp/1438084276075-0
[org.ops4j.pax.url.mvn.internal.Connection] : Resolving
[mvn:org.apache.karaf/apache-karaf/4.0.0/tar.gz]
[shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider]
: Using manager SimpleLocalRepositoryManager with priority 0.0 for
/home/david/.m2/repository Ignored FQCN:
shaded.org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLoggerEx
[org.ops4j.pax.url.mvn.internal.AetherBasedResolver] : Resolved
(org.apache.karaf:apache-karaf:tar.gz:4.0.0) as
/home/david/.m2/repository/org/apache/karaf/apache-karaf/4.0.0/apache-karaf-4.0.0.tar.gz
[shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
Connection manager is shutting down Ignored FQCN:
shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
[shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager] :
Connection manager shut down Ignored FQCN:
shaded.org.apache.commons.logging.impl.SLF4JLocationAwareLog
[org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Test
Container started in 3 millis
[org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Wait
for test container to finish its initialization [ RelativeTimeout value
= 0 ]
[org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for
remote bundle context.. on 21000 name:
1269041e-ec7f-41d2-8c45-5147836cc4bb timout: [ RelativeTimeout value = 0
]
Listening for transport dt_socket at address: 5005
[org.ops4j.pax.exam.spi.reactors.ReactorManager] : suite finished
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 36.892
sec <<< FAILURE! - in com.orbis.ingestion.models.FileTest
simpleTest(com.orbis.ingestion.models.FileTest) Time elapsed: 36.886 sec
<<< ERROR!
java.rmi.NotBoundException: 1269041e-ec7f-41d2-8c45-5147836cc4bb
 at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
 at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
 at
sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
 at sun.rmi.transport.Transport$1.run(Transport.java:177)
 at sun.rmi.transport.Transport$1.run(Transport.java:174)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
 at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
 at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
 at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
 at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
 at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
 at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
 at
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
 at
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
 at
org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
 at
org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
 at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
 at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
 at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
 at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
 at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
 at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
 at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
 at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Results :

Tests in error: 
 FileTest.simpleTest » NotBound 1269041e-ec7f-41d2-8c45-5147836cc4bb 

Here is my test code 

@SuppressWarnings("deprecation")
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerMethod.class)
public class FileTest {
 private static final Logger LOGGER =
LoggerFactory.getLogger(FileTest.class);

 @Inject
 protected BundleContext bundleContext;

 @Configuration
 public Option[] config() {

 MavenArtifactUrlReference karafUrl =
CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.0.0").type("tar.gz");

 return new Option[]{
KarafDistributionOption.karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache
Karaf").
 unpackDirectory(new
File("target/paxexam/unpack")).useDeployFolder(false),
 KarafDistributionOption.keepRuntimeFolder(),

 CoreOptions.keepCaches(),

CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),

 // TODO define settings.xml if behind a proxy

 CoreOptions.systemTimeout(0),

CoreOptions.vmOptions("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),

KarafDistributionOption.editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK,
"equinox"),
 // disable JMX RBAC security, thanks to the KarafMBeanServerBuilder

KarafDistributionOption.configureSecurity().disableKarafMBeanServerBuilder(),
 KarafDistributionOption.logLevel(LogLevel.INFO)
 };
 }

 @Test
 public void simpleTest() {
 try {
 Thread.sleep(5000);
 } catch (InterruptedException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 LOGGER.info("++++ Executing the test!!!!");
 Assert.assertNotNull(bundleContext);
 }
} 

On 2015-07-28 07:31, Achim Nierbeck wrote: 

> Hi David, 
> 
> taken from your stacktrace I can see you seem to use TestNG, 
> could you try convert the test to JUnit. I'm not so sure about how good TestNG always runs with Pax-Exam. 
> 
> regards, Achim
 

Re: Pax Exam testing error

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi David,

taken from your stacktrace I can see you seem to use TestNG,
could you try convert the test to JUnit. I'm not so sure about how good
TestNG always runs with Pax-Exam.

regards, Achim


2015-07-28 13:20 GMT+02:00 <de...@mobigov.com>:

>
>
> Hello all,
>
>   I am getting an RMI exception when trying to run Pax Exam.  I have seen
> email threads with the same error in the past that suggested a Thread.sleep
> but that did not seem to help.  My error is below.
>
>
>
> [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for
> remote bundle context.. on 21000 name: f5fd2beb-738f-429c-9928-ec8abec7719a
> timout: [ RelativeTimeout value = 30000 ]
> Listening for transport dt_socket at address: 5005
> [org.ops4j.pax.exam.testng.listener.PaxExam] : Exception
> java.lang.RuntimeException: Cannot get the remote bundle context
>     at
> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:255)
>     at
> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
>     at
> org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
>     at
> org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
>     at
> org.ops4j.pax.exam.testng.listener.PaxExam.runByDriver(PaxExam.java:458)
>     at org.ops4j.pax.exam.testng.listener.PaxExam.run(PaxExam.java:308)
>     at
> org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:208)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:635)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
>     at
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
>     at org.testng.TestRunner.privateRun(TestRunner.java:773)
>     at org.testng.TestRunner.run(TestRunner.java:623)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:259)
>     at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>     at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
>     at org.testng.TestNG.run(TestNG.java:1018)
>     at
> org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
>     at
> org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:129)
>     at
> org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:113)
>     at
> org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>     at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Caused by: java.rmi.NotBoundException: f5fd2beb-738f-429c-9928-ec8abec7719a
>     at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
>     at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
>     at
> sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
>     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
>     at sun.rmi.transport.Transport$1.run(Transport.java:177)
>     at sun.rmi.transport.Transport$1.run(Transport.java:174)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
>     at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
>     at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
>     at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:745)
>     at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
>     at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
>     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
>     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>     at
> org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
>
> Thank you for any help that can be provided,
>
>   David
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Pax Exam testing error

Posted by de...@mobigov.com.
 

Hello all, 

 I am getting an RMI exception when trying to run Pax Exam. I have seen
email threads with the same error in the past that suggested a
Thread.sleep but that did not seem to help. My error is below. 

[org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting for
remote bundle context.. on 21000 name:
f5fd2beb-738f-429c-9928-ec8abec7719a timout: [ RelativeTimeout value =
30000 ]
Listening for transport dt_socket at address: 5005
[org.ops4j.pax.exam.testng.listener.PaxExam] : Exception
java.lang.RuntimeException: Cannot get the remote bundle context
 at
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:255)
 at
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:578)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:230)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:180)
 at
org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
 at
org.ops4j.pax.exam.testng.listener.PaxExam.runByDriver(PaxExam.java:458)
 at org.ops4j.pax.exam.testng.listener.PaxExam.run(PaxExam.java:308)
 at
org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:208)
 at org.testng.internal.Invoker.invokeMethod(Invoker.java:635)
 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
 at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
 at org.testng.TestRunner.privateRun(TestRunner.java:773)
 at org.testng.TestRunner.run(TestRunner.java:623)
 at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
 at org.testng.SuiteRunner.run(SuiteRunner.java:259)
 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
 at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
 at org.testng.TestNG.run(TestNG.java:1018)
 at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
 at
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:129)
 at
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:113)
 at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
 at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
 at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
 at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.rmi.NotBoundException:
f5fd2beb-738f-429c-9928-ec8abec7719a
 at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:136)
 at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
 at
sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
 at sun.rmi.transport.Transport$1.run(Transport.java:177)
 at sun.rmi.transport.Transport$1.run(Transport.java:174)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
 at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
 at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
 at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
 at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
 at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
 at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
 at
org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)


Thank you for any help that can be provided, 

 David 

Re: testing web page points to possibly obsolete information for 4.0.0

Posted by Achim Nierbeck <bc...@googlemail.com>.
The karaf container moved from the karaf project to pax-exam where it
actually fits better.
Therefore the right artifact to use is:

<dependency>
    <groupId>org.ops4j.pax.exam</groupId>
    <artifactId>pax-exam-container-karaf</artifactId>
    <version>4.5.0</version>
    <scope>test</scope>
</dependency>

regarding the provision of a kar in a test.
As a KAR is a specialized deployment for features there is no extra way of
testing a standalone KAR.
Actually it should be enough to test the feature which defines the content
of the KAR file.

regards, Achim


2015-07-27 17:51 GMT+02:00 <de...@mobigov.com>:

>  Was there ever an answer for what repo to point to in order to get the
> 4.0 version of
> org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container or
> should we be using the 3.0 version for karaf 4.0 as well.
>
> Thanks for any help,
>
>   David
>
>
> On 2015-07-24 12:12, Benson Margulies wrote:
>
> The answer is:
>
> <dependency>
>     <groupId>org.ops4j.pax.exam</groupId>
>     <artifactId>pax-exam-container-karaf</artifactId>
>     <version>4.5.0</version>
>     <scope>test</scope>
> </dependency>
>
> The next question is: how do I provision a kar into here?
>
> On Fri, Jul 24, 2015 at 12:07 PM, Benson Margulies <be...@basistech.com> wrote:
>
> https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html
> This talks about
> org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container which
> has not been released since a 3.0.0 RC. Are the coordinates wrong?
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: testing web page points to possibly obsolete information for 4.0.0

Posted by de...@mobigov.com.
 

Was there ever an answer for what repo to point to in order to get the
4.0 version of
org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container or
should we be using the 3.0 version for karaf 4.0 as well. 

Thanks for any help, 

 David 

On 2015-07-24 12:12, Benson Margulies wrote: 

> The answer is:
> 
> <dependency>
> <groupId>org.ops4j.pax.exam</groupId>
> <artifactId>pax-exam-container-karaf</artifactId>
> <version>4.5.0</version>
> <scope>test</scope>
> </dependency>
> 
> The next question is: how do I provision a kar into here?
> 
> On Fri, Jul 24, 2015 at 12:07 PM, Benson Margulies <be...@basistech.com> wrote:
> 
>> https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html [1] This talks about org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container which has not been released since a 3.0.0 RC. Are the coordinates wrong?
 

Links:
------
[1]
https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html

Re: testing web page points to possibly obsolete information for 4.0.0

Posted by Benson Margulies <be...@basistech.com>.
The answer is:

<dependency>
    <groupId>org.ops4j.pax.exam</groupId>
    <artifactId>pax-exam-container-karaf</artifactId>
    <version>4.5.0</version>
    <scope>test</scope>
</dependency>

The next question is: how do I provision a kar into here?

On Fri, Jul 24, 2015 at 12:07 PM, Benson Margulies <be...@basistech.com> wrote:
> https://karaf.apache.org/manual/latest/developers-guide/writing-tests.html
>
> This talks about
>
> org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container
>
> which has not been released since a 3.0.0 RC. Are the coordinates wrong?