What does 'URI has an authority component' mean?

2022-08-31 22:08:06

I am attempting to build a Java web project on NetBeans 6.8, but I get get the following error:

The module has not been deployed.

It points to my file, line 577:build-impl.xml

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

The GlassFish v3 error log says:

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.

What does "URI has an authority component" mean?


答案 1

An authority is a portion of a URI. Your error suggests that it was not expecting one. The authority section is shown below, it is what is known as the website part of the url.

From RFC3986 on 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

So there are two formats, one with an authority and one not. Regarding slashes:

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

Source: https://tools.ietf.org/rfc/rfc3986.txt (search for text 'authority is not present, the path cannot begin with two slash')


答案 2

The solution was simply that the URI was malformed (because the location of my project was over a "\\" UNC path). This issue was fixed when I used a local workspace.


推荐