-->
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.  [ 1 post ] 
Author Message
 Post subject: jboss 4 RC2 - Component mapping - deployment failure
PostPosted: Tue Sep 14, 2004 12:04 pm 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
Hibernate version: 2.1.6

hi all

for some time now im trying to deploy on jboss 4 a VERY simple app
using a mapped component in the most trivial way ,
but still im getting error in the deployment .....and its starting to be embarrassing please help....

the component in the hbm.xml :

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
   package="shop.admin">

   <class name="Item" table="ITEMS" lazy="true">
      <id name="id" column="ITEM_ID">
         <generator class="uuid.string"/>
      </id>
      
      
      <property
         name="name"
         column="NAME"
         not-null="true"
         unique="false"
         type="string"/>
         
      <many-to-one
         name="order"
         column="ORDER_ID"
         class="Order"
         cascade="all"/>
         
      <property
         name="price"
         column="PRICE"
         not-null="true"
         unique="false"
         type="integer"/>
         
      <component name="vendor" class="Vendor">

         <property name="customer_name" column="CUST_NAME"/>
         <property name="customer_lastName" column="CUST_LAST"/>
         <property name="customer_code" column="CUST_CODE"/>
      </component>
         
         
      
   </class>
   
</hibernate-mapping>


a snippt from the item class having the getters and setters
Code:
package shop.admin;

public class Item{
   private String id;
   private String name;
   private int price;
   private Order order;
   private Vendor vendor;
   
   public void setVendor(Vendor vendor){
      this.vendor = vendor;
   }
   public Vendor getVendor(){
      return vendor;
   }
   
   public Item(){
   }
   
   public String getId(){
      return id;
   }
......
......


the component ..
Code:
package shop.admin;

public class Vendor{

   private String customer_name;
   private String customer_lastName;
   private String customer_code;


      
      public void setCustomer_name(String name){
      this.customer_name = name;      

      }
      public void setCustomer_lastName(String last){
         this.customer_lastName = last;

      }
      public void setCustomer_code(String code){

         this.customer_code = code;
      }

      public String getCustomer_name(){
         return customer_name;      

      }
      public String getCustomer_lastName(){

         return customer_lastName;

      }
      public String getCustomer_code(){

         return customer_code;
      }   

}


and the created by jboss :

Code:
18:43:17,703 INFO  [Configuration] Searching for mapping documents in jar: HibernateTest.har
18:43:17,703 INFO  [Configuration] Found mapping documents in jar: Item.hbm.xml
18:43:17,718 INFO  [Binder] Mapping class: shop.admin.Item -> ITEMS
18:43:17,718 ERROR [Configuration] Could not compile the mapping document
net.sf.hibernate.PropertyNotFoundException: field not found: vendor
        at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74)
        at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
        at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88)
        at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81)
        at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90)
        at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1049)
        at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
        at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1253)
        at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
        at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
        at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:393)
        at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:459)
        at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:436)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
        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:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:373)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:927)


it looks so simple but i just cant find it!!!
the field vendors has its getters and setters i tried to use it with and without a constructor - i just dont know what to do .....


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

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.