• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package import !

 
Ankit Pedro
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ankit Pedro
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

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



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

exception

org.apache.jasper.JasperException

root cause

java.lang.NullPointerException

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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 64617
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic