spring+springmvc+mybatis 报错。求大神指教。
 严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'index': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.biz.UserService com.yhq.controller.Index.userd; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.dao.UserMapper com.yhq.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yhq.service.dao.UserMapper] 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)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    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:5231)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5518)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.biz.UserService com.yhq.controller.Index.userd; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.dao.UserMapper com.yhq.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yhq.service.dao.UserMapper] 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)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    ... 29 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.dao.UserMapper com.yhq.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yhq.service.dao.UserMapper] 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)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
    ... 31 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.dao.UserMapper com.yhq.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yhq.service.dao.UserMapper] 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)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    ... 42 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yhq.service.dao.UserMapper] 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)}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:988)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:858)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
    ... 44 more

4个回答

重要看这句

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '**userServiceImpl**': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yhq.service.dao.UserMapper **com.yhq.service.impl.UserServiceImpl.userMapper**;
这就是你在注入userServiceImpl的时候失败,可能命名不一致,你看下

找了一下,没找到有什么不一致的地方。
图片说明
图片说明
图片说明
图片说明
图片说明
图片说明
图片说明
图片说明

Could not autowire field: private com.yhq.service.biz.UserService com.yhq.controller.Index.userd;

这个是怎么自动匹配的

我的注解是在spring-servlet.xml 里通过 /context:component-scan 自动扫描包实现的。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
程序报错,求大神指教
adodataset1.Fiter:='Number'+''''+edit1.Text+'''';n为什么报错说nunable to invoke code completion due to errors in source coden求大神解析一下为什么T_T
spring的问题,求大神指教
在DAO实现类头部rn@Repositoryrnrn在BIZ实现类头部rn@Service("studentManager")rnrn在action头部rn@SuppressWarnings("serial")rn@Scope("prototype")rn@Controller("idc.demo.studentAction")rnrnrn以上配置后 可以不用配置 spring 配置文件 就能代理 这个我看不懂。求大神逐句解读一下吧,谢谢...
springMVC集成mybatis报错
springMVC集成mybatis报错:norg.apache.catalina.core.StandardContext listenerStartn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenernorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'basVideoMapper' defined in file [D:\TOOLS\software\apache-tomcat-7.0.69\wtpwebapps\TanWuAppAPI\WEB-INF\classes\com\tanwuapp\java\BasVideoMapper.class]: Cannot resolve reference to bean 'SqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'SqlSessionFactory' is definedn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)n at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)n at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)n at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)n at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)n at java.util.concurrent.FutureTask.run(FutureTask.java:262)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)n at java.lang.Thread.run(Thread.java:745)nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'SqlSessionFactory' is definedn at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)n at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)n at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)n ... 28 morennnapplicationContext配置文件n```n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n```nspringMVC-servlet配置文件:nn```n n n n n n n n n```nnweb.xmlnn```n n contextConfigLocationn /WEB-INF/applicationContext.xmln n n n org.springframework.web.util.Log4jConfigListener n n n org.springframework.web.context.ContextLoaderListenern n n n org.springframework.web.util.IntrospectorCleanupListenern nn n n CharacterEncodingFiltern org.springframework.web.filter.CharacterEncodingFiltern n encodingn UTF-8n n n forceEncodingn truen n n n CharacterEncodingFiltern /*n n n n SpringMVC n org.springframework.web.servlet.DispatcherServlet n n contextConfigLocation n /WEB-INF/springMVC-servlet.xml n n 1 n n n SpringMVC n *.do n n n n index.jspn nn```nntomcat服务启动时报错,求帮忙看下。nnn
springmvc spring mybatis 整合
1:前端简单实现 2:后端详细 3:增删改查等
spring + springmvc + mybatis
spring + springmvc + mybatis; 里面包含mybatis生成文件,可以自己生成,看看学习一下就行,如果把自己生成的放进去可能会出现问题; 内涵mysql 表
SpringBoot +Spring +SpringMvc +Mybatis
SpringBoot +Spring +SpringMvc +Mybatis 基本架构的框架搭建
spring + springMVC + mybatis + poi
spring + springMVC + mybatis + maven + apache-poi 框架整合源码,带详细注释。
spring springmvc mybatis 整合
ssm 框架整合代码
springmvc spring mybatis整合
ssm maven 框架整合,我上传是为了方便自己看 大家需要请留言 免费发
spring springMVC mybatis
java spring springMVC mybatis 框架 搭建的简单环境
spring springmvc mybatis配置文件
里面带有验证码,简单的增删改查
SpringMVC Spring MyBatis整合
1.spring数据源配置n 2.SpringMVC Spring MyBatis整合n 3.SpringMVC Spring MyBatis实现单表增、删、改、查
Spring SpringMVC Mybatis环境搭建
JavaEE SSM三层框架Spring+SpringMVC+Mybatis简单介绍,JavaEE SSM三层框架整合简单案例从头到尾做一个管理系统:JavaEE SSM三层架构客户管理系统、框架搭建、用户登录实现、实现登录验证以及实现退出登录、实现查询客户、实现修改客户和实现删除客户功能。
Spring SpringMVC Mybatis easyui
可以直接运行
springMVC spring mybatis
springMVC spring mybatis 整合 实现登录 基本增删改查
spring mybatis springmvc jar包
ssm整合jar包,完整 ssm整合jar包,完整 ssm整合jar包,完整
spring springMVC mybatis maven
spring springMVC mybatis maven 框架整合附带数据库
springmvc,spring,mybatis整合
SPRINGMVC SPRING MYBATIS 利用maven整合起来,有实际例子,可以节省新手的配置时间
springMvc + spring + mybatis + easyUI
springMvc + spring + mybatis + easyUI,直接可以用,把数据库导入就可以。 采用分层,MVC模式。可以学习一下。
Spring集成SpringMVC/Mybatis
Spring集成SpringMVC/Mybatis,有初始化脚本
spring和mybatis整合 测试报错 求大神路过解决一下!!!!!!!!
[b]以下是报错内容[/b][color=#FF0000][/color]rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mybatisTest.test2': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'stuService' is definedrn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rnrnrnrn以下是配置文件rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrnrnrnrn rnrn rn rnrnrnrnrndao层rnrnrnpackage com.mapper;rnrnimport java.util.List;rnimport org.springframework.stereotype.Repository;rnimport com.entity.student;rnrn@Repositoryrnpublic interface StuDao rnrn // 按学号查询学生信息rn student findStuBySno(int sno) throws Exception;rnrn // 查询全部学生rn List findStuAll() throws Exception;rnrnrnrnservice层rnpackage com.service;rnrnimport java.util.List;rnrnimport com.entity.student;rnrnpublic interface StuService rnrn public student findStuBySno (int sno) throws Exception;rn rn public List findStuAll() throws Exception;rnrnrnrn实现类rnrnpackage com.serviceImp;rnrnimport java.util.List;rnrnrnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.stereotype.Service;rnrnimport com.entity.student;rnimport com.mapper.StuDao;rnimport com.service.StuService;rnrn@Service("stuService")rnpublic class StuServiceImp implements StuService rnrn @Autowiredrn private StuDao studao;rn rn rn public student findStuBySno(int sno) throws Exception rn rn return this.studao.findStuBySno(sno);rn rnrn public List findStuAll() throws Exception rn rn return this.studao.findStuAll();rn rnrnrnrn测试类rnrnpackage mybatisTest;rnimport static org.junit.Assert.fail;rnimport javax.annotation.Resource;rnimport org.apache.log4j.Logger;rnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnrnimport com.entity.student;rnimport com.service.StuService;rnrn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(locations = "classpath:Spring-*.xml")rnpublic class test2 rn private static Logger logger =Logger.getLogger(test2.class);rn @Resource(name="stuService")rn StuService stuService;rn @Testrn public void testFindStuBySno() throws Exception rn student student=stuService.findStuBySno(123);rn System.out.println(student);rn logger.info(student);rn rn @Testrn public void testFindStuAll() rn fail("Not yet implemented");rn rnrnrn
spring springmvc mybatis整合
使用myeclipse整合的spring springmvc mybatis含有整合所需要的jar包;已经测试过tomcat能正常启动;还包含了springmvc的一些页面跳转!!感兴趣的可以下载参考!
spring + springmvc + mybatis整合
这个是一个spring + springmvc + mybatis整合的项目,初学者可以参考一下,发现什么问题或者有更好的建议请提出来。共勉!
ssm spring springmvc mybatis
ssm spring spring mvc mybatis 简单的demo 实现了基础的配置
SpringMVC + Spring + MyBatis
ssm框架
SpringMVC + Spring + Mybatis
NULL 博文链接:https://jaakko.iteye.com/blog/2364758
Spring、SpringMVC和Mybatis入门
老彭根据目前互联网主流开发企业级架构,整合SSM 框架,基于框架研究了一套视频教程,本教程浅显易懂,新学员易上学。解决了复杂、难以操作的框架搭建问题,让大家非常清楚地明白框架的运行机制,理解SSM 之间的调用关系,通过学生系统案例让大家掌握SSM 项目开发,让大家具备企业级开发的能力,该框架可以应用到实际工作中。
springMVC报错,在线等,求大神解答
在使用spring框架的时候出现找不到类的异常,我自己下载包到导入了,还是这样。这个javax/portlet/PortletException到底是什么???求大神解答rn十二月 23, 2015 11:57:05 上午 org.apache.catalina.core.ApplicationContext logrn严重: StandardWrapper.Throwablernjava.lang.NoClassDefFoundError: javax/portlet/PortletExceptionrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:800)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3114)rn at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1342)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1823)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)rn at java.lang.Class.getDeclaredMethods0(Native Method)rn at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)rn at java.lang.Class.getDeclaredMethods(Class.java:1868)rn at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)rn at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)rn at javax.servlet.GenericServlet.init(GenericServlet.java:158)rn at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5253)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5543)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1978)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: java.lang.ClassNotFoundException: javax.portlet.PortletExceptionrn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)rn ... 48 morern十二月 23, 2015 11:57:05 上午 org.apache.catalina.core.StandardContext loadOnStartuprn严重: Servlet [SpringMVC05] in web application [/SpringMVC04] threw load() exceptionrnjava.lang.ClassNotFoundException: javax.portlet.PortletExceptionrn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)rn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:800)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3114)rn at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1342)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1823)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)rn at java.lang.Class.getDeclaredMethods0(Native Method)rn at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)rn at java.lang.Class.getDeclaredMethods(Class.java:1868)rn at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)rn at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)rn at javax.servlet.GenericServlet.init(GenericServlet.java:158)rn at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5253)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5543)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1978)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rn
求大神指导spring mybatis整合一些问题
[code=java]rn rn rn 未读rn 已读rn 其他rn rn $list.sendUid rn $list.receiverUid rn $list.title rn rn 查看 删除rn rn [/code]rn如上代码..我想的是,在运行的时候,把$list.sendUid 和$list.receiverUid 这2个uid,在去执行给换成对应表里边的name,如何实现?[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img]rn要不还得弄2表查询,得写实体类好麻烦....
一个简单的存储过程报错,求大神指教
[code=sql]rn--Drop PROCEDURE [dbo].[FenYe]rnCREATE PROCEDURE [dbo].[FenYe]rnrn @curPage int, --当前页数rn @pageSize int, -- 每页显示的数量rn @th varchar(200) = '', --查询,图号rn @mc varchar(200) = '', --查询,名称rn @tm varchar(200) = '', --查询,条码rn @gysdm varchar(200)='' --查询,供应商代码 rnASrnrnBeginrnrnDeclare @before int,@sql nvarchar(1000)rnrnSet @before=(@curpage-1)*@pageSizernSet @sql='select top '+cast(@pageSize as varchar(10))+' th,bh,mc,wlbh,tx,dw,nx,xfdw_dm,xfdw_mc,no_bh,rq,bz,glry,bgy From tm_wlbhrnwhere id not in (Select top '+cast(@before as varchar(10))+' id from tm_wlbh where (th like ''%''+@th+''%'' or bh like ''%''+@th+''%'') and mc like ''%''+@mc+''%'' and wlbh like ''%''+@tm+''%'' and xfdw_dm like ''%''+@gysdm+''%'' order by id)'rnExec (@sql)rnrnEndrnrn--exec FenYe 1,30,'','','',''rnrn调用时报错:消息 137,级别 15,状态 2,第 2 行rn必须声明标量变量 "@th"。rn[/code]
3Dmax塌陷报错求各路大神指教
-
androidstudio运行时总是报错:求大神指教
报的错:Error:Execution failed for task ':app:dexDebug'.n> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0\bin\java.exe'' finished with non-zero exit value 2n网上说的更改架包,和设置studio里的默认路径等,试过了,不是这个问题;ndos系统里用cmd以及javac都试过了,jdk、sdk都配置好了工作空间里也试过新建一个工程验证是否是代码问题,但都不是;n工程里build.gradle文件里更改sdk版本,也试过了没反应。n所以,现在很肯定是androidstudio里系统配置的问题,因为此问题对我很重要,所以请教大神,求指教
SVN上传报错,求大神指教
[img=https://img-bbs.csdn.net/upload/201511/18/1447826067_534433.png][/img]rn求大神提点下,为什么我把代码上传的SVN指定的目录下,总出现这种情况,代码中改过东西我才Commit的,不怎么会用这东西,还有我想问下我Commit之前是不是要先从SVN上更新下再上传?
为什么会报错 求大神指教
[code=html]rnrnrnrn rn rn rnrnrnrn rn rn 喜欢rn 0rn rn rn 喜欢rn 1rn rn rnrnrn rn[/code]rnTypeError: num[i] is undefinedrnalert(num[i].innerHTML);rnrn为什么说没定义呢 要怎么样才能 输出 num每个的innerHTML
hibernate3.6+spring3.2.13整合报错,求大神指教
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:921)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:864)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:779)rn at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:817)rn at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:745)rn ... 54 morernCaused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:244)rn at org.hibernate.service.internal.AbstractServiceRegistryImrnpl.initializeService(AbstractServiceRegistryImpl.java:208)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)rn at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:208)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)rn at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)rn at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:217)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)rn at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)rn at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)rn at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)rn at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)rn at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:692)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:863)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:782)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)rn ... 65 morernCaused by: org.hibernate.HibernateException: Could not instantiate connection provider [org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider]rn at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:194)rn at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:111)rn at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:41)rn at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)rn at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)rn ... 90 morern[b][color=#FF0000]Caused by: java.lang.ClassCastException: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider cannot be cast to org.hibernate.engine.jdbc.connections.spi.ConnectionProvider[/color][/b]rn at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:191)rn ... 94 more
maven 项目打包时报错,求大神指教!
[img=https://img-bbs.csdn.net/upload/201401/28/1390896159_351186.jpg][/img]rnrn刚开始学maven,这个包在库中是有的,不知道这个错误怎么回事,还请大神指教。
新手寒假作业多报错求大神指教
/*1、 会议记录管理系统rn基本功能要求:会议信息包括:会议编号,会议名称、部门名称、会议地点,会议日期,会议主持人,会议记录人,rn出席人员,会议摘要。rn 会议信息以二进制形式存储在文件中。rn要求能够:rn(1) 添加会议记录rn(2) 浏览所有会议记录信息rn(3) 按不同字段(会议编号,会议名称等)查询会议记录rn(4) 修改会议记录rn(5) 删除会议记录rn扩展功能要求: (1) 按某些字段进行排序浏览rn (2) 不同部门的会议纪录存放在不同的文件中rn (3) 把文件中的会议记录导入到程序中*/rnrn#includern#includern#define FILENAME "meeting.dat"rntypedef struct tagMeetingrnrn int num;rn char name[20];rn char department[20];rn char place[20];rn char date[20];rn char host[20];rn char recorder[20];rn int member[50];rn char abstruct[50];rn struct tagMeeting *next;rnMEETING,*PMEETING;rnMEETING g_head;rn//1.显示菜单rnvoid ShowMenu();rn//2.获取用户选择的菜单编号rnint GetMenuChoose();rn//3.创建一个节点,它会返回一个新创建的会议信息节点的指针rnPMEETING CreateMeeting();rn//4.把会议信息节点加入到链表中rnint AddMeeting(PMEETING pmee);rn//5.返回指定编号会议节点的上一个节点的指针rnPMEETING GetPrevAddr(int num);rn//6.显示所有会议信息rnvoid ShowAll();rn//7.显示信息数量 rn int ShowMeetingCount(); rn//7.修改会议信息,参数为要修改会议的编号rnvoid ModityMeeting(int num);rn//8.获取用户的选择rnint Question(const char *pstr);rn//9.获取用户输入的会议的编号rnint GetInputNum();rn//10.删除编号为num的会议信息rnvoid DelMeeting(int num);rn//11.删除全部会议信息rnvoid DelAll(int num);rn//12.存档rnvoid SaveToFile();rn//13.读档rnvoid LoadFromFile();rnint main()rnrn while(1)rn rn switch(GetMenuChoose())rn rn case 1:AddMeeting(CreateMeeting());break;rn case 2:DelMeeting(GetInputNum());break;rn case 3:;break;rn case 4:ModityMeeting(GetInputNum());break;rn case 5:DelAll();break;rn case 6:ShowAll();break;rn case 7:ShowMeetingCount();break;rn case 8:LoadFromFile();break;rn case 9:SaveToFile();break;rn rnrn rn return 0;rnrn//1.显示菜单rnvoid ShowMenu()rnrn printf("会议管理系统");rn printf("1.添加会议记录 2.删除会议记录 3.查询会议记录\n");rn printf("4.修改会议记录 5.删除所有会议信息 6.显示所有会议信息\n");rn printf("7.显示指定会议信息 8.读档 9.存档 0.退出\n");rnrn//2.获取用户选择的编号rnint GetMenuChoose()rnrn int num;rn ShowMenu();rn printf("请选择菜单(0 ~ 9):");rn while(1 != scanf("%d", &num) || num < 0 || num > 9)rn rn ShowMenu();rn printf("选择菜单错误,请重新选择(0 ~ 9):");rn fflush(stdin);rn rn return num;rn//3.创建一个节点,它会返回一个新创建的会议信息节点的指针 rnPMEETING CreateMeeting() rn rn PMEETING pmee=(PMEETING)malloc(sizeof(MEETING));//在堆内存申请空间,存储会议信息 rn if(!pmee) rn rn printf("申请内存空间失败!\n"); rn return NULL; rn rn printf("请输入会议编号(数字):"); rn while(1 != scanf("%d", &pmee->num) || GetPrevAddr(pmee->num)) rn rn printf("会议编号输入错误或已经有了,请重新输入会议的编号:"); rn fflush(stdin); rn rn printf("请输入会议名称:"); rn scanf("%20s",pmee->name);rn printf("请输入部门名称:");rn scanf("%20s",pmee->department);rn printf("请输入会议地点:");rn scanf("%20s",pmee->place);rn printf("请输入会议日期(年月日中间用.等符号隔开");rn scanf("%20s",pmee->date);rn printf("请输入会议主持人:");rn scanf("%20s",pmee->host);rn printf("请输入会议记录人:");rn scanf("%20s",pmee->recorder);rn printf("请输入出席人员:");rn scanf("%50s",pmee->member);rn printf("请输入会议摘要:");rn scanf("%50s",pmee->abstruct);rn pmee->next = NULL;rn return pmee;rnrn//4.把会议信息节点加入到链表中 rnint AddMeeting(PMEETING pmee) rn rn PMEETING pm = &g_head; rn if(!pmee) rn rn return 0; rn //看输过没有rn if(GetPrevAddr(pmee->num)) rn rn printf("会议信息已存在.\n", pmee->num); rn free(pmee);//释放该节点内存空间 rn return 0; rn rn while(pm->next) rn pm=pm->next; rn pm->next=pmee; rn pmee->next=NULL; rn return 1;rnrn//5.返回指定编号会议节点的上一个节点的指针 rnPMEETING GetPrevAddr(int num) rnrn PMEETING pmee=&g_head;rn while(pmee->next)rn rn if(pmee->next->num==num)rn return pmee;rn pmee=pmee->next;rn rn return NULL; rnrn//6.显示所有会议信息 rnvoid ShowAll() rn rn PMEETING pmee=&g_head; rn while(pmee->next) rn rn printf("会议编号:%d\n", pmee->next->num); rn printf("会议名称:%20s\n", pmee->next->name);rn printf("部门名称:%20s\n",pmee->next->department);rn printf("会议地点:%20s\n",pmee->next->place);rn printf("会议日期:%20s\n",pmee->next->date);rn printf("会议主持人:%20s\n",pmee->next->host);rn printf("会议记录人:%20s\n",pmee->next->recorder);rn printf("出席人员:%50s\n",pmee->next->member);rn printf("会议摘要:%50s\n",pmee->next->abstruct); rn pmee=pmee->next;rn rnrn//7.显示信息数量 rnint ShowMeeting() rn rn int count = 0; rn PMEETING pmee = &g_head; rn while(pmee->next) rn rn ++count; rn pmee=pmee->next; rn rn printf("\n当前共有%d位学生信息。\n", count); rn return count;rnrn//8.修改会议信息rnvoid ModityMeeting(int num) rn rn PMEETING pmee = GetPrevAddr(num); rn int choose; rn if(!pmee) rn rn printf("没有编号为%d的会议信息。\n", num); rn return; rn rn pmee=pmee->next;rn printf("当前会议名称为%s,", pmee->name); rn if(Question("确定要修改吗?"))rn rn printf("请输入会议名称:"); rn scanf("%20s", pmee->name); rn rn printf("当前部门名称为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入部门名称:");rn scanf("%20s",pmee->department);rn rn printf("当前会议地点为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入会议地点:");rn scanf("%20s",pmee->place);rn rn printf("当前会议日期为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入会议日期:");rn scanf("%20s",pmee->date);rn rn printf("当前会议主持人为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入会议主持人:");rn scanf("%20s",pmee->host);rn rn printf("当前会议记录人为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入会议记录人:");rn scanf("%20s",pmee->recorder);rn rn printf("当前出席人员为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入出席人员:");rn scanf("%50s",pmee->member);rn rn printf("当前会议摘要为%s,", pmee->name);rn if(Question("确定要修改吗?"))rn rn printf("请输入会议摘要:");rn scanf("%50s",pmee->place);rn rn printf("修改完毕!\n"); rnrn//9.获取用户的选择 rnint Question(const char *pmee) rn rn char answer; rn printf("%s请选择(y or n):", pmee); rn while(1 != scanf(" %c", &answer) || (answer != 'y' && answer != 'n')) rn rn printf("输入错误!%s请重新选择(y or n):", pmee); rn fflush(stdin); rn rn if('y' == answer) rn return 1; rn else rn return 0; rnrn//10.获取用户输入的会议的编号 rnint GetInputNum() rn rn int num; rn printf("请输入会议编号:"); rn while(1 != scanf("%d", &num)) rn rn printf("编号输入错误!请重新输入会议编号(整型):"); rn fflush(stdin); rn rn return num; rnrn//11.删除编号为num的会议信息 rnvoid DelMeeting(int num) rn rn PMEETING pmee, ptmp; rn if(pmee = GetPrevAddr(num)) rn rn if(!Question("确定要删除该会议信息吗?")) rn rn return; rn rn ptmp = pmee->next; rn pmee->next = ptmp->next; rn free(ptmp); rn printf("删除了编号为%d的会议信息。\n", num); rn rn else rn rn printf("没有找到编号为%d的会议信息。\n", num); rn rnrn//12.删除所有会议信息 rnvoid DelAll() rn rn PMEETING pmee=g_head.next, ptmp; rn int count = 0; rn if(!Question("确定要删除当前所有的会议信息吗?")) rn rn return; rn rn while(pmee) rn rn ptmp=pmee; rn pmee=pmee->next; rn free(ptmp); rn ++count; rn rn printf("共删除了%d位会议信息。\n", count); rn g_head.next = NULL; rnrn//13.存档rnvoid SaveToFile() rn rn FILE *pf = fopen(FILENAME, "wb"); rn PMEETING pmee=&g_head; rn int i=0, count=ShowMeetingCount(); rn if(!pf) rn rn printf("打开待写入的文件失败!\n"); rn return; rn rn if(!Question("确定要将当前会议信息保存到文件中吗?")) rn rn fclose(pf); rn return; rn rn fwrite(&count, 1, sizeof(count), pf);//把会议信息的数量先写入到文件头 rn while(pmee->next) rn rn fwrite(pmee->next, 1, sizeof(MEETING), pf);//把每项会议信息写入文件 rn ++i; rn pmee=pmee->next; rn rn fclose(pf); rn if(i==count) rn rn printf("成功的写入了%d条会议信息。\n", count); rn rn else rn rn printf("应写入%d条会议信息,实际写入%d条会议信息。\n", count, i); rn rnrn//14.读档rnvoid LoadFromFile() rn rn int i, count = 0, repeat = 0; rn FILE *pf; rn PMEETING pmee; rn printf("从文件中读取会议信息会询问是否清空已有会议信息(不清空表示合并所有信息)。\n"); rn if((pf = fopen(FILENAME, "rb")) == NULL) rn rn printf("文件还没有创建,请手工输入会议信息并保存吧!\n"); rn return; rn rn DelAll();//删除之前的所有会议信息,然后从文件中读取 rn fread(&count, 1, sizeof count, pf);//获取会议信息的数量 rn for(i = 0; i < count; ++i) rn rn pmee=(PMEETING)malloc(sizeof(MEETING)); rn fread(pmee, 1, sizeof(MEETING), pf); rn if(!AddMeeting(pmee)) rn rn ++repeat;//保持有多少个和当前链表中相重复的会议信息 rn rn rn fclose(pf); rn printf("文件读取完毕!新增会议信息%d条。\n", count - repeat); rnrn修改了好多次还是很多错误
django 迁移数据库 报错,求大神指教!
不知道为什么,创建一个新的app,迁移数据库就报错了,报错信息如下,求大神帮帮忙 rnrn报错信息:[img=https://img-bbs.csdn.net/upload/201809/04/1536055846_867787.png][/img]rnrn评论app的models:[img=https://img-bbs.csdn.net/upload/201809/04/1536055961_370835.png][/img]rnrnrn博客app的models:[img=https://img-bbs.csdn.net/upload/201809/04/1536055977_949971.png][/img]rn [img=https://img-bbs.csdn.net/upload/201809/04/1536055999_769812.png][/img]rnrnsetting:[img=https://img-bbs.csdn.net/upload/201809/04/1536056016_142390.png][/img]
执行SQL报错,求大神指教!!
该SQL用本机访问数据库无问题,用服务器的应用访问就报一下错误!rnrn[INFO ][admin_1410801622342][09:36:59,186]结果集获取sql=select PROVNO,ORG_ID,ORG_NAME,ORG_DESC,ORG_TYPE,ORG_LEVEL,ABOVEPROVNO,ABOVE_ORG_ID,ACCTPROVNO,ACCTORGNO,CCPROVNO,CCORGNO,OUTPROVNO,OUTPROXYORG,INPROVNO,INPROXYORG,PAYSYSBKID,CLEARBKID,INNERPROVNO,INNER_ORG_ID,LINKNM,TEL,EMAIL,ORG_ADRESS,BAK1,BAK2,BAK3,AUTHLOWAMT,AUTHABOVEAMT,CREATETS,UPDATETS from t_org_cnaps order by org_id rnorg.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select PROVNO,ORG_ID,ORG_NAME,ORG_DESC,ORG_TYPE,ORG_LEVEL,ABOVEPROVNO,ABOVE_ORG_ID,ACCTPROVNO,ACCTORGNO,CCPROVNO,CCORGNO,OUTPROVNO,OUTPROXYORG,INPROVNO,INPROXYORG,PAYSYSBKID,CLEARBKID,INNERPROVNO,INNER_ORG_ID,LINKNM,TEL,EMAIL,ORG_ADRESS,BAK1,BAK2,BAK3,AUTHLOWAMT,AUTHABOVEAMT,CREATETS,UPDATETS from t_org_cnaps order by org_id ]; SQL state [null]; error code [-99999]; null; nested exception is com.ibm.db2.jcc.b.SqlException rnat org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:121)rnat org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)rnat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382) rnat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:433) rnat com.hundsun.tamcx.database.JdbcDaoSupport.find(JdbcDaoSupport.java:185) rnat sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) rnat java.lang.reflect.Method.invoke(Method.java:611) rnat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301) rnat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rnat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rnat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) rnat $Proxy0.find(Unknown Source) rnat com.hundsun.tamcx.systemx.ext.util.dbUtil.ExtOrgDao.jgInit(ExtOrgDao.java:78) rnat com.hundsun.tamcx.systemx.ext.util.dbUtil.ExtOrgDao.(ExtOrgDao.java:44) rnat com.hundsun.tamcx.systemx.ext.util.dbUtil.ExtOrgDao.getInstance(ExtOrgDao.java:51) rnat com.hundsun.tamcx.systemx.ext.util.dict.TamcDict.tree(TamcDict.java:132) rnat com.hundsun.tamcx.systemx.ext.util.dict.TamcDict.exeAjax(TamcDict.java:496) rnat com.hundsun.tamcx.systemx.base.AjaxDictServlet.doPost(AjaxDictServlet.java:70) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:647) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:729) rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) rnat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) rnat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) rnat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873) rnat org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)rnat org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) rnat org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) rnat org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) rnat java.lang.Thread.run(Thread.java:736) rnCaused by: com.ibm.db2.jcc.b.SqlException rnat com.ibm.db2.jcc.b.s.a(s.java:1517) rnat com.ibm.db2.jcc.b.s.n(s.java:532) rnat com.ibm.db2.jcc.b.s.W(s.java:1436) rnat com.ibm.db2.jcc.b.kf.a(kf.java:1075) rnat com.ibm.db2.jcc.b.kf.getObject(kf.java:1062) rnat org.apache.commons.dbcp.DelegatingResultSet.getObject(DelegatingResultSet.java:286) rnat org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:137) rnat org.springframework.jdbc.core.ColumnMapRowMapper.getColumnValue(ColumnMapRowMapper.java:96) rnat com.hundsun.tamcx.database.util.CommonRowMapper.mapRow(CommonRowMapper.java:38) rnat org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)rnat org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:423) rnat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:371) rn... 34 more
Spring + Mybatis 结合报错
rt。我在搭建一个struts2+spring+mybatis+mysql的web环境。在搭建好之后,可以使用mybatis访问数据库,检索出数据。但当我使用spring与mybatis结合后,就报错了。rnrn[color=#FF0000]错误发生在我打开session的时候[/color]rn------------------------------------------------------------------------------rn public boolean checkUser(String userName, String password) rn [color=#FF0000]SqlSession sqlSession = sqlSessionFactory.openSession();[/color]rn rn try rn UserMapper mapper = sqlSession.getMapper(UserMapper.class);rn UserExample example = new UserExample();rnrn example.clear();rn example.or().andUsernameEqualTo(userName).andPasswordEqualTo(password);rn List lst = mapper.selectByExample(example);rnrn return !lst.isEmpty();rn finally rn sqlSession.close();rn rn rn------------------------------------------------------------------------------rnrn[color=#FF0000]错误信息如下。[/color]rn------------------------------------------------------------------------------rnorg.apache.ibatis.exceptions.PersistenceException: rn### Error opening session. Cause: java.lang.NullPointerExceptionrn### Cause: java.lang.NullPointerExceptionrn------------------------------------------------------------------------------rnrn[color=#FF0000]spring的配置文件(applicationContext.xml)[/color]rn------------------------------------------------------------------------------rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rnrnrn------------------------------------------------------------------------------rnrn[color=#FF0000]mybatis的配置文件(mybatis-config.xml)由于使用spring自动注入了,就不需要再配置mybatis了[/color]rn------------------------------------------------------------------------------rnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrn------------------------------------------------------------------------------rnrnrnrn
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件