hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Wannheden <knut.wannhe...@gmail.com>
Subject Re: Ant and hivemind ( classpath problem probably )
Date Thu, 02 Feb 2006 08:55:07 GMT
Aleksej,

I assume that the error messages pertain to one of your own service
points. Or is it HiveMind internal services?

The only thing I can see is that you're using the thread context
classloader for HiveMind's module descriptors (and any other
"META-INF/hivemodule.xml" descriptors) and the system classloader for
your own "hivemodule.xml" descriptors. You could try using the same
classloader for all descriptors.

I.e. in your code either change the line:

  ClassLoader classLoader= ClassLoader.getSystemClassLoader();

to:

  ClassLoader classLoader= Thread.currentThread().getContextClassLoader();

or change the line:

  registryBuilder.addDefaultModuleDescriptorProvider();

to:

  registryBuilder.addModuleDescriptorProvider(new
XmlModuleDescriptorProvider(classResolver));

HTH,

--knut

On 2/2/06, Aleksej <aleksej@ivs.lt> wrote:
> Hi.
> I got such situation:
> When I run my application from eclipse everything works fine.
> Registry is created, Log4j is initialized and all services working, but
> when I run the same application from ANT, I got  "There is no service
> point for interface XXX".
> The only one idea for me is that my "hivemodule.xml" can't be found on
> classpath, but I can't
> understand why. I tried to copy it into the same directory where my
> log4j.properties are but
> with the same result. The strangest thing about it is that running from
> eclipse everything works fine.
> The code that constructs Registry looks like:
> <code>
> RegistryBuilder registryBuilder= new RegistryBuilder();
> ClassLoader classLoader= ClassLoader.getSystemClassLoader();
> ClassResolver classResolver= new DefaultClassResolver( classLoader );
> ModuleDescriptorProvider moduleDescriptorProvider= new
> XmlModuleDescriptorProvider( classResolver, "hivemodule.xml" );
> registryBuilder.addModuleDescriptorProvider( moduleDescriptorProvider );
> registryBuilder.addDefaultModuleDescriptorProvider();
> Locale locale= Locale.getDefault();
> registry= registryBuilder.constructRegistry( locale );
> </code>
> I also was testing is "hivemodule.xml" file accessible from classpath
> and yes, it was, so I am out of ideas.
> Any help?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>

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


Mime
View raw message