You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/09/05 19:31:11 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/test/org/apache/catalina/util URLTestCase.java

craigmcc    01/09/05 10:31:11

  Modified:    catalina/src/share/org/apache/catalina/util URL.java
               catalina/src/test/org/apache/catalina/util URLTestCase.java
  Log:
  Update org.apache.catalina.util.URL to deal with cases like:
  
    URL context = new URL("http://localhost/cocoon/");
    URL relative = new URL(context, "index.xml");
  
  which was incorrectly resolving "relative" to "http://localhost/index.xml"
  instead of the correct value "http://localhost/cocoon/index.xml".
  
  Gotta love it when a bug report includes not only a patch, but updated
  JUnit test cases :-).
  
  Submitted by:	Bernard D'Have <bd...@SpiritSystems.be>
  
  Revision  Changes    Path
  1.2       +6 -6      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java
  
  Index: URL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- URL.java	2001/08/24 23:06:08	1.1
  +++ URL.java	2001/09/05 17:31:11	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v 1.1 2001/08/24 23:06:08 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/08/24 23:06:08 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v 1.2 2001/09/05 17:31:11 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/09/05 17:31:11 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * package someplace.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2001/08/24 23:06:08 $
  + * @version $Revision: 1.2 $ $Date: 2001/09/05 17:31:11 $
    */
   
   public final class URL implements Serializable {
  @@ -736,8 +736,8 @@
               throw new MalformedURLException
                   ("Base path does not start with '/'");
           if (!path.endsWith("/"))
  -            path += '/';
  -        path += "../" + spec.substring(start, limit);
  +            path += "/../";
  +        path += spec.substring(start, limit);
           if (query != null)
               file = path + "?" + query;
           else
  
  
  
  1.2       +5 -3      jakarta-tomcat-4.0/catalina/src/test/org/apache/catalina/util/URLTestCase.java
  
  Index: URLTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/test/org/apache/catalina/util/URLTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- URLTestCase.java	2001/08/24 23:06:08	1.1
  +++ URLTestCase.java	2001/09/05 17:31:11	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/test/org/apache/catalina/util/URLTestCase.java,v 1.1 2001/08/24 23:06:08 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/08/24 23:06:08 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/test/org/apache/catalina/util/URLTestCase.java,v 1.2 2001/09/05 17:31:11 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/09/05 17:31:11 $
    *
    * ====================================================================
    *
  @@ -75,7 +75,7 @@
    * Unit tests for the <code>org.apache.catalina.util.URL</code> class.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2001/08/24 23:06:08 $
  + * @version $Revision: 1.2 $ $Date: 2001/09/05 17:31:11 $
    */
   
   public class URLTestCase extends TestCase {
  @@ -457,6 +457,8 @@
           positive("http://a/b/c/d;p?q", "g?y/../x");
           positive("http://a/b/c/d;p?q", "g#s/./x");
           positive("http://a/b/c/d;p?q", "g#s/../x");
  +        positive("http://a/b", "c");
  +        positive("http://a/b/", "c");
   
       }
   
  
  
  

RE: LinkageError: duplicate Class definition

Posted by Peter Romianowski <an...@gmx.de>.
ok, i switched to today's nightly (20010906) but the error remains.
instead of bothering you again and again i downloaded the src (20010906) and
"fixed" the bug. (or at least make it disappear :-)
first i simply synchronized the complete method
(WebappClassLoader.findClassInternal) and that did the trick.

because of possible performance issues (dont know if there are some) i moved
the formally synchronized code to a separate synchronized method (and left
the findClassInternal unsynchronized).
but then the error reoccured (this time within the new method)... :-(

are there points for which the whole method must not be synchronized? if
not, i would synchronize it...

any other ideas?

as always - thanks dudes...

pero



-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Thursday, September 06, 2001 5:05 PM
To: tomcat-dev@jakarta.apache.org
Subject: Re: LinkageError: duplicate Class definition


> ok, i try to develop a test case (and environment). but my first attempt
to
> reproduce the error in that testcase failed (even though it remains in my
> "real" application). here's a short doc on what's happening:
> 1. i start tomcat with tomcat/bin/catalina.sh -config myserver.xml - file
> follows
>
> tomcat startup message
>
> Using CLASSPATH:
>
c:/tools/java/tomcat4/bin/bootstrap.jar;c:\tools\java\jdk\1.3.1/lib/tools.ja
> r
> Using CATALINA_HOME: c:/tools/java/tomcat4
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0-b7
> WebappLoader[]: Deploying class repositories to work directory
> o:\coreg\projects\main\devenv\tomcat\work
> WebappLoader[]: Deploy JAR /WEB-INF/lib/peroframework.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\peroframework
> .jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/coregmain.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\coregmain.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/parser.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\parser.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/ecs-1.4.1.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\ecs-1.4.1.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/jaxp.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\jaxp.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/mail.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\mail.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/mysqljdbc202.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\mysqljdbc202.j
> ar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/activation.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\activation.jar
> StandardManager[]: Seeding random number generator class
> java.security.SecureRandom
> StandardManager[]: Seeding of random number generator has been completed
> StandardWrapper[:default]: Loading container servlet default
> default: init
> StandardWrapper[:invoker]: Loading container servlet invoker
> invoker: init
> StandardWrapper[:jsp]: Using Jasper classloader for servlet jsp
> jsp: init
> __coregapplication: init <--- THIS IS MY SERVLET
>
>
> 2. i've written a servlet which is executed on tomcat-startup (web.xml
> <load-on-startup>1000</...>)
> 3. within the init method i start some threads that are alive throughout
the
> whole server-lifetime
> 4. upon first execution there's the linkage-error
>
> trace:
>
> [Thu Sep 06 15:17:00 CEST 2001:
> coreg.mail.campaignuser.ReceiveDaemon.service]
> [[RecieveDaemon] unsubscribe] fatal exception
> java.lang.LinkageError: duplicate class definition:
> com/sun/mail/pop3/POP3Store
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
>         at
>
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
> ader.java:1484)
>         at
>
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
> a:851)
>         at
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1230)
>         at
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1113)
>         at javax.mail.Session.getService(Session.java:587)
>         at javax.mail.Session.getStore(Session.java:402)
>         at javax.mail.Session.getStore(Session.java:364)
>         at javax.mail.Session.getStore(Session.java:343)
>         at pero.mail.Pop3Handler.connect(Pop3Handler.java:38)
>         at
> coreg.mail.campaignuser.ReceiveDaemon.service(ReceiveDaemon.java:172)
>         at pero.common.Deamon.run(Deamon.java:94)

