9 Replies Latest reply on Oct 28, 2001 3:49 AM by Shyam Natarajan

    JSP Compile Error

    Howard Ginsburg Newbie

      I've got a jar that has some utility classes that resides in my .ear. I've got a war file that contains servlets and jsps that also resides in my .ear. The servlets and jsp's reference files in the utility jar. The servlets run fine, but the jsp's won't compile. I read another post that said to put the utility jar in the war, but that isn't working for me either. I'm using JBoss-2.4.1 with Tomcat-3.2.3. Thoughts on what to do?


        • 1. Re: JSP Compile Error
          Sean Mullaney Newbie

          I'm having exactly the same problem, has anyone found a solution to this?

          • 2. Re: JSP Compile Error
            Charles Ng Newbie

            Is the Classpath in the WAR file's manifest set correctly?


            • 3. Re: JSP Compile Error
              Sean Mullaney Newbie

              I have read over the articles about this on theserverside.com and have built my .ear in the following way :

              - .ear
              --- META-INF
              ------ application.xml
              ------ manifest.mf
              --- ejb-beans.jar
              --- web.war
              --- common.jar

              I want the classes in common.jar to be shared between both the ejb and the servlet container.

              My manifest file lookes like this :

              Manifest-Version: 1.0
              Created-By: 1.3.0_02 (Sun Microsystems Inc.)
              Class-Path: common.jar

              The error I get is :
              org.apache.jasper.JasperException: JASPER: Unable to compile class for JSPC:\DOCUME~1\ADMINI~1\LOCALS~1
              Class com.bluetech.common.adpaters.JNDIAdapter not found in import.
              import com.bluetech.common.adpaters.JNDIAdapter; ^ 1 error

              where the class in my common.jar I am trying to access in my JSP is com.bluetech.common.adapters.JNDIAdapter

              I assume I dont need to reference common.jar in my application.xml? There seems to be quite a few posts on the boards regarding JSP compilation errors concerning classpaths. Has anyone tackled this problem?

              • 4. Re: JSP Compile Error
                Aanchal Newbie

                Instead of giving Class-Path: common.jar
                give it as Class-Path: ../common.jar and it will work just fine !!!! I did the same thing and the servlet works fine.

                • 5. Re: JSP Compile Error
                  Sean Mullaney Newbie

                  Thanks, mine works fine now too.

                  A couple things I had to change as well was - the last two lines of a manifest file had to be carriage returns. Also it didn't seem to like gaps between lines in the file. It seems manifest formatting is very strict :)

                  • 6. Re: JSP Compile Error
                    Paul Pearce Newbie

                    I am using JBoss-2.2.2_Tomcat-3.2.2, and I have tried the solution(s) specified in this discussion, to no avail.

                    The relevant line from the JBoss log seems to be :-

                    [J2EE Deployer Default] added jar:file:D:\java\JBoss-2.2.2_Tomcat-3.2.2\jboss\tmp\deploy\D
                    efault\copy1016.zip!/ublib.jar to common classpath

                    Yet I have specified in my manifest file :-

                    Class-Path: ../ublib.jar

                    Seem like the relative path is thrown away and my jsp's cannot find the classes in the jar.

                    Any ideas ?

                    • 7. Re: JSP Compile Error
                      Paul Pearce Newbie

                      Seems silly to reply to myself, but ...

                      I got it to work (finally), I also had to copy the ublib.jar file to WEB-INF/lib directory, then produce the .web archive.

                      The duplication seems a waste, but it's better than nothing.

                      • 8. Re: JSP Compile Error
                        Ava To Newbie

                        I'm using JBoss-2.4.0_Tomcat-3.2.3

                        I figured that you don't need to include the client.jar in the application.ear.

                        All you need to do is to put the client.jar in the WEB-INF/lib/client.jar and include it in the webmodule.war
                        and you don't even need to add the class-path line in the manifest.mf of the webmodule.

                        • 9. Re: JSP Compile Error
                          Shyam Natarajan Newbie

                          Suppose I want to map an external jar file in MANIFEST.MF. Some thing like
                          Class-path : F:\abc\xyz.jar

                          How can I achive this? The relative path mechanism won't work here.