problem in weblogic(jsp calling bean)


EJB design: problem in weblogic(jsp calling bean)

  1. problem in weblogic(jsp calling bean) (14 messages)

       im trying to call a simple bean from jsp..i put my bean in clientclasses and set my classpath to that..but i get the following problem when i call the jsp page

    /hello.jsp(11): Could not create a bean of type: TestBean: java.lang.ClassNotFoundException: TestBean
    probably occurred due to an error in /hello.jsp line 11:
    <jsp:useBean id="test" class="TestBean" />

    pls anyone help me

    Threaded Messages (14)

  2. problem in weblogic(jsp calling bean)[ Go to top ]

    are your home and remote interfaces also there in the client classes ..........?
    p.s: It definately is a class path problem...nothing to lose sleep about
  3. problem in weblogic(jsp calling bean)[ Go to top ]

    hello sahil,
               i didnt use any ejb here..i just try to call a simple bean from a jsp code is

    <jsp:useBean id="test" class="TestBean" />
    <% out.println(test.getMessage()); %>

    TestBean is nothing but a simple bean has a single method

    public class TestBean{


    public String getMessage()

     return "message";



    i put my bean in clientclasses ant set my classpath to that before start the server...but i get the above mentioned error..pls help me

    thx a lot
  4. problem in weblogic(jsp calling bean)[ Go to top ]

    Make sure that you have set the classpath of the server. In other words, make sure that your server's batch file is not changing the classpath that you set on the console.
  5. problem in weblogic(jsp calling bean)[ Go to top ]

    Have you done the import of the bean?

    <%@ page import="packages.BeanName"%>

    You should put a line like that on the top of the page.

    Maybe this will help you.
  6. problem in weblogic(jsp calling bean)[ Go to top ]


    U donn't need to import the beans..

    U put u'r bean in a package, say com.bean.test.TestBean
    and put the class file in the WEB-INF/classes/com/bean/test
    folder and in the jsp u mention the full path fo the bean class
    <jsp:useBean id="test" scope="session" class="com.bean.test.TestBean" />

    Hope this helps

  7. problem in weblogic(jsp calling bean)[ Go to top ]

    hello friends,
               i tried all those things u said..but still i get the same it right to put the classfile under clientclasses?..pls direct me...

    dear mr.saran i dont find any web-inf directory under my weblogic directory(in weblogic5.1) there anyother way?

    thx a lot again
  8. problem in weblogic(jsp calling bean)[ Go to top ]


    Sorry.. i gave the path for weblogic6.0.

    For 5.1.. i guess u have to put the javabean class files
    for examples if u'r beans r in package com.bean.test
    then put u'r bean class files in

    jsp will be the same as i told before..

    I think u no need to put it in clientclasses

    Try it out and let me know..
  9. problem in weblogic(jsp calling bean)[ Go to top ]

    hai saran,
             i tried that aslo but i donno what the problem is unable to access the beans..still i get the following error

    Wed Feb 07 12:21:58 GMT 2001:<E> <ServletContext-General> Servlet failed with Exception
    weblogic.servlet.jsp.JspException: (line 11): Could not create a bean of type: TestBean: java.lang.ClassNotFoundException
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.RuntimeException.<init>(
    at weblogic.servlet.jsp.JspException.<init>(
    at weblogic.servlet.jsp.JspLexer.jspException(
    at weblogic.servlet.jsp.JspLexer.processBeanTag(
    at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(Compiled Code)
    at weblogic.servlet.jsp.JspLexer.mXML_THING(
    at weblogic.servlet.jsp.JspLexer.mTOKEN(
    at weblogic.servlet.jsp.JspLexer.nextToken(Compiled Code)
    at weblogic.servlet.jsp.JspLexer.parse(Compiled Code)
    at weblogic.servlet.jsp.JspParser.doit(Compiled Code)
    at weblogic.servlet.jsp.JspParser.parse(
    at weblogic.servlet.jsp.Jsp2Java.outputs(
    at weblogic.utils.compiler.CodeGenerator.generate(Compiled Code)
    at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
    at weblogic.servlet.jsp.JspStub.prepareServlet(
    at weblogic.servlet.internal.ServletStubImpl.getServlet(
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(
    at weblogic.socket.MuxableSocketHTTP.execute(
    at Code)

      if anyone knows the solution pls help me...
  10. problem in weblogic(jsp calling bean)[ Go to top ]


    The problem will be in u'r environment settings..
    serverclasses may not be included in the settings..
    If possible send u'r env settings in u'r system..
    Check u'r setEnv batch file in weblogic folder..
    And how did u declared u'r bean initialisation in the jsp..?
    If i get these inf i try to solve u'r prob...

  11. problem in weblogic(jsp calling bean)[ Go to top ]

    hai saran,
     yes definetely there is a problem in classpath...i didnt modify anything in startweblogic.cmd or setEnv..i just use a batch file..i execute it before starting the server..i have given it here

    set path=%path%;e:\weblogic\bin\oci815_8;e:\weblogic\oci\bin\oci815_8;
    set classpath=%classpath%;e:\weblogic\lib\weblogic510sp8boot.jar;c:\jdk1.1.8\lib\;e:\weblogic\classes\boot;e:\weblogic\eval\cloudscape\lib\cloudscape.jar;e:\weblogic\lib\weblogicaux.jar;e:\weblogic\classes;e:\weblogic;e:\weblogic\myserver\clientclasses;
    set Dweblogic.class.path=%Dweblogic.class.path%;e:\weblogic\lib\weblogic510sp8.jar;e:\weblogic\classes;e:\weblogic\licence;e:\weblogic\lib\weblogic\weblogicaux.jar;e:\weblogic\myserver\serverclasses weblogic.server

    i think i made a mistake here..pls tell me what is wrong in the above file..if everything is right then tell me am i have to modify anything in the startweblogic.cmd or setenv

    pls clear this

    thx a lot
  12. problem in weblogic(jsp calling bean)[ Go to top ]


    Try with including the serverclasses in u'r CLASSPATH environment variable though its there in weblogic classpath.

    U'r CLASSPATH should be as:

    %CLASSPATH%; e:\weblogic\lib\weblogic510sp8boot.jar;
    c:\jdk1.1.8\lib\; e:\weblogic\classes\boot; e:\weblogic\eval\cloudscape\lib\cloudscape.jar; e:\weblogic\lib\weblogicaux.jar;e:\weblogic\classes; e:\weblogic;e:\weblogic\myserver\clientclasses;

    I guess all other path settings r correct.


  13. problem in weblogic(jsp calling bean)[ Go to top ]

    hai saran,
     im still getting the same probs
  14. problem in weblogic(jsp calling bean)[ Go to top ]

    Mmm.. Interesting..
    Make sure u declared the bean in jsp with full path.
    If u send me the codes i will try my level best..

  15. Hi guys,

    It's quite interesting to see your conversation. As per my knowledge whatever the path saran mentioned should work.


    Try this:

    inside jsp:

    <page import="xxx.yyy.BeanName">
    <jsp:useBean id="xxxxx" scope="yyy" class="BeanName">

    Location of JSP:

    Keep this JSP inside

    C:\weblogic\myserver\public_html (if u want create your own package and add in your property file)

    Location of Bean:


    After doing this...

    Give the classpath of the bean in the post classpath of the startweblogic.cmd file:

    The classpath is:


    after doing this start the server and call the JSP

    Hope this should work:

    if u have further problem give a msg