You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/08/27 05:20:09 UTC

Hivemind throwing an exception when the service interface is Regi stryShutdownListener

I'm trying to make a service who's whole job in life is to listen for a
registry shutdown and do something. Here is the hivemodule.xml snip.

    <service-point
     id="ControllerShutdown"
     interface="org.apache.hivemind.events.RegistryShutdownListener">
        <invoke-factory>
            <construct
             class="com.mckesson.lab.adept.ControllerShutdown">
                <set-service
                 property="controller"
                 service-id="com.mckesson.adept.Controller" />
            </construct>
        </invoke-factory>
    </service-point>

    <contribution
     configuration-id="hivemind.EagerLoad">
        <load
         service-id="ControllerShutdown" />
    </contribution>

I worked around this problem by making an empty interface and using that for
my service instead of the RegistyShutdownListener interface.

    <service-point
     id="ControllerShutdown"
     interface="com.mckesson.lab.adept.ControllerShutdown">
        <invoke-factory>
            <construct
             class="com.mckesson.lab.adept.ControllerShutdownImpl">
                <set-service
                 property="controller"
                 service-id="com.mckesson.adept.Controller" />
            </construct>
        </invoke-factory>
    </service-point>

I'm eager loading it and getting the following exception at registry
construction.

org.apache.hivemind.ApplicationRuntimeException: Attempt to redefine method
void registryDidShutdown() of class $SingletonProxy_fe9e3b7e00_14.
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxy(SingletonServiceModel.java:114)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getService(Singl
etonServiceModel.java:58)
	at
org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:1
71)
	at
org.apache.hivemind.impl.ServicePointImpl.forceServiceInstantiation(ServiceP
ointImpl.java:273)
	at
org.apache.hivemind.service.impl.EagerLoader.run(EagerLoader.java:39)
	at org.apache.hivemind.impl.StartupImpl.run(StartupImpl.java:38)
	at $InnerProxy_fe9e3b7d10_1.run($InnerProxy_fe9e3b7d10_1.java)
	at
$SingletonProxy_fe9e3b7c48_0.run($SingletonProxy_fe9e3b7c48_0.java)
	at
org.apache.hivemind.impl.RegistryImpl.startup(RegistryImpl.java:466)
	at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:417)
	at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
ilder.java:711)
	at
com.mckesson.lab.services.impl.CensusImplTest.testService(CensusImplTest.jav
a:72)
	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:324)
	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
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:421)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:305)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:186)
Caused by: org.apache.hivemind.ApplicationRuntimeException: Attempt to
redefine method void registryDidShutdown() of class
$SingletonProxy_fe9e3b7e00_14.
	at
org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:91
)
	at
org.apache.hivemind.impl.ProxyBuilder.addServiceMethods(ProxyBuilder.java:90
)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxyClass(SingletonServiceModel.java:169)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxy(SingletonServiceModel.java:89)
	... 26 more
org.apache.hivemind.ApplicationRuntimeException: Attempt to redefine method
void registryDidShutdown() of class $SingletonProxy_fe9e3b7f0f_29.
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxy(SingletonServiceModel.java:114)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getService(Singl
etonServiceModel.java:58)
	at
org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:1
71)
	at
org.apache.hivemind.impl.ServicePointImpl.forceServiceInstantiation(ServiceP
ointImpl.java:273)
	at
org.apache.hivemind.service.impl.EagerLoader.run(EagerLoader.java:39)
	at org.apache.hivemind.impl.StartupImpl.run(StartupImpl.java:38)
	at $InnerProxy_fe9e3b7eab_16.run($InnerProxy_fe9e3b7eab_16.java)
	at
$SingletonProxy_fe9e3b7ea1_15.run($SingletonProxy_fe9e3b7ea1_15.java)
	at
org.apache.hivemind.impl.RegistryImpl.startup(RegistryImpl.java:466)
	at
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:417)
	at
org.apache.hivemind.impl.RegistryBuilder.constructDefaultRegistry(RegistryBu
ilder.java:711)
	at
com.mckesson.lab.services.impl.CensusImplTest.testService2(CensusImplTest.ja
va:101)
	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:324)
	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
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:421)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:305)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:186)
Caused by: org.apache.hivemind.ApplicationRuntimeException: Attempt to
redefine method void registryDidShutdown() of class
$SingletonProxy_fe9e3b7f0f_29.
	at
org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:91
)
	at
org.apache.hivemind.impl.ProxyBuilder.addServiceMethods(ProxyBuilder.java:90
)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxyClass(SingletonServiceModel.java:169)
	at
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonP
roxy(SingletonServiceModel.java:89)
	... 26 more


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