Announcement Announcement Module
Collapse
No announcement yet.
java.lang.ClassNotFoundException: org.springframework.context.EnvironmentAware Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.ClassNotFoundException: org.springframework.context.EnvironmentAware

    Hi folks. i'm attempting to integrate spring social into an existing, working project built from an archetype our spring experts here at my employer have made. the project is spring 3.0.5. trying to integrate spring-social 1.0.0.RC2.

    all i've done is add the spring social dependencies to the build, as well as explicit dependency for spring-web as the reference doc indicates.

    i'm getting the title runtime exception on startup using tomcat 7.0.11. the EnvionmentAware class appears to be a Spring 3.1.0 class.

    Any suggestions? tomcat log snippet below...

    Aug 5, 2011 4:12:07 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /SocialGateway3 threw load() exception
    java.lang.ClassNotFoundException: org.springframework.context.EnvironmentAware
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1521)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :616)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1148)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1521)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :616)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1148)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1521)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :616)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1148)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.lo adClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.lo adClassMaybePrivileged(DefaultInstanceManager.java :397)
    at org.apache.catalina.core.DefaultInstanceManager.ne wInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1062)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:1010)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4915)
    at org.apache.catalina.core.StandardContext$3.call(St andardContext.java:5242)
    at org.apache.catalina.core.StandardContext$3.call(St andardContext.java:5237)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Aug 5, 2011 4:12:07 PM org.apache.catalina.core.StandardWrapperValve invoke
    INFO: Servlet dispatcher is currently unavailable

  • #2
    Spring Social should not have any required dependency on a 3.1 type. I'm not aware of a dependency on EnvironmentAware anywhere in the framework. Have you been able to trace how this class is being instantiated? Have you tried running the spring-social-quickstart-3.0.x sample for RC2 as a point of comparison - it runs on Spring 3.0.5 and should run with no problems.

    If you think it's a bug, report it at jira.springsource.org and we'll look into it.

    Keith

    Comment


    • #3
      Thanks, Keith. here's a maven dependency tree listing snippet. it appears to indicate a depencency that spring-social-web has on 3.1. I'm sorry - i'm relatively new to java and spring - not familiar with execution time tracing options.

      I appreciate your help.

      Comment


      • #4
        oops one other thing... i am able to run the spring social quickstart 3.0.x sample...

        Comment


        • #5
          You need to declare the spring-web dependency explicitly with version 3.0.5.RELEASE I'd say -- it's a good practice to declare such dependencies explicitly anyway as you can get into these kinds of issues with transitive deps.

          Keith

          Comment


          • #6
            thanks, Keith.. actually i had already put the spring-web dependency in per the spring social reference documentation. putting in the explicit depencency on spring-webmvc 3.0.5 as well solved my problem. might be good to add that to the reference doc (section 1.4.3). appreciate your timely responses on this!

            Comment

            Working...
            X