-->
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.  [ 5 posts ] 
Author Message
 Post subject: Deployment Problem on Sun Java System Application Server
PostPosted: Sat Feb 05, 2005 10:00 am 
Newbie

Joined: Fri Feb 04, 2005 11:34 am
Posts: 16
Hi all,

I have a code using hibernate that is working successfully as a standalone application. When I put that into a web application, and put the test code into a jsp or servlet (the same code in the standalone application), I get exception below.

I have tried to initialize SessionFactory in a static block and in a non-static method of a singleton object. No difference. Let me say it again, it is working successfully as a standalone application, and the code using hibernate is very loosely coupled to web application.

All required jars are in the WEB-INF/lib folder, and the configuration files are in the WEB-INF/classes folder.

Platform: Sun Java System Application Server 8.1 PE on Linux, MySQL 4.1.7, Hibernate 2.1.8.

Any help/idea is really welcomed..

Mete

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:215)
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.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:237)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:796)


Top
 Profile  
 
 Post subject: Deployment Problem on Sun Java System Application Server
PostPosted: Sat Feb 05, 2005 1:18 pm 
Newbie

Joined: Mon Jan 17, 2005 11:34 am
Posts: 11
Location: Bratislava, Slovakia
Hi,

this is a problem with your application sever security grants. You must add following grants to your appserver domain policy file: ${com.sun.aas.instanceRoot}/config/server.policy (i.e. /opt/SUNWappserver/domains/domain1/config/server.policy)

Code:
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.lang.reflect.ReflectPermission "suppressAccessChecks";


Part of my security.policy file:
Code:
...
// Basic set of required permissions granted to all remaining code
grant {
   permission java.lang.RuntimePermission  "loadLibrary.*";
   permission java.lang.RuntimePermission  "queuePrintJob";
   permission java.net.SocketPermission    "*", "connect";
   permission java.io.FilePermission       "<<ALL FILES>>", "read,write";

        // work-around for pointbase bug 4864405     
        permission java.io.FilePermission "${com.sun.aas.instanceRoot}${/}lib${/}databases${/}-", "delete";
        permission java.io.FilePermission "${java.io.tmpdir}${/}-", "delete";

   permission java.util.PropertyPermission "*", "read";

   permission java.lang.RuntimePermission   "modifyThreadGroup";

   // Permission for cglib part of Hibernate framework
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};
...


bg, Radovan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 07, 2005 4:40 am 
Newbie

Joined: Fri Feb 04, 2005 11:34 am
Posts: 16
Thank you so much sninsky. It is working smoothly. I dont think I could find it easily. How did you find this ? Is it written anywere ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 12:51 pm 
Beginner
Beginner

Joined: Tue Feb 01, 2005 8:38 am
Posts: 38
Cheers sninsky! That has solved a nightmare of a problem for me - how the hell are you supposed to know to do that in the first place though?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 28, 2005 11:50 am 
Newbie

Joined: Mon Apr 11, 2005 4:55 am
Posts: 16
I encounter the same problem with JOnAS 4.3. Do you know how configure Hibernate or Jonas to work together ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.