aspose file tools*
The moose likes BEA/Weblogic and the fly likes A small problem while running my webapplication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "A small problem while running my webapplication" Watch "A small problem while running my webapplication" New topic
Author

A small problem while running my webapplication

scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
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.

--------------------------------------------------------------------------------------------
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
My web.xml descriptor is formatted correctly.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Howdy scart scott,

Welcome to JavaRanch

May you please make use of CodeTags to paste the java source code so that it will look neatly and well formatted?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
I tried the link but it's not active anymore.
May be somebody will give proper solution to my problem of making my webapplication to run.
regards
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
Hi,
I tried to run a html program of my application .
It's working fine.
My html prg is in c:\bea\user_projects\....\applications\Suresh\web-inf\venkatesh.html

I deployed my application "Suresh" to weblogic server through admin console
and ran it by specifying
http://localhost:7001/Suresh-3/Venkatesh.html
It's working but when i want to run my servlet it's showing either 505 - resource not found or 404 error.
Expecting one of our greenhorn or somebody with good experience to solve this problem.

regards.
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
Hi all,
( I've use coding tags so that the code looks neat and formatted)
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 :


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 :


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.

---------------------------------------------------------------------------- I then tried to run an html page of my application which is working , but it's only the servlet page which is playing games.
Hope some greenhorn would solve this.

regards
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
Hi,
Since html page of my application is working, i checked for any errors while deploying my webapplication.

while deploying it is not showing any error, even my web app module name appeared on the webapplication module tree in the left pane of the admin console.

I clicked my web application module and then navigated to the " deploy" tab ( which is on the right hand side of console).
It informed that
target type -> myserver
status-> success.
which confirms that my module is deployed successfully.

Then i clicked on the Testing tab which showed a url: http://localhost:7001/Suresh-4/

Here when i run html page
http://localhost:7001/Suresh-4/Venkatesh.html
it's working fine.

But to run servlets, if i specify
http://localhost:7001/Suresh-4/Suresh
It's showing 405 - resource not allowed (and it's not showing 404 - resource not found) which confirms that the module is deployed.

If possible just run this application in your system & check it whether it is working.

I even checked my webapplication module's ( Suresh-4) configuration tab & checked my web.xml descriptor.
It's correct.

Hoping for your opinion!
regards.
scart scott
Greenhorn

Joined: Jan 08, 2008
Posts: 13
can somebody fix this problem?
Madusudhanan Ragothaman
Greenhorn

Joined: Dec 19, 2007
Posts: 6
Please try just calling

http://localhost:7001/Suresh , Seeing your web-xml , I think this should work

Another thing is

by saying http://localhost:7001 , nothing will get executed. You need to say some thing http://localhost:7001/console or some thing to make sure your server is running

by the way whatz this Suresh-2 and Suresh-4 stuff?

Thanks
Madhu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A small problem while running my webapplication