Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access via domain name fails on Tomcat 6

 
som halikhede
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's 2009, why are you still putting scriptlets in JSPs?

In any case, have you imported the class in question?
 
som halikhede
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, in that URL, the context path is /Client. Why would you expect otherwise?
 
som halikhede
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic