2010-03-02 68 views
31

我試圖建立的NetBeans 6.8的Java Web項目,但我得到得到以下錯誤:「URI擁有權限組件」是什麼意思?

The module has not been deployed.

它指向我build-impl.xml文件,行577:

<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/> 

了GlassFish v3的錯誤日誌中說:

SEVERE: Exception in command execution : java.lang.IllegalArgumentException: URI has an authority component 
java.lang.IllegalArgumentException: URI has an authority component 
    at java.io.File.<init>(File.java:368)`..., etc. 

是什麼「URI有一個授權組成」是什麼意思?

+0

難道你的意思‘J2EE’標記這個(搜索文本「權威不存在,路徑不能有兩個斜槓開始」)? – 2010-03-02 20:12:14

+0

我擡頭看'URI語法權威組件',這看起來像一個很好的參考:http://www.ietf.org/rfc/rfc2396.txt ... – vkraemer 2010-03-03 00:48:35

+0

你認爲它與我的事實有什麼關係netbeans工作區在unc連接路徑上? – Kirby 2010-03-03 14:00:18

回答

25

解決方案只是URI格式錯誤(因爲我的項目位置在「\\」UNC路徑上)。當我使用本地工作區時,此問題已修復。

+1

你能從服務器日誌中發送完整的堆棧跟蹤嗎?好像需要在這裏進行代碼修復......或者更好的錯誤消息。 – vkraemer 2010-03-03 15:43:54

+0

讓我知道在哪裏發送它?或發表評論? – Kirby 2010-03-04 17:04:24

+2

不幸的是,這並沒有爲我解決任何問題。一切都已經從我的本地機器上運行。 – Webnet 2012-03-12 18:50:16

2

翻轉到GlassFish輸出選項卡,它會給你更好的信息。 Netbeans爲您提供了一般錯誤,但Glassfish爲您提供了詳細信息。當我得到這個時,它通常是我的一個JSP或XML文件中的拼寫錯誤...

+0

我上面發佈了glassfish錯誤。我仔細檢查了我的拼寫錯誤和語法。仍然不確定。 – Kirby 2010-03-02 20:00:00

1

我有同樣的問題(NetBeans的6.9.1)和修復是如此簡單:)

我意識到的NetBeans沒有創建一個META-INF文件夾,因此沒有context.xml被發現,所以我創建在主項目文件夾下的META-INF文件夾中創建文件context.xml,並帶有以下內容。

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

,它運行:)

0

我發現該應用程序與衝突在Sun的GlassFish模塊的URL。 因此,在文件sun-web.xml中,我重命名了< context-root>/servlets-samples </context-root>。

它現在正在工作。

0

在開展Affable Bean電子商務網站開發時,我也遇到了類似的問題。我收到一個錯誤:

Module has not been deployed.

我檢查了sun-resources.xml文件,並發現了導致錯誤下面的語句。

<resources> 
    <jdbc-resource enabled="true" 
        jndi-name="jdbc/affablebean" 
        object-type="user" 
        pool-name="AffableBeanPool"> 
    </jdbc-resource> 

    <jdbc-connection-pool allow-non-component-callers="false" 
          associate-with-thread="false" 
          connection-creation-retry-attempts="0" 
          connection-creation-retry-interval-in-seconds="10" 
          connection-leak-reclaim="false" 
          connection-leak-timeout-in-seconds="0" 
          connection-validation-method="auto-commit" 
          datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" 
          fail-all-connections="false" 
          idle-timeout-in-seconds="300" 
          is-connection-validation-required="false" 
          is-isolation-level-guaranteed="true" 
          lazy-connection-association="false" 
          lazy-connection-enlistment="false" 
          match-connections="false" 
          max-connection-usage-count="0" 
          max-pool-size="32" 
          max-wait-time-in-millis="60000" 
          name="AffableBeanPool" 
          non-transactional-connections="false" 
          pool-resize-quantity="2" 
          res-type="javax.sql.ConnectionPoolDataSource" 
          statement-timeout-in-seconds="-1" 
          steady-pool-size="8" 
          validate-atmost-once-period-in-seconds="0" 
          wrap-jdbc-objects="false"> 

     <description>Connects to the affablebean database</description> 
     <property name="URL" value="jdbc:mysql://localhost:3306/affablebean"/> 
     <property name="User" value="root"/> 
     <property name="Password" value="nbuser"/> 
    </jdbc-connection-pool> 
</resources> 

然後我改變了以下這些陳述,這是簡單的和有效的。我能夠成功運行文件。

<resources> 
    <jdbc-resource enabled="true" jndi-name="jdbc/affablebean" object-type="user" pool-name="AffablebeanPool"> 
     <description/> 
    </jdbc-resource> 
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="AffablebeanPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> 
     <property name="URL" value="jdbc:mysql://localhost:3306/AffableBean"/> 
     <property name="User" value="root"/> 
     <property name="Password" value="nbuser"/> 
    </jdbc-connection-pool> 
</resources> 
0

在嘗試了一個名爲「jsf-blank」的框架項目後,它沒有用xhtml文件證明這個問題;我的結論是,我的項目中存在一個未知的問題。我的解決方案可能不太優雅,但它節省了時間。我備份了我已經開發的代碼和其他文件,刪除了項目,並重新開始 - 重新創建項目。到目前爲止,我已經添加了大部分文件,它看起來很不錯。

17

權限是URI的一部分。你的錯誤表明它沒有期待。權威部分如下所示,這就是所謂的網址部分。

從RFC3986上URIs

The following is an example URI and its component parts:

 foo://example.com:8042/over/there?name=ferret#nose 
    \_/ \______________/\_________/ \_________/ \__/ 
     |   |   |   |  | 
    scheme  authority  path  query fragment 
     | _____________________|__ 
    /\/      \ 
    urn:example:animal:ferret:nose 

所以有兩種格式,一種具有權威和一個沒有。關於斜線:

"When authority is not present, the path cannot begin with two slash
characters ("//")."

來源:http://www.rfc-base.org/txt/rfc-3986.txt