If you use a mirror to resolve the artifact, and you don't have direct
access to Central and other default repository, then you have to define
the mirror repository in Karaf.
Regards
JB
On 06/21/2015 10:56 PM, Stephen Kahmann wrote:
When I add:
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.repositories",
"http://10.1.11.243:8082/nexus/content/groups/public/")
Then it works. Must be related to my ~/.m2/settings.xml file containing:
<mirrors>
<mirror>
<id>nexus</id>
<name>nexus</name>
<url>http://10.1.11.243:8082/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
Is this expected behavior? Is there a way to fix this without specifying
our nexus in the test?
Thanks!
Stephen
On 6/20/15, 7:50 PM, "Stephen Kahmann" <[email protected]>
wrote:
May be related to:
https://ops4j1.jira.com/browse/PAXURL-288
On 6/20/15, 6:23 PM, "Stephen Kahmann" <[email protected]>
wrote:
JB,
Thank you for your reply. Looks like the issue was in my pax-url-aether
version. I upgraded from 2.3.0 to 2.4.1 and it looks like I get a little
further. Now I am having an issue when Karaf starts:
2015-06-20 18:18:54,166 | WARN | FelixStartLevel | FeaturesServiceImpl
| 20 - org.apache.karaf.features.core - 3.0.3 | Unable to add
features repository mvn:org.ops4j.pax.exam/pax-exam-features/4.5.0/xml at
startup
java.io.IOException: Error resolving artifact
org.ops4j.pax.exam:pax-exam-features:xml:4.5.0: Could not find artifact
org.ops4j.pax.exam:pax-exam-features:xml:4.5.0
at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedRes
o
l
ver.java:487)
at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedRes
o
l
ver.java:433)
at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedRes
o
l
ver.java:411)
at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedRes
o
l
ver.java:386)
at
org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:
1
2
4)
at
org.apache.karaf.features.internal.FeatureValidationUtil.load(FeatureVali
d
a
tionUtil.java:93)
at
org.apache.karaf.features.internal.FeatureValidationUtil.validate(Feature
V
a
lidationUtil.java:58)
at
org.apache.karaf.features.internal.FeaturesServiceImpl.validateRepository
(
F
eaturesServiceImpl.java:162)
...
at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLeve
l
I
mpl.java:304)[org.apache.felix.framework-4.2.1.jar:]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_40]
2015-06-20 18:18:54,263 | ERROR | FelixStartLevel |
BootFeaturesInstaller
| 20 - org.apache.karaf.features.core - 3.0.3 | Error Boot
feature exam not found
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (3.0.3)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf@root()>
java.rmi.NotBoundException: 7fbbaa46-4dc1-4912-ae9b-da6b46ebf18f
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:166)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at
sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:410)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:268)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
...
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:
6
2)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Process finished with exit code 255
Thanks
Stephen
On 6/20/15, 2:49 PM, "Jean-Baptiste Onofré" <[email protected]> wrote:
Hi Stephen
the org.apache.karaf.tooling.exam is now deprecated and only valid for
Karaf 2.3.x.
If you use 2.4.x, 3.0.x (or 4.0.x), you can directly use pax-exam, which
provide now natively the Karaf container support.
You can take a look on Karaf or Cellar itest for example.
I will update the documentation.
For your issue, it's weird, it looks like pax-logging doesn't come with
Karaf. Please use the Karaf itest for sample.
Regards
JB
On 06/20/2015 07:36 PM, Stephen Kahmann wrote:
Hi,
I am trying to write integration tests for Karaf and I am following
https://karaf.apache.org/manual/latest/developers-guide/writing-tests.h
t
m
l.
That page says to include:
<dependency>
<groupId>org.apache.karaf.tooling.exam</groupId>
<artifactId>org.apache.karaf.tooling.exam.container</artifactId>
<version>3.0.3-SNAPSHOT</version>
<scope>test</scope>
</dependency>
But I can¹t find this dependency in Maven.
I also tried the guide here:
https://ops4j1.jira.com/wiki/display/PAXEXAM4/Karaf+Container:
@RunWith(PaxExam.class)
public classConfigurableMemoryRepositoryIT {
@Configuration
publicOption[]config() {
MavenArtifactUrlReference karafUrl =maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.version("3.0.3")
.type("tar.gz");
MavenUrlReference karafStandardRepo =maven()
.groupId("org.apache.karaf.features")
.artifactId("standard")
.classifier("features")
.version("3.0.3")
.type("xml");
return newOption[] {
karafDistributionConfiguration()
.frameworkUrl(karafUrl)
.unpackDirectory(newFile("target/exam"))
.useDeployFolder(false),
keepRuntimeFolder(),
features(karafStandardRepo,"scr"),
};
}
@Test
public voidtest()throwsException {
assertTrue(true);
}
}
But I am getting the following exception:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at
shaded.org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifie
r
.
java:89)
at
shaded.org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAl
l
H
ostnameVerifier.java:40)
at
shaded.org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSL
C
o
nnectionSocketFactory.java:124)
at
org.ops4j.pax.url.mvn.internal.HttpClients.createConnManager(HttpClient
s
.
java:70)
at
org.ops4j.pax.url.mvn.internal.HttpClients.createClient(HttpClients.jav
a
:
39)
at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.<init>(AetherBasedRe
s
o
lver.java:132)
at
org.ops4j.pax.url.mvn.MavenResolvers.createMavenResolver(MavenResolvers
.
j
ava:36)
at
org.ops4j.pax.url.mvn.MavenResolvers.createMavenResolver(MavenResolvers
.
j
ava:29)
at org.ops4j.pax.url.mvn.Handler.openConnection(Handler.java:50)
My pax-exam dependencies are attached.
Can anyone help with this?
Thanks
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com