ssm配置,总是提示说缺少bean,检查了VideoMapper.xml文件,其中并没有重复的id

我用mybatis生成了mapper文件,dao文件,还有bean文件。在调用mapper的时候报错找不到bean,我检查配置文件感觉没有问题,求大佬指点迷津。
ApplicationContext ctx = new ClassPathXmlApplicationContext("/applicationContext.xml");
System.out.println(ctx);
这样是可以获取到的,但是通过ctx获取bean的时候获取不到。
文件的组织结构如下:

图片说明

applicationContext.xml :

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
    <!-- Spring的配置文件,这里主要配置和业务逻辑有关的 -->
    <!-- 数据源,事物控制...... -->
    <context:component-scan base-package="com.teachers.*">
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>

    <context:property-placeholder location="classpath:dbConfig.properties"/>

    <bean id = "pooledDataSource" class = "com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="jdbcUrl" value = "${jdbc.jdbcUrl}"></property>
        <property name="driverClass" value = "${jdbc.driverClass}"></property>
        <property name="user" value = "${jdbc.user}"></property>
        <property name="password" value = "${jdbc.password}"></property>
    </bean>

<!-- ============================================================================================== --> 

    <!-- 配置和myBatis的整合 -->
    <bean id= "sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 指定myBatis全局配置文件的位置 -->
        <property name="configLocation" value = "classpath:mybatis-config.xml"></property>
        <property name="dataSource" ref = "pooledDataSource"></property>
        <!-- 指定myBatis mapper文件的位置 -->
        <property name="mapperLocations" value = "classpath:com.teachers.mappers.*"></property>
    </bean>

    <!-- 配置扫描器,将myBatis接口的实现加入到IOC容器中 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 扫描所有的Dao接口的实现,加入到IOC容器中 -->
        <property name="basePackage" value = "classpath:com.teachers.dao"></property>
    </bean>

<!-- ================================================================================================== -->

    <!-- 事物控制的配置 -->
    <bean id = "transactionManager" class ="org.springframework.jdbc.datasource.DataSourceTransactionManager">

        <!-- 控制住数据源 -->
        <property name="dataSource" ref="pooledDataSource"></property>
    </bean>
    <!-- 开启基于注解的事务,使用xml配置形式的事务(必要主要的都是配置式) -->   
    <aop:config>
        <!-- 切入点表达式 -->
        <aop:pointcut expression="execution(* com.teachers.service..*(..))" id="txPoint"/>
        <!-- 配置事务增强 -->
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
    </aop:config>

    <!-- 配置事务增强,事务如何切入 -->
    <tx:advice id = "txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 所有方法都是事务方法 -->
            <tx:method name="*"/>

            <!-- 以get开始的所有方法 -->
            <tx:method name="get*" read-only="true"/>
        </tx:attributes>
    </tx:advice>

    <!-- spring配置文件的核心关注点 
        1.数据源
        2.与myBatis的整合
        3.事务控制
    -->
</beans>

Junit测试代码:

package com.teachers.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.teachers.dao.VideoMapper;

/**
 * 测试Dao层的工作
 * @author Xian云
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations= {"classpath:/applicationContext.xml"})
public class mapperTest {

    /**
     * 测试Video
     */
    @Autowired(required=true)
    VideoMapper video;

    @Test
    public void testCRUD() {
        System.out.println(video);
    }
}

错误信息:

 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.teachers.test.mapperTest': Unsatisfied dependency expressed through field 'video'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.teachers.dao.VideoMapper' 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.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:386)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.Iterator.forEachRemaining(Unknown Source)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.forEach(Unknown Source)
    at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:83)
    at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:74)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.teachers.dao.VideoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    ... 46 more


mybatis-config.xml文件:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
  PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-config.dtd">
  <configuration>
    <settings>
        <setting name = "mapUnderscoreToCamelCase" value = "true"/>
    </settings>
    <typeAliases>
        <package name="com.teachers.beans"/>
    </typeAliases>
</configuration> 

5个回答

property name="basePackage" value = "com.teachers.dao" /property

qq_39537939
看不懂的人 classpath是从src中找resources中的文件夹下的配置文件这里是找包就不需要用classpath
一年多之前 回复
qq_29215513
xian云 回复qq_29215513: 大佬,你可以在这个bbs下回复,我可以给分。https://bbs.csdn.net/topics/392397731?page=1#post-403290997
一年多之前 回复
qq_29215513
xian云 十分感谢,已经解决了,不过为什么去掉classpath就可以了呢?
一年多之前 回复

