• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java. lang. NoClassDefFoundError

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot figure out what is going on. Everything worked fine, then I suddenly started getting the following error:



I have spent the last day and a half trying various things. I going insane!

Any help on this would be greatly appreciated.

server specs:
linux running redhat es 3
mysql 4.0.20
resin 2.1.14
custom tags
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javax.servlet.jsp.JspContext is a JSP 2.0 class.

As far as I know, Resin 2.x supports JSP 1.2 and JSP 2.0 support was introduced with Resin 3.x.

But the latest 2.x version of Resin I've used is 2.0.6 (currently planning a migration to Resin 3), so I'm not sure exactly what might be in 2.1.14.

Something to check though.
[ September 03, 2004: Message edited by: Bear Bibeault ]
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, and that is what is the most confusing. I must admit, I am not well versed in the ways of Java (prior to this site I knew zero), but I have learned quite a bit. The whole 2.0, 2.4, 2.3, 1.2, 1.1 thing is mighty confusing though!

Anyway, it seems that perhaps there is an issue with using pageContext? I am getting form values using pageContext.getAttribute (I think that is it, I am unable to look at my code right now). Is this a problem? As I said, everything worked fine, but now it is broken. Could it be a problem with the DTD in my TLD file?

Thanks for your assistance,
Tim
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Accessing pageContext isn't an issue. The PageContext class has been around for a while. However, in JSP 2.0, PageContext derives from JspContext but not in JSP 1.2.

So the question is: why is a JSP 1.2 engine looking for a JSP 2.0 class?

Are you compiling your servlets and beans against Servlet 2.4 and JSP 2.0, but deploying on a Servlet 2.3 and JSP 1.2 engine?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In other words, how are you compiling your classes, and where did you get the jar files that you are using in that process? You should be compiling against the jars that come with the Resin distribution
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And...

Could it be a problem with the DTD in my TLD file?



It could be, if you are using a DTD for a "future" version, but unlikely. If it is a problem with the tag library, it would most likely be due to using tag handler classes compiled against JSP 2.0. What tag library is causing the issues?
[ September 03, 2004: Message edited by: Bear Bibeault ]
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, thanks for the responses. There is a LOT of info in there. I guess I have a lot more to learn.

I use Netbeans 3.6 and JDK 1.4.2_05. All my functionality is built in using custom tags. I am attempting to completely separate the code from the HTML (I have an assistant that knows next to nothing about HTML, let alone sprinkling in some JSP here and there).

Like I said, I have had no issues in the past. Everything has worked fine for some time now. Then suddenly, this error pops up.

I would assume that using the most current version of the JDK would not break backwards compatibility, but I guess I could be wrong, no?

Thanks again for all your great info,
Tim
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I would assume that using the most current version of the JDK would not break backwards compatibility, but I guess I could be wrong, no?



The version of the JDK you are using is pretty much immaterial. What is germaine here is the versions of the Servlet and JSP APIs you are building against, and which versions you are deploying upon. That's where the mismatch appears to be.
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I must say that confuses me a bit. Like I said, I am pretty new to this all, so I am getting a bit lost. Sorry...

I guess I can explain the steps I take and you can hopefully direct me to what info you need. As I said before, I use Netbeans. I compile the .class files with Netbeans, then I upload 'em.

Does the API stuff have to do with J2EE? Like I said, all these different versions of stuff can get a bit confusing.

Sorry I don't have better answers. I appreciate your assistance,
Tim
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reading back, it seems that it must be an issue with which jar files are included in the resin/lib directory, no? I added a jar for MySQL, but other than that, the jars are what were there from the original resin install.

Hope this helps,
Tim
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I take that last post back - there are some items that were added. I'll try removing all the jars (except the basics) and starting again.

On that note: how can I easily tell which jars use what servlet?

I cannot tell you how much this has helped. Thanks again,
Tim
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I removed everything, replaced the entire resin directory fresh from the resin.tgz and still the same thing.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think it's your resin setup.

Again, what jar files are you compiling your beans, servlets and tag handlers against? Are you using the jar files that came with Resin?

Are your tag handlers in jars that you down-loaded from elsewhere that might have been compiled against JSP 2.0?

The symptoms of your issue all point to compiling classes against the JSP 2.0 API, but trying to run them against JSP 1.2.
 
Tim Hobbs
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jar files are mostly all ones that came with Resin, except for a java mail jar and the MySQL jar.

The biggest problem is that everything worked for months, then, suddenly, things no longer worked. I grasp the concept of versions (although I am unaware exactly how I would easliy tell the version of a jar), but I am confused how something could work for months then suddenly no longer work when nothing changed? It seems something must have changed, but I have went back tothe most recent java file changes I made and cannot find anything that sticks out.

Thanks for sticking with me on this one,
Tim
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic