glassfish
  1. glassfish
  2. GLASSFISH-11208

JSP compiler Erro whit OSGI imported class

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: V3
    • Fix Version/s: not determined
    • Component/s: OSGi-JavaEE
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      have 2 bundle:
      Bundla A --> a WAB bundle with a JSP pages
      and
      Bundle B --> that export class with static fields

      The JSP pages (in Bundle A) use the exported class (in Bundle B)
      When I want to see my page, i have compilation
      error "org.apache.jasper.JasperException: PWC6033: Error in Javac compilation
      for JSP"

      Current GlassFish JSP compiler can't
      see classes imported from another WAB. This is because it expects all
      the dependencies to be specified in a classpath which it can pass onto
      the javac. I have always felt, JSP compiler should use a classloader
      backed JavaFileManager.

      Forum Thread
      http://forums.java.net/jive/thread.jspa?messageID=373634

        Activity

        Hide
        Sanjeeb Sahoo added a comment -

        This issue is difficult to fix until JSP compiler allows us to use class loaders to be used for searching classes. So deferring it for now. Recommended work around is to use offline JSP compiler to precompile JSPs and package them in the WAB.

        Show
        Sanjeeb Sahoo added a comment - This issue is difficult to fix until JSP compiler allows us to use class loaders to be used for searching classes. So deferring it for now. Recommended work around is to use offline JSP compiler to precompile JSPs and package them in the WAB.
        Hide
        ejroberts added a comment - - edited

        One workaround is to push the use of the OSGi provided classes out of the JSP pages and into a local class available from within the WAB.

        I have found that this manages to defer the class loading until such a point where it is then the compiled Servlet class that loads the OSGi provided classes.

        Show
        ejroberts added a comment - - edited One workaround is to push the use of the OSGi provided classes out of the JSP pages and into a local class available from within the WAB. I have found that this manages to defer the class loading until such a point where it is then the compiled Servlet class that loads the OSGi provided classes.
        Hide
        PashaTurok added a comment -

        The same I have in GlassFish 4.1. Five years have passed since this bug was fired. Can you say if you are going to fix it?

        Show
        PashaTurok added a comment - The same I have in GlassFish 4.1. Five years have passed since this bug was fired. Can you say if you are going to fix it?
        Hide
        PashaTurok added a comment -

        Please, anyone, answer my question. It's impossible to use jsp with this bug as it makes duplicate code and all soft architecture becomes a nightmare.

        Show
        PashaTurok added a comment - Please, anyone, answer my question. It's impossible to use jsp with this bug as it makes duplicate code and all soft architecture becomes a nightmare.
        Hide
        PashaTurok added a comment - - edited

        Here I described the suggested solution - use precompiling jsp files with GF 4.1 http://stackoverflow.com/questions/38139152/glassfish-4-and-offline-jsp-compiler I hope it will be useful for anyone.

        Show
        PashaTurok added a comment - - edited Here I described the suggested solution - use precompiling jsp files with GF 4.1 http://stackoverflow.com/questions/38139152/glassfish-4-and-offline-jsp-compiler I hope it will be useful for anyone.

          People

          • Assignee:
            Sanjeeb Sahoo
            Reporter:
            sebglon
          • Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: