Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Access via domain name fails on Tomcat 6

 
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





 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.

 
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic