facebook

Using incorrect web.xml file

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #294549 Reply

    Mary
    Member

    I am referring to the web.xml file at c:\development\Servers\Tomcat v6.0 Server at localhost-config\web.xml instead of the one within my project’s WEB-INF directory which is at C:\development\MyProject\WebContent\WEB-INF\web.xml.

    I am trying to use Tomcat 6 imbedded within MyEclipse Enterprise Workbench 6.5.1. I guess I’ve missed a basic configuration step.

    I’m using the Eclipse 3.0 Kickstart book by Carlos Valcarcel as a guide.

    Thanks to anyone who can tell me where my error is.

    #294566 Reply

    ernestz
    Member

    More than likely, there may be a problem with the ‘WebRoot’ folder. Most Eclipse setups default to a web root folder of WebContent. By default, when you create a new Dynamic Web Application using MyEclipse, the default web root folder is called “WebRoot”.

    Your best best is to create a new “Dynamic Web Probject” using MyEclipse, deploy, and just try to access the new project. If that works, compare the new empty project to your sample to find out what is different. You may also want to “restore” the MyEclipse Tomcat 6 configuration (Window -> Preferences -> MyEclipse Enterprise Workbench -> Servers -> Integrated Sandbox -> MyEclipse Tomcat 6 -> Restore MyEclipse Tomcat Server installation. The default settings work and should not require modification, with the exception of server logging.

    #294606 Reply

    Mary
    Member

    Can I not modify some configuration files instead of creating a new deployment? What files would those be? It seems I would understand what is going on better if I did that.

    I do have a separate project called “Servers” that is included in this project. It has the web.xml in it that is being used. Maybe I don’t need that project included if I’m using the embedded Tomcat server?

    I really want to understand what I am doing and why it is not working. Thank you so much for hanging in there with me.

    #294609 Reply

    Mary
    Member

    I’m just thinking if I create another project, I would most likely make the same wrong choice again. Right now I have “Web-Content” with META-INF and WEB-INF under it. WEB-INF contains the “lib” and “classes” directories. Above Web-Content , I have a directory names”MyProject” which is inside my development directory on the C: drive. Seems pretty standard so I must have the project configured incorrectly. I have two other projects in the development directory, one for testing simple Java files and one that looks like this:
    C:\development\Servers\Tomcat v6.0 Server at localhost-config

    #294613 Reply

    ernestz
    Member

    @kentucky_b wrote:

    Can I not modify some configuration files instead of creating a new deployment? What files would those be?

    Without knowing exactly what you have done, which configuration files would you chose to modify?

    @kentucky_b wrote:

    I do have a separate project called “Servers” that is included in this project. It has the web.xml in it that is being used. Maybe I don’t need that project included if I’m using the embedded Tomcat server?

    Using MyEclipse, you typically would not see a “Servers” project in the package explorer. I have only seen “Servers” using a standard Eclipse installation with the Web Tools Project (WTP) plugin.

    1. You might want to try a quick test. Bring up MyEclipse with a new workspace.
    2. Go into the Windows Preferences and enable the Integrated Sandbox Tomcat 6 server.
    3. Create a new Dynamic Web Project, and deploy it to the integrated Tomcat 6 server, call it ‘test’.
    4. Start the integrated Tomcat 6 server and attempt to access the resource as “http://localhost:8080/test”.

    #294618 Reply

    Mary
    Member

    @ernestz wrote:

    @kentucky_b wrote:

    Can I not modify some configuration files instead of creating a new deployment? What files would those be?

    I really do not know; that is why I am asking. I am not comfortable with creating new workspaces or projects quickly to test something, but I will get there!

    Since I do have both the embedded Tomcat instance and a free standing instance of Tomcat on my laptop, I am not sure which one is being referred to in that Servers project or if I need it or not to use the embedded Tomcat server.

    If I uncheck adding that project to MyProject, that would be one configuration change.

    I have also read about another file that tells what type of project you are creating; I don’t remember which file that was, but perhaps there is an error there.

    I can deliver an initial jsp page in this project; I just cannot access any servlets from that jsp page. I have a form on the jsp page which has a servlet in it’s action tag. I don’t think so, but may e I am using an incorrect name for that servlet.

    When I click on properties for my project, named MyProject, that is when I see that I am not using the web .xml within my project. So I think I am using the wrong web.xml; I assume this is configured somewhere that I can change. But I cannot seem to find where that would be.

    Does this help explain my situation? Maybe I am just not explaining myself well. I really do appreciate your hanging in there with me; and I will try creating a new workspace, etc. tomorrow.

    Without knowing exactly what you have done, which configuration files would you chose to modify?

    @kentucky_b wrote:

    I do have a separate project called “Servers” that is included in this project. It has the web.xml in it that is being used. Maybe I don’t need that project included if I’m using the embedded Tomcat server?

    Using MyEclipse, you typically would not see a “Servers” project in the package explorer. I have only seen “Servers” using a standard Eclipse installation with the Web Tools Project (WTP) plugin.

    1. You might want to try a quick test. Bring up MyEclipse with a new workspace.
    2. Go into the Windows Preferences and enable the Integrated Sandbox Tomcat 6 server.
    3. Create a new Dynamic Web Project, and deploy it to the integrated Tomcat 6 server, call it ‘test’.
    4. Start the integrated Tomcat 6 server and attempt to access the resource as “http://localhost:8080/test”.

    #294630 Reply

    Mary
    Member

    I am using the <url-pattern> to access the servlet. The servlet is in a package. But, given that the properties of the project show I am somehow accessing the wrong web.xml, that has to be the root cause of my difficulties. Where do I tell the project which web.xml to use? Is my web-root for the project somehow incorrect? What is the path to setting that? I am trying to narrow down what the problem might be. I’ve been “stuck ” here too long!

    #294642 Reply

    ernestz
    Member

    You may want to check out some of the tutorials here: http://myeclipseide.com/module-htmlpages-display-pid-7.html,
    specifically the “MyEclipse Web Project Tutorial” at http://www.myeclipseide.com/documentation/quickstarts/webprojects/ and “MyEclipse Tomcat Server Tutorial ” at http://www.myeclipseide.com/documentation/quickstarts/tomcat/. They can probably point you in the right direction.

    #294654 Reply

    Mary
    Member

    Thanks; I will pursue all the tutorials this evening. I may have found the problem.

    Looking at my project preferences under “Targeted Runtimes”, I see “Apache Tomcat v6.0” checked. Would this be the case when using the embedded Tomcat server?

    The configuration files I would be wondering if they are correct are all located at :C:\development\MyProject\.settings

    I believe there is one of these directories for each project. I don’t know if there is a tutorial related to understanding and configuring a project for these files. Normally, I would think these files are created by Eclipse from the GUI responses given by the user, but they could be modified directly in the event of a problem…

    #294657 Reply

    ernestz
    Member

    I”m not sure what your setup is like, but, using MyEclipse, a web project does not typically have a “Targeted Runtime” preferences section. I’ve only seen that with Eclipse and the WTP (Web Tools Platform). Have your questions been based on MyEclipse or Eclipse?

    MyEclipse adds added functionality to the base Eclipse platform. And while similar, there are inherent differences.

    #294765 Reply

    Mary
    Member

    I think the Targeted Runtime should have been left blank. I am using MyEclipse. When I unchecked that Targeted Runtime and omitted the “Servers” project we discussed above, I can not access the correct web.xml. Thank you for hanging in there with me through all that.

    #294777 Reply

    Mary
    Member

    Continuing the saga, I am able to access my servlets now which was the original problem.
    However, in the “Problems” tab of MyEclipse 6.5, I am seeing the following message:
    Severity and Description Path Resource Location Creation Time Id
    Missing web.xml deployment descriptor in WEB-INF folder MyProject Unknown 1233810587084 965

    I am able to navigate from the html file to a servlet so I think MyEclipse is seeing the web.xml. I don’t understand the implications of this message.
    Thank you very much.

    #294908 Reply

    support-joy
    Member
    #294942 Reply

    Mary
    Member

    YEs, you can close this thread, and I will follow that one. Thanks.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Using incorrect web.xml file

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in