0

以下は私のプロジェクトcontext.xmlのディレクトリにある私のファイルです:META-INF

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/poll"/>

<Resource name="jdbc/PollDatasource" auth="Container" type="javax.sql.DataSource"
 driverClassName="org.apache.derby.jdbc.ClientDriver"
 url="jdbc:derby://localhost:1527/poll database;create=true"
 username="suhail" password="suhail"
 maxActive="20" maxIdle="10" maxWait="-1" />

しかし、プロジェクトnetbeansをデプロイ/実行しようとすると、次のエラーが発生します。

[Fatal Error] :4:2: The markup in the document following the root element must be 
well-formed.
W:\UnderTest\NetbeansCurrent\poll\nbproject\build-impl.xml:721: Deployment error: 
Tomcat configuration file 
W:\UnderTest\NetbeansCurrent\poll\web\META-INF\context.xml seems to be broken.
Please make sure it is parseable and valid.
See the server log for details.

なぜこのエラーが発生するのですか?にデータベース情報を追加しましたcontext.xml

ここに画像の説明を入力してください

4

1 に答える 1

7

context.xmlで、Contextタグの>の直前の/を取り出し、リソースの後に終了タグを追加します。リソースはコンテキスト内で定義する必要があります。

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

    <Resource name="jdbc/PollDatasource" auth="Container" type="javax.sql.DataSource"
     driverClassName="org.apache.derby.jdbc.ClientDriver"
     url="jdbc:derby://localhost:1527/poll database;create=true"
     username="suhail" password="suhail"
     maxActive="20" maxIdle="10" maxWait="-1" />

</Context>

お役に立てれば!

于 2012-07-20T19:19:15.870 に答える