[JBoss Seam] - Entity not Mapped with two datasources accessing EJBs outsid
by sysex
Hi, I'm new to JBoss and Seam and have encountered a problem when trying to query Entity beans outside of my EAR.
My environment consists of JBoss-4.0.5 running Seam-1.2.1.GA and Hibernate. My EAR deployment uses a MySQL database (which is connecting and working just fine) but also needs to query Entity beans, which also use Hibernate, and are deployed one level up (~/server/default/deploy) as two separate JAR archives (API and Impl). The JARs are able to communicate with Hibernate to create and import data into their OracleXE database but aren't accessible from my EAR.
After having done some research I am not sure if the issue is related to Seam needing an explicit persistence-unit declaration to use for the query or whether there is an issue with the Entities needing to be published as a JMX service using jboss-app.xml so that the separate classloaders can communicate.
I am writing the simplest query possible which throws the following exception:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: CollectionCategory is not mapped [select categoryCollection from CollectionCategory categoryCollection where categoryCollection.collectionCategoryId = :el1]
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.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
... 85 more
Is anyone able to elaborate on the mechanisms of communication between separate JBoss deployments and the accessibility of Hibernate mappings? As well, whether Seam's implicit usage of datasource mappings should be considered as a factor?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055834#4055834
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055834
18Â years, 10Â months
[JBoss Seam] - Re: How do folks layout pages: panelgrids (embedded tables)
by Delphi's Ghost
Hey Pete,
Yes, I saw that, I have looked at the decorate stuff, actually, I think I have copied edit.xhtml to my app to look at start trying to use it. I do need to add an access key element on to there, but that should be easy.
I did implement a facelet for date edits, and my main problem was that in order to specify a proper document, with access keys in labels and labels and controls with Ids, you end up having include a lot of parameters, and putting an access key param in a facelet is a lot longer than putting accessKey="a" in the label tag.
Also, remembering the params can be a pain, until you get to the point where you are having to copy and paste the invokation of the template, at which point, you might as well just copy and paste the raw html that is in the template. My select date template contained around 8 tags for params, whereas the underlying html was 3 tags and a few attributes.
I know, you get re-use and all that from s:decorate and templates, but still...I'm a tough customer to please :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055829#4055829
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055829
18Â years, 10Â months