Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

使用命令 java -jar springBoot.jar  启动项目,结果报错如下:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
        at java.lang.String.substring(String.java:1963)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromDirectoryEntry(JarFile.java:278)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:258)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:248)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:237)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.PropertiesLauncher.addNestedEntries(PropertiesLauncher.java:480)
        at org.springframework.boot.loader.PropertiesLauncher.getClassPathArchives(PropertiesLauncher.java:418)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
        at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)

原因是,Spring Boot项目中,resources目录中,含有中文的文件夹,所以导致报错,所以,以后文件夹和文件的命名,一定最好使用英文!!!!

原文地址:https://www.cnblogs.com/jiafuwei/p/8514637.html

时间: 2024-10-22 07:30:45

Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37的相关文章

Spring报错:Exception in thread "main" java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.<init>(Unknown Source)

简单搭建了一个Spring Maven工程就报错: 看到网上说是JDK 7 和 Spring3.x :JDK编译级别设置成1.7,仍然没有得到解决,采用版本为  3.2.0.RELEASE <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>

使用Grizzy+Jersey搭建一个RESTful框架()报错Exception in thread &quot;main&quot; java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;

报错的类涉及UriBuilder,我搜索类发现, 这个类存在于两个包中,我在baidu的时候,也有人提到是jar包冲突,我就删除了 这个依赖,问题解决了. 环境搭建过程请见地址https://blog.csdn.net/jinxfei/article/details/4714809 原文地址:https://www.cnblogs.com/BaleW/p/8668712.html

报错Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: javax/xml/bind/...

首先我的jdk是11.05的 这个是由于: 这个是 由于缺少了javax.xml.bind,在jdk10.0.1中没有包含这个包,所以我自己去网上下载了jdk 8,然后把jdk10.0.1换成jdk 8问题就解决了 网址:jdk下载网址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 重新运行后就没有报错了,希望能解决大家的问题 但其实我个人认为最好的解决的方法是在项目加个 

myeclipse运行tomcat报错Exception in thread &quot;main&quot; java.lang.OutOfMemoryError: PermGen space

将myeclipse所配置的tomcat的jdk进行设置:-Xms512m -Xmx512m -XX:MaxNewSize=512m -XX:MaxPermSize=512m,如下图:

MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory

今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\startup.bat启动web服务正常.但在MyEclipse8.5中集成配置Tomcat7后,在MyEclipse启动Tomcat服务则出现如下错误提示: Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactoryat org.apache.catalina.star

dom4j使用xpath报异常 Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext

Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230 ) at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207) at org.dom4j.tree.Abstrac

xom报错 Exception in thread &quot;main&quot; java.net.UnknownHostException: file

Exception in thread "main" java.net.UnknownHostException: file at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.Socket.connect(Socket.java:579

【原】MyEclipse8.5集成Tomcat7时启动错误:Exception in thread “main” java.lang.NoClassDefFoundError

解决方法: MyEclipse->Window->Preferences->MyEclipse->Servers->Tomcat->Tomcat 6.x->Laucch->Create Launch Configuration->Classpath->Bootstrap Entities->Add External JARs->选择并填加tomcat的安装路径,比如:D:\Java\tomcat\bin\tomcat-juli.jar

Exception in thread &quot;main&quot; java.lang.ClassCastException

启动springboot时,报这个错Exception in thread "main" java.lang.ClassCastException 原因:热部署搞的, <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> 所谓热部署,就是