Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Tomcat: can't import package....
Frances Del Rio wrote:
> Juha, just as an experiment I packaged a simple helper class I have in
> an app..  class is sH.class (simple class that I use just to store vars
> to generate HTML code..)  I put this class in WEB-INF\lib\com, then
> converted this 'com' into a jar.. ('jar cf sH.jar com' in WEB-INF\lib)
> so now I have WEB-INF\lib\sH.jar (sH.jar = com\sH.class..)  and if in
> WEB-INF\lib I do 'jar tf sH.jar' I get
>
> META-INF/
> META-INF/MANIFEST.MF
> com/
> com/sH.class
>
> so far so good, right?
>
> so in servlet (which is in WEB-INF\classes\hm) I now do
>
>    import com.sH;  but when compiling servlet get told that
>           'package com.sH' does not exist..
>
> I must be missing something here..
> (again, Tomcat knows to look for packages in WEB-INF\lib, right?  Juha,
> thanks again..  Frances

ok, I think mistake I made is I gave package same name as class inside
'com' dir.. what I did now:  in WEB-INF\lib I have com\sH.class, so:

to create jar file: "jar cf html.jar com", which, when I do
"jar tf html.jar" returns:

META-INF/
META-INF/MANIFEST.MF
com/
com/sH.class

in servlet (in WEB-INF\classes\hm) I do

import com.sH;

yet when I compile I get told 'package com doesn't exist'..

now I REALLY don't know what I am doing wrong..  would appreciate
leads...  thank you...  Frances



Report this thread to moderator Post Follow-up to this message
Old Post
Frances Del Rio
04-27-05 09:01 PM


Re: Tomcat: can't import package....
are u trying to compile the servlet or run/access thru browser the
servlet?

If you are just trying to compile -
I think maybe the issue is not in the package structure. it's in the
compiling tool you're using. How are you compiling your code? Make sure
that the jar is in your classpath or if you're using one of the
standard IDE's. that you have it listed, with the correct path, as one
of the required libraries.


Report this thread to moderator Post Follow-up to this message
Old Post
Rivky
04-27-05 09:01 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.