Missing JavaBean..

Discussion in 'Java' started by Andrew Thompson, Jul 7, 2003.

  1. My first (of many) dumb newbie questions while learning
    JSP/Beans and other server side marvels relates to a page at..
    http://www.lensescapes.com/tst/jsp/124 - accessbean.jsp

    This page crashes while trying to access a JavaBean in the
    same directory. There are two things I don't understand
    about the page.

    Why the "Note: sun.tools.javac.Main has been deprecated"
    message - my bean doesn't have one, but I think that's
    secondary to "Class _tst._jsp.LineBean not found"..

    It looks as though it's looking in the tst/jsp directory for the
    bean, which exists both there as well as WEB-INFO/classes,
    the tst/jsp directory also has the source code of the (absolutely trivial)
    bean.

    The java code as well as the JSP saved as html are linked from
    http://www.lensescapes.com/tst/jsp/accessbean.html

    Can anybody clue me in as to how to get this simple
    bean to work?

    (scratches head) I'm very new to ServerSide stuff and not
    sure of what is relevant so I better include more, rather than
    less info, so..

    I also have a series of JSP's in the http://www.lensescapes.com/tst/jsp/
    directory, one of which is..
    http://www.lensescapes.com/tst/jsp/110 - properties.jsp
    This provides some further properties on the server environment.

    Any help/pointers appreciated

    --
    Andrew Thompson
    http://physci.org/
    http://lenescapes.com/
     
    Andrew Thompson, Jul 7, 2003
    #1
    1. Advertising

  2. Andrew Thompson

    Andy Flowers Guest

    The message "Note: sun.tools.javac.Main has been deprecated" is related to
    your use of JDK 1.4. According to the Resin developers it is a harmless
    warning and can be safely ignored.

    As to your 'real' problem it appears that the LineBean is not declared to be
    in the correct package, in fact from the source you have provided it's not
    in any package. Either leave it with no package declaration and move the
    ..class file to the root of the WEB-INF\classes tree or put it into a
    package.


    "Andrew Thompson" <> wrote in message
    news:AcgOa.1464$...
    > My first (of many) dumb newbie questions while learning
    > JSP/Beans and other server side marvels relates to a page at..
    > http://www.lensescapes.com/tst/jsp/124 - accessbean.jsp
    >
    > This page crashes while trying to access a JavaBean in the
    > same directory. There are two things I don't understand
    > about the page.
    >
    > Why the "Note: sun.tools.javac.Main has been deprecated"
    > message - my bean doesn't have one, but I think that's
    > secondary to "Class _tst._jsp.LineBean not found"..
    >
    > It looks as though it's looking in the tst/jsp directory for the
    > bean, which exists both there as well as WEB-INFO/classes,
    > the tst/jsp directory also has the source code of the (absolutely trivial)
    > bean.
    >
    > The java code as well as the JSP saved as html are linked from
    > http://www.lensescapes.com/tst/jsp/accessbean.html
    >
    > Can anybody clue me in as to how to get this simple
    > bean to work?
    >
    > (scratches head) I'm very new to ServerSide stuff and not
    > sure of what is relevant so I better include more, rather than
    > less info, so..
    >
    > I also have a series of JSP's in the http://www.lensescapes.com/tst/jsp/
    > directory, one of which is..
    > http://www.lensescapes.com/tst/jsp/110 - properties.jsp
    > This provides some further properties on the server environment.
    >
    > Any help/pointers appreciated
    >
    > --
    > Andrew Thompson
    > http://physci.org/
    > http://lenescapes.com/
    >
    >
     
    Andy Flowers, Jul 7, 2003
    #2
    1. Advertising

  3. "Andy Flowers" <> wrote in message
    news:eek:aiOa.5900$...
    > The message "Note: sun.tools.javac.Main has been deprecated" is related to
    > your use of JDK 1.4. According to the Resin developers it is a harmless
    > warning and can be safely ignored.
    >
    > As to your 'real' problem it appears that the LineBean is not declared to

    be
    > in the correct package, in fact from the source you have provided it's not
    > in any package. Either leave it with no package declaration and move the
    > .class file to the root of the WEB-INF\classes tree or put it into a
    > package.


    I've put a copy of the class in..
    http://www.lensescapes.com/WEB-INFO/classes/LineBean.class
    Is that where it needs to be put to be accessed in the JSP as
    <jsp:useBean _class="LineBean"_ id="bean0" scope="page" />?

    The exceptions on the page indicate the server is still looking in
    tst/jsp/ for the class, or am I reading this wrong..
    "Class _tst._jsp.LineBean not found"

    ??

    --
    Andrew Thompson
    http://physci.org/
    http://lenescapes.com/
     
    Andrew Thompson, Jul 7, 2003
    #3
  4. Andrew Thompson

    Andy Flowers Guest

    It needs to be in WEB-INF\classes - not WEB-INFO

    The _tst._jsp is just a reflection of the directory your JSP is in. The
    compiler cannot find the .class file so is giving it's best stab error
    message about where it might be looking for it.

    "Andrew Thompson" <> wrote in message
    news:NRiOa.1554$...
    >
    > "Andy Flowers" <> wrote in message
    > news:eek:aiOa.5900$...
    > > The message "Note: sun.tools.javac.Main has been deprecated" is related

    to
    > > your use of JDK 1.4. According to the Resin developers it is a harmless
    > > warning and can be safely ignored.
    > >
    > > As to your 'real' problem it appears that the LineBean is not declared

    to
    > be
    > > in the correct package, in fact from the source you have provided it's

    not
    > > in any package. Either leave it with no package declaration and move the
    > > .class file to the root of the WEB-INF\classes tree or put it into a
    > > package.

    >
    > I've put a copy of the class in..
    > http://www.lensescapes.com/WEB-INFO/classes/LineBean.class
    > Is that where it needs to be put to be accessed in the JSP as
    > <jsp:useBean _class="LineBean"_ id="bean0" scope="page" />?
    >
    > The exceptions on the page indicate the server is still looking in
    > tst/jsp/ for the class, or am I reading this wrong..
    > "Class _tst._jsp.LineBean not found"
    >
    > ??
    >
    > --
    > Andrew Thompson
    > http://physci.org/
    > http://lenescapes.com/
    >
    >
    >
     
    Andy Flowers, Jul 7, 2003
    #4
  5. Andrew Thompson

    Wendy S Guest

    "Andrew Thompson" <> wrote
    > I've put a copy of the class in..
    > http://www.lensescapes.com/WEB-INFO/classes/LineBean.class
    > Is that where it needs to be put to be accessed in the JSP as
    > <jsp:useBean _class="LineBean"_ id="bean0" scope="page" />?


    What are those underscores for?

    Which JDK are you using? At some point in the recent past, Sun began
    enforcing a rule which says you cannot import a class in the default package
    [no package statement] into a class that is in a named package. If the
    container is making up package names for the Servlets that your JSP's get
    converted into, that may be why you can't import your bean class.

    Production code needs to be packaged anyway, so you might try that and see
    if it fixes this problem.

    --
    Wendy in Chandler, AZ
     
    Wendy S, Jul 7, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A Bag Of Memes

    Re: Use one javabean for each table?

    A Bag Of Memes, Jul 24, 2003, in forum: Java
    Replies:
    0
    Views:
    447
    A Bag Of Memes
    Jul 24, 2003
  2. tom
    Replies:
    0
    Views:
    373
  3. Andy
    Replies:
    0
    Views:
    302
  4. Todd Peterson
    Replies:
    2
    Views:
    503
    Todd Peterson
    Sep 11, 2003
  5. m
    Replies:
    1
    Views:
    342
    John C. Bollinger
    Oct 9, 2003
Loading...

Share This Page