tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36767] New: - Taglibrary utilizing generified collections
Date Thu, 22 Sep 2005 05:04:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36767>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36767

           Summary: Taglibrary utilizing generified collections
           Product: Tomcat 5
           Version: 5.0.28
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: JDK1.5
          Severity: minor
          Priority: P4
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: snoyberg@gamebox.net


I implemented two tags, one to display a navigation bar and another to display a
list of news items.  Both tags received their data from a DAO which returned a
Collection of appropriate objects.  When I switched over to using generics the
error below appeared for *both* tags.

I found two different fixes.  If I avoided creating a local variable to hold
either the Collection<NewsItem> or Iterator<NewsItem>, then everything worked
fine.  For example:
for(NewsItem n : newsItemDao.getAll()) { ... }
solved the problem.  The other approach was simply not to use the generic
approach in the tag, even though the DAO was still returning a generified
collection.

Here's one of the stacktraces, the other was the same:

Sep 21, 2005 9:43:57 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling file:
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms//org/apache/jsp/WEB_002dINF/jsp/news_jsp.java
    [javac] Compiling 1 source file
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:29:95:35:
Semantic Error: The class file "NewsTag.class" in
"/var/lib/tomcat-5/default/webapps/javacms/WEB-INF/classes/com/snoyman/jcms/taglib"
has an invalid format (duplicate local variable type table).
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:61:95:91:
Semantic Error: Type "NewsTag" was not found.
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:129:95:159:
Semantic Error: Type "NewsTag" was not found.


Sep 21, 2005 9:43:57 PM org.springframework.web.servlet.FrameworkServlet
serviceWrapper
SEVERE: Could not complete request
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 8 in the jsp file: /WEB-INF/jsp/news.jsp
Generated servlet error:
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:29:95:35:
Semantic Error: The class file "NewsTag.class" in
"/var/lib/tomcat-5/default/webapps/javacms/WEB-INF/classes/com/snoyman/jcms/taglib"
has an invalid format (duplicate local variable type table).


An error occurred at line: 8 in the jsp file: /WEB-INF/jsp/news.jsp
Generated servlet error:
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:61:95:91:
Semantic Error: Type "NewsTag" was not found.


An error occurred at line: 8 in the jsp file: /WEB-INF/jsp/news.jsp
Generated servlet error:
    [javac]
/var/lib/tomcat-5/default/work/Catalina/localhost/javacms/org/apache/jsp/WEB_002dINF/jsp/news_jsp.java:95:129:95:159:
Semantic Error: Type "NewsTag" was not found.




	at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
	at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
	at
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:97)
	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
	at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:928)
	at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:705)
	at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
	at
org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
	at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:595)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message