Simon,

Contributions to hivemind.Startup must implement java.lang.Runnable (and if
the contribution is a service, its service interface must be
java.lang.Runnable). The void run() method will then be invoked on registry
startup.

Hope that helps,


Paul

-----Original Message-----
From: Simon Raveh [mailto:[EMAIL PROTECTED]
Sent: 30 May 2006 23:59
To: [email protected]
Subject: [Maybe Spam] ClassCastException


Hi,

I'm new to HiveMind so please  forgive  me if this  is a very simple  
(stupid mistake)
I'm integrating Spring and  HiveMind  in a development of  a web 
application. I have a service that should run as a startup service.

I'm getting Class cast exception when I start jetty

Any help will be appreciated

**********************************************************


java.lang.ClassCastException: $AppInitializer_10b8782744e
org.apache.hivemind.impl.StartupImpl.run(StartupImpl.java:43)
$Runnable_10b87827433.run($Runnable_10b87827433.java)
$Runnable_10b87827432.run($Runnable_10b87827432.java)
org.apache.hivemind.impl.RegistryInfrastructureImpl.startup(RegistryInfrastr
uctureImpl.java:436)
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.j
ava:154)
org.apache.tapestry.ApplicationServlet.constructRegistry(ApplicationServlet.
java:253)
org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:194)
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383)
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243)
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.j
ava:446)
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplic
ationHandler.java:321)
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContex
t.java:509)
org.mortbay.util.Container.start(Container.java:72)
org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
org.mortbay.util.Container.start(Container.java:72)
org.iana.rzm.Main.start(Main.java:33)
org.iana.rzm.Main.main(Main.java:21)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

**********************************************************



 The HiveMind configuration file:

<module id="rzm" version="1.0.0" package="test.rzm.startup">

    <service-point id="Startup" interface="test.rzm.startup.AppInitializer">
        <invoke-factory>
            <construct class="test.rzm.startup.AppInitializerImpl">
                <set-object property="context" 
value="service:hivemind.lib.SpringBeanFactoryHolder" />
            </construct>
        </invoke-factory>
    </service-point>

    <contribution configuration-id="hivemind.Startup">
        <startup object="service:Startup"/>
    </contribution>

</module>
 
The service interface

public interface AppInitializer {
    public void initialize();
}

The service implementation is

public class AppInitializerImpl implements AppInitializer {
    private SpringBeanFactoryHolder context;

    public void initialize() {
        //initialization code goes here
    }

    public void setContext(SpringBeanFactoryHolder beanHolder) {
        this.context = beanHolder;
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail (and any attachments) may contain privileged and/or confidential 
information. If you are not the intended recipient please do not disclose, 
copy, distribute, disseminate or take any action in reliance on it. If you have 
received this message in error please reply and tell us and then delete it. 
Should you wish to communicate with us by e-mail we cannot guarantee the 
security of any data outside our own computer systems. For the protection of 
Legal & General's systems and staff, incoming emails will be automatically 
scanned.

Any information contained in this message may be subject to applicable terms 
and conditions and must not be construed as giving investment advice within or 
outside the United Kingdom.

The following companies are subsidiary companies of the Legal & General Group 
Plc which are authorised and regulated by the Financial Services Authority for 
advising and arranging the products shown: Legal & General Partnership Services 
Limited (insurance and mortgages), Legal & General Insurance Limited 
(insurance), Legal & General Assurance Society Limited 
(life assurance, pensions and investments), Legal & General Unit Trust Managers 
Limited and Legal & General Portfolio Management Services Limited (investments).

They are registered in England under numbers shown.
The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 
4TP.

Legal & General Partnership Services Limited: 5045000 Legal & General Assurance 
Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 
Legal & General (Portfolio Management Services) Limited: 2457525 Legal & 
General Insurance Limited: 423930

They are registered with the Financial Services Authority under numbers shown. 
You can check this at www.fsa.gov.uk/register

Legal & General Partnership Services Limited: 300792 Legal & General Assurance 
Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 
Legal & General (Portfolio Management Services) Limited: 146786 Legal & General 
Insurance Limited: 202050


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to