Problem:
When I try to add following code to context.xml of Tomcat 7 It gives this error.
(NOTE: I'm adding this code from inside the Eclipse)
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource
name="jdbc/UsersDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/usersDB"
username="root"
password="secret"
/>
</Context>
Error:
Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete. Element type "Resource" must be followed by either attribute specifications, ">" or "/>".
And when I remove this code and save context.xml , Server starts successfully without doing anything (Refreshing and all).
What I have tried:
Referred This question: publishing failed with multiple errors eclipse
- Tried closing Eclipse and opening again.
- Tried closing and opening peoject again.
Nothing is working.
What should I try Now?
UPDATE:
Tomcat server started successfully. I just typed everything in context.xml rather than copy paste the code. It could be some encoding problem I guess in copy pasting the code directly into eclipse file.