我正在尝试在net beans 6.5中使用Hibernate开发Restful Service
我还添加了asm3.1.jar
但是我仍然有例外:
javax.servlet.ServletException: com.sun.jersey.api.container.ContainerException: java.lang.ExceptionInInitializerError
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:346)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
root cause
com.sun.jersey.api.container.ContainerException: java.lang.ExceptionInInitializerError
com.sun.jersey.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:99)
com.sun.jersey.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:123)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:722)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
root cause
java.lang.ExceptionInInitializerError
se.xyz.util.HibernateUtil.<clinit>(HibernateUtil.java:28)
se.xyz.main.CompaniesResource.getAllEmployees(CompaniesResource.java:368)
se.xyz.main.CompaniesResource.getXml_getAllEmployees(CompaniesResource.java:129)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:136)
com.sun.jersey.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:85)
com.sun.jersey.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:123)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:722)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
root cause
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
se.xyz.util.HibernateUtil.<clinit>(HibernateUtil.java:24)
se.xyz.main.CompaniesResource.getAllEmployees(CompaniesResource.java:368)
se.xyz.main.CompaniesResource.getXml_getAllEmployees(CompaniesResource.java:129)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:136)
com.sun.jersey.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:85)
com.sun.jersey.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:123)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:722)
com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)