程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> exception-org.springframework.beans.TypeMismatchException

exception-org.springframework.beans.TypeMismatchException

編輯:編程綜合問答
org.springframework.beans.TypeMismatchException

eclipse啟動沒問題,打成war包,放在tomcat中直接啟動就報這個錯。

嚴重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activityDao' defined in file [F:\work\apache-tomcat-7.0.52\webapps\luckeys\WEB-INF\classes\com\luckeys\dao\ActivityDao.class]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'mapperInterface'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.luckeys.dao.ActivityDao]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'mapperInterface'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.luckeys.dao.ActivityDao]: problem with class file or dependent class.
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 25 more
Caused by: java.lang.IllegalArgumentException: Error loading class [com.luckeys.dao.ActivityDao]: problem with class file or dependent class.
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:286)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
... 31 more
Caused by: java.lang.UnsupportedClassVersionError: com/luckeys/dao/ActivityDao : Unsupported major.minor version 51.0 (unable to load class com.luckeys.dao.ActivityDao)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2948)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:247)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:280)
... 36 more
2015-10-24 9:59:32 org.apache.catalina.core.StandardContext startInternal
嚴重: Error listenerStart
2015-10-24 9:59:32 org.apache.catalina.core.StandardContext startInternal
嚴重: Context [/luckeys] startup failed due to previous errors
2015-10-24 9:59:32 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/luckeys] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
2015-10-24 9:59:32 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/luckeys] appears to have started a thread named [Atomikos:0] but has failed to stop it. This is very likely to create a memory leak.

最佳回答:



用SSH做web開發的經常遇到以下問題:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.kgjia.admin.service.impl.ShopTypeServiceImpl$$EnhancerByCGLIB$$6af677d9] to required type [com.kgjia.admin.service.IShopTypeServi......
答案就在這裡:org.springframework.beans.TypeMismatchException:
----------------------Hi,地球人,我是問答機器人小S,上面的內容就是我狂拽酷炫叼炸天的答案,除了贊同,你還有別的選擇嗎?

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved