spring - HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: DataSource must not be null -
sou novo com spring, ao fazer uma consulta em uma classe dao, aparece o seguinte erro:
meu spring-context.xml é:
<mvc:interceptors> <bean class="br.com.softwarescomerciais.os.interceptor.autorizadorinterceptor"></bean> </mvc:interceptors> <mvc:default-servlet-handler/> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.mysql.jdbc.driver"/> <property name="url" value="jdbc:mysql://192.168.101.178/sc"/> <property name="username" value="sfilho"/> <property name="password" value="123"/> </bean>
http status 500 - request processing failed; nested exception java.lang.illegalargumentexception: datasource must not null type: exception report message: request processing failed; nested exception java.lang.illegalargumentexception: datasource must not null description: server encountered internal error prevented fulfilling request.
exception :
org.springframework.web.util.nestedservletexception: request processing failed; nested exception java.lang.illegalargumentexception: datasource must not null org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:943) org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:833) javax.servlet.http.httpservlet.service(httpservlet.java:648) org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:807) javax.servlet.http.httpservlet.service(httpservlet.java:729) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:53)
root cause:
java.lang.illegalargumentexception: datasource must not null org.springframework.util.assert.notnull(assert.java:112) org.springframework.jdbc.core.namedparam.namedparameterjdbctemplate.<init>(namedparameterjdbctemplate.java:89) br.com.softwarescomerciais.os.dao.usuariodao.existe(usuariodao.java:27) br.com.softwarescomerciais.os.controller.logincontroller.efetualogin(logincontroller.java:34) sun.reflect.nativemethodaccessorimpl.invoke0(native method) sun.reflect.nativemethodaccessorimpl.invoke(unknown source) sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) java.lang.reflect.method.invoke(unknown source) org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:214) org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:104) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:748) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:689) org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:83) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:945) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:876) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:931) org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:833) javax.servlet.http.httpservlet.service(httpservlet.java:648) org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:807) javax.servlet.http.httpservlet.service(httpservlet.java:729) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:53)
Comments
Post a Comment