Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72519

JSP compiler cannot find transitive dependency

    Details

    • Story Points:
      8
    • Fix Priority:
      2

      Description

      Steps to reproduce:

      Lets say we have the following project structure:

            bundle-1
                  com.base  
                        interface Foo
      
            bundle-2
                  com.api
                        interface Bar extends Foo
      
            bundle-3
                  com.impl
                        class FooBar implements Bar
      

      Bundle-2 has provided dependency on bundle-1 and bundle-3 has provided dependency on bundle-1/2. We want to use FooBar in our MVCPortlet bundle (bundle-4). For the sake of this example export packages in bundle-1/2/3 which should make Foo/Bar/FooBar visible to other bundles, and add bundle-1/2/3 as provided dependencies to build.gradle of bundle-4.

      Use FooBar class in .java and.jsp code ( e.g. Bar bar = new FooBar(); bar.get(); )

      Expected Results:
      Everything compiles and runs fine in .java and .jsp code.

      Actual Results:
      .java code compiles and runs fine, .jsp throws the following error in runtime:

      org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP__PWC6197: An error occurred at line: 11 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot access Foo, class file Foo not found..... (full log attached)
      

      Explicitly adding unused import for Foo "solves" the problem. as Raymond Auge explained: "The problem is likely that the jsp introspection isn't deep enough, since it only looks at source and not bytecode."

        Attachments

        1. error.log
          43 kB
        2. LPS-72519.7z
          5 kB

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            matija.petanjek Matija Petanjek
            Participants of an Issue:
            Recent user:
            Sharry Shi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              2 years, 45 weeks, 5 days ago

                Packages

                Version Package