Java lang illegalargumentexception uri has an authority components

URI has an authority Error

DefaultModuleRegistry.(DefaultModuleRegistry.java:61) at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:55) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22) Solution 1: The only cause I’ve seen of this is if your home directory is on a network share (it has a Windows path of the form (\\UNC_PATH\. instead of something like C:\ for a local file). I get the below error OS — Java JDK version — Gradle version — can some one tell me what i am doing wrong here ? command works fine in the command prompt Solution: URI has an authority component: As the error suggests the gradle path whichever you have used contain some special characters like //.

URI has an authority Error

I have looked at the solution provided in this question What does ‘uri has an authority component’ mean?

before asking this question, but I am having the same issue in Intellij . What I have is

import java.io.File; import java.net.URI; import java.net.URISyntaxException; public class FileLoading < public static void main(String . args)< File someFile = null; try < someFile = new File( new URI("file://somefile.txt")); >catch (URISyntaxException e) < e.printStackTrace(); >System.out.println(someFile.getPath()); > > 
"C:\Program Files\Java\jdk1.8.0_162\bin\java" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar=51711:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_162\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_162\jre\lib\rt.jar;C:\Users\U631156\code\java\target\classes" FileLoading Exception in thread "main" java.lang.IllegalArgumentException: URI has an authority component at java.io.File.(File.java:423) at FileLoading.main(FileLoading.java:9) Process finished with exit code 1 

If you’re not specifying a host for the file, the syntax should be file:///somefile.txt (note 3 slashes).

Читайте также:  Название документа

The relevant RFC RFC 8089 shows the structure of the URI in section 2, which identifies the part after 2 slashes as the auth-path (hence your error).

Note, however, that this will put «somefile.txt» in the root of your filesystem, since the URI has no directory path.

Sbt 0.13.8 URI has an authority component, The URI that activator adds to sbt repository list is lacking a third slash. Open C:\Users\[USER]\.sbt\repositories.

Gradle Error URI has an authority component

I am trying to install gradle .when i try to execute gradle -v command.

java.lang.IllegalArgumentException: URI has an authority component at java.io.File.(File.java:423) at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:68) at org.gradle.api.internal.classpath.DefaultModuleRegistry.findDistDir(DefaultModuleRegistry.java:94) at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:62) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:44) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 

OS — Windows 7 Java JDK version — 1.7 Gradle version — 2.5

can some one tell me what i am doing wrong here ?

java -version command works fine in the command prompt

URI has an authority component: As the error suggests the gradle path whichever you have used contain some special characters like //. Which makes it unusable.

Setting hadoop.tmp.dir on Windows gives error: URI has an authority, IllegalArgumentException: URI has an authority component at java.io.File.(File.java:423) at org.apache.hadoop.hdfs.server.namenode.

Android Studio 0.8.2 URI has an authority component

I am getting «Gradle project sync failed.» when I start up Android Studio. When I try to clean the project, I get «failed to complete gradle execution Cause: URI has an authority component»

I’ve tried several things already and am still stuck. I moved my config files out of my user folders and put them in my root directory where I have Android Studio. (C:/Studio). I’ve also tried to invalidate caches but that still didn’t help. I’m on a networked VDI so I’m not sure if that might have something to do with it. Below is the message I’m getting from Gradle sync. Any ideas what can be going wrong here?

Gradle Sync Message:

Error:Unable to start the daemon process. This Problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html

Please read below process output to find out more:

java.lang.IllegalArgumentException: URI has an authority component at java.io.File.(File.java:423) at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41) at org.gradle.api.internal.classpath.EffectiveClassPath.(EffectiveClassPath.java:32) at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:61) at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:55) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)

The only cause I’ve seen of this is if your home directory is on a network share (it has a Windows path of the form (\\UNC_PATH\. instead of something like C:\ for a local file). Gradle doesn’t properly support that right now. There’s a bug in Android Studio’s bug database to track it:

and it references a bug in Gradleware’s bug database:

The Android Studio bug report lists this as a workaround:

  1. Copied .gradle folder from path on network [\\users.gradle] to [C:\Users.gradle]
  2. In Android Studio v-(Beta) 0.8.6 [File —> Settings] changed Gradle Settings Global Gradle settings Service directory path: C:/Users//.gradle Gradle VM options: -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttp.proxyUser= -Dhttp.proxyPassword=

if you don’t have a strong internet connectivity make sure you select the offline mode from the console. Selecting offline mode could solve the issue.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: URI has an authority component #259

java.lang.IllegalArgumentException: URI has an authority component #259

Comments

When using the extension on any simple maven java project I got exception on exception in output console and a «Classpath is incomplete. Only syntax errors will be reported» in code UI
So it seems to be an issue on the settings on PC (I try to set proxy but without success)
Any idea how to solve this issue!,
Thanks by advance for any help
Regards

Environment
  • Operating System: Windows 10
  • JDK version: 1.8.0_131
  • Visual Studio Code version: 1.12.2
  • Java extension version: 0.7.0
Steps To Reproduce

Open any project under a corporate PC (that I am not fully administrator)

Current Result
[Error — 09:30:14] 17 juil. 2017 09:29:58 Failed to read package name from file://s90104/Users/U805679/userdata/screenplay-pattern-todomvc/src/main/java/net/serenitybdd/ChromeDriverNoExt.java
URI has an authority component
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(File.java:423)
at org.eclipse.jdt.ls.core.internal.JDTUtils.getPackageName(JDTUtils.java:185)
at org.eclipse.jdt.ls.core.internal.JDTUtils.getFakeCompilationUnit(JDTUtils.java:151)
at org.eclipse.jdt.ls.core.internal.JDTUtils.resolveCompilationUnit(JDTUtils.java:129)
at org.eclipse.jdt.ls.core.internal.JDTUtils.resolveCompilationUnit(JDTUtils.java:102)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.handleOpen(DocumentLifeCycleHandler.java:121)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler$2.run(DocumentLifeCycleHandler.java:78)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2262)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.didOpen(DocumentLifeCycleHandler.java:75)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.didOpen(JDTLanguageServer.java:349)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:126)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:165)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:136)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

The text was updated successfully, but these errors were encountered:

Источник

What does ‘URI has an authority component’ mean?

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.

Solution 2

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.

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‘)

Solution 3

Flip over to the GlassFish output tab, it’ll give you better info. Netbeans gives you that generic error, but Glassfish gives you the details. When I get this it’s usually a typo in one of my JSP or XML files.

Solution 4

I had the same problem (NetBeans 6.9.1) and the fix is so simple 🙂

I realized NetBeans didn’t create a META-INF folder and thus no context.xml was found, so I create the META-INF folder under the main project folder and create file context.xml with the following content.

Источник

Оцените статью