提示:本文为个人记录的各种启动报错问题及解决思路,写的不好地方多多谅解~
文章目录
- 1、启动服务报错,访问不了,weblogic控制台也访问不了
- 2、启动报错:registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
- 3、maven install报错:version' contains an expression but should be a constant 依赖唯一,出现了多个。groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-thymeleaf:jar -> duplicate declaration of version
- 4、启动报错:xxxImpl': Unsatisfied dependency expressed through field 'baseFolder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxObject' defined in xxx FileObjectConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.commons.vfs2.FileObject]: Factory method 'xxxObject' threw exception; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
- 5、jenkins构建失败,[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project xxx: Failed to install metadata xxx/maven-metadata.xml: Could not parse metadata /opt/repository/xxx/maven-metadata-local.xml: in epilog non whitespace content is not allowed but got 7 (position: END_TAG seen ...\n7... @22:2) -> [Help 1]
- 6、tomcat启动不会报错,weblogic启动报错
- 7、遇到类都在一个包里面,但是引用不到
- 8、启动报错:Unsatisfied dependency expressed through field Error creating bean with name failed to introspect bean class for resource metadata: could not find class that it depends on
- 9、错误Invalid bound statement(not found):xxx问题解决办法
- 10、启动报错:[zip:/root/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/xxx-web/ud705e/war/WEB-INF/lib/xxx-1.1.1.jar!/xxx/ProxyCachingConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Lcn/hutool/log/Log;
- 11、Cannot access RandomAccessFile java.io.IOExcepion:文件名、目录名或者卷标语法不正确
- 12、启动报错:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean#6d7d5827' defined in URL [jar:file:/C:/Programing/source/nontax-industry-airline/industry/industry-web-airline/target/industry-web-airline-1.0-SNAPSHOT/WEB-INF/lib/industry-web-airline-1.0-SNAPSHOT.jar!/spring/spring-airline.xml]: Cannot resolve reference to bean 'EPaybookConfirmSyncJob' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'EPaybookConfirmSyncJob' available
- 13、maven项目中报错 could not find class that it depends on找不到所依赖的类
- 14、nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'deptCode' of 'class com.xxx.system.Dict' with value '' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for
- 15、使用idea,基于nacos注册中心,启动微服务项目报错:java.net.ConnectException: no available server
1、启动服务报错,访问不了,weblogic控制台也访问不了
解决思路:关闭防火墙 systemctl stop firewalld。
2、启动报错:registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
解决:刷新maven,重新install即可。
3、maven install报错:version’ contains an expression but should be a constant 依赖唯一,出现了多个。groupId:artifactId:type:classifier)’ must be unique: org.springframework.boot:spring-boot-starter-thymeleaf:jar -> duplicate declaration of version
org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
原因:pom中多了一个无效引用导致
4、启动报错:xxxImpl’: Unsatisfied dependency expressed through field ‘baseFolder’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxxObject’ defined in xxx FileObjectConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.commons.vfs2.FileObject]: Factory method ‘xxxObject’ threw exception; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
解决思路:看到这种错误,优先排查下是不是包冲突了
5、jenkins构建失败,[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project xxx: Failed to install metadata xxx/maven-metadata.xml: Could not parse metadata /opt/repository/xxx/maven-metadata-local.xml: in epilog non whitespace content is not allowed but got 7 (position: END_TAG seen …\n7… @22:2) -> [Help 1]
原因:冲突了,需要删除jenkings服务器上本地仓库对应的 /xx/maven-metadata-local.xml,然后重新构建即可。
注:有时候Jenkins构建正式版失败,jenkins服务器上删了配置文件还是报错,得删了云上maven仓库的配置文件。
6、tomcat启动不会报错,weblogic启动报错
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘xxxServiceImpl’: Unsatisfied dependency expressed through field ‘xxxService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘xxxServiceImpl’: Unsatisfied dependency expressed through field ‘xxxService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘cacheAdvice’: Cannot resolve reference to bean ‘sfacadeEhcacheManager’ while setting bean property ‘cacheManager’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘xxxCacheManager’ defined in class path resource [xxxCacheConfiguration
R
e
d
i
s
C
a
c
h
e
C
o
n
f
i
g
u
r
a
t
i
o
n
.
c
l
a
s
s
]
:
U
n
s
a
t
i
s
f
i
e
d
d
e
p
e
n
d
e
n
c
y
e
x
p
r
e
s
s
e
d
t
h
r
o
u
g
h
m
e
t
h
o
d
′
x
x
x
C
a
c
h
e
M
a
n
a
g
e
r
′
p
a
r
a
m
e
t
e
r
0
;
n
e
s
t
e
d
e
x
c
e
p
t
i
o
n
i
s
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
B
e
a
n
C
r
e
a
t
i
o
n
E
x
c
e
p
t
i
o
n
:
E
r
r
o
r
c
r
e
a
t
i
n
g
b
e
a
n
w
i
t
h
n
a
m
e
′
c
a
c
h
e
R
e
d
i
s
s
o
n
′
d
e
f
i
n
e
d
i
n
c
l
a
s
s
p
a
t
h
r
e
s
o
u
r
c
e
[
x
x
x
C
a
c
h
e
C
o
n
f
i
g
u
r
a
t
i
o
n
RedisCacheConfiguration.class]: Unsatisfied dependency expressed through method 'xxxCacheManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheRedisson' defined in class path resource [xxxCacheConfiguration
RedisCacheConfiguration.class]:Unsatisfieddependencyexpressedthroughmethod′xxxCacheManager′parameter0;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname′cacheRedisson′definedinclasspathresource[xxxCacheConfigurationRedisCacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method ‘cacheRedisson’ threw exception; nested exception is java.lang.NoSuchMethodError: io.netty.util.concurrent.SingleThreadEventExecutor.(Lio/netty/util/concurrent/EventExecutorGroup;Ljava/util/concurrent/Executor;ZLjava/util/Queue;Lio/netty/util/concurrent/RejectedExecutionHandler;)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory
1.
g
e
t
O
b
j
e
c
t
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
306
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
D
e
f
a
u
l
t
S
i
n
g
l
e
t
o
n
B
e
a
n
R
e
g
i
s
t
r
y
.
g
e
t
S
i
n
g
l
e
t
o
n
(
D
e
f
a
u
l
t
S
i
n
g
l
e
t
o
n
B
e
a
n
R
e
g
i
s
t
r
y
.
j
a
v
a
:
230
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
d
o
G
e
t
B
e
a
n
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
302
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
g
e
t
B
e
a
n
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
202
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
c
o
n
f
i
g
.
D
e
p
e
n
d
e
n
c
y
D
e
s
c
r
i
p
t
o
r
.
r
e
s
o
l
v
e
C
a
n
d
i
d
a
t
e
(
D
e
p
e
n
d
e
n
c
y
D
e
s
c
r
i
p
t
o
r
.
j
a
v
a
:
208
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
D
e
f
a
u
l
t
L
i
s
t
a
b
l
e
B
e
a
n
F
a
c
t
o
r
y
.
d
o
R
e
s
o
l
v
e
D
e
p
e
n
d
e
n
c
y
(
D
e
f
a
u
l
t
L
i
s
t
a
b
l
e
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
1138
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
D
e
f
a
u
l
t
L
i
s
t
a
b
l
e
B
e
a
n
F
a
c
t
o
r
y
.
r
e
s
o
l
v
e
D
e
p
e
n
d
e
n
c
y
(
D
e
f
a
u
l
t
L
i
s
t
a
b
l
e
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
1066
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
a
n
n
o
t
a
t
i
o
n
.
A
u
t
o
w
i
r
e
d
A
n
n
o
t
a
t
i
o
n
B
e
a
n
P
o
s
t
P
r
o
c
e
s
s
o
r
1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
1.getObject(AbstractBeanFactory.java:306)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)atorg.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
… 146 more
解决思路:排查发现是包冲突了。
7、遇到类都在一个包里面,但是引用不到
解决思路:rebuild project,然后重启idea。
8、启动报错:Unsatisfied dependency expressed through field Error creating bean with name failed to introspect bean class for resource metadata: could not find class that it depends on
排查:发现是新版的程序,替换了旧版的补丁导致。
9、错误Invalid bound statement(not found):xxx问题解决办法
解决思路:
1、https://blog.csdn.net/qq_40646143/article/details/90783416
2、xml写的是oracle版本的,服务用的是mysql的,所以导致取不到
3、xml目录放的不对,Mapper文件应该放在Resources文件夹中
4、mapper的namespace写的不对!!!注意系修改。
5、UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此
6、UserDao的方法返回值是List,而select元素没有正确配置ResultMap,或者只配置ResultType!
7、 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决…
10、启动报错:[zip:/root/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/xxx-web/ud705e/war/WEB-INF/lib/xxx-1.1.1.jar!/xxx/ProxyCachingConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Lcn/hutool/log/Log;
经排查:
hutool-all-4.6.8.jar升级为hutool-all-5.4.5.jar(这个版本是jdk1.8版本的,所以jdk1.7的服务器会启动报错)
11、Cannot access RandomAccessFile java.io.IOExcepion:文件名、目录名或者卷标语法不正确
解决思路:用tomcat启动,catalina.bat 没加VM option配置导致。
12、启动报错:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean#6d7d5827’ defined in URL [jar:file:/C:/Programing/source/nontax-industry-airline/industry/industry-web-airline/target/industry-web-airline-1.0-SNAPSHOT/WEB-INF/lib/industry-web-airline-1.0-SNAPSHOT.jar!/spring/spring-airline.xml]: Cannot resolve reference to bean ‘EPaybookConfirmSyncJob’ while setting bean property ‘targetObject’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘EPaybookConfirmSyncJob’ available
一个或多个listeners启动失败,更多详细信息查看对应的容器日志文件
由于之前的错误,Context[/airline-174]启动失败
Artifact industry-web-airline:war exploded: Error during artifact deployment. See server log for details.
提示:关键信息在最后面
原因:另一个服务正在启动,端口冲突了导致启动不了。
13、maven项目中报错 could not find class that it depends on找不到所依赖的类
解决思路:maven工程在程序编译时报错,could not find class that it depends on找不到所依赖的类。
能够引起这种错误的原因:jar包缺失、jar包冲突、jar包不完整、IDE工具问题。
14、nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property ‘deptCode’ of ‘class com.xxx.system.Dict’ with value ‘’ Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for
错误原因:有两个路径一样但是在不同模块里的pojo,且内容也不一样,导致映射出问题。
15、使用idea,基于nacos注册中心,启动微服务项目报错:java.net.ConnectException: no available server
currentServerAddr:http://localhost:8848, err : connect timed out
[2022-06-15 20:42:09.093] [main] [] [E] [com.alibaba.nacos.client.config.http.ServerHttpAgent:96] [NACOS SocketTimeoutException httpGet] currentServerAddr:http://localhost:8848, err : connect timed out
[2022-06-15 20:42:10.107] [main] [] [E] [com.alibaba.nacos.client.config.http.ServerHttpAgent:96] [NACOS SocketTimeoutException httpGet] currentServerAddr:http://localhost:8848, err : connect timed out
[2022-06-15 20:42:10.108] [main] [] [E] [com.alibaba.nacos.client.config.http.ServerHttpAgent:114] no available server
[2022-06-15 20:42:10.109] [main] [] [E] [com.alibaba.nacos.client.config.impl.ClientWorker:239] [fixed-localhost_8848-dev-zhsf-05] [sub-server] get server config exception, dataId=saas-application.yml, group=DEFAULT_GROUP, tenant=dev-05
java.net.ConnectException: no available server
at com.alibaba.nacos.client.config.http.ServerHttpAgent.httpGet(ServerHttpAgent.java:115) ~[nacos-client-1.1.4.jar:?]
[sub-server] get server config exception, dataId=saas-cache.properties, group=DEFAULT_GROUP, tenant=dev-zhsf-05
java.net.ConnectException: no available server
Caused by: org.springframework.beans.factory.BeanInitializationException: CacheManager initialization fail, j2cache properties not found!
错误原因:idea启动配置有误。不能加空格,加了导致识别不到,就变成去读nacos默认端口8848去了。