【求解】SPRING namedParameterJdbcTemplate为什么返回null?

使用spring jdbc

首先。 dataSource 用的C3P0 , 测试没有问题。

其次是DefaultService接口

public interface DefaultService {
}

以及DefaultServiceImpl

public class DefaultServiceImpl extends NamedParameterJdbcDaoSupport implements DefaultService{

}

我在spring中声明了这个类

<bean id="defaultService" class="x.x.x.DefaultServiceImpl">
    <property name="dataSource" ref="dataSource"></property>
</bean>

然后我还有一个类是BaseServiceImpl

public abstract class BaseServiceImpl {
    private DefaultService defaultService;
    /**
     * @return the defaultService
     */
    public DefaultService getDefaultService () {
        return defaultService;
    }
    /**
     * @param defaultService the defaultService to set
     */
    public void setDefaultService (DefaultService defaultService) {
        this.defaultService= defaultService;
    }
}

在spring中配置

<bean id="serviceBase" abstract="true">
     <property name="defaultService" ref="defaultService" />
</bean>

接下来是业务SERVICE

有一个TestService

public interface TestService {
    public List findDataList(Map params);
}

以及他的实现类, 继承了BaseServiceImpl

public class TestServiceImpl extends BaseServiceImpl implements TestService {
    /**
     * @descrption
     */
    @Override
    public List findDataList(Map params) {
        String sql = "SELECT * FROM USERMARK WHERE ID = :id";
        return this.getNamedParameterJdbcTemplate().query(sql, params, new QueryRowMapper());
    }
}

然后在spring中配置了

<bean id="testService" autowire="byName" parent="serviceBase" class="x.x.x.TestServiceImpl"/>

在action里注入了这个testService, 没有问题注入成功, 进入到service里的findDataList方法了。
但是this.getNamedParameterJdbcTemplate() 返回为null 报了空指针。。
namedParameterJdbcTemplate在NamedParameterJdbcDaoSupport类中注入。
首先要说明的是dataSource没有问题, 其次是和BaseServceImpl是个抽象类也没有关系。
在线求教。。

1个回答

http://wendal.net/2013/08/23.html
推荐你先看看这篇文章

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

新人 求解 spring 的事务处理 机制

@Transactional// 注解 事务回滚 public String addUser(Model model, String userCode, String userName, String userPasswd, String roleId) { User user = new User(userCode, userName, userPasswd, 1); int ret = iUserService.addUser(user); if (ret == 1) { // 获取插入的用户ID int ret2 = iUserRoleService.addUserRole(userRole); } 自己在控制层 里面有一个 方法,其中包含两个添加方法, 方法2 是在方法1成功的前提下 执行的 。 现在方法2 失败了,方法1的数据却添加加导数据库。。是我的用法不对,还是怎么用 这个事务处理。 求解, 事务处理器,和事务启动 已经配好。

求解spring整合mybatis问题

Could not publish to the server. There were issues during deployment to server Tomcat v7.0 Server at local at localhost. See Error Log for details. Deployment failed Child module deployment failed

spring-mvc 为什么我不能继承simpleformcontroller???求解!

spring-mvc 为什么我不能继承simpleformcontroller???求解!

三大框架整合 为什么mybatis一般都不会交给spring去管理

三大框架整合 为什么mybatis一般都不会交给spring去管理 求解!!!!!!

Spring getBean时出错 求解

![图片说明](https://img-ask.csdn.net/upload/201505/27/1432663962_129525.png)

求解:SpringJUnit4ClassRunner constructor called with

在进行 springmvc3.0 + junit4.5测试的时, 执行测试类抛异常. [org.springframework.test.context.junit4.SpringJUnit4ClassRunner]-[DEBUG] SpringJUnit4ClassRunner constructor called with [class com.hsl.hjEnglish.dao.impl.TestCouponDao]. 谁知道如何处理啊.

SpringBoot1.5.18 Cacheable不起作用,为什么,求解

代码: ``` @Service public class EmployeeService { @Autowired EmployeeMapper employeeMapper; @Cacheable(cacheNames = {"emp"}) public Employee getEmp(Integer id){ System.out.println("查询"+id+"号员工"); return employeeMapper.getEmployee(id); } ``` 配置: ``` spring.datasource.url=jdbc:mysql://localhost:3306/spring_cache spring.datasource.username=xxx spring.datasource.password=xsg5207896 #spring.datasource.driver-class-name=com.mysql.jdbc.Driver # 开启驼峰命名规则 mybatis.configuration.map-underscore-to-camel-case=true logging.level.com.example.sbcache.mapper=debug ``` 我看别人都是这么写的,为什么我的都不得行呢 求解 工具idea

spring @Qualifier得到的bean为null 求解

xml文件配置 <bean id="pDao"class="edu.utah.further.profiledb.service.ProfilesDaoImpl"> </bean> 实现类: @Implementation @Repository( "profilesdbDao" ) public class ProfilesDaoImpl implements ProfilesDao { 注入地方: @Service @Configurable( dependencyCheck = true ) public class ResourceProfileLoaderNew { /** The log. */ Logger log = Logger.getLogger( ResourceProfileLoaderNew.class.getName() ); /** The status. */ static boolean status; /** The pdao. */ @Autowired @Qualifier( "pDao" ) private ProfilesDao pdao; tomcat启动没有任何异常 运行的时候pdao就为null !求解

spring注入service时报错。求解

SEVERE: Context initialization failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productAction': Unsatisfied dependency expressed through field 'productService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.duobao.modules.service.inter.ProductService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 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.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:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5229) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5516) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1763) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1486) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:96) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1327) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1419) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:847) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$1.run(Transport.java:177) at sun.rmi.transport.Transport$1.run(Transport.java:174) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:173) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.duobao.modules.service.inter.ProductService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1486) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ... 65 more spring配置: <context:component-scan base-package="com.duobao.modules"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Service" /> <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository"/> </context:component-scan> springMVC配置: <context:component-scan base-package="com.duobao.modules.web"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan>

spring boot和spring data hadoop冲突怎么解决啊

就是我的项目是spring boot项目,然后我在里面加了一个spring data hadoop的依赖,然后就运行不起来项目了,而且不报错,就是stop server,也没有错误日志,求解

Spring 项目中web.xml 配置问题?

为什么有的SSM项目在web.xml中只通过dispatcherServlet加载所有xml 配置文件?而不是像传统的用Listener加载applicationContext.xml,用dispatcherServlet加载springmvc的配置文件? 这两种方式有什么区别?对生成的上下文有什么影响吗? 只配置DispatcherServlet的方式如下 ``` <!-- 配置DispatcherServlet --> <servlet> <servlet-name>seckill-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- 配置springMVC需要加载的配置文件 spring-dao.xml,spring-service.xml,spring-web.xml Mybatis - > spring -> springmvc --> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/spring-*.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>seckill-dispatcher</servlet-name> <!-- 默认匹配所有的请求 --> <url-pattern>/</url-pattern> </servlet-mapping> ```

springcloud config client端通过访问server端远程获取git上面的yml中的内容,获取失败,求各路大神求解

## spring config client端bootstrap.yml ```spring: cloud: config: name: microservicecloud-config-client #需要从git上读取的资源名称,注意没有yml后缀名 profile: dev #本次访问的配置项 label: master uri: http://config-3344.com:3344 #本微服务启动后先去找3344号服务,通过SpringCloudConfig获取git的服务地址 ``` ## 类ConfigClientRest ``` @RestController public class ConfigClientRest { @Value("${spring.application.name}") private String applicationName; @Value("${eureka.client.service-url.defaultZone}") private String eurekaServers; @Value("${server.port}") private String port; @RequestMapping("/config") public String getConfig(){ String str = "applicationName: " + applicationName + "\t eurekaServers: " + eurekaServers + "\t port: " + port; System.out.println("*****str: " + str); return "applicationName: " + applicationName + "\t eurekaServers: " + eurekaServers + "\t port: " + port; } } ``` ## 码云上面microservicecloud-config-client.yml ``` spring: profiles: active: - dev --- server: port: 8201 spring: profiles: dev application: name: microservicecloud-config-client eureka: client: service-url: defaultZone: http://eureka-dev.com:7001/eureka/ --- server: port: 8202 spring: profiles: test application: name: microservicecloud-config-client eureka: client: service-url: defaultZone: http://eureka-test.com:7001/eureka/ ``` ## springcloud config server端application.xml ``` server: port: 3344 spring: application: name: microservicecloud-config cloud: config: server: git: uri: git@gitee.com:lb20162501306/mricoservicecloud-config.git #码云上git仓库地址 ``` ## 报错 ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configClientRest': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.application.name' in value "${spring.application.name}" ```

Spring整合Mybatis关于Dao注入失败的问题求解

抛出异常 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private pers.zww.grad.dao.IAdminDao pers.zww.grad.service.impl.AdminServiceImpl.adminDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [pers.zww.grad.dao.IAdminDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=adminDao)} 此为自动生成的Mapper,我加了注解@Repository package pers.zww.grad.dao; import org.springframework.stereotype.Repository; import pers.zww.grad.vo.Admin; @Repository("adminDao") public interface IAdminDao { int deleteByPrimaryKey(String id); int insert(Admin record); int insertSelective(Admin record); Admin selectByPrimaryKey(String id); int updateByPrimaryKeySelective(Admin record); int updateByPrimaryKey(Admin record); Integer getCountByName(String name); Integer getCountByNameAndPass(String name,String password); } 这是Service里面注入 package pers.zww.grad.service.impl; 、、、 @Service("adminService") public class AdminServiceImpl implements IAdminService { @Autowired @Qualifier("adminDao") private IAdminDao adminDao; @Override public int deleteByPrimaryKey(String id) { // TODO Auto-generated method stub return 0; } 配置文件都已扫描过了,而且相关mybatis的如下: <!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="classpath:pers/zww/grad/mapping/*.xml"></property> </bean> <!-- DAO接口所在包名,Spring会自动查找其下的类 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pers.zww.grad.dao" /> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> </bean>

Spring Security 4 : 获取当前登录用户, 有时成功有时失败. 求解

场景描述:<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5端登录成功以后, 在请求需要用户登录才能访问的接口前, 会调用一个检测是否有用户登录的接口. <br/> 问题描述: <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当第一次H5端登录成功后, 一切是正常的, 访问其他接口也是. &nbsp;但...如果现在退出登录并立马去登录页进行第二次登录的时候, 登录成功了, 去访问需要权限的接口时, 调用检测接口时, 就会出现获取当前用户失败的情况出现!!! <br/> 求各位大佬解惑!!! <br/> 代码情况: <br/> ![图片说明](https://img-ask.csdn.net/upload/201908/26/1566805298_249886.png)

【Spring事务】spring事务应用方法求解!

问题描述: 现有一个业务A,需要调用B,C,D;B和D需要同时成功或同时失败,同时D需要依赖C的结果,请问如何通过spring事务进行控制? 知道的大神麻烦解答下,多谢~~

【spring】上传文件MultipartHttpServletRequest,为null,求解

![图片说明](https://img-ask.csdn.net/upload/201901/07/1546843816_882615.png) debug发现的错误位置,报错信息为空指针异常,debug发现这个为null 但是不知道原因 ![图片说明](https://img-ask.csdn.net/upload/201901/07/1546843917_891771.png) ![图片说明](https://img-ask.csdn.net/upload/201901/07/1546843925_872818.png) 这个是请求的参数,我感觉没错啊,求解是什么问题额 ![图片说明](https://img-ask.csdn.net/upload/201901/07/1546844059_597759.png) -------------- 项目中有配置 ``` @Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME) public CommonsMultipartResolver commonsMultipartResolver(MultipartConfigElement element) { CommonsMultipartResolver resolver = new CommonsMultipartResolver(); resolver.setMaxUploadSize(element.getMaxRequestSize()); resolver.setMaxUploadSizePerFile(element.getMaxFileSize()); resolver.setResolveLazily(multipartProperties.isResolveLazily()); return resolver; } ``` ------------------------------------- 我快愁死了,我把这个bean注释掉就能拿到文件了,我在网上找的要不就是 吧HttpServletRequest强转成MultipartHttpServletRequest,可我为啥弄了还是null呢,求救啊

用ant编译spring源码出现了下面的错误,求解

E\projects\org.springframework.jdbc\target\classes [s:javac] ---------- [s:javac] 1. ERROR in F:\frame\spring-framework-3.0.5.RELEASE\projects\org.spr ingframework.jdbc\src\main\java\org\springframework\jdbc\datasource\DelegatingDa taSource.java (at line 39) [s:javac] public class DelegatingDataSource implements DataSource, Initial izingBean { [s:javac] ^^^^^^^^^^^^^^^^^^^^ [s:javac] The type DelegatingDataSource must implement the inherited abstract method CommonDataSource.getParentLogger() [s:javac] ---------- [s:javac] ---------- [s:javac] 2. ERROR in F:\frame\spring-framework-3.0.5.RELEASE\projects\org.spr ingframework.jdbc\src\main\java\org\springframework\jdbc\datasource\DriverManage rDataSource.java (at line 66) [s:javac] public class DriverManagerDataSource extends AbstractDriverBased DataSource { [s:javac] ^^^^^^^^^^^^^^^^^^^^^^^ [s:javac] The type DriverManagerDataSource must implement the inherited abstra ct method CommonDataSource.getParentLogger() [s:javac] ---------- [s:javac] ---------- [s:javac] 3. ERROR in F:\frame\spring-framework-3.0.5.RELEASE\projects\org.spr ingframework.jdbc\src\main\java\org\springframework\jdbc\datasource\SimpleDriver DataSource.java (at line 53) [s:javac] public class SimpleDriverDataSource extends AbstractDriverBasedD ataSource { [s:javac] ^^^^^^^^^^^^^^^^^^^^^^ [s:javac] The type SimpleDriverDataSource must implement the inherited abstrac t method CommonDataSource.getParentLogger() [s:javac] ---------- [s:javac] ---------- [s:javac] 4. ERROR in F:\frame\spring-framework-3.0.5.RELEASE\projects\org.spr ingframework.jdbc\src\main\java\org\springframework\jdbc\datasource\embedded\Emb eddedDatabaseFactory.java (at line 190) [s:javac] private class EmbeddedDataSourceProxy implements EmbeddedDatabas e { [s:javac] ^^^^^^^^^^^^^^^^^^^^^^^ [s:javac] The type EmbeddedDatabaseFactory.EmbeddedDataSourceProxy must implem ent the inherited abstract method CommonDataSource.getParentLogger() [s:javac] ---------- [s:javac] ---------- [s:javac] 5. ERROR in F:\frame\spring-framework-3.0.5.RELEASE\projects\org.spr ingframework.jdbc\src\main\java\org\springframework\jdbc\datasource\lookup\Isola tionLevelDataSourceRouter.java (at line 92) [s:javac] public class IsolationLevelDataSourceRouter extends AbstractRout ingDataSource { [s:javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [s:javac] The type IsolationLevelDataSourceRouter must implement the inherited abstract method CommonDataSource.getParentLogger() [s:javac] ---------- [s:javac] 5 problems (5 errors) [subant] Leaving directory: F:\frame\spring-framework-3.0.5.RELEASE\projects\ org.springframework.jdbc

Spring MVC配置问题,求解

我在xml里配置 < bean id="jdbcTemplate" p:dataSource-ref="dataSource" class="org.springframework.jdbc.core.JdbcTemplate" /> <bean id="userDaoJdbc" class="com.maya.web.dao.impl.UserDaoImpl"> <property name="jdbcTemplateTarget"> <ref local="jdbcTemplate"/> </property> </bean> 如此的话tomcat启动会报错: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 49 in XML document from URL [file:/E:/apache-tomcat-6.0.36/webapps/maya/WEB-INF/classes/conf/spring-jdbc-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'local' is not allowed to appear in element 'ref'. 改成(local改成bean就可以了。): 不是在一个xml里可以用local吗? 求解!!!!

spring 全局变量 是写成 static好,还是通过 spring 注入好?

RT,求助大神。。。。。spring mvc 在引用一个全局共享的列表的时候是应该用static来定义好, 还是通过 spring 以单例模式注入好呀? 求解。。。

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c# cad插入影像 c#设计思想 c#正则表达式 转换 c#form复制 c#写web c# 柱形图 c# wcf 服务库 c#应用程序管理器 c#数组如何赋值给数组 c#序列化应用目的博客园
立即提问