Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gyrex-dev] NullPointer in ApplicationResourceServlet

Hi,

got some troubles with the ApplicationResourceServlet. But i am not sure if it is a wrong config by me or a bug.

I am registering a resourceProvider at the application context. So far everything is fine.

        // register
        VaadinResourceProvider resourceProvider = new VaadinResourceProvider(
                VaadinActivator.getInstance().getBundle());
        getApplicationContext().registerResources(RESOURCE_BASE, RESOURCE_BASE,
                resourceProvider);


But if i call the url and the
ApplicationResourceServlet looks for the resource a NPE is thrown since DefaultServlet#init() was never called and so the _mimeType is NULL.

static ServletHolder newHolder(final ApplicationHandler applicationHandler) {
        final ServletHolder defaultServlet = new ServletHolder(new ApplicationResourceServlet(applicationHandler));
        if (Platform.inDevelopmentMode()) {
            defaultServlet.setInitParameter("dirAllowed", "true");
            defaultServlet.setInitParameter("useFileMappedBuffer", "f.....

It tried to fix it by calling the initMethod but could not find a way to fix the problem.

Did i miss something in registering the resource or it is a bug?

Thanks, Florian

Back to the top