Hello Thierry!

Thnx for answer. But unfortunately it's not the solution i'm looking for :))
My problem is not impossiblity to start restlet based service with spring.
My problem is that i can't start restlet services _in the way i want_.

The way i'm trying to accomplish is make Spring start all my applications components (including restlet) only using XML configuration.
Without writing _any_ glue code in main() method.
The final objective is make main() method of my application look exactly like this :)))

public static void main(String[] args) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("META-INF/spring.xml");
        ctx.registerShutdownHook();
}

Is there any way to achieve this goal in current implementation of Restlet ?
Thnx in advance !

Hello Evgeny,

could you try with the following code and attached xml file taken both
from the or.restlet.test package (class SpringTestCase) :

    public static void main(String[] args) {
        // Load the Spring container
        ClassPathResource resource = new ClassPathResource(
                "org/restlet/test/SpringTestCase.xml");
        BeanFactory factory = new XmlBeanFactory(resource);

        // Start the Restlet component
        Component component = (Component) factory.getBean("component");
        try {
            component.start();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
}

best regards,
Thierry Boileau



--
Best Regards
Evgeny K. Shepelyuk

Reply via email to