This stacktrace shows you're not using the latest CVS version or nightly
(which syncs the call to defineClass and would probably solve the issue).
In the latest version, line 1484 of WebappClassLoader is:
-----> synchronized(this) {
            clazz = defineClass(name, entry.binaryContent, 0,
                                entry.binaryContent.length, codeSource);
        }

In the version before, it was the defineClass call.

So could you try again with the latest nightly ? Looking at the stack trace,
it really looks like the bug which was fixed.

Remy


Re: LinkageError: duplicate Class definition

Posted by Remy Maucherat <re...@apache.org>.
> ok, i try to develop a test case (and environment). but my first attempt
to
> reproduce the error in that testcase failed (even though it remains in my
> "real" application). here's a short doc on what's happening:
> 1. i start tomcat with tomcat/bin/catalina.sh -config myserver.xml - file
> follows
>
> tomcat startup message
>
> Using CLASSPATH:
>
c:/tools/java/tomcat4/bin/bootstrap.jar;c:\tools\java\jdk\1.3.1/lib/tools.ja
> r
> Using CATALINA_HOME: c:/tools/java/tomcat4
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0-b7
> WebappLoader[]: Deploying class repositories to work directory
> o:\coreg\projects\main\devenv\tomcat\work
> WebappLoader[]: Deploy JAR /WEB-INF/lib/peroframework.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\peroframework
> .jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/coregmain.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\coregmain.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/parser.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\parser.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/ecs-1.4.1.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\ecs-1.4.1.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/jaxp.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\jaxp.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/mail.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\mail.jar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/mysqljdbc202.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\mysqljdbc202.j
> ar
> WebappLoader[]: Deploy JAR /WEB-INF/lib/activation.jar to
> o:\coreg\projects\main\devenv\www\WEB-INF\lib\activation.jar
> StandardManager[]: Seeding random number generator class
> java.security.SecureRandom
> StandardManager[]: Seeding of random number generator has been completed
> StandardWrapper[:default]: Loading container servlet default
> default: init
> StandardWrapper[:invoker]: Loading container servlet invoker
> invoker: init
> StandardWrapper[:jsp]: Using Jasper classloader for servlet jsp
> jsp: init
> __coregapplication: init <--- THIS IS MY SERVLET
>
>
> 2. i've written a servlet which is executed on tomcat-startup (web.xml
> <load-on-startup>1000</...>)
> 3. within the init method i start some threads that are alive throughout
the
> whole server-lifetime
> 4. upon first execution there's the linkage-error
>
> trace:
>
> [Thu Sep 06 15:17:00 CEST 2001:
> coreg.mail.campaignuser.ReceiveDaemon.service]
> [[RecieveDaemon] unsubscribe] fatal exception
> java.lang.LinkageError: duplicate class definition:
> com/sun/mail/pop3/POP3Store
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
>         at
>
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
> ader.java:1484)
>         at
>
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
> a:851)
>         at
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1230)
>         at
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1113)
>         at javax.mail.Session.getService(Session.java:587)
>         at javax.mail.Session.getStore(Session.java:402)
>         at javax.mail.Session.getStore(Session.java:364)
>         at javax.mail.Session.getStore(Session.java:343)
>         at pero.mail.Pop3Handler.connect(Pop3Handler.java:38)
>         at
> coreg.mail.campaignuser.ReceiveDaemon.service(ReceiveDaemon.java:172)
>         at pero.common.Deamon.run(Deamon.java:94)

