wood burning stoves 2.0*
The moose likes JSP and the fly likes Access via domain name fails on Tomcat 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Access via domain name fails on Tomcat 6" Watch "Access via domain name fails on Tomcat 6" New topic
Author

Access via domain name fails on Tomcat 6

som halikhede
Greenhorn

Joined: Jul 16, 2009
Posts: 4
We have an application we trying to host on tomcat 6.

When I try to access a link http://www.poodlewise.com/Client/jsp/index.jsp I get a complication error


============== Error 1 =====================

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 6 in the generated java file
Only a type can be imported. com.bredge.poodle.Config.ModuleConfiguration resolves to a package

An error occurred at line: 3 in the jsp file: /jsp/index.jsp
ModuleConfiguration cannot be resolved to a type
1: <%
2: String error="",errorText="";
3: ModuleConfiguration conf;
4: if(session.getAttribute("moduleType")==null)
5: {
6: conf=new ModuleConfiguration();


An error occurred at line: 6 in the jsp file: /jsp/index.jsp
ModuleConfiguration cannot be resolved to a type
3: ModuleConfiguration conf;
4: if(session.getAttribute("moduleType")==null)
5: {
6: conf=new ModuleConfiguration();
7: session.setAttribute("moduleType",conf);
8: }
9: conf=(ModuleConfiguration)session.getAttribute("moduleType");


An error occurred at line: 9 in the jsp file: /jsp/index.jsp
ModuleConfiguration cannot be resolved to a type
6: conf=new ModuleConfiguration();
7: session.setAttribute("moduleType",conf);
8: }
9: conf=(ModuleConfiguration)session.getAttribute("moduleType");
10: errorText="Invalid Login Id/Email Id or Password.";
11:
12: %>


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

===================================================




When I refresh the page again I get following error




============== Error 2 =====================
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:620)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.ClassNotFoundException: org.apache.jsp.jsp.index_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

===================================================


However when I access same link with ip address it works fine - http://85.25.184.107/poodlewise/Client/jsp/index.jsp it works fine.

In our server.xml we have mapped www.poodlewise.com to /webapps/poodlewise.

I am not sure what we have missed.

Please help.

-Som





Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

It's 2009, why are you still putting scriptlets in JSPs?

In any case, have you imported the class in question?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
som halikhede
Greenhorn

Joined: Jul 16, 2009
Posts: 4
Bear Bibeault wrote:It's 2009, why are you still putting scriptlets in JSPs?
In any case, have you imported the class in question?


It is some old code.

Yes, all the necessary classes are imported. That is whay it is working fine when I using IP adrress.

One more thing we noticed while investigating is when I try to access via http://www.poodlewise.com/Client/jsp/index.jsp, it is taking 'Client' as context path where as it should have been 'poodlewise'.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Well, in that URL, the context path is /Client. Why would you expect otherwise?
som halikhede
Greenhorn

Joined: Jul 16, 2009
Posts: 4
We could figure it out -

there was mistake in appBase and docBase values in Sever.xml.

It is resolved now.
Anyhow thanks for the reply and taking time to help me out.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Access via domain name fails on Tomcat 6
 
Similar Threads
unable to display charts in tomcat6.x
Error message
Can't get index.jsp to refer to hello.jsp
The value for the useBean class attribute *class* is invalid.
Unable to Resolve JSTL taglib Declaration