본문 바로가기

프로그래밍/JAVA, Servlet, JSP

The type Collection is not generic; it cannot be parameterized with arguments <? extends E>

아래와 같은 Exception이 발생하였음.

 

3시간정도를 고민하다가 Gauce 기술지원센터에 문의한 결과 10분만에 해결한 내용임.. ㅠ.ㅠ

 

http://www.gauce.com/zboard.php?id=gauceFAQ&page=2&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=49

 

An error occurred at line: 14 in the generated java file
The type Collection is not generic; it cannot be parameterized with arguments <? extends E>

Stacktrace:
 at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
 at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
 at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at com.gauce.filter.GauceFilter.doFilter(Unknown Source)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Unknown Source)

 

해결책 -----------------

 

tomcat 5.5.X.X 버전에서 jsp 파일 include 요청시 compile Exception 발생하는 경우 해결방법입니다.


org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
The type Collection is not generic; it cannot be parameterized with arguments <? extends E>



해당 문제는 Gauce 문제가 아니라 톰캣에서만 발생하는 문제입니다.

톰켓 엔진에서 작성한 JSP파일을 서블렛 파일로 변경 후 컴파일 하는 도중에

JDK 1.5에서 추가된 generic 기능에 관련하여 컴파일을 하지 못하는 에러 입니다.

아래의 <servlet>태그를 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>
   <init-param>
      <param-name>mappedfile</param-name>
      <param-value>true</param-value>
   </init-param>
   <init-param>
      <param-name>compilerTargetVM</param-name>
      <param-value>1.5</param-value>
   </init-param>
   <init-param>
      <param-name>compilerSourceVM</param-name>
      <param-value>1.4</param-value>
   </init-param>
   <load-on-startup>3</load-on-startup>
</servlet>