commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian (SerpentMage)" <mail...@devspace.com>
Subject Problem with Discovery...
Date Wed, 09 Apr 2003 14:27:27 GMT
I have been trying to get my discovery sample code running and I am 
entirely preplexed as to why it does not work.

Consider the following code...
         ClassLoaders loaders = 
ClassLoaders.getAppLoaders(InterfaceToBeShared.class, getClass(), false);

         DiscoverClass discover = new DiscoverClass(loaders);
         Class implClass = discover.find(InterfaceToBeShared.class);

In the same package I have an implementation of the interface.  Basically 
the code mimics what the test application does.  I try and try and I cannot 
get the code to work.  I experimented with the classpaths and nothing seems 
to work.  Could somebody please enlighten me on how this is supposed to 
work.  BTW I did debug through the sources and here is a log dump:

[DEBUG] DiscoveryLogFactory - -Class meets requirements: 
org.apache.commons.discovery.tools.ClassUtils
[DEBUG] DiscoveryLogFactory - -Class meets requirements: 
org.apache.commons.discovery.resource.names.DiscoverNamesInFile
[DEBUG] DiscoveryLogFactory - -Class meets requirements: 
org.apache.commons.discovery.resource.DiscoverResources
[DEBUG] DiscoverNamesInFile - -find: 
fileName='META-INF/services/com.devspace.jseng.create.InterfaceToBeShared'
[DEBUG] DiscoverResources - -find: 
resourceName='META-INF/services/com.devspace.jseng.create.InterfaceToBeShared'
[DEBUG] DiscoveryLogFactory - -Class meets requirements: 
org.apache.commons.discovery.resource.classes.DiscoverClasses
[DEBUG] DiscoverResources - -getNextResources: search using ClassLoader 
'sun.misc.Launcher$AppClassLoader@4b222f'
[DEBUG] DiscoverResources - -getNextResources: search using ClassLoader 
'sun.misc.Launcher$AppClassLoader@4b222f'
[DEBUG] DiscoverResources - -getNextResources: search using ClassLoader 
'sun.misc.Launcher$AppClassLoader@4b222f'
[DEBUG] DiscoverResources - -getNextResources: search using ClassLoader 
'sun.misc.Launcher$AppClassLoader@4b222f'

Thanks...

Christian Gross


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message