You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Olivier Lefevre <ol...@ubsw.com> on 2000/07/27 23:55:34 UTC

Class name conflicts

I started testing Tomcat. I have a rather long CLASSPATH and most
of my packages have an Exception class within them. Now, trying
the Calendar example, I get

/home/lefevrol/java/tomcat-3.2/work/localhost_8080%2Fexamples/_0002fjsp_0002fcal_0002fcal_00031_0002ejspcal1_jsp_0.java:76:
Ambiguous class: java.lang.Exception and cal.Exception
                        } catch (Exception exc) {
 
where cal is one of my packages. This must be a rather common
situation. I wonder if the jsp servlet generator (I hope that's
the right term) shouldn't fully qualify all class names; otherwise
clashes with user classes seem bound to occur.

I also get:

org.apache.jasper.JasperException: Unable to compile class for
JSP/home/lefevrol/java/tomcat-3.2/work/localhost_8080%2Fexamples/_0002fjsp_0002fcal_0002fcal_00031_0002ejspcal1_jsp_0.java:75:
Exception java.lang.ClassNotFoundException must be caught, or it must be
declared in the throws clause of this method.
                            table = (cal.TableBean)
Beans.instantiate(this.getClass().getClassLoader(), "cal.TableBean");
  
which looks like something else altogether.

This happens with both 3.1 and 3.2b2.

Regards,

Olivier Lefevre

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.