You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by William Barker <wb...@wilshire.com> on 2001/02/23 01:52:43 UTC

ClassPath problem with Tomcat 3.3

   It seems that the only way to add files to the CLASSPATH in 3.3 is via
the tomcat.cp property, but it doesn't seem to be working quite right.
Below is the patch to org/apache/tomcat/startup/Main.java that works for me.

133,134c133,134
<           if( ! base.endsWith( "/" ) )
<               base=base + "/";
---
> //        if( ! base.endsWith( "/" ) )
> //            base=base + "/";
136c136
<           File f = new File(base + file);
---
>           File f = new File(base , file);
140c140
<           return new URL( "file", null, path );
---
>             return new URL( "file", null, path );
193c193,205
<             URL[] commonClassPath=getURLs(getClassPathV(getCommonDir()));
---
>             urlV = getClassPathV(getCommonDir());
>           // add CLASSPATH
>           String cpath=System.getProperty( "tomcat.cp");
>           if( cpath!=null ) {
>               System.out.println("Extra CLASSPATH: " + cpath);
>               String pathSep=System.getProperty( "path.separator");
>               StringTokenizer st=new StringTokenizer( cpath, pathSep );
>               while( st.hasMoreTokens() ) {
>                   String path=st.nextToken();
>                   urlV.addElement( getURL( "/",path ));
>               }
>           }
>             URL[] commonClassPath=getURLs(urlV);
287,297d298
<           // add CLASSPATH
<           String cpath=System.getProperty( "tomcat.cp");
<           if( cpath!=null ) {
<               System.out.println("Extra CLASSPATH: " + cpath);
<               String pathSep=System.getProperty( "path.separator");
<               StringTokenizer st=new StringTokenizer( cpath, pathSep );
<               while( st.hasMoreTokens() ) {
<                   String path=st.nextToken();
<                   urlV.addElement( getURL( path, "" ));
<               }
<           }