Hi all,
I'm novice to
J2EE.
I've encountered a problem while accessing the deployed module in weblogic 8.1 server.
I'm sure that the webapplication module is deployed as i saw my module in administration console & also the status said that it is deployed.
when i access my web application by specifying the proper server and port no and context root it is showing
either 505 - resource not found error(
http://localhost:7001/Suresh-2/Suresh) or 404 - not found error.(
http://localhost:7001/Suresh-2/Suresh) Now let me elaborate what i've done till now.
My webapplication folder structure is : C:\bea\user_projects\domains\mydomain\applications\Suresh\WEB-INF\classes\Sai\ServExamp.class
My
servlet is ServExamp.java
I created a folder called "Suresh". In that folder created another folder called "WEB-INF". In WEB-INF created a folder called "Classes".
Since my servlet is in package "Sai", the .class file reside in \Suresh\WEB-INF\Classes\Sai\ServExamp.class
The source code is :
package Sai;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ServExamp extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res)throws IOException
{
PrintWriter out=res.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+"<body>"+
"<h1 align=center>HF\'s Chapter1 Servlet </h1>"
+"<br>"+today+"</body>"+"</html>");
}
}
Now i'm almost done creating a web application. Next, I constructed a simple web.xml descriptor that gives a web friendly name for my servlet, and points to
the servlet. I constructed web.xml descriptor file in the WEB-INF folder (C:\bea\user_projects\domains\mydomain\applications\Suresh\WEB-INF\).
The web.xml file source is :
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Hello World Web Application</display-name>
<description>
Test Servlet</description>
<servlet>
<servlet-name>ServExamp</servlet-name>
<servlet-class>Sai.ServExamp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServExamp</servlet-name>
<url-pattern>/Suresh</url-pattern>
</servlet-mapping>
</web-app>
Now I have told Weblogic that the URI /Suresh corresponds to my servlet "Sai.ServExamp".
-----------------------------------------------------------------------------------------------------------
My Web Application is ready to be deployed at this point. I logged onto Weblogic's admin console,
1) clicked on deployments, then navigated to "Web Application Modules" .
2) Clicked "Deploy new Web Application Module"
3) Navigated to the location of your web application folder (Suresh). There was a radio button next to it indicating that I can select that folder as a
valid web application.
4) I Clicked that radio button and clicked "Target Module".
5) It informed that my web application "Suresh" will be deployed to myServer.It asked a name for my web application deployment. By default it was "Suresh"
I clicked Deploy.
6) After deployment, my web application "Suresh" appeared in the "Web Application Modules" tree on the left.
I Clicked on "Suresh"( my web application) then clicked the testing tab, then clicked the link shown there(
http://localhost:7001/Suresh-2).
It was not showing my servlet (showed a 403 error)
Error - 403
This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
I think so it came b'coz I don't have an index.html or index.jsp page.
7)Instead,I added my servlet on to the URL it provided.
http://localhost:7001/Suresh-2/Suresh It is showing these error code: Http: 505 resource not allowed
The page cannot be displayed
The page you are looking for cannot be displayed because the address is incorrect.
--------------------------------------------------------------------------------
Please try the following:
If you typed the page address in the Address bar, check that it is entered correctly.
Open the localhost:7001 home page and then look for links to the information you want.
Click Search to look for information on the Internet.
when i just type :
http://localhost:7001/ -> Error 404 not found error
it's showing
Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code
SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding
address.
I want to run my web application & any help would be appreciated.
Thanks in advance.
with regards,
S.SayeeNarayanan.
---------------------------------
Note: I even deployed my war file, which i got by execution of (jar cv0f webapp.war . ) command from the root directory of my web application i.e. Suresh
Then executed my webapplication it is showing
error-505 resource not allowed.
--------------------------------------------------------------------------------------------