java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy
spring1 + struts1 + hibernate2
我就用這兩句話來測試是否db連線成功.
ApplicationContext ctx = new FileSystemXmlApplicationContext("D:/eclipse/workspace/TestWeb/WebContent/WEB-INF/applicationContext.xml");
SessionFactory sf = (SessionFactory)ctx.getBean("sessionFactory");
出來這個錯誤, java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy不知道什麼原因??
?
log4j:WARN No appenders could be found for logger (org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\eclipse\workspace\TestWeb\WebContent\WEB-INF\applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy
java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.beans.Introspector$1.run(Introspector.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:137)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:79)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:226)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:208)
at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:217)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:177)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:60)
at com.test1.TestMain.main(TestMain.java:24)
我就用這兩句話來測試是否db連線成功.
ApplicationContext ctx = new FileSystemXmlApplicationContext("D:/eclipse/workspace/TestWeb/WebContent/WEB-INF/applicationContext.xml");
SessionFactory sf = (SessionFactory)ctx.getBean("sessionFactory");
出來這個錯誤, java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy不知道什麼原因??
?
log4j:WARN No appenders could be found for logger (org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\eclipse\workspace\TestWeb\WebContent\WEB-INF\applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy
java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/NamingStrategy
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.beans.Introspector$1.run(Introspector.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:137)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:79)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:226)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:208)
at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:217)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:177)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:60)
at com.test1.TestMain.main(TestMain.java:24)
相關文章
- .NET程式配置檔案操作(ini,cfg,config)
- 如何獲得Session物件及在Hibernate.cfg.xml檔案中的配置Session物件XML
- 歡迎大家訪問http://www.sf.net/projects/luntbuild/HTTPProjectUI
- oracle has a disk HB, but no network HB, DHB has r cfg , wrtcntOracle
- XJ/SF flotation machineMac
- SF精靈 for ChromeChrome
- SF58-ASEMI介面卡二極體SF58
- 問一下可不可以在hibernate.cfg.xml配置連線池XML
- Java.Lang.NoclassdeffounderrorJavaError
- Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.HTTPPlugin
- SF506DS-ASEMI開關電源二極體SF506DS
- net.sf.json.JSONException: 'object' is an array. Use JSONArray insteadJSONExceptionObject
- 【Azure 微服務】Service Fabric, 使用ARM Template方式來更新SF叢集的證書(Renew SF Certificate)微服務
- java.lang.NoClassDefFoundError: weblogic/WLSTJavaErrorWeb
- tomcat部署出現異常如下[main] WARN : net.sf.ehcache.config.ConfiguratorTomcatAI
- python解析ini、conf、cfg檔案Python
- Exception in thread "main" java.lang.NoClassDefFoundErrorExceptionthreadAIJavaError
- Caused by: java.lang.NoClassDefFoundError: javax/persistence/EntityListenersJavaError
- Android中java.lang.NoClassDefFoundError (2)AndroidJavaError
- issue: java.lang.NoClassDefFoundError: javax/el/ELManagerJavaError
- Json和Map互轉,三個包(org.json/net.sf.json/com.google.gson)JSONGo
- android 混淆檔案proguard.cfg詳解Android
- Caused by: java.lang.NoClassDefFoundError: javax/servlet/GenericFilterJavaErrorServletFilter
- springboot報錯java.lang.NoClassDefFoundErrorSpring BootJavaError
- java.lang.NoClassDefFoundError:javax/servlet/ServletContextJavaErrorServletContext
- java.lang.NoClassDefFoundError: org/json/JSONObjectJavaErrorJSONObject
- DBCA啟動報錯Java.Lang.NoclassdeffounderrorJavaError
- nagios-監控端的localhost.cfg配置iOSlocalhost
- proguard.cfg 系統找不到指定的檔案
- SF伺服器多少錢?影響因素有哪些?-VeCloud伺服器Cloud
- java.lang.NoClassDefFoundError: android/os/PersistableBundleJavaErrorAndroid
- java.lang.NoClassDefFoundError:com/google/common/base/MoreobjectsJavaErrorGoObject
- 遭遇java.lang.NoClassDefFoundError:org/apache/tomcat/PeriodicEventListenerJavaErrorApacheTomcat
- java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactoryJavaErrorApacheBATSessionSQL
- android除錯出現 java.lang.NoClassDefFoundError:Android除錯JavaError
- Hibernate SQL方言 (hibernate.dialect)SQL
- Hibernate學習:初識hibernate
- fedora 28 重新生成 /boot/grub2/grub.cfgboot