When I try to access a
servlet via weblogic 8.1 I get the following error:
Found no context for "/servlet/brokearage.broker.co.servlet.broker.TestServlet". This request does not match the
context path for any installed Web applications, and there is no default Web application configured.>
These are the steps I took
1) Created a servlet
package brokearage.broker.co.servlet.broker;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TestServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();
out.println("Broker Up and Running");
}
}
2) Created a web.xml file
<?xml version="1.0"?>
<!DOCTYPE WEB-APP PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>TestServlet</display-name>
<description>TestServlet</description>
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>brokearage.broker.co.servlet.broker.TestServlet</servlet-class>
</servlet>
</web-app>
3) Jarred it into a war file : BrokerWAR.war
META-INF\MANIFEST.MF (Empty)
WEB-INF\web.xml
WEB-INF\classes\brokearage\broker\co\servlet\broker\TestServlet.class
4) Jarred the war file into a EAR file
BrokerWAR.war in the top directory
5)Edited the application.xml
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD
J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
<application>
<display-name/>
<module>
<ejb>BrokerEJB.jar</ejb>
</module>
<module>
<
java>TradeJar.jar</java>
</module>
<module>
<web>
<web-uri>BrokerWAR.war</web-uri>
<context-root>BrokerWAR</context-root>
</web>
</module>
</application>
6) Called the servlet with the following url:
http://localhost:11001/servlet/brokearage.broker.co.servlet.broker.TestServlet Thanks for any help
Tony