• 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

HELP PLEASE! You guys are my last hope and the client is screaming

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have downloaded jspsmartupload and it works fine! I use the bean in my own application and that works fine when it is local. I then upload the app to the web host and I get the following error. It has nothing to do with file permissions.
org.apache.jasper.JasperException: Unable to compile class for JSP
/home/lampoons/tomcat4/work/lampoonslodge.com/mondo/jsp/manageUpload$jsp.java:6: Class or interface declaration expected.
import javax.servlet.*;
^
/home/lampoons/tomcat4/work/lampoonslodge.com/mondo/jsp/manageUpload$jsp.java:12: Superclass org.apache.jsp.HttpJspBase of class org.apache.jsp.manageUpload$jsp not found.
public class manageUpload$jsp extends HttpJspBase {
^
2 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java)
at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java)
at java.lang.Thread.run(Thread.java:498)
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess the problem is with the server configuration. Have you checked the server configuration?
Is the problem with using beans in JSP or all JSPs? Try putting simple JSP and try on the target server. If the basic JSP doesn't work, then the problem is with the server.
If the basic JSP page works fine then the problem is with your app.Make sure that u've put all your class files and jar files in appropriate places. Check WEB-INF and web.xml.
I think the problem is with the server.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Did u check the installation manual ? Do u need to edit any class paths ?
Please double check the installtion methodlogy.
Murthy !! Are u the Murthy from CMU ?? (I have one frnd in CMU with sasme signature)
All the best,
Gaya3

-------------------------
Prasanna Kumar R.V
 
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
Looks like the tomcat installation on the server could be missing servlet.jar (that's where packages such as javax.servlet) are stored. In a typical tomcat4 installation, that jar file should be in $CATALINA_HOME/common/lib
First thing I'd do is check to make sure that's there.
hth,
bear
 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have included the servlet.jar in the common/lib directory and set my class path for that directory. I was sure that would fix it but it does not.
All of my jsp pages work bar the one with the jspsmartupload bean. I know it is not the code as it works local so it has to be the server settings. This is on a web host so I am working in a virtual environment. I have my own server.xml and web.xml.
Do I have to register anything in those. Like the bean???
Thank for all your help.
David
 
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

The fact that you are getting a 'Class or interface declaration expected' rather than a 'package does not exist' leads me to believe that it is something other than a classpath problem.
That error almost sounds like something or other got put into the file before the import that's confusing the compiler.
If you can find the java file that is being created on behalf of your JSP (tomcat puts these in a folder hierarchy rooted at $CATALINA_HOME/work) you might be abke to figure out what the compiler's getting freaked out about.
bear
 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone.
I figured out what happened. Bear thanks for the pointer. You were right on the money.
Regards david
 
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
Hi david,
Glad to be of help. When you get out from under the screaming client do you think you could post what happened and your solution so that others that might have the same sort of problems can find your solution?
thanks!
bear
 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well Bear,
The problem was very simple (in hindsight of course)
If you look at the following line of code
<%@ page language="java" import="com.jspsmart.upload.*;"%>
You can see that I have a semi colon at the end of it. Now the problem with detecting this was the fact that the compiler was placing this before the import javax.servlet.*; and was generating an error saying that it could not find javax.servlet.*; which threw me off completely.
So the java file created for the JSP page by the compiler looked like this.
import com.jspsmart.upload.*;;
import javax.servlet.*;
I only found it by going into the work directory and looking at the created java file for that jsp page.
Thanks again Bear.
 
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
Great! Glad that tip helped. When all else fails, I've found that looking at the generated Java is the best way to find out what's really going on.
It's also great just for figuring out how JSP works! In fact, I really got a great handle on how custom tags works by simply looking at the generated pages -- something you just cannot get from a tutorial!
bear
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic