File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes How to set context-root for web application in 6.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "How to set context-root for web application in 6.1" Watch "How to set context-root for web application in 6.1" New topic
Author

How to set context-root for web application in 6.1

Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
How do I set context-root for web application in 6.1 when using the exploded directory format for deploying.
I think for deploying using the EAR, I can set the context-root element in application.xml.
But I tried to put the context-root element in my weblogic.xml which is placed under WEB-INF directory. As expected I got the SAX exception because, the dtd for version 6 doesnot have any element named context-root.
Please help
Thanks in advance
Pradeep


Pradeep<br />Consultant - Enterprise Solutions,<br />Infosys Technologies Ltd,<br />Bangalore, India
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1836
If I remember right the folder name of your webapplication is the context root.
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1836
This is when you want to deploy only the web application and not a ear.
Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
Thanks Mahindrakar,
But I actually wanted to set the context root to nothing. WHich means I wanted to access my webapp without using the /webappname/resource URL. Instead I should be able to access it using /resource as the URL as is the case with the DefaultWebApp provided in 6.1.
I came to know that in Weblogic 7.0 there is an option by which I can have an element named context-root set up in the weblogic.xml present in the WEB-INF folder of my web app.
All these problems come because I want to deploy using the exploded directory format instead of EAR.
Thanks once again,
Pradeep
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1836
Now I get it that you want to set this web application as your default application.
Why havent you tried out what Chris Mathews has explained
here very clearly. The same steps have to be followed whether it is a 6.1 application or a 7.0 application.
I have verified this too.
However here is a slight correction
Open up the WebLogic console. Select your server, click on the Connections tab. Then select the HTTP tab, select your default web application from the drop-down of Default Web Application. Restart the server. Done.
Please Note the name that is in the popup will be the name of the directory where you have unzipped the web application you have specified.
Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
Thanks Mahindrakar,
In fact I had thought that by setting my web app to default I would be able to access it without having to specify a context path in the URL. But it didn't work although my webapp is now the default.
So I thought probably by setting the context-root of my web-app to nothing,I should be able to access it(without the context-path).
In fact I had posted that question(in a different forum link) earlier than this one.
Hope I am able to convey my problem
Thanks once again,
Pradeep
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Hi Pradeep,
your problem has been well understood.
I am surprised by what u have posted. By making a web application a default one it worked perfectly fine for me.
To quote from BEA doc -
"If you declare a default Web Application that fails to deploy correctly, an error is logged and users attempting to access the failed default Web Application receive an HTTP 400 error message."
One more thing - Have u restarted the server after making configuring the default web app from admin console.
I am not sure whether server restart is required but give a try.

Originally posted by Pradeep Sahoo:
Thanks Mahindrakar,
In fact I had thought that by setting my web app to default I would be able to access it without having to specify a context path in the URL. But it didn't work although my webapp is now the default.
So I thought probably by setting the context-root of my web-app to nothing,I should be able to access it(without the context-path).
In fact I had posted that question(in a different forum link) earlier than this one.
Hope I am able to convey my problem
Thanks once again,
Pradeep


Groovy
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Yes a server restart is required. The other thing you will want to check is the logs. Make sure that your servlet is being deployed. The logs will also tell you what context the servlet was bound to.
Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
Thanks Pradeep and Mahindrakar,
My problem is solved now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set context-root for web application in 6.1
 
Similar Threads
syntax for setting context root
how to configure the a web application directory as the root directory
tomcat 6 - how to define context root name diff than WAR file name
requested resource() not found for simple HTML?
problem in context root