项目场景:
SSM改装Servlet项目
问题描述:
登录功能进去Controller被标记不可用
javax.naming.NamingException: 无法创建资源实例
原因分析:
直接将项目复制过来增加SSM注解,没有删除web.xml中注册的Servlet.
解决方案:
删除web.xml中的Controller即可
问题描述:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.bjpowernode.crm.settings.service.UserService.login
at org.apache.ibatis.binding.MapperMethod
S
q
l
C
o
m
m
a
n
d
.
<
i
n
i
t
>
(
M
a
p
p
e
r
M
e
t
h
o
d
.
j
a
v
a
:
235
)
a
t
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
i
n
d
i
n
g
.
M
a
p
p
e
r
M
e
t
h
o
d
.
<
i
n
i
t
>
(
M
a
p
p
e
r
M
e
t
h
o
d
.
j
a
v
a
:
53
)
a
t
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
i
n
d
i
n
g
.
M
a
p
p
e
r
P
r
o
x
y
.
l
a
m
b
d
a
SqlCommand.<init>(MapperMethod.java:235) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53) at org.apache.ibatis.binding.MapperProxy.lambda
SqlCommand.<init>(MapperMethod.java:235)atorg.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53)atorg.apache.ibatis.binding.MapperProxy.lambdacachedMapperMethod
0
(
M
a
p
p
e
r
P
r
o
x
y
.
j
a
v
a
:
62
)
a
t
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
i
n
d
i
n
g
.
M
a
p
p
e
r
P
r
o
x
y
0(MapperProxy.java:62) at org.apache.ibatis.binding.MapperProxy
0(MapperProxy.java:62)atorg.apache.ibatis.binding.MapperProxy$Lambda
171
/
497589885.
a
p
p
l
y
(
U
n
k
n
o
w
n
S
o
u
r
c
e
)
a
t
j
a
v
a
.
u
t
i
l
.
c
o
n
c
u
r
r
e
n
t
.
C
o
n
c
u
r
r
e
n
t
H
a
s
h
M
a
p
.
c
o
m
p
u
t
e
I
f
A
b
s
e
n
t
(
C
o
n
c
u
r
r
e
n
t
H
a
s
h
M
a
p
.
j
a
v
a
:
1660
)
a
t
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
i
n
d
i
n
g
.
M
a
p
p
e
r
P
r
o
x
y
.
c
a
c
h
e
d
M
a
p
p
e
r
M
e
t
h
o
d
(
M
a
p
p
e
r
P
r
o
x
y
.
j
a
v
a
:
62
)
a
t
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
i
n
d
i
n
g
.
M
a
p
p
e
r
P
r
o
x
y
.
i
n
v
o
k
e
(
M
a
p
p
e
r
P
r
o
x
y
.
j
a
v
a
:
57
)
a
t
c
o
m
.
s
u
n
.
p
r
o
x
y
.
171/497589885.apply(Unknown Source) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:62) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57) at com.sun.proxy.
171/497589885.apply(UnknownSource)atjava.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)atorg.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:62)atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)atcom.sun.proxy.Proxy19.login(Unknown Source)
at com.bjpowernode.crm.settings.web.controller.UserController.login(UserController.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol
C
o
n
n
e
c
t
i
o
n
H
a
n
d
l
e
r
.
p
r
o
c
e
s
s
(
A
b
s
t
r
a
c
t
P
r
o
t
o
c
o
l
.
j
a
v
a
:
888
)
a
t
o
r
g
.
a
p
a
c
h
e
.
t
o
m
c
a
t
.
u
t
i
l
.
n
e
t
.
N
i
o
E
n
d
p
o
i
n
t
ConnectionHandler.process(AbstractProtocol.java:888) at org.apache.tomcat.util.net.NioEndpoint
ConnectionHandler.process(AbstractProtocol.java:888)atorg.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1597)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor
W
o
r
k
e
r
.
r
u
n
(
T
h
r
e
a
d
P
o
o
l
E
x
e
c
u
t
o
r
.
j
a
v
a
:
617
)
a
t
o
r
g
.
a
p
a
c
h
e
.
t
o
m
c
a
t
.
u
t
i
l
.
t
h
r
e
a
d
s
.
T
a
s
k
T
h
r
e
a
d
Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread
Worker.run(ThreadPoolExecutor.java:617)atorg.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Invalid bound statement (not found): com.bjpowernode.crm.settings.service.UserService.login
原因分析:
Spring配置文件中MapperScannerConfigurer的属性basePackage不对,
复制dao所在包名解决