- This topic has 2 replies, 2 voices, and was last updated 19 years, 9 months ago by Riyad Kalla.
-
AuthorPosts
-
rmauerMemberI am using MyEclipse 3.8.3, hibernate, jboss 3.2.5 on XP. What can I do to correct this problem?
I wrote a web project that includes hibernate and struts. It tested and ran fine. Now when I create a new web project or try to run an existing project, the JBoss console view shows that the wrong mapping resource and class are being called. No matter what application I try to launch it always shows the following mapping resource and class.
EXCERPT FROM JBOSS CONSOLE
resource: /hibernate.cfg.xml
14:59:54,648 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
14:59:54,820 INFO [Configuration] Mapping resource: com/visn15/hibernate/Sales.hbm.xml
14:59:56,335 INFO [Binder] Mapping class: com.visn15.hibernate.Sales -> Sales(In this case the web app was accessing a drug table)
Later on I’ll get a message like:15:00:07,179 WARN [QueryTranslator] no persistent classes found for query class: select Drugs from com.mauer.hibernate.Drugs Drugs order by Drugs.genericname
In this case the mapping should have been com/mauer/hibernate/Drugs.hbm.xml.
HERE IS THE HIBERNATE.CFG.XML FILE
<?xml version=’1.0′ encoding=’UTF-8′?>
<!DOCTYPE hibernate-configuration PUBLIC
“-//Hibernate/Hibernate Configuration DTD 2.0//EN”
“http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd”><!– DO NOT EDIT: This is a generated file that is synchronized –>
<!– by MyEclipse Hibernate tool integration. –>
<hibernate-configuration><session-factory>
<!– properties –>
<property name=”connection.username”></property>
<property name=”connection.url”>jdbc:odbc:database</property>
<property name=”dialect”>net.sf.hibernate.dialect.SQLServerDialect</property>
<property name=”connection.password”></property>
<property name=”connection.driver_class”>sun.jdbc.odbc.JdbcOdbcDriver</property><!– mapping files –>
<mapping resource=”com/mauer/hibernate/Drugs.hbm.xml”/></session-factory>
</hibernate-configuration>
HERE IS DRUGS.HBM.XML
<?xml version=”1.0″?>
<!DOCTYPE hibernate-mapping PUBLIC
“-//Hibernate/Hibernate Mapping DTD 2.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd” ><!– DO NOT EDIT: This is a generated file that is synchronized –>
<!– by MyEclipse Hibernate tool integration. –>
<!– Created Tue Mar 01 14:11:24 CST 2005 –>
<hibernate-mapping package=”com.mauer.hibernate”><class name=”Drugs” table=”Drugs”>
<id name=”id” column=”ID” type=”java.lang.Integer”>
<generator class=”native”/>
</id><property name=”vaclassnumber” column=”VAClassNumber” type=”java.lang.String” />
<property name=”restriction” column=”Restriction” type=”java.lang.String” />
<property name=”natform” column=”NatForm” type=”java.lang.String” />
<property name=”visnform” column=”VISNForm” type=”java.lang.String” />
<property name=”vaclassdescription” column=”VAClassDescription” type=”java.lang.String” />
<property name=”genericname” column=”GenericName” type=”java.lang.String” />
<property name=”commonname” column=”CommonName” type=”java.lang.String” />
<property name=”strength” column=”Strength” type=”java.lang.String” />
<property name=”form” column=”Form” type=”java.lang.String” />
<property name=”dispunit” column=”DispUnit” type=”java.lang.String” />
<property name=”priceperunit” column=”PriceperUnit” type=”java.lang.String” />
<property name=”restrictionsComments” column=”Restrictions_Comments” type=”java.lang.String” />
<property name=”weblinks” column=”Weblinks” type=”java.lang.String” />
</class></hibernate-mapping>
THANKS
rmauerMemberAfter playing around some more, I found that I have to remove the previous project deployment before I can run another project.
Riyad KallaMemberThank you for posting your solution.
-
AuthorPosts