aspose file tools*
The moose likes Servlets and the fly likes ServletException: KGBInternet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletException: KGBInternet" Watch "ServletException: KGBInternet" New topic
Author

ServletException: KGBInternet

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I signed up for an account at KGB yesterday to test them out as they have a good price. They are running Tomcat 5. I created a simple program that takes a users name as input and then uses a servlet to forward the value to a page and display it using EL. Very simple, and works on my PC at home. I deployed it to KgB and I cam getting a servlet exception after I submit the form. I have asked the KGB guys what the problem is and they have no clue. Hmmm. Anyone else know what this typically means?


[ April 27, 2005: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Further investigation would lead me to believe it has something to do with EL. I removed the ${name} from the name.jsp page and I no longer get the exception.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Assuming com.gthought is your package, what's on lines 30 and 20?


com.gthought.test.TestServlet.procRequest(TestServlet.java:30)
com.gthought.test.TestServlet.doPost(TestServlet.java:20)


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Line 20: procRequest(request, response)

That line is in the doGet method and it and doPost both call procRequest()

Line 30: response.getRequestDispatcher("/name.jsp").forward(request, response);
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

So we know it's a problem executing the JSP due to an EL issue.
Do you have access to the log files on that server?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ben Souther:
So we know it's a problem executing the JSP due to an EL issue.
Do you have access to the log files on that server?


No I don't. I just signed up for the cheap shared host plan to test them out. They aren't passing with flying colors quite yet. I've got the kgb guy looking to see if they have somehow disabled EL or something globally. And I am trying to remember how to specifically turn it back on in my web.xml.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I believe the page directive overrides what's in web.xml

isELIgnored Defines whether EL expressions are ignored or evaluated for
this page and translation unit. If true, EL expressions (of the
form ${...}) are ignored by the container. If false, EL
expressions (of the form ${...}) are evaluated when they
appear in template text or action attributes. The
corresponding JSP configuration element is el-ignored (see
Section JSP.3.3.2). The default value varies depending on the
web.xml version - see Section JSP.2.2.4, "Deactivating EL
Evaluation".


Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thanks. I tried that but still have the same error. I am just going to cancel my account. You know what KGB's suggestion was?


Hi Gregg.

Maybe you should consider a private JVM so you can make sure all of the
JAR files you are using in your test environment are the same as what we
have. You could even zip up and upload your entire Tomcat directory, and
change the port numbers to what we have, replacing the Tomcat we have
installed with yours.


Oh, spend more money and my problems go away? I think I'll be blogging about this little experience.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Hmm. EL is pretty fundamental in 2.4. One would expect it to work out of the box.

Blog away...
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ben Souther:
Hmm. EL is pretty fundamental in 2.4. One would expect it to work out of the box.

Blog away...


You'd think. They are using apache on the front and doing a redirect. so when you type in

gthought.kgbinternet.com/index.jsp is automatically goes to gthought.kgbinternet.com/gthought/index.jsp. I asked them if that redirection could be cause the request to get lost. As that seems like what is happening.

If I replace my ${name} with <% request.getParameter("name"); %> the page displays without a name.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410



<%= is shorthand for <% out.println(...

Also try:


[ April 27, 2005: Message edited by: Ben Souther ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6



<%=request.getParameter("name")%>

That works. So it is specifically an EL problem.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

${param.name} didn't?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ben Souther:
${param.name} didn't?


Haven't tried that one yet. I am trying JSTL with EL real quick. The guy says that is "what he is used to doing".
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ben Souther:
${param.name} didn't?


Nope, that gives the same error as well. And JSTL <c ut value="${name}"/> doesn't work. All of these however work on my local machine.

I am done with it. I am trying to solve their issues and I don't work for them. I can't imagine other customers not having this problem though if I am. Oh well.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

http://radio.javaranch.com/gthought/2005/04/28/1114705574557.html
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

That's a great story.
It was good of you to update the thread here as well as on your blog.
They sound like a good company.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletException: KGBInternet