This stacktrace shows you're not using the latest CVS version or nightly
(which syncs the call to defineClass and would probably solve the issue).
In the latest version, line 1484 of WebappClassLoader is:
-----> synchronized(this) {
            clazz = defineClass(name, entry.binaryContent, 0,
                                entry.binaryContent.length, codeSource);
        }

In the version before, it was the defineClass call.

So could you try again with the latest nightly ? Looking at the stack trace,
it really looks like the bug which was fixed.

Remy


AW: LinkageError: duplicate Class definition

Posted by Peter Romianowski <an...@gmx.de>.
ok, i try to develop a test case (and environment). but my first attempt to
reproduce the error in that testcase failed (even though it remains in my
"real" application). here's a short doc on what's happening:
1. i start tomcat with tomcat/bin/catalina.sh -config myserver.xml - file
follows

tomcat startup message

Using CLASSPATH:
c:/tools/java/tomcat4/bin/bootstrap.jar;c:\tools\java\jdk\1.3.1/lib/tools.ja
r
Using CATALINA_HOME: c:/tools/java/tomcat4
Starting service Tomcat-Standalone
Apache Tomcat/4.0-b7
WebappLoader[]: Deploying class repositories to work directory
o:\coreg\projects\main\devenv\tomcat\work
WebappLoader[]: Deploy JAR /WEB-INF/lib/peroframework.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\peroframework
.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/coregmain.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\coregmain.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/parser.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\parser.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/ecs-1.4.1.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\ecs-1.4.1.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/jaxp.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\jaxp.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/mail.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\mail.jar
WebappLoader[]: Deploy JAR /WEB-INF/lib/mysqljdbc202.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\mysqljdbc202.j
ar
WebappLoader[]: Deploy JAR /WEB-INF/lib/activation.jar to
o:\coreg\projects\main\devenv\www\WEB-INF\lib\activation.jar
StandardManager[]: Seeding random number generator class
java.security.SecureRandom
StandardManager[]: Seeding of random number generator has been completed
StandardWrapper[:default]: Loading container servlet default
default: init
StandardWrapper[:invoker]: Loading container servlet invoker
invoker: init
StandardWrapper[:jsp]: Using Jasper classloader for servlet jsp
jsp: init
__coregapplication: init <--- THIS IS MY SERVLET


