On Fri, Jun 11, 2010 at 3:24 AM, Eshan Sudharaka <[email protected]>wrote:

> I tried to get some services from the DefaultMetaDataResolver class. Since
> i
> dont have following objects it is throwing nul pointer exceptions.
>   * private MetadataRepository metadataRepository;
>  * private StorageMetadataResolver storageResolver;
>
> stack trace :
>  java.lang.NullPointerException
>    at
>
> org.apache.archiva.metadata.repository.DefaultMetadataResolver.getRootNamespaces(DefaultMetadataResolver.java:122)
>
> As deng mentioned those objects are injected by plexes by the
> @plexus.requirement annotation. But here that annotation is commented. But
> in components.xml  i saw those objects as reqiurements.
>
> Here actually I want to know how do we inject those objects when we are
> using that DefaultMetadataResolver class in another module.?
>

Did you add the @plexus.requirement annotation for the MetadataResolver
variable declaration in your class? The components of the MetadataResolver
class should have already been injected.

Thanks,
Deng

Reply via email to