Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to resolve the class file error  RSS feed

 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
I am stuck with my application. I have jsp,servlet application with jasper report server. When I run the application through eclipse, everything works perfectly. But When I try to run it in Tomcat (without eclipse) it gives me the "Unable to resolve the class file " error. I tried all the solutions I got through the google, but still I am unable to come over it. Any help will be appreciated.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which class file is missing, and where is the missing class in your web app? Post the full stack trace of all exceptions.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It gives the error for all servlet pages. Here is the stack
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by putting all your classes in packages; that is not optional.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf Dittmer : All my classes are in Packeges only
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm, that's not how it appears from these error messages:

The import Backup cannot be resolved

The import Logout cannot be resolved


Post the import statements from your JSP.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, that brings us back to my earlier question:

where is the missing class in your web app?
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classes are in Tomcat> Webapps > MyApplicationName > WEB- INF folder
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your error message says otherwise.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Bear Bibeault : Thats why I am still confused with the error I am getting
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WEB-INF is not the right place for either loose class files or jar files.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf Dittmer:Can you just provide me the more info on that?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jar files go into WEB-INF/lib, whereas loose class files go into WEB-INF/classes (inside a directory hierarchy mirroring their package structure).
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf Dittmer : Thats . what I am saying. Let me clarify. Here is my application structure
ApplicationName
|
|---WEB-INF|
|---lib
|---classes|
|--com
|--util
|--report

Here "com","util","report" are my packages


 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, those packages comes under classes folder and "lib" & "classes" comes under WEB-INF
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You still haven't said where the "com.iAssist.*" classes are -which are the relevant ones, since they cause the errors.
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its in WEB-INF > classes folder
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have files WEB-INF/classes/com/iAssist/Backup.class and WEB-INF/classes/com/iAssist/Logout.class. Hm. Are there no other exceptions, before or after this one?
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No exceptions. Is there any relation between environment variable and this exception? Do i need to set any environment variables?
 
Bharat Sankannanavar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue solved, I dont exactly got to know what was the issue, but I guess it was with my WAR file. When I used my old WAR file,everything working fine now.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!