Hi,
Some strange artifact resolution behaviour is driving me crazy, and
after about three days of struggling I think I have the symptoms
figured out. First of all, if trying to deploy an opstring that
specifies only a JavaSpace (outrigger) instance to be deployed, does
not work. For example:
deployment(name: 'Standalone space')
{
groups System.getProperty(Constants.GROUPS_PROPERTY_NAME,
System.getProperty('
user.name'))
artifact id: 'outrigger-impl', 'com.sun.jini:outrigger:2.1'
artifact id: 'outrigger-dl', 'com.sun.jini:outrigger:jar:dl:2.1'
service(name: 'Space')
{
interfaces {
classes 'net.jini.space.JavaSpace05'
artifact ref: 'outrigger-dl'
}
implementation(class:
'com.sun.jini.outrigger.TransientOutriggerImpl') {
artifact ref: 'outrigger-impl'
}
maintain 1
}
}
Always fails with (even though outrigger is present in my local
repository):
org.rioproject.resolver.ResolverException: Could not find artifact
com.sun.jini:outrigger:jar:2.1 in central (
http://repo1.maven.org/
maven2/)
at
org.rioproject.resolver.aether.AetherResolver.getClassPathFor(AetherResolver.java:
92)
at org.rioproject.resolver.ResolverHelper.resolve(ResolverHelper.java:
99)
at org.rioproject.resolver.ResolverHelper.resolve(ResolverHelper.java:
75)
at
org.rioproject.cybernode.ServiceBeanLoader.provisionService(ServiceBeanLoader.java:
507)
at
org.rioproject.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:
259)
at org.rioproject.cybernode.JSBDelegate$1.run(JSBDelegate.java:534)
I don't fully understand the artifact resolution yet, but here is my
take on it: If, in addition to my space, I deploy a number of workers
(via something like:)
service(name: 'Worker')
{
implementation(class: "foo.bar.Worker") {
artifact ref: 'worker-impl'
}
association(type: "requires",
serviceType: JavaSpace05.name,
property: "javaSpace", name: "Space")
maintain 1
}
The space does still not deploy. The POM for the maven artifact
'worker-impl' in this case, does have a reference to the Rio
repository (that hosts outrigger) but it is ignored. However, as soon
as I deploy something that exposes an interface, e.g.:
service(name: 'Master')
{
interfaces {
classes 'org.rioproject.examples.workflow.Master'
artifact ref: 'master-dl'
}
implementation(class:
"org.rioproject.examples.workflow.MasterImpl") {
artifact ref: 'master-impl'
}
association(type: "requires",
serviceType: JavaSpace05.name,
property: "javaSpace", name: "Space")
maintain 1
}
where the POM for the artifact used in the 'interfaces' section -
'master-dl' - refers to the Rio Maven Repo, then the space deploys
fine. Even if I modify the above, and simply comment out the
'interfaces' section (but still launching the component), dependency
resolution for outrigger (and I suspect anything similar) again does
not work. In all cases, the declarations of the artifacts in the
deployment are left intact, i.e. even though they are not used, they
are still defined as children of the deployment.
This is very very subtle and non-intuitive, it seems that dependency
resolution (for unrelated services, e.g. such as for Outrigger) is
performed solely based on the POMs of artifacts containing the
interfaces that are exposed? I would have expected all declared
artifacts to have been taken into account, and not just the ones
actually used for exposed interfaces.
If I am missing some other mechanism to specify this, I would much
appreciate some guidance :-) This is on Rio 5.0-SNAPSHOT, of course.
This problem can easily be replicated by taking the standard Rio
workflow example opstring, and simply commenting out the Master
service (leaving the worker and space intact).
regards,
Dawid