-->
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: joined-subclasses
PostPosted: Sun Apr 25, 2004 8:09 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class name="com.mydomain.ectd.budgets.IBudget" table="BPMS_BUDGETS">
       <id name="budgetId" column="BUDGET_ID">
          <generator class="uuid.hex" />
       </id>
       <property name="budgetType" column="BUDGET_TYPE"/>
       <property name="budgetYear" column="BUDGET_YEAR"/>
      <property name="isApproved" column="IS_APPROVED"/>
      <property name="costType" column="COST_TYPE"/>
       <many-to-one name="organisation" column = "ORG_CODE"/>
       <many-to-one name="costElement" column="ELEMENT_ID"/>      
      
      <joined-subclass name="com.mydomain.ectd.labor.ILaborLineItem" table = "BPMS_LABOR" >
         <key column="BUDGET_ID"/>
           <property name="laborCost" column="LABOR_COST"/>
           <property name="laborCount" column="LABOR_COUNT"/>
      </joined-subclass>
      
    </class>
</hibernate-mapping>


I have the above mapping file for my Budget and LaborBudget line item Classes ... with two tables ... one for Budget and other for LaborLineItems. but I am getting duplicat import error which means .. there is some problem with the mapping.

Ofcourse I have not coded the other joined-classes ... Isn't the case that I have to code for all the joined-subclass before testing it?

If not ... please let me know where the error is?

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 8:12 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Sorry .... here is the trace ...

<Apr 25, 2004 3:00:08 PM GMT+03:00> <Error> <HTTP> <BEA-101017> <[ServletContext(id=13317442,name=bpms,context-path=/bpms)] Root cause of ServletException.
java.lang.ExceptionInInitializerError
at com.mydomain.ectd.organisation.impl.OrganisationMgrImpl.getOrganisations(OrganisationMgrImpl.java:31)
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.apache.taglibs.standard.lang.jstl.ArraySuffix.evaluate(ArraySuffix.java:317)
at org.apache.taglibs.standard.lang.jstl.ComplexValue.evaluate(ComplexValue.java:146)
at org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:242)
at org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:201)
at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:138)
at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
at org.apache.taglibs.standard.tag.el.core.ForEachTag.evaluateExpressions(ForEachTag.java:191)
at org.apache.taglibs.standard.tag.el.core.ForEachTag.doStartTag(ForEachTag.java:102)
at jsp_servlet._jsp.__organisationlist._jspService(__organisationlist.java:207)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
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:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.lang.RuntimeException: net.sf.hibernate.MappingException: Error reading resource: /com/mydomain/ectd/budgets/Budget.hbm.xml
at com.mydomain.ectd.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:73)
... 38 more
Caused by: net.sf.hibernate.MappingException: Error reading resource: /com/mydomain/ectd/budgets/Budget.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:318)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:976)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:928)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842)
at com.mydomain.ectd.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:67)
... 38 more
Caused by: net.sf.hibernate.MappingException: duplicate import: IBudget
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229)
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.addResource(Configuration.java:315)
... 43 more
>

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 8:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The "duplicate import" most of the time comes from an earlier error in the configuration process. Did you check the log that there were no other errors before the "duplicate import"?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 6:13 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Thanks michel

Yes ... the problem is womewhere else ... I solved it.

Thanks for ur help.

_________________
Thanks
Irfani


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.