• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JspParseException

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on JSP with Apache server
My files are under c:\oracle\apache\apache\htdocs
All my individual jsp files are working fine.
There is one bean I have defined in the same directory and I use this bean in a jsp file
I have included
<jsp:usebean>
But I get the following error:
oracle.jsp.parse.JspParseException: Line # 2, Error: Unable to find class for bean: takeOrderBean defined by tag with class: htdocs.TakeOrderBean
I have the TakeOrderBean.java in the same directory and I am able to compile it independently to TakeOrderBean.class.
There was a similar example in the book Professional Java Server Programming J2EE ed.
They also have an XML descriptor file -- is it necessary to have that? What purpose does it serve?
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:usebean>
But I get the following error:

That must be <jsp:useBean>, with an upper case B.
regds.
- madhav
 
shree vijay
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I guess I should have given the whole thing -- I tried to make it short and missed the syntax nuance:
Here is the syntax I used for using the bean:
<jsp:useBean id="takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>
Am I missing out something? Right now, I am reading about Web deployment and packaging -- but I really don't know if I 'have' to do that. I am just trying out a simple appln.
[ April 10, 2002: Message edited by: shree vijay ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I should have given the whole thing -- I tried to make it short and missed the syntax nuance:
Here is the syntax I used for using the bean:
<jsp:useBean id="takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>
Am I missing out something? Right now, I am reading about Web deployment and packaging -- but I really don't know if I 'have' to do that. I am just trying out a simple appln.
[ April 10, 2002: Message edited by: shree vijay ]
--------------------
TRy this
<%@ page language="java" import="beans.databeans.*"%>
<jsp:useBean id="beans.databeans.takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>

I had the same problems as soon as gave the path where the bean was residing , it worked.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lot of annoying and mysterious problems can be avoided if you go ahead and make your application a "web application" with an entry in web.xml, etc etc. and with your classes in a package.
Bill
 
shree vijay
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have tried to put the whole thing as an appln.
MY application is ordapp under

c:\oracle\apache\apache\htdocs
The hierarchy is
ordapp (contains)
1 *.html
2 *.jsp
3 web-inf (contains)
1 web.xml
2 classes (contains)
TakeOrderBean.java
TakeOrderBean.class
my web.xml file is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<welcome-file-list>
<welcome-file>submitorder.html</welcome-file>
</welcome-file-list>
</web-app>

Still it doesn't work. I also saw that there is a file called server.xml. Is that essential?
TIA
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

.....class="htdocs.TakeOrderBean" ......
[ snip ]
2 classes (contains)
TakeOrderBean.java
TakeOrderBean.class
[ snip ]
Still it doesn't work. I also saw that there is a file called server.xml. Is that essential?

Ofcourse it still doesn't work.
I hate to say this but it is very clear to me that you are second guessing what works and what doesn't. Please take some time. Read a tutorial or two and see how it all fits together. You could have done all this if you din't waster your time guessing....pssttt! Sorry.
When you lean something, do it the right way, don't guess. It will not take you very far, if you do.
For what its worth..........
- madhav
 
shree vijay
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Madhav,
I think what your are referring to is that
TakeOrderBean is under the directory classes and therefore htdocs.TakeOrderBean is an error.
I should admit my error. In fact, I found out that soon after I posted and corrected and of course "still it doesn't work"
But regarding your opinion

I hate to say this but it is very clear to me that you are second guessing what works and what doesn't. Please take some time. Read a tutorial or two and see how it all fits together. You could have done all this if you din't waster your time guessing....


I think you would accept that there are as many ways of learning as there are people.
There are people who go through the whole set of facts , and then only try the basic things.
I have tried this approach and it doesn't work for me. I feel that I get mired in too much text and theory. You take a book, and there are all the details of all methods in a class, what they do ... on... and on...
I prefer the 'incremental approach', I guess especially with programming -- I try to decide the basic thing I want to do, search out the commands for that, try it out and then improve upon the basic thing with additional code -- and so forth -- as far as learning personally. That the basic structure works gives me added incentive to learn more and dig in.
I would like to state that I appreciate your opinion and of course, I will have to dig in more into this stuff. Thanks, of course.
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe you said you are using an web application called ordapp. I believe you should have defined a sub-directory in your Web-Inf\classes directory, this is where you should place you bean.
i.e.
\Web-Inf\classes\htdocs\TakeOrderBean.class
What do you think.
Craig
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic