java常见错误二

idea项目目录没有了

-----------------------------------------------------------------------------------------------------------------------------------

2019年9月7日

解决方案:   使用删除命令:rm-rf .idea

windows下直接删除即可。

2 \java -jar Eureka_Client-1.0-SNAPSHOT.jar

Eureka_Client-1.0-SNAPSHOT.jar中没有主清单属性

---------------------------------

解决方案:


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

3、mvn clean package
打包的时候错误

oot:spring-boot-maven-plugin:1.5.9.RELEASE:repackage failed: Unable to find a single main class from the following candidates

解决方案:

不使用springboot的maven插件,改为使用普通的maven插件,使用springboot的maven插件意味着每个模块都需要有启动类,而使用普通的插件则不需要。

4、

2019-09-12 16:37:51.117 ERROR 9812 --- [           main] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error

com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect

-------------------------------------------------------------------------------------------------------------------------------------

解决方案:

	register-with-eureka: false #是否将自己注册到Eureka Server上,默认为true
	fetch-registry: false #是否从Eureka Server上获取注册信息,默认为true

5、

2019-09-16 18:49:09.874  WARN 32228 --- [on(7)-127.0.0.1] .c.s.e.MultipleJGitEnvironmentRepository : Error occured cloning to base directory.

org.eclipse.jgit.api.errors.TransportException: Read timed out after 5,000 ms
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:254) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar:5.1.3.201810200350-r]

spring:
  cloud:
     config:
       server:
         git:
           uri: https://github.com/bluewelkin/springcloudcon
           searchPaths: config
           username:
           password:
       label: master

  application:
    name: config-server
server:
  port: 8768
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka


2019年9月24日

 Unable to find a suitable main class, please add a 'mainC
lass' property -> [Help 1]

在tesekeji3下面运行 mvn spring-boot:run 

确实没有主运行方法啊mainclass

切换到eureka目录运行即可

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration><!-- 指定该Main Class为全局的唯一入口 -->
                <mainClass>com.tesekeji.EurekaApplication</mainClass>
                <layout>ZIP</layout>
            </configuration>

        </plugin>
    </plugins>
</build>
发布了149 篇原创文章 · 获赞 8 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/bluewelkin/article/details/100592076
今日推荐