0

I am currently developing the website for company and using spring and hibernate. The website is near finish. However, when i deployed it in web hosting, it give me the error:

16:51:39,518 WARN PoolConfig:105 - Read of system Properties blocked -- ignoring any c3p0 configuration via System properties! (But any configuration via a c3p0.properties file is still okay!) java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252) at java.lang.System.getProperties(System.java:580) at com.mchange.v2.c3p0.PoolConfig.(PoolConfig.java:101) at com.mchange.v2.c3p0.impl.C3P0ImplUtils.defaultConnectionTester(C3P0ImplUtils.java:283) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.(WrapperConnectionPoolDataSource.java:47) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.(WrapperConnectionPoolDataSource.java:67) at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:113) at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:104) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:83) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:872) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:404) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at com.caucho.server.http.Application.init(Application.java:1845) at com.caucho.server.http.VirtualHost.startApplication(VirtualHost.java:1207) at com.caucho.server.http.VirtualHost.getInvocation(VirtualHost.java:1007) at com.caucho.server.http.ServletServer.getInvocation(ServletServer.java:1249) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:343) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:619) 16:51:41,690 INFO Version:37 - Hibernate Commons Annotations 3.2.0.Final

16:51:45,639 ERROR BasicLazyInitializer:165 - Javassist Enhancement failed: com.xxx.entity.xxx java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.Class.getProtectionDomain(Class.java:2106) at javassist.util.proxy.ProxyFactory.getDomain(ProxyFactory.java:619) at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:501) at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:486) at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:422) at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:394) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:162) at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:65) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:185) at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:167) at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:77) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:80) at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:322) at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:485) at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:133) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:286) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:753) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:691) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1346) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1315) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:398) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at com.caucho.server.http.Application.init(Application.java:1845) at com.caucho.server.http.VirtualHost.startApplication(VirtualHost.java:1207) at com.caucho.server.http.VirtualHost.getInvocation(VirtualHost.java:1007) at com.caucho.server.http.ServletServer.getInvocation(ServletServer.java:1249) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:343) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:619) 16:51:45,664 WARN PojoEntityTuplizer:197 - could not create proxy factory for:com.xxx.entity.xxx org.hibernate.HibernateException: Javassist Enhancement failed: com.hitv.entity.ProductMap at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:169) at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:65) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:185) at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:167) at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:77) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:80) at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:322) at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:485) at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:133) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:286) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:753) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:691) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1346) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1315) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:398) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at com.caucho.server.http.Application.init(Application.java:1845) at com.caucho.server.http.VirtualHost.startApplication(VirtualHost.java:1207) at com.caucho.server.http.VirtualHost.getInvocation(VirtualHost.java:1007) at com.caucho.server.http.ServletServer.getInvocation(ServletServer.java:1249) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:343) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:619) Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.Class.getProtectionDomain(Class.java:2106) at javassist.util.proxy.ProxyFactory.getDomain(ProxyFactory.java:619) at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:501) at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:486) at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:422) at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:394) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:162) ... 41 more

I have search on the internet for a long time. It seem that it is the server security policy issue. Do i have any method to change the code of framework to bypass the security restrict? Which file i need to modify according to the log?

Thank you in advance!

Fan Wu
  • 237
  • 1
  • 4
  • 11

1 Answers1

0

Ah lovely, the whole stacktrace....

Could do with some more detail. What OS are you running? Which server are you deploying to? What have you tried so far? Does it work locally? What do you mean by web hosting? Do you have full access to the server?

In the end I believe there are is a conflict between the deployment servers security policy and what you are trying to do.

E.g. if it is tomcat check the policy.d configuration folder.

flurdy
  • 3,782
  • 29
  • 31
  • The old company website is running in remote web hosting JSP sever. It use the resin 2.17. It is just a cpanel hosting so i cannot configure the security policy. this website running perfect locally, and my resin didn't enable the security policy. So i believe the security policy cause this problem. I have call the technical support, but i don't think they will willing to change the security policy. That is why i am seeking for an alternate solution. – Fan Wu Mar 07 '12 at 00:52