春季启动:java.lang.IllegalArgumentException:URI具有权限组件

时间:2019-01-10 23:00:10

标签: java spring spring-boot

运行Spring Boot应用程序时出现“ URI具有权限组件”错误。该应用程序将执行上传文件功能。 我已经验证了针对类似问题的一些解决方案,但没有发现运气。

已尝试: 1. C://中的工作区 2. POM文件更正。包括了Tomcat的jasper和starter依赖关系。

能帮助您解决此错误吗?

以下是我的POM文件;

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nbn</groupId>
<artifactId>boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Spring boot application - Maven</name>
<properties>
    <java.version>1.8</java.version>
</properties>


<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.1.RELEASE</version>
</parent>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <!-- <scope>provided</scope> -->
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-jasper</artifactId>
        <version>9.0.13</version>
    </dependency>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.4.0-atlassian-hosted</version>
    </dependency>

</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

错误堆栈跟踪:

    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_161]
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_161]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    ... 29 common frames omitted
Caused by: java.lang.IllegalArgumentException: URI has an authority component
    at java.io.File.<init>(Unknown Source) ~[na:1.8.0_161]
    at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:61) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:374) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.scan.StandardJarScanner.processURLs(StandardJarScanner.java:309) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.scan.StandardJarScanner.doScanClassPath(StandardJarScanner.java:266) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:229) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262) ~[tomcat-jasper-9.0.13.jar:9.0.13]
    at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104) ~[tomcat-jasper-9.0.13.jar:9.0.13]
    at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:83) ~[tomcat-jasper-9.0.13.jar:9.0.13]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5098) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    ... 35 common frames omitted

0 个答案:

没有答案