OK. Looks like I had some weird stuff going on. This seems to work now. But I was messing around with the OS classpath (in order to compile some other stuff) and it seems this works now when it didn't before. But I was under the impression that Tomcat does not use the OS's classpath environment variable. Is that true?
Also, is it true that Tomcat (or at least version 4.1.27) has trouble with unpackaged classes? The issue below came to light because I was originally using unpackaged classes with JRun (old version of JRun - 2.3.3). When I tried putting these classes in the classes directory under my app's WEB-INF directory, they could not be found. During my search to resolve this, I noticed many others with a similar problem, and the solution was always to put the classes in a package. So that's what I did, and it worked. So is there a known issue with unpackaged classes? Is this supposed to work? Thanks, Neil -----Original Message----- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 4:22 PM To: Tomcat Users List Subject: RE: Full Package Names?? Howdy, >I'm just starting to use Tomcat (4.1.27) and I'm trying to get my existing >app to work. It worked fine with JRun, but it seems that Tomcat requires >that I specify the full package name for a class whenever I use it?? Is >this true? No, tomcat does not required that. Tomcat follows the Java Language Specification regarding package imports, as all servers should. >For example, I get, "cannot resolve symbol" for the following: >------------------------------ >import com.fgic.Utility.* >Utility util = new Utility(); You need a semicolon at the end of the import statement. You also probably mean import com.fgic.Utility; rather than import com.fgic.Utility.*; >------------------------------ >But when I change it like below, it works fine: > >import com.fgic.Utility.* >com.fgic.Utility util = new com.fgic.Utility(); That's because your import statement is flawed. I don't buy that the above works fine as it shouldn't even compile. >So does this means I have to go through all my code and specify the full >package name everywhere? No. >Note: in JRun, I didn't even have to specify the package name in the import >statement. It was able to find it with just: import Utility.* That's strange at best. In general, you have to import classes you use, or use their fully qualified name if you don't import them. If you post the entire relevant piece of code along with the compilation errors in full, we could help more. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
