Not able to run servlets in Weblogic Server 5.1


Web tier: servlets, JSP, Web frameworks: Not able to run servlets in Weblogic Server 5.1

  1. Hi... When I run my servlet thru weblogic server it shows me following error: Error loading servlets: examples.servlets.SessionCounter

    Java.lang.NoClassDefFoundError : examples/servlets/SessionCounter (wrong name : SessionCounter)

    I have posted SessionCounter.class file in C:\weblogic\myserver\servletclasses\examples\servlets\ folder and also registerd with weblogic.httpd.register.ServletCount in file
    I have chked path is properly set weblogic.httpd.servlet.classpath=D:/weblogic/myserver/servletclasses but still it is not working while other servlets in the same folder are working properly .

    Please help me to solve this error

    Thanks in advance


    Threaded Messages (10)

  2. PRE_CLASSPATH[ Go to top ]

    You could have 'PRE_CLASSPATH' - check startWLS.cmd. I am using 7.4 and also you could keep classes (regular used ones) under 'bea\weblogic700\server\ext'.

    Sorry I am talking about 7.x, not really sure about 5.1

    Another thought is that if SessionCounter is compiled in a package; make sure that you keep same package structure under - servletclasses\examples\servlets\ folder.

    i.e - servletclasses\examples\servlets\examples\servlets\SessionCounter

  3. correction..[ Go to top ]

    sorry not


    - servletclasses\examples\servlets\examples\servlets\example\xx\SessionCounter
  4. correction..[ Go to top ]

    sorry notservletclasses\examples\servlets\examples\servlets\SessionCounter- servletclasses\examples\servlets\examples\servlets\example\xx\SessionCounter
    Hi Arun,

    I have not used any Package. I have simply post the file in servletclasses/examples/servlets/SessionCounter.class so wht should i set more


  5. try[ Go to top ]

    put SessionCounter.class immediate under Servletclasses directory, if you have any package.
  6. try[ Go to top ]

    put SessionCounter.class immediate under Servletclasses directory, if you have any package.
    if i put SessionCounter under ServletClasses directory then wht setting should i make in file
  7. try[ Go to top ]

    These are the 2 arugments you should be looking in
    weblogic.httpd.servlet.classpath=<path>; [defaulted to /weblogic/myserver/servletclasses]
    weblogic.httpd.servlet.reloadCheckSecs=some refresh time integer

    You can add multiple directories, you own, to the servlet classpath, separated by semi-colons ";".


    you can also try to register your new sevlet class using console. hope you know how to do that. if not
    then go to console HTTP option .. then Servlets ManagedObject and take command tag... give servlet name as 'virtual name'.

    if this doesnt work then give me u r weblogic.propeties file.

  8. try[ Go to top ]

    will try and let u know
  9. try[ Go to top ]

    not able to post whole file so if u dont mind can u gie me ur email id so that i can send u..

    Second i have tried thru console but not succeed

    I hvae given following parameter
    I kept my file DBconnection.class in D;\weblogic\myserver\myservletclasses

    Virtual name : connection
    servlet name : wht shuld i give only DBConnection or something else

    Please suggest me
  10. Hi....

    I have posted part of
    Here my servelt is DBConnection.class file and posted in D;\weblogic\myserver\myservletclasses as well in D;\weblogic\myserver\myservletclasses\examples\servlets folder now tell me wht should i write here

     # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # --------------------------------------------------------
    # Set ACLs for these as desired
    # --------------------------------------------------------
    # Set initArgs phonelist value to the fully-qualified
    # file specification of the phonelist file\
    #DBConnection is User Written Servlet
  11. I am little confused here. You said before your servlet class doesnt have any package 'DBConnection.class' (i assue this is u r servlet - bit strange name). But when you register you have regsitered like this - 'weblogic.httpd.register.connection=examples.servlets.DBConnection'. So create the directory structure or compile using javac -d and place classes under appropriate directory/package.

    Its a simple job, i dont know why you have so much trouble.

    Also, have a look in here.