启动springboot项目报错

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/FXMDLF/article/details/83830661
2018-11-07 19:51:11.775[INFO ][background-preinit][o.h.v.i.util.Version:30] HV000001: Hibernate Validator 5.2.4.Final

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.2.RELEASE)

2018-11-07 19:51:13.459[INFO ][main][c.t.s.WsfySqsxApplication:661] No active profile set, falling back to default profiles: default
2018-11-07 19:51:24.590[INFO ][main][o.a.c.c.StandardService:179] Starting service Tomcat
2018-11-07 19:51:24.592[INFO ][main][o.a.c.c.StandardEngine:179] Starting Servlet Engine: Apache Tomcat/8.5.6
2018-11-07 19:51:24.982[INFO ][localhost-startStop-1][o.a.c.c.C.[.[.[/]:179] Initializing Spring embedded WebApplicationContext
2018-11-07 19:51:30.679[INFO ][main][c.m.v2.log.MLog:80] MLog clients using log4j logging.
2018-11-07 19:51:30.775[INFO ][main][c.m.v.c.C3P0Registry:204] Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
2018-11-07 19:51:54.928[INFO ][main][o.a.c.c.StandardService:179] Stopping service Tomcat
2018-11-07 19:51:55.024[ERROR][main][o.s.b.SpringApplication:839] Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration': Invocation of init method failed; nested exception is tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:137)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
	at com.thunisoft.sqsx.WsfySqsxApplication.main(WsfySqsxApplication.java:17)
Caused by: tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource(MapperHelper.java:314)
	at tk.mybatis.mapper.mapperhelper.MapperHelper.processConfiguration(MapperHelper.java:253)
	at tk.mybatis.mapper.mapperhelper.MapperHelper.processConfiguration(MapperHelper.java:232)
	at tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration.addPageInterceptor(MapperAutoConfiguration.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134)
	... 18 common frames omitted
Caused by: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at tk.mybatis.mapper.mapperhelper.MapperTemplate.setSqlSource(MapperTemplate.java:280)
	at tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource(MapperHelper.java:311)
	... 28 common frames omitted
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:935)
	at java.lang.StringBuilder.substring(StringBuilder.java:76)
	at tk.mybatis.mapper.mapperhelper.SqlHelper.getAllColumns(SqlHelper.java:247)
	at tk.mybatis.mapper.mapperhelper.SqlHelper.selectAllColumns(SqlHelper.java:259)
	at tk.mybatis.mapper.provider.base.BaseSelectProvider.selectOne(BaseSelectProvider.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at tk.mybatis.mapper.mapperhelper.MapperTemplate.setSqlSource(MapperTemplate.java:270)
	... 29 common frames omitted
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [util.c:840]

extends一个父类时   父类中加的泛型是object  应该加为对应的实体类型  没有的话应该创建

在mapper.xml中  添加对应的返回resultMap 字段由框架自动构建在了实体定义中

一般  微服务中引用的实体文件  应该在微服务中创建   引用别的微服务的实体  会出现类型不匹配 或者找不到类等错误

展开阅读全文

tomcat启动maven项目报错

01-09

将eclise上的项目重写了一份一模一样的在IDEA上,eclise启动成功,IDEA就报错了,纠结 rn[code=java]rn09-Jan-2017 16:54:06.200 信息 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpathrn09-Jan-2017 16:54:06.405 信息 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContextrn09-Jan-2017 16:54:13.284 严重 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class com.evanosc.common.listener.WebContextListenerrn org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in file [D:\Java\IdeaProjects\evanosc\target\evanosc\WEB-INF\classes\spring\spring-context-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in file [D:\Java\IdeaProjects\evanosc\target\evanosc\WEB-INF\classes\spring\spring-context-shiro.xml]: Cannot resolve reference to bean 'shiroDbRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shiroDbRealm': Unsatisfied dependency expressed through field 'systemUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'systemUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'systemUserMapper' defined in file [D:\Java\IdeaProjects\evanosc\target\evanosc\WEB-INF\classes\com\evanosc\dao\SystemUserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\Java\IdeaProjects\evanosc\target\evanosc\WEB-INF\classes\spring\spring-context-mybatis.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.logging.LogException: Error setting Log implementation. Cause: java.lang.reflect.InvocationTargetExceptionrn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1231)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)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:202)rn at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:240)rn at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:697)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:526)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)rn at com.evanosc.common.listener.WebContextListener.initWebApplicationContext(WebContextListener.java:23)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)rn at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1702)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)rn at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)rn at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)rn at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)rn at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)rn at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)rn at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)rn at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)rn at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)rn at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)rn at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)rn at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)rn at sun.rmi.transport.Transport$1.run(Transport.java:200)rn at sun.rmi.transport.Transport$1.run(Transport.java:197)rn at java.security.AccessController.doPrivileged(Native Method)rn at sun.rmi.transport.Transport.serviceCall(Transport.java:196)rn at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)rn at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)rn at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)rn at java.security.AccessController.doPrivileged(Native Method)rn at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in file [D:\Java\IdeaProjects\evanosc\target\evanosc\WEB-INF\classes\spring\spring-context-shiro.xml]: Cannot resolve reference to bean 'shiroDbRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factorrn[/code]rnrn 论坛

没有更多推荐了,返回首页