你的service层都有加注解吗?

qq_29215513
xian云 回复qq_37165235: 已经发到下面了
一年多之前 回复
qq_37165235
浅歌余生 回复qq_29215513: 可以看下你的web.xml吗?
一年多之前 回复
qq_29215513
xian云 我还没有写service层啊,我测试中也没有用到service层,只是调用了myBatis自动生成的dao接口的实现类
一年多之前 回复

web.xml 文件 :


 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
    <!-- 配置spring配置文件的名称和位置 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classPath*:applicationContext.xml</param-value>
    </context-param>

    <!-- 启动IOC容器的ServletContextListener -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- 配置springMVC 前端控制器 -->
    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:dispatcherServlet-servlet.xml</param-value>
        </init-param>
        <!--用来标记是否在项目启动时就加在此Servlet,0或正数表示容器在应用启动时就加载这个Servlet, 当是一个负数时或者没有指定时,则指示容器在该servlet被选择时才加载.正数值越小启动优先值越高 -->
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <!-- 拦截所有请求,千万注意是(/)而不是(/*) -->
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>CharacterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceRequestEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>forceResponseEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>CharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


    <filter>
        <filter-name>HiddenHttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>HiddenHttpMethodFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

use demoysc32
declare @myxml xml
set @myxml='
''''''''''''
''''''''''''dongsheng
''''''''''''男
''''''''''''423545
''''''''''''
''''''''''''
土豆

123123


choushuigou

54543545

'

--获得所有student节点的数据,每一行显示一条people节点的数据

/*select @myxml.query('.') as result from @myxml.nodes('/Peoples/people') as T(c) */
--将这些数据显示为一个表格
select T.c.value('(./Name)[1]','nvarchar(16)') as name,
T.c.value('(./Sex)[1]','nvarchar(4)') as sex,
T.c.value('(./QQ)[1]','nvarchar(16)') as QQ
from @myxml.nodes('/Peoples/people') as T(c)


 use demoysc32 
declare @myxml xml
set @myxml='<Peoples>
                <people>
                    <Name>dongsheng</Name>
                    <Sex>男</Sex>
                    <QQ>423545</QQ>
                </people>
                <people>
                    <Name>土豆</Name>
                    <Sex>男</Sex>
                    <QQ>123123</QQ>
                </people>
                <people>
                    <Name>choushuigou</Name>
                    <Sex>女</Sex>
                    <QQ>54543545</QQ>
                </people>
            </Peoples>'

--获得所有student节点的数据,每一行显示一条people节点的数据      
/*select @myxml.query('.')  as result from @myxml.nodes('/Peoples/people') as  T(c) */
--将这些数据显示为一个表格
select  T.c.value('(./Name)[1]','nvarchar(16)') as name,
        T.c.value('(./Sex)[1]','nvarchar(4)') as sex,
        T.c.value('(./QQ)[1]','nvarchar(16)') as QQ
        from @myxml.nodes('/Peoples/people') as T(c)
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
自动检查消除重复ID
自动检查消除sqlserver中的重复ID
为什么总是提示说窗口ID末定义
我在以CListView单方档中创建一个对话框作为输入框,总是提示说窗口ID末定义rnenum IDD = IDD_INPUTBOX ;rn类名为:CInputrnrn引用方法:rn 1、 CInput *input=new CInput;rn input->DoModal();rnrn 2、 CInput input;rn input.DoModal();rnrnrn总是提示说窗口ID末定义????rnrn窗口ID肯定是存在的,请高手帮个忙,找了一个晚上了查不出哪里出问题了
各位大侠,在装BCB时总是说缺少文件,怎么办?
说缺少文件,我就按忽略,完成后,但是编译时总是说读取文件错误。
运行PoissonRecon总提示说缺少vcomp.dll文件
运行PoissonRecon总提示说缺少vcomp.dll文件,就在网上下载了一个。放到了C:\Windows\SysWOW64下,可是还是提示缺少。最后把该文件和PoissonRecon.exe放在一个目录下,就好了
XP搜索功能无法使用,提示说缺少一个文件。。。。。。。。。。
缺少的是什么文件啊????rn谢谢啊
缺少 mcrypt 扩展。请检查 PHP 配置。
sudo aptitude install libmcrypt-dev 或者sudo apt-get install php5-mcrypt 模块安装完毕后,将mcrypt模块加载 sudo php5enmod mcrypt 检查:/etc/php5/apache2/conf.d/ /etc/php5/mods-available/ 有mcrypt.ini文件 随后重启a
git提交提示缺少change id
Total 27 (delta 21), reused 0 (delta 0) remote: Resolving deltas: 100% (21/21) remote: Processing changes: refs: 1, done remote: ERROR: missing Change-Id in commit message footer remote: remote: Hint:...
缺少 mysqli 扩展。请检查 PHP 配置。
extension_dir = "c:\php5\ext" 我的PHP装在C盘的rn;extension=php_bz2.dllrn;extension=php_curl.dllrn;extension=php_dba.dllrn;extension=php_dbase.dllrn;extension=php_exif.dllrn;extension=php_fdf.dllrnextension=php_gd2.dllrn;extension=php_gettext.dllrn;extension=php_gmp.dllrn;extension=php_ifx.dllrn;extension=php_imap.dllrn;extension=php_interbase.dllrn;extension=php_ldap.dllrn;extension=php_mbstring.dllrn;extension=php_mcrypt.dllrn;extension=php_mhash.dllrn;extension=php_mime_magic.dllrn;extension=php_ming.dllrn;extension=php_msql.dllrn;extension=php_mssql.dllrnextension=php_mysql.dllrnextension=php_mysqli.dllrn;extension=php_oci8.dllrn;extension=php_openssl.dllrn;extension=php_pdo.dllrn;extension=php_pdo_firebird.dllrn;extension=php_pdo_mssql.dllrn;extension=php_pdo_mysql.dllrn;extension=php_pdo_oci.dllrn;extension=php_pdo_oci8.dllrn;extension=php_pdo_odbc.dllrn;extension=php_pdo_pgsql.dllrn;extension=php_pdo_sqlite.dllrn;extension=php_pgsql.dllrn;extension=php_pspell.dllrn;extension=php_shmop.dllrn;extension=php_snmp.dllrn;extension=php_soap.dllrn;extension=php_sockets.dllrn;extension=php_sqlite.dllrn;extension=php_sybase_ct.dllrn;extension=php_tidy.dllrn;extension=php_xmlrpc.dllrn;extension=php_xsl.dllrn;extension=php_zip.dllrn这些都改好了啊! 为什么还显示rnrn缺少 mysqli 扩展。请检查 PHP 配置。
为什么我总是提示缺少控件?
我在下载了一些源码想学习的是否,总是提示×××not found ,我去网上下了×××,可是安装却不行。急死急死阿。比如TAMADVLED TJPaneltexture这些。GOD!
为什么总是说找不到窗体的ID呢
现在需要添加一个对话框,rn编译一个窗体类时,报错,说是窗体的ID是“未声明的标识符”,rn资源表中明明就有这个窗体的ID,rnrn这是怎么回事
结果总是提示缺少返回语句
使用LinkedList模拟一个队列数据结构,先进先出rn[code=java]import java.util.*;rnclass DuiLiernrn private LinkedList link;rn DuiLie()rn rn link=new LinkedList();rn rn public void myAdd(Object obj)rn rn link.addFirst(obj);rn rn public Object myGet()rn rn link.removeLast();rn rn public boolean isNull()rn rn return link.isEmpty();rn rnrnrnclass LinkedListTestrnrn public static void main(String[] args)rn rn DuiLie dl=new DuiLie();rn dl.myAdd("java01");rn dl.myAdd("java02");rn dl.myAdd("java03");rn dl.myAdd("java04");rn while(!dl.isNull())rn rn System.out.println(dl.myGet());rn rn rn[/code]rnrn为什么结果提示:[img=https://img-bbs.csdn.net/upload/201411/10/1415592673_935279.jpg][/img]rn
就一句话,但总是提示 :消息: 缺少 ')'
源码是这样rn[code=C#]rn<%#Eval("S_Name")%>rn[/code]rnrn生成以下代码 rn[code=HTML]rnrn演示rn[/code]rnrn但是却总是提示:消息: 缺少 ')'
为什么submit的onclick事件总是提示缺少对象?
我定义了一个rn<%rn sub act()rn ...rn end subrn%>rnrn然后在rn为什么submit的onclick事件总是提示缺少对象?
AjaxPro.2.dll使用总是提示缺少对象
AjaxPro.2.dll使用总是提示缺少对象rn程序能执行..但总是出现这样一句错误...rn好像是AjaxPro.2.dll内部的问题...谁的出现过这样的问题没???rn老是出现一个这样的错误一点也不好看...rn谁知道这是怎么一回事啊....rn
Delphi 总是提示缺少 .dcu 在线等待!
如题,运行了好几个Delphi程序总是缺少这个或者那个的 .dcu ,该如何解决?请高手指点,谢谢
为什么总是提示我缺少对象呢??
我在一个图片按钮的onclick事件中调用下面的这个函数,但是为什么它总是提示我缺少对象呢?rnrn<%rnfunction CheckData()rnrnif document.formhead1.txtName.value ="" And document.formhead1.txtState.value ="" And document.formhead1.txtArea.value="" And document.formhead1.txtProd.value="" Then rn response.write " "rn document.formhead1.txtName.setfocus()rn return falsernElsern response.write " "rn return truernEnd Ifrnend functionrn%>rnrn调用rnrn
nativexml 总是提示缺少 sdStreams.dcu文件 【delphi7环境】
[Fatal Error] NativeXml.pas(11): File not found: 'sdStreams.dcu'rnrn找了好几个下载版本,都是这个提示
ssm框架文件配置
1简介 Spring MVC (web level),采取 MVC 架构,意图取代麻烦的 Servlet 写法,简化 web 层 MyBatis (dao level),意图取代 jdbc 操作数据库,轻量级、灵活、高效 Spring,提供了 IoC(容器,用来管理组装对象) 和 AoP(切面,用来自动增强对象功能) 功能,它用来将对象和其他框架组织在一起 ...
SSM下的jdbc.properties文件配置
SSM下的jdbc.properties文件配置 使用Spring+Struts2.0+MyBatis配置jdbc.properties文件: 单个或多个数据源配置 Spring文件对jdbc.properties文件的引用
配置SSM的文件
1.pom.xml&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/m...
SSM文件配置
SSM(Spring Springmvc Mybatis) 说明:小学生所写,若有不足请指出 三大框架简单说明:   Spring:经常使用的就是IOC(控制反转)和AOP编程,不需要使用new关键字,安全。  Spring mvc:SpringMVC:它用于web层,相当于controller(等价于传统的servlet和struts的action),用来处理用户请求   Mybati
提示缺少这个文件uWriteIcon.dcu
该怎么解决??我在本机没有找到uWriteIcon.dcu,是不是缺什么控件啊??哪位明白 给想个办法 着急!
SSM myBatis 配置及自动生成Bean 和 Dao
因为我发现在做SSM 的配置的时候 ,配置中出现一点问题都会导致项目打包失败或者其他问题,但是我发现网上很多都没有贴出每个配置文件的代码,如果是新手在配置上就会走很多的弯路,所以这里我贴出所有配置文件的代码,这样会方便很多新手快速的构建正确的SSM项目
SSH与SSM学习之Spring02——bean元素配置
SSH与SSM学习之Spring02bean元素配置 一bean元素说明 二scope属性 三scope代码示例 1 Userjava 2 测试代码 3 scope为singleton 31 applicationContextxml 32 运行结果 4 scope为prototype 41 applicationContextxml 42 运行结果 四生命周期属性 1 属性说明 2 applica
框架文件在预览时总是提示说:文件下载--安全警告
rnrnrn 购物系统后台管理rnrn rn rn rnrn rn rnrn在预览时总是提示说:文件下载--安全警告rn 你想打开或保存此文件吗?rn为何呀?
说总是提示找不到标识符“uninitialized_copy”
[align=right][/align][code=C/C++]rnif(size() == capacity())rnrn int old_size = size();rn int temp = size() * growth;rnrn type *extended_space = alloc.allocate(temp);rn uninitialized_copy(start_space , free_space , extended_space); //here!!rn deep_free();rnrn start_space = extended_space;rn free_space = start_space + old_size;rn end_of_space = start_space + temp;rnrnrnalloc.construct(free_space , value);rnfree_space++;rnrn[/code]rnrn请问这是何故
为什么VS2005总是提示说找不到程序集?
我继承Button类生成新MyButton类。然后我又添加了一个项目Form1来使用MyButton类,一切都很顺利。但是当我退出VS2005后,再次启动这个解决方案。Form1的设计视图就不能用了,提示下面这句话:rn"找不到类型“MyButtonLib.MyButton”。请确保已引用包含此类型的程序集。如果此类型为开发项目的一部分,请确保已成功生成该项目。"rn我已在调用项目中添加了对MyButtonLib的引用,并且MyButtonLib项目也已生成,编译也提示生成成功,程序运行也没问题,但是为什么Form1的设计视图就是不能用?我还要添加其他东西呢!这到底是怎么一回事啊?
总是提示说“是未定义的名称”。。。
同一个脚本里的建表sql,建完显示成功,用控制中心去看,表也有了。rn但在db2cmd 那用建表的那个用户webuser connect 进去rnselect * from WFFARUT就可以;rn但select * from Address 就提示:WEBUSER.ADDRESS" 是未定义的名称。 SQLSTATE=42704rn郁闷,建表的脚本如下:rnconnect to edw user WEBUSER using web;rndrop table "WFFARUT";rndrop table "ADDRESS";rnCREATE TABLE "WEBUSER "."WFFARUT" (rn "CHECK_IND" CHAR(1) NOT NULL , rn "TRAN_TELLER" CHAR(4) , rn "TRAN_DEPT" SMALLINT , rn "TRAN_DATE" DATE , rn "TRAN_TIME" TIME , rn "AUTH_TELLER" CHAR(4) , rn "AUTH_DATE" DATE , rn "AUTH_TIME" TIME , rn "RECORD_NO" SMALLINT NOT NULL , rn "MAIN_AREA_NO" CHAR(4) NOT NULL , rn "AREA_TYPE" CHAR(2) , rn "SUB_DEPT_NO" CHAR(4) ) ; rnrnALTER TABLE "WEBUSER "."WFFARUT" rn ADD CONSTRAINT "PK_WFFARUT" PRIMARY KEYrn ("CHECK_IND",rn "MAIN_AREA_NO",rn "RECORD_NO");rncreate table "WEBUSER". "Address"rn(rn "id" NUMERIC(6,0) not null generated by default as identity,rn "officerCode" CHAR(4),rn "company" varchar(40),rn "name" varchar(20),rn "phone1" VARCHAR(20),rn "phone2" VARCHAR(20),rn "fax" VARCHAR(20),rn "address" VARCHAR(100),rn "email" VARCHAR(40),rn constraint P_PK_ADDR primary key ("id")rn);rn
重复文件检查软件,揪出你电脑中重复的文件
揪出你电脑中重复的文件,节省你的硬盘空间
获取bean的id,bean的生命周期
获取bean的id 在某些情况下,项目需要在写bean类就知道bean的配置id 两部 1.让bean实现BeanNameAware的接口 2.实现该接口中setBeanName的方法 //spring会自动检查容器中的bean,如果发现了某个bean实现了BeanNameAware这个接口,spring就立即调用setBeanName方法 //spring 容器调用这个方法时,它会把beanid...
为何提示说文件不存在?
帮我看看下面的代码是哪儿错了?rnprocedure TForm3.BitBtn5Click(Sender: TObject);rnvarrnsd,s1,s2,s:string;rnbeginrn //panel3.Visible:=true;rn sd:=copy(label2.caption,7,2);rn dm3.ADOquery2.Close;rn dm3.adoquery2.sql.Clear;rn dm3.ADOQuery2.sql.Add('select * from detailed_table where adata='+quotedstr(sd)+'order by uid');rn dm3.ADOquery2.open;rn dbsumlist1.DataSet:=dm3.adoquery2;rn str1:=currtostr(dbsumlist1.SumCollection.Items[0].SumValue);rn str2:=currtostr(dbsumlist1.SumCollection.Items[1].SumValue);rn str3:=currtostr(dbsumlist1.SumCollection.Items[2].SumValue);rn str4:=currtostr(dbsumlist1.SumCollection.Items[3].SumValue);rn str5:=currtostr(dbsumlist1.SumCollection.Items[4].SumValue);rn str6:=currtostr(dbsumlist1.SumCollection.Items[5].SumValue);rn str7:=currtostr(dbsumlist1.SumCollection.Items[6].SumValue);rn str8:=currtostr(dbsumlist1.SumCollection.Items[7].SumValue);rn str9:=currtostr(dbsumlist1.SumCollection.Items[8].SumValue);rn str10:=currtostr(dbsumlist1.SumCollection.Items[9].SumValue);rn str11:=currtostr(dbsumlist1.SumCollection.Items[10].SumValue);rn str12:=currtostr(dbsumlist1.SumCollection.Items[11].SumValue);rn str13:=currtostr(dbsumlist1.SumCollection.Items[12].SumValue);rn str14:=currtostr(dbsumlist1.SumCollection.Items[13].SumValue);rn str15:=currtostr(dbsumlist1.SumCollection.Items[14].SumValue); rn s1:=copy(dm3.ADOTable3.Fields[1].AsString,1,4)+copy(label2.Caption,1,10);rn if radiobutton1.Checked thenrn assignfile(copytxt,'c:\'+s1+'.txt')rn elsern assignfile(copytxt,'a:\'+s1+'.txt');rn s2:='c:\'+s1+'.txt';rn rewrite(copytxt);rn tryrn beginrn s:='编制单位:'+dm3.ADOTable3.Fields[1].AsString;rn writeln(copytxt,s);rn writeln(copytxt,str1);rn writeln(copytxt,str2);rn writeln(copytxt,str3);rn writeln(copytxt,str4);rn writeln(copytxt,str5);rn writeln(copytxt,str6);rn writeln(copytxt,str7);rn writeln(copytxt,str8);rn writeln(copytxt,str9);rn writeln(copytxt,str10);rn writeln(copytxt,str11);rn writeln(copytxt,str12);rn writeln(copytxt,str13);rn writeln(copytxt,str14);rn writeln(copytxt,str15);rn CloseFile(copytxt);rn end;rn savedialog1.FileName:=s1;rn savedialog1.Filter:='txt';rn if saveDialog1.Execute thenrn beginrn AssignFile(copytxt, saveDialog1.FileName);rn Append(copytxt);rn Flush(copytxt);rn CloseFile(copytxt);rn end;rnrn finallyrn closefile(copytxt);rn end; rn end;rnrnrnrn if saveDialog1.Execute thenrn beginrn AssignFile(copytxt, saveDialog1.FileName);rn Append(copytxt);rn Flush(copytxt);rn CloseFile(copytxt);rn end;rnAppend(copytxt);提示文件不存在。我明明已经创建了文件。rn
asp老是说缺少;
<%rnSet conn = Server.CreateObject("ADODB.Connection")rnconn.Open "driver=Microsoft Access Driver (*.mdb);dbq="&Server.MapPath("test.mdb")rn%>rnrnrnrn rn 无标题文档rnrnrnrnrnrnrn我在submit.asp中include了上面那个conn.asp,rnrn但老是说rnMicrosoft JScript 编译错误 错误 '800a03ec' rnrn缺少 ';' rnrn/conn.asp,行 2 rnrnSet conn = Server.CreateObject("ADODB.Connection")rn----^rnrn自己刚学asp,请大家指点一下,谢谢
为什么提示说找不到文件?
我建了一个虚拟目录practice,并在practice根目录里面建了一个number.txt文件rn以下是代码:rnrnrn Untitled Documentrn rnrnrnrn<%rnsub numberappend()rnset file=server.createobject("scripting.filesystemobject")rnset numtxt=file.opentextfile(server.mappath("/number.txt"))rnapplication("number")=numtxt.readlinernnumtxt.closernapplication("number")=application("number")+1rnresponse.write application("number")rnrnset numtxt=file.creattextfile(server.mappath("/number.txt"),true)rnnumtxt.writeline(application("number"))rnnumtxt.closernend subrnrnapplication.lockrnnumberappendrnapplication.unlockrn%>rnrnrnrn提示错误说:rnMicrosoft VBScript 运行时错误 错误 '800a0035' rnrn文件未找到 rnrn/practice/TMP7zcb9niq89.asp, 行11 rnrnrn
Bean的其他配置 id和name的区别
id遵守XML约束的id的约束.id约束保证这个属性的值是唯一的,而且必须以字母开始,可以使用字母、数字、连字符、下划线、句话、冒号name没有这些要求***** 如果bean标签上没有配置id,那么name可以作为id.***** 开发中Spring和Struts1整合的时候, /login.&amp;lt;bean name=”/login” class=””&amp;gt; 现在的开发中都使用id属性即可....
总是提示我重复定义了,很麻烦,
第一题我定义了i 和j之后,我在第二题里面也定义了i和j,应该和第一题没什么联系阿,可是编译的时候总是提示我重复定义了,该怎么办??
总是缺少文件? 快帮帮我呀
我做的小程序让别人用,有时会提示缺少***.dll文件,或缺少mfc42.dll文件,rn如何解决呀?rnrn
关于DirectShow SDK总是缺少文件
抓狂,这挺几天了,楞是没找到可以用的DirectShowSDK,总是显示缺少文件。rnrn装了DXSDK_Mar09,又装了个dxsdk_feb2005_extras,然后把它们的路径在开发环境里设置好,可总显示缺少strsafe.h文件,怎么办呢? 下载了几个版本试了都不行。rnrn谁给推荐个可以用的SDK呢? 下载地址也行,要确实能用就可以。
条码重复检查条码重复
条码重复检查条码重复 条码重复检查条码重复 条码重复检查条码重复
配置Opencv 3.2.0 VC++ 提示缺少 ucrtbased.dll
用VS2013配置了Opencv3.2.0 运行后提示缺少 ucrtbased.dllrn[img=https://img-bbs.csdn.net/upload/201706/15/1497503945_608385.png][/img]rnrn代码如下rn[code=c]rnrn#include "stdafx.h"rn#include rn#include rn#include rnrnusing namespace std;rnusing namespace cv;rnrnint _tmain(int argc, _TCHAR* argv[])rnrn cout << "测试C++程序" << endl;rn int a;rn cin >> a;rnrn Mat img = imread("lena.jpg");rnrn return 0;rnrnrnrn[/code]rnrn把opencv代码相关代码去掉, 程序正常运行
【SSM】No qualifying bean of type
异常:rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.how2java.service.CsHomeworkService com.how2java.controller.TestController.csHomeworkService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.how2java.service.CsHomeworkService] 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)rn代码:rn[code=java]rnpackage com.how2java.controller;rnrnimport java.util.List;rnrnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.stereotype.Controller;rnimport org.springframework.web.bind.annotation.RequestMapping;rnimport org.springframework.web.servlet.ModelAndView;rnrnrnimport com.how2java.pojo.CsHomework;rnimport com.how2java.service.CsHomeworkService;rnrn@Controllerrn@RequestMapping("")rnpublic class TestController rn rn @Autowiredrn CsHomeworkService csHomeworkService;rn rn @RequestMapping("dachuang")rn public ModelAndView show()rn ModelAndView mav = new ModelAndView();rn List cs= csHomeworkService.list();rn rn // 鏀惧叆杞彂鍙傛暟rn mav.addObject("cs", cs);rn // 鏀惧叆jsp璺緞rn mav.setViewName("listCsHomework");rn return mav;rn rn rnrn[/code]rnapplicationContext.xmlrn[code=java]rnrnrn rn rn rn rn rn rn rn com.mysql.jdbc.Driver rn rn rn jdbc:mysql://localhost:3306/python?characterEncoding=UTF-8 rn rn rn rn root rn rn rn *********** rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn[/code]rnspringMVC.xmlrn[code=java]rnrnrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrnweb.xmlrn[code=java]rnrnrnrnrn rn rn contextConfigLocationrn classpath:applicationContext.xmlrn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn rn mvc-dispatcherrn org.springframework.web.servlet.DispatcherServletrn rn rn contextConfigLocationrn classpath:springMVC.xmlrn rn 1rn rn rn mvc-dispatcherrn /rn rn rn[/code]rn[code=java]rnrn@Servicernpublic class CsHomeworkServiceImpl implements CsHomeworkServicernrn @Autowiredrn CsHomeworkMapper cs;rn rn @Overridern public List list() rn return cs.list();rn rnrnrn[/code]rn[code=java]rn@Controllerrn@RequestMapping("")rnpublic class TestController rn rn @Autowiredrn CsHomeworkService csHomeworkService;rn rn @RequestMapping("dachuang")rn public ModelAndView show()rn ModelAndView mav = new ModelAndView();rn List cs= csHomeworkService.list();rn rn // 鏀惧叆杞彂鍙傛暟rn mav.addObject("cs", cs);rn // 鏀惧叆jsp璺緞rn mav.setViewName("listCsHomework");rn return mav;rn rn rnrnrn[/code]rn
相关热词 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天 c#func链接匿名方法 c#怎么创建文件夹 c#从键盘接收空格 c#da/ad c#部门请假管理系统 c#服务器socket c# 默认的访问修饰符