facebook

GWT 2.1 and Spring Scaffolding: error starting app

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #321813 Reply

    Javier
    Member

    Hi,

    I just followed the GWT 2.1 and Spring Scaffolding guide to create a new CRUD application. I am working on OS X Lion, MyEclipse for Spring 10.

    When I try to start the application in MyEclipse Tomcat I get the following exception:

    2011-12-18 18:51:58,426 ERROR [main] ContextLoader – Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: es.parsec.crsys.admin.user.service.AgenciesGWTAdapter; nested exception is java.io.FileNotFoundException: class path resource [com/google/web/bindery/requestfactory/shared/Locator.class] cannot be opened because it does not exist
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:195)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:142)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.io.FileNotFoundException: class path resource [com/google/web/bindery/requestfactory/shared/Locator.class] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)
    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:45)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:110)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:85)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:191)

    I see com/google/web/bindery/requestfactory/shared/Locator.class is in get-user.jar which is correctly deployed under WEB-INF/lib

    Can anybody give a clue about this error ?

    Thanks,

    Javier

    #321831 Reply

    cconway
    Member

    Hi Javier,

    The class should be picked up at runtime from a jar named gwt-servlet.jar. If you look in your project’s WEB-INF/lib directory inside the Package Explorer view, you should see gwt-servlet.jar.

    If you don’t see it under WEB-INF/lib in Package Explorer, then likely the project was not configured to Launch and deploy from the WebRoot directory when the Google support was added. To check that, perform these steps:

    1. Right-click on the project and select Properties.
    2. Expand the Google node on the left.
    3. Select the Web Application node.
    4. In the properties page on the right, make sure the “Launch and deploy from this directory” box is checked.

    Unfortunately, the jar is only copied to WEB-INF/lib when the Google Web Toolkit is configured on the project. If it was not checked when you enabled the Google Web Toolkit, the jar will not be copied so you’ll have to manually put it there. You can find it inside the GWT 2.4.0 SDK.

    Please let me know if this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: GWT 2.1 and Spring Scaffolding: error starting app

You must be logged in to post in the forum log in