That's the method i use and that throws the Exception



James Carman wrote:

You can call getServiceIds( Class serviceInterface ) on the registry to get
all service ids which implement that interface.


-----Original Message-----
From: Jean-Yves Sironneau [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 7:11 PM
To: [email protected]
Subject: Re: Several services implementations

Hello,

I added again hivemind-lib to my classpath and i know get the following error, i guess it's normal as i don't have spring jars in my classpath. Do you know a way to get a list of services implementing a given interface or an interface extending it (i think a factory like the tapestry validators one is quite complicated for what i need) ?

Thank you.

Jean-Yves


org.apache.hivemind.ApplicationRuntimeException: Unable to find interface org.springframework.beans.factory.BeanFactory (for service hivemind.lib.DefaultSpringBeanFactory). [jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/hivemind-lib-1.1-be ta-2.jar!/META-INF/hivemodule.xml, line 121, column 106] at org.apache.hivemind.impl.ServicePointImpl.lookupDeclaredInterface(ServicePoi
ntImpl.java:132)
at org.apache.hivemind.impl.ServicePointImpl.getDeclaredInterface(ServicePointI
mpl.java:110)
at org.apache.hivemind.impl.ServicePointImpl.lookupServiceInterface(ServicePoin
tImpl.java:142)
at org.apache.hivemind.impl.ServicePointImpl.getServiceInterface(ServicePointIm
pl.java:102)
at org.apache.hivemind.impl.RegistryInfrastructureImpl.getServiceIds(RegistryIn
frastructureImpl.java:591)
at org.apache.hivemind.impl.RegistryImpl.getServiceIds(RegistryImpl.java:107) at org.jys.jphotowiki.content.ProcessorFactory.getMetaDataExtractor(ProcessorFa
ctory.java:20)
at org.jys.jphotowiki.testing.tests.TestContentProcessing.testExifPreserved(Tes
tContentProcessing.java:55)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)
Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to convert type 'org.springframework.beans.factory.BeanFactory' to a Java class, either as is, or in package org.apache.hivemind.lib.
   at org.apache.hivemind.impl.ModuleImpl.resolveType(ModuleImpl.java:197)
at org.apache.hivemind.impl.ServicePointImpl.lookupDeclaredInterface(ServicePoi
ntImpl.java:128)
   ... 24 more




[EMAIL PROTECTED] wrote:

Yes you're right i was getting an error related to module definitions in
hivemind-lib that's why i tried without it but then i forgot, i have to
post
the actual error.

Selon Achim Huegen <[EMAIL PROTECTED]>:



Sounds like the hivemind-lib.jar is not in your classpath.
Can you check that?

Achim

Jean-Yves Sironneau wrote:
Hello,

I'am getting into an issue and i guess it's a design problem, but i
can't see why :

I have an interface that services should implement  :

public interface IContentProcessor {
   public boolean isDocumentClassSupported(Class<? extends IDocument>
documentClass);

 public boolean isContentClassSupported(Class<? extends IDocument>
contentClass);
   public void process(IDocument document);
}

And i have several implementations of this interface, so basically my
module definition looks like :

<service-point id="ThumbnailCreator"
interface="org.jys.jphotowiki.content.IContentProcessor">
 <invoke-factory>
   <construct class="org.jys.jphotowiki.content.ThumbnailProcessor">
       <set property="thumbnailSize" value="50"/>
   </construct>
 </invoke-factory>
</service-point>

<service-point id="MetaDataExtractor"
interface="org.jys.jphotowiki.content.IContentProcessor">
 <invoke-factory>
   <construct class="org.jys.jphotowiki.content.MetaDataExtractor"/>
 </invoke-factory>
</service-point>

<service-point id="RotateLeftProcessor"
interface="org.jys.jphotowiki.content.IContentProcessor">
 <invoke-factory>
   <construct class="org.jys.jphotowiki.content.RotateProcessor">
       <set property="clockwise" value="false"/>
   </construct>
 </invoke-factory>
</service-point>

<service-point id="RotateRightProcessor"
interface="org.jys.jphotowiki.content.IContentProcessor">
 <create-instance
class="org.jys.jphotowiki.content.RotateProcessor,clockwise"/>
</service-point>


So i would like to dynamically get all of the services that implements
the interface, so i tried to call
getRegistry().getServiceIds(IContentProcessor.class) and i'am getting a
lots of errors :

#2005-08-11 02:03:20,138 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/hivemodule.xml,


line 23, column 57: Required module hivemind.lib does not exist.
#2005-08-11 02:03:20,353 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.props.xml,


line 24, column 94: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
#2005-08-11 02:03:20,356 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.props.xml,


line 105, column 99: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
#2005-08-11 02:03:20,357 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.enhance.xml,


line 58, column 91: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
#2005-08-11 02:03:20,359 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.listener.xml,


line 36, column 79: Unable to resolve reference to schema
'hivemind.lib.Pipeline'.
#2005-08-11 02:03:20,361 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.asset.xml,


line 83, column 95: Unable to resolve reference to schema
'hivemind.lib.StrategyRegistry'.
#2005-08-11 02:03:20,363 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.form.translator.xml,


line 23, column 90: Unable to resolve reference to schema
'hivemind.lib.BeanFactoryContribution'.
#2005-08-11 02:03:20,376 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.init.xml,


line 32, column 96: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
#2005-08-11 02:03:20,378 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.request.xml,


line 91, column 94: Unable to resolve reference to schema
'hivemind.lib.Pipeline'.
#2005-08-11 02:03:20,379 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.request.xml,


line 122, column 90: Unable to resolve reference to schema
'hivemind.lib.Pipeline'.
#2005-08-11 02:03:20,381 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.valid.xml,


line 23, column 90: Unable to resolve reference to schema
'hivemind.lib.BeanFactoryContribution'.
#2005-08-11 02:03:20,382 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.describe.xml,


line 22, column 92: Unable to resolve reference to schema
'hivemind.lib.StrategyRegistry'.
#2005-08-11 02:03:20,384 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.describe.xml,


line 73, column 87: Unable to resolve reference to schema
'hivemind.lib.StrategyRegistry'.
#2005-08-11 02:03:20,388 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.page.xml,


line 139, column 95: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
#2005-08-11 02:03:20,394 ERROR

org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.java
:37)


- Error at

jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-3
.jar!/META-INF/tapestry.page.xml,


line 188, column 100: Unable to resolve reference to schema
'hivemind.lib.ChainContribution'.
org.apache.hivemind.ApplicationRuntimeException: Unable to find
interface org.apache.hivemind.lib.BeanFactory (for service
tapestry.valid.ValidatorBeanFactory).

[jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta-
3.jar!/META-INF/tapestry.valid.xml,


line 33, column 92]

So i think there are some issues regarding the tapestry hivemind
modules, and as every module is processed  i think  i'am trying to do
something that do not make sense at all.

What do you think ? Doesn't an interface can be implemented by several
services ?

Thanks

Jean-Yves

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Jean-Yves Sironneau
[EMAIL PROTECTED]
06.16.18.71.63

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to