Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0.RC1
    • Component/s: SERVER
    • Labels:
      None

      Description

      1. Start with a clean build.
      2. In Package Explorer, select New > Spring Template Project
      3. Select Spring MVC Project > Finish. Tell it okay when it asks if you want to download it.
      4. Give the project a name and a location, press Finish.
      5. Wait. It takes a while for the build to finish.
        You will see the error: Class 'org.springframework.web.servlet.view.InternalResourceViewResolver' not found [config set: <projectName>/web-context
      6. Project > Clean clean the project. It will rebuild and this time have no error.
      7. Create a vFabric server (if you don't have one already). I did: Servers, New > Server > VMware vFabric tc Server v2.5, v2.6, server info, new instance named "base" which only had "base".
      8. Drag your project onto the server.
      9. Start the server.
      10. Select your project under the server; right-click and select Open Home Page.
        You will get an error:
      javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method 
      "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" 
      the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, 
      org/apache/jsp/WEB_002dINF/views/home_jsp, and 
      the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, 
      javax/servlet/jsp/JspApplicationContext, have different Class objects for the type 
      
      javax/el/ExpressionFactory used in the signature
      

        Activity

        Hide
        Kaitlin Sherwood (c) added a comment -

        Sometimes the error
        Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
        shows up instead/in addition to the InternalResourceViewResolver.

        Show
        Kaitlin Sherwood (c) added a comment - Sometimes the error Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" shows up instead/in addition to the InternalResourceViewResolver.
        Hide
        Martin Lippert (c) added a comment -

        It looks like moving the Maven Builder up to the top of the builder chain resolves the issues at the moment. I still have the impression that this is not the root cause of all the issues, but it at least seem to work around them. We have updated the MVC project template definition accordingly and will ship a new version with STS 2.9.1

        Show
        Martin Lippert (c) added a comment - It looks like moving the Maven Builder up to the top of the builder chain resolves the issues at the moment. I still have the impression that this is not the root cause of all the issues, but it at least seem to work around them. We have updated the MVC project template definition accordingly and will ship a new version with STS 2.9.1
        Hide
        Kaitlin Sherwood (c) added a comment -
        Show
        Kaitlin Sherwood (c) added a comment - Opened bug in M2E: https://bugs.eclipse.org/bugs/show_bug.cgi?id=374998
        Hide
        Kaitlin Sherwood (c) added a comment -

        This does not appear to be an M2E bug, but a bug in the JST builder and/or the whole build system: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375365

        Show
        Kaitlin Sherwood (c) added a comment - This does not appear to be an M2E bug, but a bug in the JST builder and/or the whole build system: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375365
        Hide
        Kaitlin Sherwood (c) added a comment -

        There is a stack trace on STS-2590 (which is a duplicate of this bug).

        Show
        Kaitlin Sherwood (c) added a comment - There is a stack trace on STS-2590 (which is a duplicate of this bug).
        Hide
        Martin Lippert (c) added a comment -

        After some investigations in the past this seems to be a timing issue. To me it looks like m2e is adding libraries to the classpath container after they got downloaded, but the validations ran before and therefore weren't able to find that class.

        So my assumption is that we don't revalidate this after the right JARs got added to the project classpath. Maybe we don't listen to the right event, maybe m2e isn't firing up the right one, don't know.

        The bad thing is that this is not easy to reproduce. The best chance is to delete the local Maven repository, so that m2e/Maven needs to download everything again (and maybe have a slow connection for that).

        Show
        Martin Lippert (c) added a comment - After some investigations in the past this seems to be a timing issue. To me it looks like m2e is adding libraries to the classpath container after they got downloaded, but the validations ran before and therefore weren't able to find that class. So my assumption is that we don't revalidate this after the right JARs got added to the project classpath. Maybe we don't listen to the right event, maybe m2e isn't firing up the right one, don't know. The bad thing is that this is not easy to reproduce. The best chance is to delete the local Maven repository, so that m2e/Maven needs to download everything again (and maybe have a slow connection for that).
        Hide
        lee young sam added a comment -

        Tomcat 7 uses el-api 2.2 and jsp-api 2.2.

        To get this running I commented out jsp-api 2.1 from the pom

        <!--dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
        </dependency -->

        저장후 다시 함 실행해보세요, 잘 될 겁니다.

        Show
        lee young sam added a comment - Tomcat 7 uses el-api 2.2 and jsp-api 2.2. To get this running I commented out jsp-api 2.1 from the pom <!--dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency --> 저장후 다시 함 실행해보세요, 잘 될 겁니다.
        Hide
        Martin Lippert (c) added a comment -

        Finally I managed to track the underlying issue down to the real problem. It is related to the validation build being triggered by Spring IDE in case of classpath changes. That piece of code contained a bug that prevented the additional validation builds from being triggered in certain cases (for example when m2e changes the content of the Maven Classpath Container in a certain way).

        The same problem seems to be in the webtools code - and that is causing the wrong error marker for the problem in the JSP.

        I fixed the problem in the Spring IDE code to trigger the validation for all those classpath changes and added a workaround the webtools problem. We should remove the workaround as soon as the problem is solved in webtools.

        Show
        Martin Lippert (c) added a comment - Finally I managed to track the underlying issue down to the real problem. It is related to the validation build being triggered by Spring IDE in case of classpath changes. That piece of code contained a bug that prevented the additional validation builds from being triggered in certain cases (for example when m2e changes the content of the Maven Classpath Container in a certain way). The same problem seems to be in the webtools code - and that is causing the wrong error marker for the problem in the JSP. I fixed the problem in the Spring IDE code to trigger the validation for all those classpath changes and added a workaround the webtools problem. We should remove the workaround as soon as the problem is solved in webtools.

          People

          • Assignee:
            Martin Lippert (c)
            Reporter:
            Kaitlin Sherwood (c)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: