|
How are you getting these two different
classloaders? Can you try printing out the classloaders at each point
(registry creation and when you ask for the service) so that we can verify that
you are actually using the exact same one (print out there “identity hashcode”)?
From: GUMMOW JR,
DONALD R [AG/1000] [mailto:[EMAIL PROTECTED] --> James, thanks for the response. I've tried this, making sure that
the classloader I pass into DefaultClassResolver is the same as the loader
reported for the interface that I later pass into registry.getService( ) - but
am still getting the app run-time exception: org.apache.hivemind.ApplicationRuntimeException: Service
com.monsanto.tcc.domain.Item does not implement the requested interface
(com.monsanto.tcc.domain.Item). The declared service interface type is
com.monsanto.tcc.domain.Item.
[./com/monsanto/tcc/domain/service/descriptor/domainServices.xml, line 53, column
101]
at
org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:226)
at
org.apache.hivemind.impl.RegistryInfrastructureImpl.getService(RegistryInfrastructureImpl.java:242)
at org.apache.hivemind.impl.RegistryImpl.getService(RegistryImpl.java:73)
at
com.monsanto.tcc.domain.service.impl.DomainRepositoryServiceImpl.getRepository(DomainRepositoryServiceImpl.java:62) ... I don't see any place else in the API where you can inject a
ClassLoader, but the "does not implement the requested interface"
really does seem to be loader related, since it all works just fine in the UT. Any good ideas on how to proceed from here? Thanks, ...Don -----Original Message----- You need to build your
registry differently... RegistryBuilder builder =
new RegistryBuilder(); builder.addModuleDescriptorProvider(
new XmlModuleDescriptorProvider( new DefaultClassResolver( MY_CLASSLOADER ) )
); Registry reg =
builder.constructRegistry( Locale.getDefaultLocale() ); That code's off the top
of my head, so the method names may be changed. Also, this is HiveMind
1.1 code. From: GUMMOW
JR, DONALD R [AG/1000] [mailto:[EMAIL PROTECTED] Hello - I've got a
situation where the service interface and
implementation
classes
use a different class loader than the default loader for the registry,
and I'm getting an
ApplicationRuntimeException when I call to registry.getService(
) telling me that the service does not implement the requested
interface. (The code works perfectly in my unit test, where both
are using the same classloader.) Does anyone have any tips on how
this situation should be approached within HiveMind? Regards, ...Don This e-mail message may contain
privileged and/or confidential information, and is intended to be received only
by persons entitled to receive such information. If you have received this e-mail
in error, please notify the sender immediately. Please delete it and all
attachments from any servers, hard drives or any other media. Other use of this
e-mail by you is strictly prohibited. All e-mails and attachments sent and
received are subject to monitoring, reading and archival by Monsanto. The
recipient of this e-mail is solely responsible for checking for the presence of
"Viruses" or other "Malware". Monsanto accepts no liability
for any damage caused by any such code transmitted by or accompanying this
e-mail or any attachment. This e-mail message may contain privileged and/or confidential
information, and is intended to be received only by persons entitled to receive
such information. If you have received this e-mail in error, please notify the
sender immediately. Please delete it and all attachments from any servers, hard
drives or any other media. Other use of this e-mail by you is strictly
prohibited. All e-mails and attachments sent and received are subject to monitoring,
reading and archival by Monsanto. The recipient of this e-mail is solely
responsible for checking for the presence of "Viruses" or other
"Malware". Monsanto accepts no liability for any damage caused by any
such code transmitted by or accompanying this e-mail or any attachment. |
Title: Classloaders and Registry
- Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- RE: Classloaders and Registry James Carman
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- RE: Classloaders and Registry James Carman
- Re: Classloaders and Registry Johan Lindquist
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- Re: Classloaders and Registry Johan Lindquist
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- Re: Classloaders and Registry Johan Lindquist
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- Re: Classloaders and Registry Johan Lindquist
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- RE: Classloaders and Registry GUMMOW JR, DONALD R [AG/1000]
- Re: Classloaders and Registry Johan Lindquist
