srvlet初学,帮帮忙吧,大哥们。难道我的classpath设错了?怎么设呢 ?
7 个解决方案
#1
你可以将你的class文件放在$ResinHome$\doc\WEB-INF\classes下,或者打包后放在$ResinHome$\Lib下。
#2
这样访问:http://172.17.1.123/servlet/HelloServlet,对了吧?
我已经把,helloservlet.java和helloservlet.class拷到了$ResinHome$\doc\WEB-INF\classes下了。
我已经把,helloservlet.java和helloservlet.class拷到了$ResinHome$\doc\WEB-INF\classes下了。
#3
出的问题如下:
500 Servlet Exception
javax.servlet.ServletException: Class `servlettest.Servlet1' was not found
in classpath.
Classes normally belong in d:\inetpub\wwwroot\WEB-INF\classes.
at com.caucho.server.http.Application.instantiateServlet(Application.java:2819)
at com.caucho.server.http.Application.createServlet(Application.java:2753)
at com.caucho.server.http.Application.loadServlet(Application.java:2711)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2478)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2445)
at com.caucho.server.http.Invocation.service(Invocation.java:276)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:338)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:270)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
500 Servlet Exception
javax.servlet.ServletException: Class `servlettest.Servlet1' was not found
in classpath.
Classes normally belong in d:\inetpub\wwwroot\WEB-INF\classes.
at com.caucho.server.http.Application.instantiateServlet(Application.java:2819)
at com.caucho.server.http.Application.createServlet(Application.java:2753)
at com.caucho.server.http.Application.loadServlet(Application.java:2711)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2478)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2445)
at com.caucho.server.http.Invocation.service(Invocation.java:276)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:338)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:270)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
#4
serverlet没有配好
#5
web server没找到
#6
???我原来没配对吗?能有人给俺详细讲讲吗?时间紧迫,帮帮忙好吗?有相关的资料也行啊
#7
重新描述一下问题:我用的是iis+resin;并且classpath设成:$ResinHome$\doc\WEB-INF\classes\;我的servlettest.jar 和servlettest.class都已经复制到上述classpath目录里了;访问用了:http://172.17.1.123/servlet/servlettest.servlet1
结果就出现上面的错误了。有人知道怎么回事,怎么解决吗?
两天了呢。帮帮忙啊……help!
结果就出现上面的错误了。有人知道怎么回事,怎么解决吗?
两天了呢。帮帮忙啊……help!
#1
你可以将你的class文件放在$ResinHome$\doc\WEB-INF\classes下,或者打包后放在$ResinHome$\Lib下。
#2
这样访问:http://172.17.1.123/servlet/HelloServlet,对了吧?
我已经把,helloservlet.java和helloservlet.class拷到了$ResinHome$\doc\WEB-INF\classes下了。
我已经把,helloservlet.java和helloservlet.class拷到了$ResinHome$\doc\WEB-INF\classes下了。
#3
出的问题如下:
500 Servlet Exception
javax.servlet.ServletException: Class `servlettest.Servlet1' was not found
in classpath.
Classes normally belong in d:\inetpub\wwwroot\WEB-INF\classes.
at com.caucho.server.http.Application.instantiateServlet(Application.java:2819)
at com.caucho.server.http.Application.createServlet(Application.java:2753)
at com.caucho.server.http.Application.loadServlet(Application.java:2711)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2478)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2445)
at com.caucho.server.http.Invocation.service(Invocation.java:276)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:338)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:270)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
500 Servlet Exception
javax.servlet.ServletException: Class `servlettest.Servlet1' was not found
in classpath.
Classes normally belong in d:\inetpub\wwwroot\WEB-INF\classes.
at com.caucho.server.http.Application.instantiateServlet(Application.java:2819)
at com.caucho.server.http.Application.createServlet(Application.java:2753)
at com.caucho.server.http.Application.loadServlet(Application.java:2711)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2478)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2445)
at com.caucho.server.http.Invocation.service(Invocation.java:276)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:338)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:270)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
#4
serverlet没有配好
#5
web server没找到
#6
???我原来没配对吗?能有人给俺详细讲讲吗?时间紧迫,帮帮忙好吗?有相关的资料也行啊
#7
重新描述一下问题:我用的是iis+resin;并且classpath设成:$ResinHome$\doc\WEB-INF\classes\;我的servlettest.jar 和servlettest.class都已经复制到上述classpath目录里了;访问用了:http://172.17.1.123/servlet/servlettest.servlet1
结果就出现上面的错误了。有人知道怎么回事,怎么解决吗?
两天了呢。帮帮忙啊……help!
结果就出现上面的错误了。有人知道怎么回事,怎么解决吗?
两天了呢。帮帮忙啊……help!