spring springmvc mybatis 加入shiro后报错

问题描述

spring springmvc mybatis 加入shiro后报错

2016-3-23 15:14:53 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "type".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
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:610)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "type".
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:434)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
... 27 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "type".
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:109)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:92)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:428)
... 30 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "type".
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:256)
at org.apache.ibatis.parsing.XPathParser.(XPathParser.java:125)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.(XMLMapperBuilder.java:78)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:321)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:107)
... 32 more
Caused by: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "type".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:254)
... 36 more

解决方案

明显映射文件中的sql写错了

解决方案二:

你看下你配置文件格式,是不是属性值没加引号,或者引号不是中文的

时间: 2024-11-30 06:11:45

spring springmvc mybatis 加入shiro后报错的相关文章

spring springmvc mybatis整合时,tomcat启动正常,查询数据库时报错

问题描述 spring springmvc mybatis整合时,tomcat启动正常,查询数据库时报错 Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YE

spring+springmvc+mybatis 报错。求大神指教。

问题描述 spring+springmvc+mybatis 报错.求大神指教. 严重: StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'index': Injection of autowired dependencies failed; nested exception is org.springframework.b

IDEA开发JavaWeb(SpringMVC+MyBatis)项目报错。

问题描述 IDEA开发JavaWeb(SpringMVC+MyBatis)项目报错. 刚开始JavaWeb的开发,用了SpringMVC+Mybatis的结构,按着教程来的,但是运行欢迎页能看到,但是报了Injection of resource dependencies failed.错误,Dao没找到.这是工程的结构.这是applicationContext.xml的配置. <?xml version=""1.0"" encoding="&quo

java-求解为何一直404,底层用的spring+springmvc+mybatis

问题描述 求解为何一直404,底层用的spring+springmvc+mybatis 解决方案 你的url最后有.do ,那么你的web.xml中dispatcherServlet中是拦截.do 的请求吗 解决方案二: 你看一下配置了拦截.do的吗 再看一下你的页面地址是否跟控制器里面的地址是一致的 都正确 软件关了重新启动 解决方案三: 你的jsp页面中action指定的URL怎么是.do呢. 应该把这个去掉. 解决方案四: 看一下dispatcher.xml中有没有对应的执行类,ctrl+

spring+springMVC+mybatis的框架项目基础环境搭建

上一个项目在后台用到spring+springMVC+mybatis的框架,先新项目初步需求也已经下来,不出意外的话,应该也是用这个框架组合. 虽然在之前activiti相关的学习中所用到的框架也是这个,但是当时重点在于实现activiti的功能,因此在环境搭建上也只是以能用为前提,与真实项目中所用的还是差了不少. 因此为了给接下来的项目做准备,今天便抽空练习了一下这个框架组合的搭建.虽然之前的框架都不是我来搭,接下来这个可能也不是让我搭,但记录下来说不定以后能用上,也或者对其他人有用. 那么进

用Spring SpringMVC MyBatis 实现用户注册登录并保存验证。 求代码 谢大神

问题描述 用Spring SpringMVC MyBatis 实现用户注册登录并保存验证. 求代码 谢大神 注册,将新用户输入的信息提交并进行验证,验证可采用验证框架也可采用validate,验证失败返回注册页面显示错误信息,验证成功后保存用户数据. 登陆,验证,失败后返回登陆页面显示错误信息,验证成功后保存用户信息至session. 登陆成功后,将所有用户数据展示给用户,列出用户详细信息,并分页.用拦截器判断,如果没有登陆的话返回登陆页面并提示用户没有登陆 1.Ioc注入全部采用Spring注

java web-学习springmvc运行tomcat启动后报错

问题描述 学习springmvc运行tomcat启动后报错 初学springmvc 自己练习一下最简单的实力 但是报错 下面是错误代码 type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servle

spring +springmvc+mybatis,service中调用dao接口报空

问题描述 spring +springmvc+mybatis,service中调用dao接口报空 搭建ssm,启动项目没问题,但是在service实现类中调用dao接口时,对象loginDao对象是空的,错误信息如下 log4j:ERROR Error occured while converting date. java.lang.NullPointerException at java.lang.System.arraycopy(Native Method) at java.lang.Abs

spring+springmvc+mybatis+jsp员工考勤管理系统

问题描述 spring+springmvc+mybatis+jsp员工考勤管理系统 需要完整源码?说有类似的????? 解决方案 兄弟 现成的估计没有 这不给你免费开发吗 新手,可以从网上找一个 spring + ibatis + jsp的例子,或者 springMVC + jsp 那这个项目练练手,对自己成长有好处 如果你是个毕业生,着急毕业,花点银子算了