Uploaded image for project: 'Spring BlazeDS Integration'
  1. Spring BlazeDS Integration
  2. FLEX-194

IllegalArgumentException: ServletContext must not be null

    Details

    • Type: Defect
    • Status: Resolved
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.5.0.M2
    • Fix Version/s: None
    • Component/s: Core
    • Environment:
      Apache Tomcat 7.0.12, BlazeDS 4.0.0.14931, Spring 3.0.5, Spring-BlazeDS-Integration 1.5.0.M2 (, dpHibernate 2.0 RC6)

      Description

      see http://stackoverflow.com/questions/5648428/spring-blazeds-integration-illegalargumentexception-servletcontext-must-not-be

      as soon as I am calling a service method (just a simple void method) the server returns following Exception, not sure where in my configuration the mistake lies.

        Activity

        Hide
        jeremyg484 Jeremy Grelle added a comment -

        If you attach an updated sample that reproduces the problem, I will take a look to see what's going wrong. I am inclined to think that there is still something wrong with your configuration. I would also suggest asking for help on the dpHibernate google group, since this seems to be specific to dpHibernate.

        Show
        jeremyg484 Jeremy Grelle added a comment - If you attach an updated sample that reproduces the problem, I will take a look to see what's going wrong. I am inclined to think that there is still something wrong with your configuration. I would also suggest asking for help on the dpHibernate google group, since this seems to be specific to dpHibernate.
        Hide
        robbatt Robert Brendler added a comment -

        Updated lazyoverflow example
        use libs:

        • blazeDS 4.0.0
        • springFlex 1.5.0.M2
        • Tomcat 7.0.12
        • dpHibernate current "2.0" branch (dpHibernateAdapter, springExtensions3.0)
        • parsley framework 2.4
        • Flex 4.5 Hero
        Show
        robbatt Robert Brendler added a comment - Updated lazyoverflow example use libs: blazeDS 4.0.0 springFlex 1.5.0.M2 Tomcat 7.0.12 dpHibernate current "2.0" branch (dpHibernateAdapter, springExtensions3.0) parsley framework 2.4 Flex 4.5 Hero
        Hide
        robbatt Robert Brendler added a comment -

        I attached another sample project. I had to strip most of the libs and stuff to match the 10MB limit.

        to get it running first check out:
        (blazeDS 4.0.0)
        https://www.adobe.com/cfusion/entitlement/index.cfm?e=lc_blazeds

        (springFlex 1.5.0.M2)
        http://s3.amazonaws.com/dist.springframework.org/milestone/FLEX/spring-flex-1.5.0.M2-dist.zip

        (Tomcat 7.0.12)
        http://tomcat.apache.org/download-70.cgi#7.0.12

        (Flex 4.5 latest)
        http://opensource.adobe.com/wiki/display/flexsdk/download?build=4.5.0.19786&pkgtype=1

        (parsley Framework 2.4 (included in download))
        http://www.spicefactory.org/download.php

        (current "2.0" branch of dpHibernate)
        http://code.google.com/p/dphibernate/source/browse/branches/#branches%2F2.0%253Fstate%253Dclosed

        (lazyoverflow example)
        http://code.google.com/p/lazyoverflow/source/browse/#svn%2Ftrunk

        Then import the dpHibernate_dpHibernateAdapter and dpHibernate_springExtensions-3.0 project from the "2.0" dpHibernate branch, overwrite the lazyoverflow files with the one from the zip file and the dependency settings of the project to match the imported projects and libraries.

        Show
        robbatt Robert Brendler added a comment - I attached another sample project. I had to strip most of the libs and stuff to match the 10MB limit. to get it running first check out: (blazeDS 4.0.0) https://www.adobe.com/cfusion/entitlement/index.cfm?e=lc_blazeds (springFlex 1.5.0.M2) http://s3.amazonaws.com/dist.springframework.org/milestone/FLEX/spring-flex-1.5.0.M2-dist.zip (Tomcat 7.0.12) http://tomcat.apache.org/download-70.cgi#7.0.12 (Flex 4.5 latest) http://opensource.adobe.com/wiki/display/flexsdk/download?build=4.5.0.19786&pkgtype=1 (parsley Framework 2.4 (included in download)) http://www.spicefactory.org/download.php (current "2.0" branch of dpHibernate) http://code.google.com/p/dphibernate/source/browse/branches/#branches%2F2.0%253Fstate%253Dclosed (lazyoverflow example) http://code.google.com/p/lazyoverflow/source/browse/#svn%2Ftrunk Then import the dpHibernate_dpHibernateAdapter and dpHibernate_springExtensions-3.0 project from the "2.0" dpHibernate branch, overwrite the lazyoverflow files with the one from the zip file and the dependency settings of the project to match the imported projects and libraries.
        Hide
        robbatt Robert Brendler added a comment -

        I could narrow it down to FlexContext.getServletContext(); returning "null" in SpringContextSerializerFactory.java line 110.

        Quick fix to this (staying compatible to the current implementation) was altering the code to look like the following:

        ServletContext servletContext = FlexContext.getServletContext();
        if(servletContext == null) // fix for Servlet Context must not be null exception during migration to Spring 3.0
        servletContext = FlexContext.getMessageBroker().getServletContext();
        context= WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);

        Don't know if I am doing something ugly here, but works for me.

        Show
        robbatt Robert Brendler added a comment - I could narrow it down to FlexContext.getServletContext(); returning "null" in SpringContextSerializerFactory.java line 110. Quick fix to this (staying compatible to the current implementation) was altering the code to look like the following: ServletContext servletContext = FlexContext.getServletContext(); if(servletContext == null) // fix for Servlet Context must not be null exception during migration to Spring 3.0 servletContext = FlexContext.getMessageBroker().getServletContext(); context= WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); Don't know if I am doing something ugly here, but works for me.
        Hide
        robbatt Robert Brendler added a comment -

        this means it was an error in dpHibernate, thanks for you help, close please.

        Show
        robbatt Robert Brendler added a comment - this means it was an error in dpHibernate, thanks for you help, close please.

          People

          • Assignee:
            jeremyg484 Jeremy Grelle
            Reporter:
            robbatt Robert Brendler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: