Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not able to deploy, context file broken

i used tomcat 7 and netbeans 7.4

when i start my web application i get

Cannot deploy the module. The context.xml file seems to be broken. Check whether it is well-formed and valid. The module has not been deployed.

it's my context.xml file

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <Resource name="jdbc/shareDS" auth="Container" type="javax.sql.DataSource"
          maxActive="50" maxIdle="10" maxWait="100000"
          username="${db.user}" password="${db.password}" driverClassName="com.mysql.jdbc.Driver"
          url="${db.url}"
          timeBetweenEvictionRunsMillis="1800000" autoReconnect="true"
          removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true"/>
</Context>

when i try to validate my context file, i get

Cannot find the declaration of element 'Context'. [19] 

any idea?

like image 795
robert trudel Avatar asked Oct 18 '13 16:10

robert trudel


1 Answers

Figured it out. The Netbeans deployment process wants you to add 1 simple parameter to the Context tag, namely: path. It needs to know what path the application will be on.

For example, this was my (opening) Context tag:

<Context antiJARLocking="true" path="/sas/">

My application is deployed at the /sas/ context root.

And now, Netbeans deploys my application without any further errors.

FYI: the antiJARLocking is something I put in to avoid locking of JAR's. It's not mandatory. For more information on the antiJARLocking, refer to the documentation over at: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

like image 174
gjoris Avatar answered Oct 08 '22 21:10

gjoris