2. i've written a servlet which is executed on tomcat-startup (web.xml
<load-on-startup>1000</...>)
3. within the init method i start some threads that are alive throughout the
whole server-lifetime
4. upon first execution there's the linkage-error

trace:

[Thu Sep 06 15:17:00 CEST 2001:
coreg.mail.campaignuser.ReceiveDaemon.service]
[[RecieveDaemon] unsubscribe] fatal exception
java.lang.LinkageError: duplicate class definition:
com/sun/mail/pop3/POP3Store
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
        at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
ader.java:1484)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
a:851)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1230)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1113)
        at javax.mail.Session.getService(Session.java:587)
        at javax.mail.Session.getStore(Session.java:402)
        at javax.mail.Session.getStore(Session.java:364)
        at javax.mail.Session.getStore(Session.java:343)
        at pero.mail.Pop3Handler.connect(Pop3Handler.java:38)
        at
coreg.mail.campaignuser.ReceiveDaemon.service(ReceiveDaemon.java:172)
        at pero.common.Deamon.run(Deamon.java:94)

my server.xml:

<!--

    configuration for dos-environments
    author Peter Romianowski (30/aug/2001)

-->

<Server port="8005" shutdown="SHUTDOWN" debug="0">

  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Tomcat-Standalone">

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8080" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="60000"/>

    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">


      <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt"
              timestamp="true"/>

      <!-- Because this Realm is here, an instance will be shared
globally -->

      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0"
appBase="o:/coreg/projects/main/devenv/www" unpackWARs="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="o:/coreg/projects/main/devenv/logs"
prefix="localhost_access_log." suffix=".txt"
                 pattern="common"/>

        <Logger className="org.apache.catalina.logger.SystemOutLogger"
directory="o:/coreg/projects/main/devenv/logs"/>

        <!-- Tomcat Examples Context -->
        <Context path="" override="true" reloadable="false" cookies="false"
docBase="" debug="0" workDir="o:/coreg/projects/main/devenv/tomcat/work"/>
      </Host>

    </Engine>

  </Service>


</Server>


you are right: the error upon jsp-compilation disappeared (i did not recheck
after switching to tomcat 4b07 right after its release)

hope this helps (you to help me) - thanks again, i appreciate your work. as
i said i'm trying to build the testcase. perhaps i have to strip down my
application to gain the test case... but perhaps this is only a
configuration fault or there's a workaround... (for now the workaround is,
that i simply catch the error for i know that the second run works - i could
live with that if i am the only one struggling with this)...

sincerly,
pero



-----Ursprüngliche Nachricht-----
Von: Remy Maucherat [mailto:remm@apache.org]
Gesendet: Donnerstag, 6. September 2001 03:59
An: tomcat-dev@jakarta.apache.org
Betreff: Re: LinkageError: duplicate Class definition


