-->
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.  [ 3 posts ] 
Author Message
 Post subject: Assistence for mapping.hbm.xml with security manager Mode ON
PostPosted: Tue Aug 30, 2011 9:37 pm 
Newbie

Joined: Tue Aug 30, 2011 9:16 pm
Posts: 2
Hey guys,

I've a problem to running a java application with Hibernate.

It's a client/server application with include RMI tecnology to do comunicate the client with the server.

I've need use Security Manager because i transfer one object serializable from server to client.(object serializable = instance of a class that maps to a table)

If I don't trasfer one object Serializable but for example I invoke a method that return a boolean, string, int, array, etc, i don't have any problem.

If I don't have any problem if not use Security Manager, but i could not invoke a object Serializable. I need to invoke a object Serializable absolutely.

Post my Exception below:
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
   at Hibernate.HibernateUtil.initHibernateUtil(HibernateUtil.java:18)
   at Hibernate.HibernateUtil.<init>(HibernateUtil.java:9)
   at SorgentiServer.Function.checkUser(Function.java:120)
   at SorgentiServer.Main.main(Main.java:69)
Caused by: org.hibernate.MappingNotFoundException: resource: Mapping/Film.hbm.xml not found
   at org.hibernate.cfg.Configuration.addResource(Configuration.java:799)
   at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2344)
   at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2310)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2290)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2243)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:2216)
   at Hibernate.HibernateUtil.initHibernateUtil(HibernateUtil.java:15)
   ... 3 more


Post my Mapping/Film.hbm.xml below:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="Mapping.Film" table="FILM" schema="SYSTEM">
        <id name="titolo" type="string">
            <column name="TITOLO" length="40" />
            <generator class="assigned" />
        </id>
        <property name="id" type="long">
            <column name="ID" precision="15" scale="0" not-null="true" unique="true" />
        </property>
        <property name="anno" type="date">
            <column name="ANNO" length="7" not-null="true" />
        </property>
        <property name="regista" type="string">
            <column name="REGISTA" length="40" not-null="true" />
        </property>
        <property name="attori" type="string">
            <column name="ATTORI" length="40" not-null="true" />
        </property>
        <property name="genere" type="string">
            <column name="GENERE" length="40" not-null="true" />
        </property>
        <set name="filmVistis" inverse="true">
            <key>
                <column name="ID_TITOLO" length="40" not-null="true" />
            </key>
            <one-to-many class="Mapping.FilmVisti" />
        </set>
    </class>
</hibernate-mapping>


Post my Film.java below:
Code:
package Mapping;
// Generated 30-ago-2011 3.29.32 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
* Film generated by hbm2java
*/
public class Film  implements java.io.Serializable {


     private String titolo;
     private long id;
     private Date anno;
     private String regista;
     private String attori;
     private String genere;
     private Set filmVistis = new HashSet(0);

    public Film() {
    }

   
    public Film(String titolo, long id, Date anno, String regista, String attori, String genere) {
        this.titolo = titolo;
        this.id = id;
        this.anno = anno;
        this.regista = regista;
        this.attori = attori;
        this.genere = genere;
    }
    public Film(String titolo, long id, Date anno, String regista, String attori, String genere, Set filmVistis) {
       this.titolo = titolo;
       this.id = id;
       this.anno = anno;
       this.regista = regista;
       this.attori = attori;
       this.genere = genere;
       this.filmVistis = filmVistis;
    }
   
    public String getTitolo() {
        return this.titolo;
    }
   
    public void setTitolo(String titolo) {
        this.titolo = titolo;
    }
    public long getId() {
        return this.id;
    }
   
    public void setId(long id) {
        this.id = id;
    }
    public Date getAnno() {
        return this.anno;
    }
   
    public void setAnno(Date anno) {
        this.anno = anno;
    }
    public String getRegista() {
        return this.regista;
    }
   
    public void setRegista(String regista) {
        this.regista = regista;
    }
    public String getAttori() {
        return this.attori;
    }
   
    public void setAttori(String attori) {
        this.attori = attori;
    }
    public String getGenere() {
        return this.genere;
    }
   
    public void setGenere(String genere) {
        this.genere = genere;
    }
    public Set getFilmVistis() {
        return this.filmVistis;
    }
   
    public void setFilmVistis(Set filmVistis) {
        this.filmVistis = filmVistis;
    }




}


Post my hibernate.cfg.xml below:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>
    <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
    <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:tesiMb</property>
    <property name="hibernate.connection.username">system</property>
    <property name="hibernate.connection.password">query90</property>
    <property name="current_session_context_class">thread</property>
    <property name="show_sql">true</property>
    <mapping resource="Mapping/Film.hbm.xml"/>
    <mapping resource="Mapping/FilmVisti.hbm.xml"/>
    <mapping resource="Mapping/Utenti.hbm.xml"/>
  </session-factory>
</hibernate-configuration>


Post my security.policy below:
Code:
grant {
    permission java.security.AllPermissions;
    permission java.net.SocketPermission "*", "connect, resolve";
    permission java.net.SocketPermission "*", "accept";
    permission java.util.PropertyPermission "hibernate.enable_specj_proprietary_syntax", "read";
    permission java.util.PropertyPermission "org.apache.commons.logging.LogFactory.HashtableImpl", "read";
    permission java.io.FilePermission "src/hibernate.cfg.xml", "read,write";   
};


Post my calling to security manager below:
Code:
String manager = "src/SorgentiServer/security.policy";
System.setProperty("java.security.policy", manager);
System.setSecurityManager(new RMISecurityManager());


Help me guys, it's very important for me.


Top
 Profile  
 
 Post subject: Re: Assistence for mapping.hbm.xml with security manager Mode ON
PostPosted: Mon Sep 05, 2011 4:17 pm 
Newbie

Joined: Tue Aug 30, 2011 9:16 pm
Posts: 2
Up, help


Top
 Profile  
 
 Post subject: Re: Assistence for mapping.hbm.xml with security manager Mode ON
PostPosted: Wed Oct 05, 2011 2:56 pm 
Newbie

Joined: Wed Oct 05, 2011 2:54 pm
Posts: 1
I have the exact same error on accesing DB Postgres, mapping with hibernate annotations. Anyone?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.