2010-03-02 22 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