-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: ...proxy.BasicLazyInitializer - CGLIB Enhancement failed
PostPosted: Fri May 19, 2006 7:44 am 
Newbie

Joined: Tue Jan 24, 2006 6:10 am
Posts: 2
I have a simple servlet which is throwing following exception on the server.
I have no idea why this is happening.
I have checked there is no private construtor/method in za.co.nationwide.model.MailingList.

Please can somebody pull me out.

Hibernate version: 3.1
MySQl v 5
Stack trace:
4748 ERROR [httpWorkerThread-8080-0] org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed:
za.co.nationwide.model.MailingList
java.lang.ExceptionInInitializerError
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:167)
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.<clinit>(Enhancer.java:69)
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:116)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154)
at za.co.nationwide.model.HibernateUtil.<clinit>(HibernateUtil.java:24)
at za.co.nationwide.model.TestHibernateServlet.doGet(TestHibernateServlet.java:34)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
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.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Class.getProtectionDomain(Class.java:2074)
at net.sf.cglib.core.ReflectUtils$1.run(ReflectUtils.java:42)
at java.security.AccessController.doPrivileged(Native Method)
at net.sf.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:40)
... 61 more
hbm file is as below
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="za.co.nationwide.model.MailingList" table="mailing_list" catalog="nw_web">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="increment" />
</id>
<property name="shopper_title" type="java.lang.String">
<column name="shopper_title" />
</property>
<property name="shopper_first_name" type="java.lang.String">
<column name="shopper_first_name" />
</property>
<property name="shopper_surname" type="java.lang.String">
<column name="shopper_surname" />
</property>
<property name="shopper_city" type="java.lang.String">
<column name="shopper_city" />
</property>
<property name="shopper_country" type="java.lang.String">
<column name="shopper_country" />
</property>
<property name="shopper_telephone" type="java.lang.String">
<column name="shopper_telephone" />
</property>
<property name="shopper_mobile" type="java.lang.String">
<column name="shopper_mobile" />
</property>
<property name="shopper_email" type="java.lang.String">
<column name="shopper_email" />
</property>
<property name="shopper_agree" type="java.lang.String">
<column name="shopper_agree" />
</property>
<property name="shopper_profile_active" type="java.lang.String">
<column name="shopper_profile_active" />
</property>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 9:42 am 
Newbie

Joined: Tue Jan 24, 2006 6:10 am
Posts: 2
I have noticed that the above problem has something to do with the AccessControl.

Has somebody experienced similar problem?
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
...


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 8:14 pm 
Newbie

Joined: Fri Apr 15, 2005 7:52 pm
Posts: 13
Your problem might be related to classpath settings. If you're running inside an IDE (e.g. Eclipse), make sure all the 3rd party jar files are in the project classpath. If not, try moving some of the jarfiles into the jre/lib/ext/ directory of your jdk and see whether this solves your problem. It looks like dependent classes are loaded through different classloaders and hence not found or violate privileged access constraints. Debug/Step into this code in ReflectUtils.java and see what classloaders are involved:

line 39:

static {
PROTECTION_DOMAIN = (ProtectionDomain)AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return ReflectUtils.class.getProtectionDomain();
}
});

You need to donwload and map the JDK sources for this, too. This is probably more of a Java ClassLoader issue than a hibernate issue.

_________________
Tired of spam? => http://www.spamino.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 3:16 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
http://cglib.sourceforge.net/howto.html
But I prefer to dissable SecurityManager and to delegate system resource protection for OS on servers, I think it is more secure and it is more performant. You need SecurityManager if you download and run untusted client code on server ( RMI stuff ).
See container documentation for more information.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.