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: Table not mapped.Trotz Suchfunktion keine Lösung gefunden
PostPosted: Sun Jan 07, 2007 2:09 pm 
Newbie

Joined: Sun Jan 07, 2007 1:52 pm
Posts: 1
Location: Heilbronn
Grüße,

ich habe ein Problem welches schon zumindest 2x im Forum gepostet wurde u. auch einmal "gelöst" wurde. Gelöst, aber warum / wie es funktioniert hat habe ich nicht wirklich nachvollziehen können ^^ Leider ist es auch so, dass wenn man dann in dem betreffenden Posting nachfragt die Personen nie wieder in ihren eigenen Thread schauen ;-) Kurzum: deshalb meine Anfrage obwohl es schon Threads zu dem Thema gibt

So nun zu meinem Problem:

Ich erhalte folgende Fehlermeldung wenn ich ein simples SELECT k from XLog k absetze:

Quote:
org.hibernate.hql.ast.QuerySyntaxException: XLog is not mapped [SELECT k from XLog k]



Hibernate version: 3.2 , JBOSS for Eclipse 2.0

hibernate.cfg.xml:

<?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.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">tigert</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/karma</property>
<property name="hibernate.connection.username">karma</property>
<property name="hibernate.default_schema">karma</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<mapping resource="de/karma/GprioStufen.hbm.xml" />
<mapping resource="de/karma/XuserAnlegen.hbm.xml" />
<mapping resource="de/karma/XgruppeRechte.hbm.xml" />
<mapping resource="de/karma/XuserTyp.hbm.xml" />
<mapping resource="de/karma/Xparameter.hbm.xml" />
<mapping resource="de/karma/Xrechte.hbm.xml" />
<mapping resource="de/karma/Xuser.hbm.xml" />
<mapping resource="de/karma/XLog.hbm.xml" />
<mapping resource="de/karma/XuserAdresse.hbm.xml" />
<mapping resource="de/karma/GEskalationsstufen.hbm.xml" />
<mapping resource="de/karma/XdatabaseParameter.hbm.xml" />
<mapping resource="de/karma/Xgruppen.hbm.xml" />
<mapping resource="de/karma/XuserStatus.hbm.xml" />
<mapping resource="de/karma/Xadresse.hbm.xml" />
<mapping resource="de/karma/XuserMatrix.hbm.xml" />
</session-factory>
</hibernate-configuration>


Mapping für XLog:


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 07.01.2007 17:58:12 by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="de.karma.XLog" table="x_log">
<comment>Logging für User wird noch erweitert.Hier wird z.b. geloggt wan sich ein User angemeldet u. abgemeldet hat. Später
kann hier auch über diese Tabelle Auswertungen gefahren werden</comment>
<id name="xloId" type="long">
<column name="xlo_id" />
<generator class="assigned" />
</id>
<property name="xloModul" type="string">
<column name="xlo_modul" length="300" />
</property>
<property name="xloAktion" type="string">
<column name="xlo_aktion" length="300" />
</property>
<property name="xloSql" type="string">
<column name="xlo_sql" length="20000" />
</property>
<property name="xloXusId" type="java.lang.Long">
<column name="xlo_xus_id" />
</property>
<property name="xloDbUser" type="string">
<column name="xlo_db_user" length="200" not-null="true" />
</property>
<property name="xloDatum" type="timestamp">
<column name="xlo_datum" length="29" not-null="true" />
</property>
</class>
</hibernate-mapping>




Fehlermeldung (gekürzt):


Error
Sun Jan 07 19:00:04 CET 2007
org.hibernate.hql.ast.QuerySyntaxException: XLog is not mapped [SELECT k from XLog k]

org.hibernate.hql.ast.QuerySyntaxException: XLog is not mapped [SELECT k from XLog k]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:265)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at
.....



Tja wie immer die Frage: was mache ich falsch ?

Gruß und Danke aus Heilbronn

Micha


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 5:57 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
Zum einen stellt sich mir die Frage, ob Deine Anwendung auch wirklich im JBoss deployed ist. Zum anderen, falls dem so ist warum Du eine hibernate.cfg.xml innerhalb von JBoss benutzt. Vielleicht solltest Du Dir mal die entsprechenden Wiki Seiten anschauen, denn wenn JBoss/Hibernate sagt, das etwas nicht gemappt ist, dann ist das auch so.

_________________
regards

Olaf

vote if it helped


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 6:12 pm 
Newbie

Joined: Sun Jan 07, 2007 1:02 pm
Posts: 4
Schreib doch einfach mal Schrott rein in Deine hibernate.cfg.xml um zu sehen ob die überhaupt gezogen wird (keine Fehlermeldung zu bekommen wäre dann schlecht :)

Als nächstes schrottest Du Deine XLog.hbm.xml um zu sehen ob die gezogen wird.

Ansonsten würde ich gerne noch den Code sehen wo Du Deine Session holst.

_________________
Please credit if it helped!
Bitte credit nicht vergessen wenns geholfen hat!


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.