> hi there,
>
> I got a weird problem getting on here. I'm using tomcat 4b07 on both
win2000
> and linux.
> after startup I start some threads and when they execute for the first
time
> I get a LinkageError: duplicate Class definition.
> there are 4 things with this I dont understand:
> 1st: all classes are there exactly once. no jar is twice within the
> classpath (I checked that a dozen times)
> 2nd: the error occurs only when the thread is executing for the very first
> time. after each execution I wait some amount of time (Thread.sleep) and
> when the code which crashed before is re-executed everything works fine.
> 3rd: the linkage error is not restricted to a particular package. if I
> remove the non working threads, then the linkage error comes back again at
> some other place/thread.
> 4th: sometimes (very rarely) the error does not occur, but after
restarting
> tomcat it is back again.
>
> i figured out that this is not nescessarely related to threads I start. if
i
> do not start any thread of my own, then the first jsp-execution (after
> compilation) brings up the error.

At least the JSP part is supposed to be fixed.
It's bug 3107 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3107), and
the attached test case (which looks like it would duplicate your problem) is
now working fine for me.

If it's still not working, would it be possible to pull together a test case
? Could I get the stack trace you get in your threaded app if pulling
together a test case isn't possible ?

> my configuration:
> 1 wep app (not war) with all required jars in WEB-INF/lib (which are
> deployed at startup)

Remy


Re: LinkageError: duplicate Class definition

Posted by Remy Maucherat <re...@apache.org>.
> hi there,
>
> I got a weird problem getting on here. I'm using tomcat 4b07 on both
win2000
> and linux.
> after startup I start some threads and when they execute for the first
time
> I get a LinkageError: duplicate Class definition.
> there are 4 things with this I dont understand:
> 1st: all classes are there exactly once. no jar is twice within the
> classpath (I checked that a dozen times)
> 2nd: the error occurs only when the thread is executing for the very first
> time. after each execution I wait some amount of time (Thread.sleep) and
> when the code which crashed before is re-executed everything works fine.
> 3rd: the linkage error is not restricted to a particular package. if I
> remove the non working threads, then the linkage error comes back again at
> some other place/thread.
> 4th: sometimes (very rarely) the error does not occur, but after
restarting
> tomcat it is back again.
>
> i figured out that this is not nescessarely related to threads I start. if
i
> do not start any thread of my own, then the first jsp-execution (after
> compilation) brings up the error.

At least the JSP part is supposed to be fixed.
It's bug 3107 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3107), and
the attached test case (which looks like it would duplicate your problem) is
now working fine for me.

If it's still not working, would it be possible to pull together a test case
? Could I get the stack trace you get in your threaded app if pulling
together a test case isn't possible ?

> my configuration:
> 1 wep app (not war) with all required jars in WEB-INF/lib (which are
> deployed at startup)

Remy


AW: LinkageError: duplicate Class definition

Posted by Peter Romianowski <an...@gmx.de>.
hi again,

i tried the nightly build 20010904 but nothing changed. tomorrow i will try
the latest build.

but thanks for your fast reply

pero

-----Ursprungliche Nachricht-----
Von: craigmcc@localhost [mailto:craigmcc@localhost]Im Auftrag von Craig
R. McClanahan
Gesendet: Mittwoch, 5. September 2001 20:38
An: Peter Romianowski
Cc: tomcat-dev@jakarta.apache.org
Betreff: Re: LinkageError: duplicate Class definition


There was a race condition in the web app class loader in 4.0-beta-7 that
could cause this.  Could you try it again with a recent nightly build.

NOTE:  Use the one from 20010906 (tonight) or 20010904 -- the one from
20010905 has a bug related to session cookies that I just fixed.

Craig


On Wed, 5 Sep 2001, Peter Romianowski wrote:

