3 Replies Latest reply on Sep 21, 2007 5:19 AM by Renen W

    Accessing varargs from jsp (jboss 4.2.0 / jre 5.0)

    Kevin Glynn Newbie

      Hi,

      I am using jboss 4.2.0 with jre 1.5.0_09 and I get a JSP compile error from Jasper when I try to invoke a varargs method from a jsp page:

      10:37:16,288 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException: Unable to compile class for JSP:

      An error occurred at line: 20 in the jsp file: /samplefiles/sampletop.jsp
      The method GetString(String, ExternalConfiguration, Object[]) in the type IntegrationInterface is not applicable for the arguments (String, ExternalConfiguration)

      I can work around this with a dummy empty array, but is it not possible to do this?

      Thanks for your comments
      k


        • 1. Re: Accessing varargs from jsp (jboss 4.2.0 / jre 5.0)
          Renen W Newbie

          Hello,

          Tested. Problem is as described. The varargs are handled correctly from within normal POJOs in the WAR. Except, I don't think it has anything todo with EJB3: you can't access varargs on a POJO from a JSP page...

          I am curious as to why this is so. Any ideas?

          renen.

          • 2. Re: Accessing varargs from jsp (jboss 4.2.0 / jre 5.0)
            jaikiran pai Master

            Try adding the "compilerSourceVM" init-param to the web.xml file present in server/< serverName>/deploy/jboss-web.deployer/conf folder, as follows:

            <!-- compilerTargetVM Compiler target VM -->
             <!-- default is System.properties -->
             <!-- java.specification.version > 1.4 -->
             <!-- [1.5] else [1.4] -->
             <!-- -->
             <!-- compilerSourceVM Compiler source VM -->
             <!-- default is System.properties -->
             <!-- java.specification.version > 1.4 -->
             <!-- [1.5] else [1.4] -->
             <!-- -->
             <!-- If you wish to use Jikes to compile JSP pages: -->
             <!-- Please see the "Using Jikes" section of the Jasper-HowTo -->
             <!-- page in the Tomcat documentation. -->
            
             <servlet>
             <servlet-name>jsp</servlet-name>
             <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
             <init-param>
             <param-name>fork</param-name>
             <param-value>false</param-value>
             </init-param>
             <init-param>
             <param-name>xpoweredBy</param-name>
             <param-value>false</param-value>
             </init-param>
            
             <!-- Use a custom options class to allow the shared tag lib descriptors
             to be loaded from jars in the tomcat sar conf/tlds directory. The
             standard options implementation can only find taglibs based on the
             class loader classpath.
             -->
             <init-param>
             <param-name>engineOptionsClass</param-name>
             <param-value>org.jboss.web.tomcat.service.jasper.JspServletOptions</param-value>
             </init-param>
             <!-- Specify the jars relative to the jbossweb-tomcat6.sar that should
             be scanned for common tag lib descriptors to include in every war
             deployment.
             -->
             <init-param>
             <description>JSF standard tlds</description>
             <param-name>tagLibJar0</param-name>
             <param-value>jsf-libs/jsf-impl.jar</param-value>
             </init-param>
             <init-param>
             <description>JSTL standard tlds</description>
             <param-name>tagLibJar1</param-name>
             <param-value>jstl.jar</param-value>
             </init-param>
            
             <init-param>
             <param-name>compilerSourceVM</param-name>
             <param-value>1.5</param-value>
             </init-param>
             <load-on-startup>3</load-on-startup>
             </servlet>