运行报错:
错误原因:两个Controller映射同一个一个名字
解决方法:将@RequestMapping(“api/list”),括号里改一个名称
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerMapping’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration
E
n
a
b
l
e
W
e
b
M
v
c
C
o
n
f
i
g
u
r
a
t
i
o
n
.
c
l
a
s
s
]
:
I
n
v
o
c
a
t
i
o
n
o
f
i
n
i
t
m
e
t
h
o
d
f
a
i
l
e
d
;
n
e
s
t
e
d
e
x
c
e
p
t
i
o
n
i
s
j
a
v
a
.
l
a
n
g
.
I
l
l
e
g
a
l
S
t
a
t
e
E
x
c
e
p
t
i
o
n
:
A
m
b
i
g
u
o
u
s
m
a
p
p
i
n
g
.
C
a
n
n
o
t
m
a
p
′
w
h
i
t
e
L
i
s
t
C
o
n
t
r
o
l
l
e
r
′
m
e
t
h
o
d
p
u
b
l
i
c
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
r
e
.
b
e
a
n
.
R
e
s
p
o
n
s
e
B
e
a
n
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
n
t
r
o
l
l
e
r
.
W
h
i
t
e
L
i
s
t
C
o
n
t
r
o
l
l
e
r
.
i
n
s
e
r
t
(
j
a
v
a
x
.
s
e
r
v
l
e
t
.
h
t
t
p
.
H
t
t
p
S
e
r
v
l
e
t
R
e
q
u
e
s
t
)
t
o
[
/
a
p
i
/
l
i
s
t
/
i
n
s
e
r
t
]
,
m
e
t
h
o
d
s
=
[
P
O
S
T
]
:
T
h
e
r
e
i
s
a
l
r
e
a
d
y
′
b
l
a
c
k
L
i
s
t
C
o
n
t
r
o
l
l
e
r
′
b
e
a
n
m
e
t
h
o
d
p
u
b
l
i
c
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
r
e
.
b
e
a
n
.
R
e
s
p
o
n
s
e
B
e
a
n
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
n
t
r
o
l
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
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
.
l
a
m
b
d
a
EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'whiteListController' method public com.tritonsfs.core.bean.ResponseBean com.tritonsfs.controller.WhiteListController.insert(javax.servlet.http.HttpServletRequest) to {[/api/list/insert],methods=[POST]}: There is already 'blackListController' bean method public com.tritonsfs.core.bean.ResponseBean com.tritonsfs.controller.BlackListController.insert(javax.servlet.http.HttpServletRequest) mapped. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda
EnableWebMvcConfiguration.class]:Invocationofinitmethodfailed;nestedexceptionisjava.lang.IllegalStateException:Ambiguousmapping.Cannotmap′whiteListController′methodpubliccom.tritonsfs.core.bean.ResponseBeancom.tritonsfs.controller.WhiteListController.insert(javax.servlet.http.HttpServletRequest)to[/api/list/insert],methods=[POST]:Thereisalready′blackListController′beanmethodpubliccom.tritonsfs.core.bean.ResponseBeancom.tritonsfs.controller.BlackListController.insert(javax.servlet.http.HttpServletRequest)mapped.atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdadoGetBean
0
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
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r
′
m
e
t
h
o
d
p
u
b
l
i
c
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
r
e
.
b
e
a
n
.
R
e
s
p
o
n
s
e
B
e
a
n
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
n
t
r
o
l
l
e
r
.
W
h
i
t
e
L
i
s
t
C
o
n
t
r
o
l
l
e
r
.
i
n
s
e
r
t
(
j
a
v
a
x
.
s
e
r
v
l
e
t
.
h
t
t
p
.
H
t
t
p
S
e
r
v
l
e
t
R
e
q
u
e
s
t
)
t
o
[
/
a
p
i
/
l
i
s
t
/
i
n
s
e
r
t
]
,
m
e
t
h
o
d
s
=
[
P
O
S
T
]
:
T
h
e
r
e
i
s
a
l
r
e
a
d
y
′
b
l
a
c
k
L
i
s
t
C
o
n
t
r
o
l
l
e
r
′
b
e
a
n
m
e
t
h
o
d
p
u
b
l
i
c
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
r
e
.
b
e
a
n
.
R
e
s
p
o
n
s
e
B
e
a
n
c
o
m
.
t
r
i
t
o
n
s
f
s
.
c
o
n
t
r
o
l
l
e
r
.
B
l
a
c
k
L
i
s
t
C
o
n
t
r
o
l
l
e
r
.
i
n
s
e
r
t
(
j
a
v
a
x
.
s
e
r
v
l
e
t
.
h
t
t
p
.
H
t
t
p
S
e
r
v
l
e
t
R
e
q
u
e
s
t
)
m
a
p
p
e
d
.
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
w
e
b
.
s
e
r
v
l
e
t
.
h
a
n
d
l
e
r
.
A
b
s
t
r
a
c
t
H
a
n
d
l
e
r
M
e
t
h
o
d
M
a
p
p
i
n
g
0(AbstractBeanFactory.java:317) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at com.tritonsfs.PayWebApplication.main(PayWebApplication.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'whiteListController' method public com.tritonsfs.core.bean.ResponseBean com.tritonsfs.controller.WhiteListController.insert(javax.servlet.http.HttpServletRequest) to {[/api/list/insert],methods=[POST]}: There is already 'blackListController' bean method public com.tritonsfs.core.bean.ResponseBean com.tritonsfs.controller.BlackListController.insert(javax.servlet.http.HttpServletRequest) mapped. at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
0(AbstractBeanFactory.java:317)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)atorg.springframework.boot.SpringApplication.run(SpringApplication.java:327)atcom.tritonsfs.PayWebApplication.main(PayWebApplication.java:28)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)atjava.lang.reflect.Method.invoke(UnknownSource)atorg.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)Causedby:java.lang.IllegalStateException:Ambiguousmapping.Cannotmap′whiteListController′methodpubliccom.tritonsfs.core.bean.ResponseBeancom.tritonsfs.controller.WhiteListController.insert(javax.servlet.http.HttpServletRequest)to[/api/list/insert],methods=[POST]:Thereisalready′blackListController′beanmethodpubliccom.tritonsfs.core.bean.ResponseBeancom.tritonsfs.controller.BlackListController.insert(javax.servlet.http.HttpServletRequest)mapped.atorg.springframework.web.servlet.handler.AbstractHandlerMethodMappingMappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:580)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
M
a
p
p
i
n
g
R
e
g
i
s
t
r
y
.
r
e
g
i
s
t
e
r
(
A
b
s
t
r
a
c
t
H
a
n
d
l
e
r
M
e
t
h
o
d
M
a
p
p
i
n
g
.
j
a
v
a
:
544
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
w
e
b
.
s
e
r
v
l
e
t
.
h
a
n
d
l
e
r
.
A
b
s
t
r
a
c
t
H
a
n
d
l
e
r
M
e
t
h
o
d
M
a
p
p
i
n
g
.
r
e
g
i
s
t
e
r
H
a
n
d
l
e
r
M
e
t
h
o
d
(
A
b
s
t
r
a
c
t
H
a
n
d
l
e
r
M
e
t
h
o
d
M
a
p
p
i
n
g
.
j
a
v
a
:
265
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
w
e
b
.
s
e
r
v
l
e
t
.
h
a
n
d
l
e
r
.
A
b
s
t
r
a
c
t
H
a
n
d
l
e
r
M
e
t
h
o
d
M
a
p
p
i
n
g
.
l
a
m
b
d
a
MappingRegistry.register(AbstractHandlerMethodMapping.java:544) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:265) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda
MappingRegistry.register(AbstractHandlerMethodMapping.java:544)atorg.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:265)atorg.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambdadetectHandlerMethods$1(AbstractHandlerMethodMapping.java:250)
at java.util.LinkedHashMap.forEach(Unknown Source)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:248)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:218)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:188)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1765)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702)
… 19 more