> Date: Wed, 5 Sep 2001 20:20:04 +0200
> From: Peter Romianowski <an...@gmx.de>
> Reply-To: tomcat-dev@jakarta.apache.org
> To: tomcat-dev@jakarta.apache.org
> Subject: LinkageError: duplicate Class definition
>
> hi there,
>
> I got a weird problem getting on here. I'm using tomcat 4b07 on both
win2000
> and linux.
> after startup I start some threads and when they execute for the first
time
> I get a LinkageError: duplicate Class definition.
> there are 4 things with this I dont understand:
> 1st: all classes are there exactly once. no jar is twice within the
> classpath (I checked that a dozen times)
> 2nd: the error occurs only when the thread is executing for the very first
> time. after each execution I wait some amount of time (Thread.sleep) and
> when the code which crashed before is re-executed everything works fine.
> 3rd: the linkage error is not restricted to a particular package. if I
> remove the non working threads, then the linkage error comes back again at
> some other place/thread.
> 4th: sometimes (very rarely) the error does not occur, but after
restarting
> tomcat it is back again.
>
> i figured out that this is not nescessarely related to threads I start. if
i
> do not start any thread of my own, then the first jsp-execution (after
> compilation) brings up the error.
>
> my configuration:
> 1 wep app (not war) with all required jars in WEB-INF/lib (which are
> deployed at startup)
>
> not btw but with full attention: tomcat rulez, man!
>
> sincerly,
> pero
>
>


Re: LinkageError: duplicate Class definition

Posted by "Craig R. McClanahan" <cr...@apache.org>.
There was a race condition in the web app class loader in 4.0-beta-7 that
could cause this.  Could you try it again with a recent nightly build.

NOTE:  Use the one from 20010906 (tonight) or 20010904 -- the one from
20010905 has a bug related to session cookies that I just fixed.

Craig


On Wed, 5 Sep 2001, Peter Romianowski wrote:

> Date: Wed, 5 Sep 2001 20:20:04 +0200
> From: Peter Romianowski <an...@gmx.de>
> Reply-To: tomcat-dev@jakarta.apache.org
> To: tomcat-dev@jakarta.apache.org
> Subject: LinkageError: duplicate Class definition
>
> hi there,
>
> I got a weird problem getting on here. I'm using tomcat 4b07 on both win2000
> and linux.
> after startup I start some threads and when they execute for the first time
> I get a LinkageError: duplicate Class definition.
> there are 4 things with this I dont understand:
> 1st: all classes are there exactly once. no jar is twice within the
> classpath (I checked that a dozen times)
> 2nd: the error occurs only when the thread is executing for the very first
> time. after each execution I wait some amount of time (Thread.sleep) and
> when the code which crashed before is re-executed everything works fine.
> 3rd: the linkage error is not restricted to a particular package. if I
> remove the non working threads, then the linkage error comes back again at
> some other place/thread.
> 4th: sometimes (very rarely) the error does not occur, but after restarting
> tomcat it is back again.
>
> i figured out that this is not nescessarely related to threads I start. if i
> do not start any thread of my own, then the first jsp-execution (after
> compilation) brings up the error.
>
> my configuration:
> 1 wep app (not war) with all required jars in WEB-INF/lib (which are
> deployed at startup)
>
> not btw but with full attention: tomcat rulez, man!
>
> sincerly,
> pero
>
>


LinkageError: duplicate Class definition

Posted by Peter Romianowski <an...@gmx.de>.
hi there,

I got a weird problem getting on here. I'm using tomcat 4b07 on both win2000
and linux.
after startup I start some threads and when they execute for the first time
I get a LinkageError: duplicate Class definition.
there are 4 things with this I dont understand:
1st: all classes are there exactly once. no jar is twice within the
classpath (I checked that a dozen times)
2nd: the error occurs only when the thread is executing for the very first
time. after each execution I wait some amount of time (Thread.sleep) and
when the code which crashed before is re-executed everything works fine.
3rd: the linkage error is not restricted to a particular package. if I
remove the non working threads, then the linkage error comes back again at
some other place/thread.
4th: sometimes (very rarely) the error does not occur, but after restarting
tomcat it is back again.

i figured out that this is not nescessarely related to threads I start. if i
do not start any thread of my own, then the first jsp-execution (after
compilation) brings up the error.

my configuration:
1 wep app (not war) with all required jars in WEB-INF/lib (which are
deployed at startup)

not btw but with full attention: tomcat rulez, man!

sincerly,
pero