facebook

Generated servlet error in JSP’s when using generics

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #256950 Reply

    jedavie
    Member

    This message has not been recovered.

    #257041 Reply

    Riyad Kalla
    Member

    Are these errors comming from Tomcat or MyEclipse? Are they in your problem view?

    #257076 Reply

    jedavie
    Member

    Riyad,

    Thank you for the speedy answer. The errors are coming from the Console View for the JBoss application server integrated into Eclipse/MyEclipse. There is nothing listed in the Problem View for that project. I’m sorry but I’m not certain whether Tomcat or MyEclipse or something else is causing the problem. Do you have any suggestions as to what I might do to narrow the problem down? More of the pertinent parts of the integrated application server log follow:

    
    2006-08-16 08:30:33,069 INFO  [STDOUT] Trip : com.titan.domain.Cmpproductbean@10f80a9
    2006-08-16 08:30:39,600 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/Client_1].[jsp]] Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    
    An error occurred at line: 78 in the jsp file: /MyJsp.jsp
    Generated servlet error:
    The type Collection is not generic; it cannot be parameterized with arguments <Cmpproductbean>
    
    An error occurred at line: 78 in the jsp file: /MyJsp.jsp
    Generated servlet error:
    Syntax error, parameterized types are only available if source level is 5.0
    
    An error occurred at line: 78 in the jsp file: /MyJsp.jsp
    Generated servlet error:
    dao cannot be resolved
    
    An error occurred at line: 78 in the jsp file: /MyJsp.jsp
    Generated servlet error:
    Syntax error, 'for each' statements are only available if source level is 5.0
    
    
        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)
    2006-08-16 08:36:19,368 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
    

    Thanks for your help,
    Jim

    #257117 Reply

    Riyad Kalla
    Member

    The errors are comming from JBoss, and if you notice the ‘for each’ error, it’s cause you haven’t told JBoss (or myabe you aren’t running a Java-5 compatbiel version?) to allow Java 5 source code in your JSPs. In Tomcat this just works, in JBoss it might be a setting somewhere, make sure you are using the most recent JBoss release and check the JBoss docs for Java 5 JSP source and see if it’s a flag somewhere you need to set or something.

    #258039 Reply

    goldfrog
    Member

    the configure of tomcat is right here:
    %JBOSS_HOME%\server\all\deploy\jbossweb-tomcat55.sar\conf\web.xml
    <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>

    <!– Uncomment to use jdk1.5 features in jsp pages
    <init-param>
    <param-name>compilerSourceVM</param-name>
    <param-value>1.5</param-value>
    </init-param>
    –>

    remove the comment to let tomcat compile jsp using jdk1.5

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Generated servlet error in JSP’s when using generics

You must be logged in to post in the forum log in