java 代码
- 15:20:54,093 ERROR ContextLoader:203 - Context initialization failed
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
- Caused by:
- java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
- at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
- at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
- at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
- at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
- at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
- at net.sf.cglib.proxy.Enhancer.
(Enhancer.java:69) - at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:107)
- at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
- at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
- at org.hibernate.tuple.entity.AbstractEntityTuplizer.
(AbstractEntityTuplizer.java:135) - at org.hibernate.tuple.entity.PojoEntityTuplizer.
(PojoEntityTuplizer.java:55) - at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.
(EntityEntityModeToTuplizerMapping.java:56) - at org.hibernate.tuple.entity.EntityMetamodel.
(EntityMetamodel.java:295) - at org.hibernate.persister.entity.AbstractEntityPersister.
(AbstractEntityPersister.java:434) - at org.hibernate.persister.entity.SingleTableEntityPersister.
(SingleTableEntityPersister.java:109) - at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
- at org.hibernate.impl.SessionFactoryImpl.
(SessionFactoryImpl.java:226) - at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
- at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
- at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
- at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
- at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
- at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
- at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
- at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:82)
- at javax.servlet.GenericServlet.init(GenericServlet.java:212)
- at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
- at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
- at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
- at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
- at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
- at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
- at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
- at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
- at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
- at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
- at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
- at org.apache.catalina.core.StandardService.start(StandardService.java:448)
- at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:585)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
- 15:20:54,109 ERROR [/esreport]:676 - StandardWrapper.Throwable
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
- Caused by:
- java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
- at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
- at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
- at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
- at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
- at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
- at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
- at net.sf.cglib.proxy.Enhancer.
(Enhancer.java:69) - ................................................................................(省略)
asm-2.2.3.jar
asm.jar
asm-attrs.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
然后怀疑是asm-2.2.3.jar与asm.jar可能有嫌疑,于是分别去掉他们,最后,去掉asm-2.2.3.jar成功启动.
呵呵,其实,这些微不足道的小错误需要一个细心的心来发现,我在google上找了半天也没有成型的结果 ,反而让我觉得这是一个很新的问题.其实,关键是自己要细心,不要太依赖网络带给你的答案.
通过多次的测试,在使用myeclise5.5.GA时,如果你选用spring1.2,hibernate3.2和JSF1.1时,一般会顺利的配置成功.如果项目不要求指定版本的框架时,请使用如上组合,能够快速的解决你很多意想不到的错误和版本冲突.