File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes HELP PLEASE! You guys are my last hope and the client is screaming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "HELP PLEASE! You guys are my last hope and the client is screaming" Watch "HELP PLEASE! You guys are my last hope and the client is screaming" New topic
Author

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

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
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)
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
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.
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65


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

Joined: Sep 27, 2002
Posts: 185
Thanks everyone.
I figured out what happened. Bear thanks for the pointer. You were right on the money.
Regards david
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

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

Joined: Sep 27, 2002
Posts: 185
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HELP PLEASE! You guys are my last hope and the client is screaming
 
Similar Threads
'Extend class' directive in JSP
Problems with TOMCAT 4
struts-example.war
custom tag question
Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Error