• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why i can't find the servlet class? is there anything wrong?

 
chinajy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a freshman in jsp/servlet, when i try my first servlet with weblogic 6.1(sp2),i get the following message.
I put my servlet in a directory named \servlets,the parent directory of which is in my classpath.my web.xml and the wrong message is as follows,please help me,thanks a lot
=========================================
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>mybbs</display-name>
<welcome-file-list>
<welcome-file>cover.jsp</welcome-file>
<welcome-file>newuser.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>addrecord2</servlet-name>
<servlet-class>/servlet/dealins.class</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>addrecord2</servlet-name>
<url-pattern> /addrecord2</url-pattern>
</servlet-mapping>
</web-app>

//wrong message
==============================================
<2002-5-6 > <Error> <HTTP> <[WebAppServletContext(1365817,szylbb
s,/szylbbs)] Servlet failed with ServletException
javax.servlet.ServletException: Servlet class: '\servlet\dealins.class' could no
t be loaded - the requested class wasn't found in the classpath: 'D:\szylbbs'
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:594)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried accesing the servlet by it's name instead of it's class?

Bosun
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chinajy
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at JavaRanch's naming policy. . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic