[EJB 3.0] - remote interface and lazy init exception
by mazz@jboss.com
I haven't found any topic on this EJB3 forum, which seems like its more appropriate here.
See this thread, "Catching LazyInitialization exception within an Interceptor":
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=124693
The issue here is that my EJB3 SLSB has methods that return JPA entity objects. Some do not have some/all of their relationships loaded (because they don't need to be due to the semantics of the SLSB method call). Rather than force my app to load these unused relationships, we just return entities as-is. We also don't want to have to write and maintain additional DTOs or composite objects just to support the SLSB calls.
But, if these calls are made via a @Remote method, this forces the objects to be serialized and if a relationship isn't loaded, the call will throw a LazyInitializationException even though the caller never plans on looking at the relationship data.
This is, in effect, the same thing we ran across when using WebServices (in which case we had to implement our own safe invoker code injected in the web services stuff so we avoid these exceptions - there's a thread in the JBossWS forum regarding this).
How are people getting around this? I am assuming this will involve introducing a new AOP interceptor - has anyone done that with success?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137097#4137097
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137097
18 years, 1 month
[EJB 3.0] - Re: transaction timeout for managed conversation transaction
by grzegorz.knapczyk
Hi!
I am sorry, it is out of topic, but since you use Hibernate Search you might know...
When I try in my application:
| FullTextSession session = (FullTextSession) entityManager.getDelegate();
|
it throws exception:
| 15:45:23,866 WARN [HibernatePersistenceProvider] Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned
| java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.persistence.HibernatePersistenceProvider.proxySession(HibernatePersistenceProvider.java:97)
| at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:116)
| at org.jboss.seam.persistence.EntityManagerProxy.getDelegate(EntityManagerProxy.java:95)
|
I use Jboss 4.2.2.GA, Seam 2.0.1.GA, HibernateSearch 3.0.1. ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137091#4137091
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137091
18 years, 1 month
[JBoss Portal] - Lookup error
by kmekme
Hello,
When I launch JBoss and try to go on JBoss Portal, I've got this error :
| 15:36:10,731 ERROR [ServiceLocator] Exception during lookup of fr_mckesson_technique_ejb_parameter_jdbc
| javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at fr.mckesson.common.util.ServiceLocator.lookup(ServiceLocator.java:167)
| at fr.mckesson.common.util.ServiceLocator.getRemoteHome(ServiceLocator.java:132)
| at fr.mckesson.common.util.BusinessServiceLocator.lookupCreate(BusinessServiceLocator.java:71)
| at fr.mckesson.common.util.BusinessServiceLocator.lookupCreate(BusinessServiceLocator.java:89)
| at fr.mckesson.common.util.BusinessServiceLocator.getParameter(BusinessServiceLocator.java:113)
| at fr.mckesson.common.parameter.FacadeParameter.selectAllKey(FacadeParameter.java:48)
| at fr.mckesson.common.parameter.FacadeParameter.getValue(FacadeParameter.java:20)
| at fr.mckesson.common.parameter.FacadeParameter.getValue(FacadeParameter.java:34)
| at fr.mckesson.patient.hgpp.app.portlets.context.HWPContext.isWorklistActivated(HWPContext.java:234)
| at fr.mckesson.patient.hgpp.app.portlets.context.HWPContext.<init>(HWPContext.java:70)
| at fr.mckesson.patient.hgpp.app.portlets.context.HWPContext.getHWPContext(HWPContext.java:99)
|
|
I tried to copy and paste jbossall-client.jar from $jboss_home/client to my classpath and it doesn't change anything.
Where does it come from?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137085#4137085
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137085
18 years, 1 month