geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maho77 <m.hoffm...@mvolution.de>
Subject Re: Circular reference problem
Date Wed, 12 Dec 2007 09:27:17 GMT


Jacek Laskowski wrote:
> 
> On Dec 11, 2007 8:32 PM, maho77 <m.hoffmann@mvolution.de> wrote:
> What's "a bean"? Is it an ejb or a managed (backing) bean or merely a
> pojo?
> 

ModifyBean is an EJB JAR containing stateless bean and a JPA entity, the
stateless bean contains a method 
public Object modify(Object o, String languageCode)

It parses the give o for annotation from annotations.jar and catches the
translated values from the database with JPA sets translated values to  the
annotated fields using reflections.

ModifyBeans modifies other JPA Entities, POJO's whatever conains the
annotations.

BeanA and BeanB are also EJB JAR's. BeanA  containis JPA entity EnitityA and
a stateless bean with the methods
EntityA EntityAImpl.getEntityA() and
EntityA EntityAImpl.getEntityA(String languageCode) 

@Stateless
public class BeanAImpl implements ...

@EJB
ModifyBeanRemote modBean;

public EntityA getEntity() {
  //gets the entity
}

public EntityA getEntity(String langCode) {
  EntityA a = getEntity();
  return (BeanA)modBean.modify(a, langCode)
}

}

BeanB EJB JAR is a similar principle



> BeanA, BeanB depend on annotations.jar
> BeanA, BeanB depend on ModifyBean
> ModifyBean depend on annotations.jar
> 
> Right?
> 

Right, but ModifyBean also depends on BeanA and BeanB.



> ModifyBean.modify(entities) would do the trick, right?
> 

Right



> You might take a look at the interceptors feature of ejb3. It lets you
> intercept business method calls as well as lifecycle events and
> therefore do something in addition to the original call or a lifecycle
> change.
> 

I know this feature but the problem occures on execution time. I can deploy
the whole 3 EJB JAR's. But if I call 
BeanAImpl.getEntitiyA("ENG") from a client I get an exception that says that
EntityA is unkown to the ModifyBean.

10:22:17,260 ERROR [OpenEJB] The bean instances business method encountered
a system exception: null
java.lang.reflect.UndeclaredThrowableException
	at $Proxy156.modify(Unknown Source)
	at beana.impl.BeanAImpl.getEntityA(EntityAImpl.java:72)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:146)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129)
	at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
	at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:203)
	at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
	at
org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:212)
	at
org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:120)
	at
org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
	at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
	at org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:73)
	at
org.apache.openejb.server.ServiceAccessController.service(ServiceAccessController.java:55)
	at org.apache.openejb.server.ServiceDaemon$1.run(ServiceDaemon.java:117)
	at java.lang.Thread.run(Thread.java:810)
Caused by: 
java.lang.ClassNotFoundException: beana.entites.EntityA
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:163)
	at org.apache.openejb.util.Classes.forName(Classes.java:48)
	at
org.apache.openejb.core.ivm.EjbObjectInputStream.resolveClass(EjbObjectInputStream.java:37)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1568)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1490)
	at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1723)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:363)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.copyObj(BaseEjbProxyHandler.java:516)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.copyArgs(BaseEjbProxyHandler.java:471)
	at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:274)
	at
org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
	... 21 more

Sorry for my circumstantial description and thanks for your help.

Mark


-- 
View this message in context: http://www.nabble.com/Circular-reference-problem-tp14281457s134p14291570.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message