Hi there,
I struggle probably with the most simple problem for you: I've got an
application class which serves as kind of a main application, and a resource
manager that should be loaded as a service or component. The application is
one build, and the resource manager is separated into api and impl build.
I've introduced a ractor goal "maven all:jar:install" which does the
"jar:install" for all three builds. When running "maven -execute
target\*.jar -repository %MAVEN_HOME%/repository" I get a "unresolvable
service dependency". That's simply because I do not understand how
dependencies are managed by the kernel(?). As far as I understand the error
messages (appended at the end), it's not a question of not being able to
download the artifact, but rather to resolve the mapping.
I try to figure out from the composition example how this works. I thought
at the beginning the mapping is made by first declaring the right service in
the @avalon.dependency tag of the application:
001 * @avalon.dependency key="resource-manager"
type="ch.xmatrix.resource.ResourceManager"
002 public class Application {
003 ...
And then the key is added to a block.xml of the ResourceManager
implementation like this:
001 <container name="resource-manager">
002 <services>
003 <service type="ch.xmatrix.resource.ResourceManager">
004 <source>info</source>
005 </service>
006 </services>
007 <classloader>
008 <classpath>
009 <repository>
010 <resource version="4.1.5"
011 id="avalon-framework:avalon-framework-api"/>
012 <resource version="4.1.5"
013 id="avalon-framework:avalon-framework-impl"/>
014 <resource version="1.0"
015 id="ups:ch.xmatrix.resource-api"/>
016 </repository>
017 </classpath>
018 </classloader>
019 <component name="facade"
020 class="ch.xmatrix.resource.HierarchialResourceManagerFacade"/>
021 </container>
The container-name attribute is identical to the Avalon.dependency-key
attribute. As this did not work, I found another bit in the composition
example matching the key: The xprofile corresponding to the implementation
of the ResourceManager interface, which I added too:
001 <?xml version="1.0"?>
002 <profiles>
003 <profile name="resource-manager">
004 <configuration>
005 <source>Paris</source>
006 </configuration>
007 </profile>
008 </profiles>
In my case the file is called HierarchialResourceManagerFacade.xprofile
located in the impl build. However, this does not work too.
Questions:
Is there a simple recipe to publish this dependency?
Do I have different strategies to do that?
Which of the above three "resource-manager" are really necessary to be
identically named to run? I have
- avalon.dependency-key
- container-name
- profile-name
I would appreciate any help to get a first successful start with merlin.
Thanks
Daniel Frey
-----------------------------------------------
E:\Daten\UPS\ch.xmatrix.application>merlin -execute target\*.jar
[INFO ] (kernel): installing:
file:/${user.dir}/target/ch.xmatrix.application-
1.0.jar
---- exception report
----------------------------------------------------------
Exception: org.apache.avalon.merlin.KernelException
Message: Kernel startup failure.
---- cause
---------------------------------------------------------------------
Exception: org.apache.avalon.merlin.KernelException
Message: Application assembly failure.
---- cause
---------------------------------------------------------------------
Exception: org.apache.avalon.activation.appliance.AssemblyException
Message: Assembly of appliance [/application/main-entry] could not be
completed
due to an unresolvable service dependency for the key [resource-manager].
---- cause
---------------------------------------------------------------------
Exception:
org.apache.avalon.activation.appliance.NoProviderDefinitionException
Message: Unable to resolve dependency: [resource-manager]
ch.xmatrix.resource.Re
sourceManager:1.0.0
---- stack trace
---------------------------------------------------------------
org.apache.avalon.activation.appliance.NoProviderDefinitionException: Unable
to
resolve dependency: [resource-manager]
ch.xmatrix.resource.ResourceManager:1.0.0
org.apache.avalon.activation.appliance.impl.AbstractBlock.locate(AbstractBlo
ck.j
ava:313)
org.apache.avalon.activation.appliance.impl.AbstractBlock.locate(AbstractBlo
ck.j
ava:305)
org.apache.avalon.activation.appliance.impl.AbstractBlock.locate(AbstractBlo
ck.j
ava:251)
org.apache.avalon.activation.appliance.impl.DefaultAppliance.assemble(Defaul
tApp
liance.java:360)
org.apache.avalon.activation.appliance.impl.AbstractBlock.assemble(AbstractB
lock
.java:570)
org.apache.avalon.activation.appliance.impl.AbstractBlock.assemble(AbstractB
lock
.java:570)
org.apache.avalon.merlin.impl.DefaultKernel.startup(DefaultKernel.java:395)
org.apache.avalon.merlin.impl.DefaultFactory.create(DefaultFactory.java:549)
org.apache.avalon.merlin.cli.Main.<init>(Main.java:329)
org.apache.avalon.merlin.cli.Main.main(Main.java:281)
----------------------------------------------------------------------------
----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]