Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.6
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
org.hibernate.hql.ast.QuerySyntaxException: TUploadedjobs is not mapped. [from TUploadedjobs jobs where jobs.TUploadedjobstatus.status = 'U' order by jobs.uploaddate desc ]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:145)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:86)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:262)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3041)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2930)
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:216)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:156)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:473)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1060)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1010)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at <myclass1>.executeNamedParameterQuery(myclass1.java:119)
at <myclass2>(<myclass2>.java:48)
at <myclass2>(<myclass2>.java:99)
at <myclass3>(<myclass3>.java:68)
at java.lang.Thread.run(Thread.java:595)
Caused by: TUploadedjobs is not mapped.
... 22 more
Name and version of the database you are using: Postgresql 8.2
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi
I have a webservice and a jboss mbean service running on a JBoss AS (4.0.3sp1). They both have their own set of hibernate.cfg.xml and other mapping files.
The hibernate.cfg.xml files though, point to the same database and some of the mapping files point to the same tables (with same class names because the persistence classes are within a jar file which is shared by both the apps).
Sometimes I get the above mentioned exception. There is no problem in mapping. The exception does not occur when only the webservice is running or only the jboss mbean service is running. It only happens when both are deployed together.
Question
1. Why do I get this exception and what has it got to do with two apps being deployed at the same time?
2. Does hibernate share sessionfactories ?
3. Do session factory names make any difference in my case ?
4. When Jboss starts deploying the apps - does it make any diffrence to which app is deployed first ?
5. When Jboss builds a factory for one app and in the process maps all classes with mapping files - will it skip doing so for the same named classes in mapping files for the next app while builds its session factory ?
Does this have anything to do with Class Loading in JBoss+Hibernate ?
6. How does this change when Hibernate session factories are configured using JMX beans ?
I would really appreciate if someone explains whats happenning here and helps me get over this exception.
Thanks
Regards
Deb