3

I'm a beginner at creating a dynamic web project in Eclipse. I need the context.xml file to set up a database realm, but it's not under META-INF, instead I have found it in Tomcat's conf directory. Have I configured Eclipse/Tomcat wrong since all sources says the file should be in META-INF? How can I add a context.xml file to my project?

I am using Eclipse mars and Tomcat 8.

Edit I read the post linked in the comments, they are not duplicates. Frankly I cannot even understand what the other person is asking, though this could be due to all this terminology being new to me.

Gemtastic
  • 6,253
  • 6
  • 34
  • 53
manic bubble
  • 147
  • 1
  • 3
  • 13

1 Answers1

1

Even though Eclipse is an awesome tool, I recommend you do the web things with NetBeans.

In Eclipse you might not find the context.xml file where it should be under meta-inf, to find the file you can check followings:

First check the workspace path in Eclipse, assume it points to /root/workspace.

Then explorer the folder, you should have a folder called Servers, if you don't simply try to find it by looking in server tab in Eclipse.

In the Servers folder, you will find something like Tomcat v8.0 Server at localhost-config, locate the folder and the config files related to the tomcat will be found there.

This is because Eclipse follows its workspace schema for web-apps as well, while NetBeans follows the things specified by Tomcat.

And remember creating, editing or removing config files for tomcat while you are working with Eclipse will not affect anything since the files specified will be used instead.


The server stuffs would be found as a project-like item named server too, you can find it on package-manager where you explore the projects tree, stuffs,...
user4872433
  • 113
  • 7