Zuerst: Danke nach Berlin!
I checked the Beans and the Beans are not a double deployment. They even deploy once and
they deploy without errors.
I think I just missed something. Maybe it's the Deployment descriptor I was not aware
of. All my both JARs have is
persitence.xml (both look the same):
| <persistence>
| <persistence-unit name="ios">
| <jta-data-source>java:/oldios</jta-data-source>
| </persistence-unit>
| </persistence>
|
The Entity Beans in JAR #1:
| package com.teec.ios.ejb.cmp;
| import java.io.Serializable;
|
| @javax.persistence.Entity
| @javax.persistence.Table(name = "config")
| public class Config implements Serializable {
|
| private int id;
| @javax.persistence.Id
| @javax.persistence.Column(name = "id")
| public int getId() {
| return id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
| ...
| }
|
The Session Beans in JAR #2 like this Test Bean:
| package com.teec.ios.core.ejb.session;
| ...
| @Stateful
| public class MailManagerBean implements MailManagerRemote, MailManagerLocal {
| ...
| @EJB private ConfigManagerLocal config;
| ...
| @PersistenceContext(unitName="ios") private EntityManager em;
| ...
|
| public void createMailConfig(MailConfig conf, String configInstanceID) throws
ConfigExistsAlreadyException{
| try {
| System.out.println("Entities found : "+em.createQuery("from
com.teec.ios.ejb.cmp.Config c").getResultList().size());
| System.out.println("Entities found : "+em.createQuery("from Config
c").getResultList().size());
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
| }
|
When running the Example bean, I get
| 12:59:28,304 WARN [QuerySplitter] no persistent classes found for query class: from
com.teec.ios.ejb.cmp.Config c
|
|
| 12:59:28,304 INFO [STDOUT] Entities found : 0
| 12:59:28,507 ERROR [STDERR] javax.persistence.PersistenceException:
org.hibernate.hql.ast.QuerySyntaxException: Config is not mapped [from Config c]
|
|
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:562)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:80)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:127)
| 12:59:28,507 ERROR [STDERR] at
com.teec.ios.core.ejb.session.MailManagerBean.createMailConfig(MailManagerBean.java:247)
| 12:59:28,507 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
| 12:59:28,507 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
| 12:59:28,507 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| 12:59:28,507 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:308)
| 12:59:28,507 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:104)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
| 12:59:28,507 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| 12:59:28,507 ERROR [STDERR] Caused by: org.hibernate.hql.ast.QuerySyntaxException:
Config is not mapped [from Config c]
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:267)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3049)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2938)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1586)
| 12:59:28,507 ERROR [STDERR] at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:77)
| 12:59:28,507 ERROR [STDERR] ... 34 more
|
|
Anyway I do not have a deployment descriptor.
1) Di I need a deployment descriptor (a single JAR-Application doesn't need it as
anyrhing works well)?
2) What do I need to include in the deployment descritor in the Entity JAR?
3) What do I need to include in the deployment descritor in the Session Bean JAR?
4) Is it correct to have the same persistence.xml?
If anyone could provide some sample files this would be most helpful!!!
Thanks a lot,
Dennis
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985390#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...