File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Package import ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Package import !" Watch "Package import !" New topic

Package import !

Ankit Pedro

Joined: Mar 23, 2005
Posts: 12
Tomcat cant seem to import a package.

I placed the package in the WEB-INF/classes, I also placed it in the common/classes, and i tried to jar it and placed it in the WEB-INF/lib, but also tomcat didn't recognize it.
I am confused, the class compiles with no errors.
Any suggestions would be appreciated.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

What do you mean "it can't import it"?

How are you trying to use the package and what errors are you getting in your logs?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ankit Pedro

Joined: Mar 23, 2005
Posts: 12

I am using a java class (Connect) i many jsp pages :

When I browse to a page that uses that package, tomcat generates errors:



root cause


The package is in WEB-INF/classes
I am using the jdk in the Sun Application Server PE 8 ! and tomcat 4.1.27
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

And how are you importing that page in your JSP?

Also, that's a null pointer exception. Is there also a ClassNotFound exception in the stack?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

A null pointer exeception has nothing to do with whether a class was imported or not. That was a bad assumption on your part.

As Ben pointed out, you would get a JSP translation error or a ClassNotFOund exception if the class were not found.

The NPE indicates that somewhere in your code you are de-referencing a variable containing a null value.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Package import !
It's not a secret anymore!