org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [spring/applicationContext-database.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/applicationContext-database.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-database.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}"

Samebug tips2

Java does not handle IPv6 nameservers before 1.8.0_60. Upgrade to the latest JVM.


rprp

This is a bug in Wise, updating to v4.10 seems to solve the problem.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web3828

  • via GitHub by 0312birdzhang
    ,
  • Stack trace

    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [spring/applicationContext-database.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/applicationContext-database.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-database.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}" at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1418)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1159)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1121)[spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:682)[spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)[spring-context-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)[spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)[spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)[spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:771)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:411)[jetty-servlet-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:247)[jetty-servlet-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)[jetty-webapp-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)[jetty-webapp-8.1.7.v20120910.jar:8.1.7.v20120910] at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:293)[jetty-maven-plugin-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.server.Server.doStart(Server.java:277)[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910] at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)[jetty-maven-plugin-8.1.7.v20120910.jar:8.1.7.v20120910] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.7.v20120910.jar:8.1.7.v20120910] at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)[jetty-maven-plugin-8.1.7.v20120910.jar:8.1.7.v20120910] at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)[jetty-maven-plugin-8.1.7.v20120910.jar:8.1.7.v20120910] at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:516)[jetty-maven-plugin-8.1.7.v20120910.jar:8.1.7.v20120910] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)[maven-core-3.3.9.jar:3.3.9] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)[maven-embedder-3.3.9.jar:3.3.9] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)[maven-embedder-3.3.9.jar:3.3.9] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)[maven-embedder-3.3.9.jar:3.3.9] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_79] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_79] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_79] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_79] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)[plexus-classworlds-2.5.2.jar:na] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)[plexus-classworlds-2.5.2.jar:na] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)[plexus-classworlds-2.5.2.jar:na] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)[plexus-classworlds-2.5.2.jar:na] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/applicationContext-database.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-database.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}" at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1418)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1159)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] ... 58 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-database.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}" at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] ... 68 more Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}" at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:468)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:488)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1464)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1423)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1159)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] ... 74 more Caused by: java.lang.NumberFormatException: For input string: "${jdbc.maxPoolSize}" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)[na:1.7.0_79] at java.lang.Integer.parseInt(Integer.java:481)[na:1.7.0_79] at java.lang.Integer.valueOf(Integer.java:582)[na:1.7.0_79] at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:155)[spring-core-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:455)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:427)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE] ... 80 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    mauritiusmauritius
    2 times, last one
    Михайло ТітовМихайло Тітов
    4 times, last one
    magicanmagican
    Once,
    MattyMatty
    4 times, last one
    tvrmsmithtvrmsmith
    10 times, last one
    206 more bugmates