GAE上的Hibernate 5.1:无法检测javassist.util.proxy.ProxyFactory

时间:2016-06-15 10:03:23

标签: spring hibernate google-app-engine

当我尝试在本地GAE上运行代码时,我会收到如下所示的异常。这是在我从4.3.11.Final迁移到Hibernate 5.1.0.Final之后发生的。如何避免它们?

cze 15, 2016 8:54:36 AM com.google.appengine.tools.development.agent.impl.Transformer transform
[INFO] SEVERE: Unable to instrument javassist.util.proxy.ProxyFactory$ProxyDetails. Security restrictions may not be entirely emulated.
[INFO] java.lang.RuntimeException
[INFO]  at com.google.appengine.repackaged.org.objectweb.asm.MethodVisitor.visitParameter(MethodVisitor.java:115)
[INFO]  at com.google.appengine.repackaged.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:959)
[INFO]  at com.google.appengine.repackaged.org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
[INFO]  at com.google.appengine.repackaged.org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
[INFO]  at com.google.appengine.tools.development.agent.impl.Transformer.rewrite(Transformer.java:146)
[INFO]  at com.google.appengine.tools.development.agent.impl.Transformer.transform(Transformer.java:113)
[INFO]  at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
[INFO]  at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
[INFO]  at java.lang.ClassLoader.defineClass1(Native Method)
[INFO]  at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
[INFO]  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[INFO]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[INFO]  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[INFO]  at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:199)
[INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[INFO]  at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:493)
[INFO]  at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:428)
[INFO]  at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:400)
[INFO]  at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:72)
[INFO]  at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:164)
[INFO]  at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:157)
[INFO]  at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:60)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:142)
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:150)
[INFO]  at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88)
[INFO]  at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116)
[INFO]  at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:385)
[INFO]  at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:509)
[INFO]  at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:124)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:142)
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:150)
[INFO]  at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)
[INFO]  at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
[INFO]  at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:344)
[INFO]  at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465)
[INFO]  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881)
[INFO]  at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
[INFO]  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
[INFO]  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:319)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1627)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1624)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
[INFO]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
[INFO]  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
[INFO]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
[INFO]  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
[INFO]  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:829)
[INFO]  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
[INFO]  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
[INFO]  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
[INFO]  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
[INFO]  at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[INFO]  at org.mortbay.jetty.Server.doStart(Server.java:224)
[INFO]  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[INFO]  at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:271)
[INFO]  at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)
[INFO]  at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
[INFO]  at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)
[INFO]  at com.google.appengine.tools.development.Modules.startup(Modules.java:105)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:258)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:213)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:211)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)
[INFO]  at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:225)
[INFO]  at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:216)

1 个答案:

答案 0 :(得分:1)

这可能与从Hibernate 4迁移到5.1时发生的Javassist更新有关。看起来在GAE上运行任何比3.18.2-GA更新的javassist版本存在问题,它仍然只支持Java 7。

见相关文章:

Google App Engine and Java org.reflection library - Error during the scan procedure