Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-273

duplicate class definition causes servlet exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 1.0.0
    • Fix Version/s: None
    • Component/s: Unknown
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • Bugzilla Id:
      2466

      Description

      The problem involves three JSP files. The first file "index.jsp" defines a
      frameset that includes the other two JSPs "title.jsp" and "home.jsp". If I
      include the statement:

      <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

      in both of the files "title.jsp" and "home.jsp" I get a servlet exception (see
      the stacktrace at the end of this note). I do not see this problem with other
      TLDs that I include in both files. To circumvent this problem, I exclude the
      above TLD definition from the second file, "home.jsp".

      Exception Report:

      javax.servlet.ServletException: duplicate class definition:
      org/apache/struts/taglib/html/LinkTag
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:461)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
      at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
      at
      org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at
      org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
      at
      org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
      at java.lang.Thread.run(Thread.java:484)

      Root Cause:

      java.lang.LinkageError: duplicate class definition:
      org/apache/struts/taglib/html/LinkTag
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
      at
      java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at
      org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:664)
      at
      org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:1077)
      at
      org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:976)
      at
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:176)
      at
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:116)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
      at java.lang.Class.newInstance0(Native Method)
      at java.lang.Class.newInstance(Class.java:237)
      at
      org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.java:137)
      at
      org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
      at
      org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
      at
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)

        Attachments

          Activity

            People

            • Assignee:
              craigmcc Craig McClanahan
              Reporter:
              sad@comet.ucar.edu sad
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: