Announcement Announcement Module
Collapse
No announcement yet.
Core Spring 3.0 class issue - FileNotFoundException: class path resource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Core Spring 3.0 class issue - FileNotFoundException: class path resource

    I'm developing an application using Spring 3.0 and attempting to run it on dm Server 2.0 M2. However, I keep getting java.io.FileNotFoundException: class path resource errors for a few core Spring classes: org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean and org/springframework/web/servlet/view/InternalResourceViewResolver.class


    ( I've even tried using a snapshot for the dm Server and upgrading the app to use Spring 3.0 M3, but it still doesn't work)

    Here is part of the stack:
    Code:
    <SPDE0020E> Application context creation failure for bundle 'dmserver.vehicle-1-dmserver.vehicle.repository.jpa-1.0.0.jar'.
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.class] cannot be opened because it does not exist
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127)
            at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
            at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
           source.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.FileNotFoundException: class path resource [org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.class] cannot be opened because it does not exist
            at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
            at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73)
            at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199)
            ... 17 more
    
    [2009-05-27 18:29:18.548] server-dm-7              <SPDE0020E> Application context creation failure for bundle 'dmserver.vehicle-1-dmserver.vehicle.repository.jpa-1.0.0.jar'.
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.class] cannot be opened because it does not exist
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127)
            at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
            at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
            at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
            at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
    
    [2009-05-27 18:29:19.012] server-dm-12             <SPDE0020E> Application context creation failure for bundle 'dmserver.vehicle-1-dmserver.vehicle.web-1.0.0.jar'.
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/view/InternalResourceViewResolver.class] cannot be opened because it does not exist
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127)
            at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98)
          org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
            at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
            at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/view/InternalResourceViewResolver.class] cannot be opened because it does not exist
            at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
            at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73)
      at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69)
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199)
            ... 17 more
    ClassBeanDefinition(ConfigurationClassPostProcessor.java:199)
    Not entirely familiar with Spring 3.0 backward compatibility to Spring 2.5, but after inspecting the Spring 3.0 JARs these class are included. So I'm inclined to think this is a dm Server issue.

  • #2
    We have found some issues in this area when Spring 3 is used in an OSGi environment. For example, SPR-5693, which has a similar, although not identical, symptom to what you're seeing. It looks like we haven't quite tracked down all of the problems in this area just yet.

    If you open a JIRA with an app that reproduces the problem then I'd be happy to take a look. We can then fix dm Server or work with Juergen to get a fix into Spring 3.

    Comment


    • #3
      Hi Andy,

      After some further testing on a clean dm 2.0 M2 installation and changing over to EclipseLink (instead of Hibernate) the missing class error went away, however, it appears I've now encountered another cloning bug. Here is the stack and deployment sequence, I'll open a JIRA with the app if confirmed.

      Code:
      2009-05-29 15:35:45.470] fs-watcher               <SPDE0048I> Processing 'INITIAL' event for file 'server.admin.splash-2.0.0.D-69.jar'.
      [2009-05-29 15:35:45.891] fs-watcher               <SPSC1000I> Creating web application '/'.
      [2009-05-29 15:35:45.970] async-delivery-thread-1  <SPSC1001I> Starting web application '/'.
      [2009-05-29 15:35:46.578] fs-watcher               <SPDE0010I> Deployment of 'com.springsource.server.servlet.splash' version '2.0.0.D-69' completed.
      [2009-05-29 15:36:09.595] fs-watcher               <SPDE0048I> Processing 'CREATED' event for file 'dmserver.vehicle-1.0.0.par'.
      [2009-05-29 15:37:39.271] fs-watcher               <SPDE0053I> Cloned bundles: com.springsource.org.eclipse.persistence_1.0.0, org.springframework.jms_3.0.0.CI-217, org.springframework.web.portlet_3.0.0.CI-217, com.springsource.org.apache.derby.client_10.4.1000003.648739, org.springframework.aspects_3.0.0.CI-217, org.springframework.orm_3.0.0.CI-217, com.springsource.org.apache.commons.dbcp_1.2.2.osgi.
      [2009-05-29 15:38:41.885] fs-watcher               <SPFF0000I> Wrote dump files into "/home/daniel/Desktop/springsource-dm-server-2.0.0.M2/serviceability/dump/20090529153840-0"
      [2009-05-29 15:38:42.280] fs-watcher               <SPDE0018E> Unable to install application from location 'file:/home/daniel/Desktop/springsource-dm-server-2.0.0.M2/pickup/dmserver.vehicle-1.0.0.par'. Could not satisfy constraints for bundle 'dmserver.vehicle-1-dmserver.vehicle-synthetic.context' at version '1.0.0'. Cannot resolve: dmserver.vehicle-1-dmserver.vehicle-synthetic.context
          Resolver report:
              Missing constraint: <Import-Package: dmserver.vehicle.service; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle-synthetic.context_1.0.0>
              Uses violation: <Import-Package: org.eclipse.persistence.internal.weaving; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle.domain_1.0.0>
                  Possible matches:
                              <Export-Package: org.eclipse.persistence.internal.weaving; version="1.0.0"> from <dmserver.vehicle-1-com.springsource.org.eclipse.persistence_1.0.0>
                          No dependent constraint mismatch. Try refreshing the <dmserver.vehicle-1-com.springsource.org.eclipse.persistence_1.0.0> bundle.
              Missing constraint: <Import-Package: dmserver.vehicle.domain; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle.repository_1.0.0>
              Uses violation: <Import-Package: org.springframework.orm.jpa; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle.repository.jpa_1.0.0>
                  Possible matches:
                              <Export-Package: org.springframework.orm.jpa; version="3.0.0.CI-217"> from <dmserver.vehicle-1-org.springframework.orm_3.0.0.CI-217>
                          No dependent constraint mismatch. Try refreshing the <dmserver.vehicle-1-org.springframework.orm_3.0.0.CI-217> bundle.
      
            Missing constraint: <Import-Package: dmserver.vehicle.domain; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle.service_1.0.0>
              Missing constraint: <Import-Package: dmserver.vehicle.domain; version="0.0.0"> in bundle <dmserver.vehicle-1-dmserver.vehicle.web_1.0.0>.
      [2009-05-29 15:38:42.282] fs-watcher               <SPDE0011E> Deployment of 'dmserver.vehicle' version '1' failed.
      [2009-05-29 15:38:42.285] fs-watcher               <SPDE0005E> Hot deploy failed for resource '/home/daniel/Desktop/springsource-dm-server-2.0.0.M2/pickup/dmserver.vehicle-1.0.0.par'.
      ~
      By the cloning message and the final 'uses violation' error I believe it may be a cloning bug. Not entirely clear why these bundles are being cloned, since this is a clean install with only a single application. The application is a PAR file, with three bundle importing the Spring library included in the dm Server.

      Comment


      • #4
        Originally posted by drubio View Post
        Hi Andy,

        After some further testing on a clean dm 2.0 M2 installation and changing over to EclipseLink (instead of Hibernate) the missing class error went away, however, it appears I've now encountered another cloning bug. Here is the stack and deployment sequence, I'll open a JIRA with the app if confirmed.
        Yes, this certainly looks like a cloning problem. It would be great if you could open a JIRA with the app.

        By the cloning message and the final 'uses violation' error I believe it may be a cloning bug. Not entirely clear why these bundles are being cloned, since this is a clean install with only a single application.
        Agreed, from your description of the app it's not clear to me that dm Server should be attempting cloning in this situation, although there could be an unexpected uses conflict that it's attempting to resolve. The app should allow us to figure it out

        Thanks,
        Andy

        Comment


        • #5
          JIRA posted with sample application
          https://issuetracker.springsource.com/browse/DMS-807

          Comment


          • #6
            Thank you.

            Comment

            Working...
            X