-->
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.  [ 7 posts ] 
Author Message
 Post subject: HSQL and Sun Java Application Server 8.1
PostPosted: Tue Aug 16, 2005 9:28 am 
Newbie

Joined: Tue Aug 16, 2005 9:21 am
Posts: 12
I'm developing a web application that will run on Sun Application Server.
This application uses Struts, hibernate and Jasperreports.
I needed to do some security configurations in the file SUN_APP_HOME/domains/domain1/config/server.policy to allow the JasperReports and Hibernate Query Criteria to run as follow.
Code:
// Hibernate and JasperReports Permissions
grant {
     permission java.util.PropertyPermission "*", "read";
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
     permission java.lang.RuntimePermission "getProtectionDomain";
     permission java.lang.RuntimePermission "createClassLoader";
     permission java.lang.RuntimePermission "getProtectionDomain";
};

Although, when I gonna use Hibernate hsql, the server is returnnig a security exception.
Is there anybody who knows what I need to do to allow hibernate hsql on Sun App server.

thnx
Rodrigo Souza
Valinhos - Brazil

Follow the Server Exception
Code:
java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
   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.SecurityManager.checkExit(SecurityManager.java:744)
   at com.sun.enterprise.J2EESecurityManager.checkExit(J2EESecurityManager.java:83)
   at java.lang.Runtime.exit(Runtime.java:88)
   at java.lang.System.exit(System.java:868)
   at antlr.CharScanner.panic(CharScanner.java:274)
   at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
   at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:25)
   at antlr.CharScanner.<init>(CharScanner.java:51)
   at antlr.CharScanner.<init>(CharScanner.java:60)
   at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:55)
   at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:52)
   at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:46)
   at org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:20)
   at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:41)
   at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:203)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
   at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
   at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
   at br.com.sensorsistemas.nutron.dao.XmlDAO.comboData(XmlDAO.java:22)
   at br.com.sensorsistemas.nutron.bo.ComboBO.comboData(ComboBO.java:15)
   at br.com.sensorsistemas.nutron.action.ComboAction.doAction(ComboAction.java:62)
   at br.com.sensorsistemas.nutron.action.BaseAction.execute(BaseAction.java:102)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
   at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
   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 br.com.sensorsistemas.nutron.web.LoginFilter.doFilter(LoginFilter.java:49)
   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:161)
   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:185)
   at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
   at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
   at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
   at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 11:46 am 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
Your query has a syntax error in it, but released versions of Hibernate have a bug where the syntax error handling code calls System.exit() instead of propagating the exception. Fixing the syntax error should prevent that from happening, or if you don't know what the error is, you could try HB 3.1 from CVS which will tell you instead of trying to terminate the VM.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 4:33 pm 
Newbie

Joined: Tue Aug 16, 2005 9:21 am
Posts: 12
Nebob wrote:
...query has a syntax error...

Thnx for reply Nebob.
It's not possible... I mean, ok... could be possible ... :-) ... , 'cuz when make the deploy on Tomcat or JBoss there is no exception, and the hql querys work right!! And if I take off the grants from the configuration file, even the Criteria Queries don't work.

But, I gonna try hibernate 3.1.

Which part of exception have u seen the sintax error?

thnx
Rodrigo G. Tavares de Souza
Valinhos - Brazil


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 10:54 am 
Newbie

Joined: Tue Aug 16, 2005 9:21 am
Posts: 12
somebody know what could be?
thnx!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 12:31 pm 
Regular
Regular

Joined: Thu Dec 02, 2004 7:11 am
Posts: 85
It is not syntax error - it is classloader issue. Hibernate configures ANTLR with names of Hibernate-specific classes, but ANTLR can't load these classes. So, to working properly, Hibernate and ANTLR library should reside in same classloader.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 8:45 am 
Newbie

Joined: Tue Aug 16, 2005 9:21 am
Posts: 12
I tried to run the application with the hibernate cvs version and I'm getting the same security exception.
Nobody here needed to run hql on Sun Application Server?

Thnx
Rodrigo


Top
 Profile  
 
 Post subject: I found the error
PostPosted: Thu Aug 25, 2005 5:12 pm 
Newbie

Joined: Thu Aug 25, 2005 4:59 pm
Posts: 1
Hi, I`m working with Java SUN system ( SUN ONE V7 and 8), and I had the same problem, so, in the server.policy file is missing one permission:


permission java.lang.RuntimePermission "getProtectionDomain";

with this, and the modifications made according with

http://www.hibernate.org/294.html

all work fine !!!

good lock.

_________________
Jorge Rodríguez
México D.F.
Software developer J2EE


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