[jboss-user] [EJB/JBoss] - Accessing JBoss service from EJB

2009-05-21 Thread vlotarev
Dear guru!

Coudl you please tell me how is it possible to access JBoss service (POJO 
marked with @Service and @Local/@Remote) from EJB? Is it possible just to 
inject such bean? What will be a JNDI name of a @Service POJO?

Thanks in advance,
Vadim

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232493#4232493

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232493
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: @EJB injection after redeploy

2009-05-20 Thread vlotarev
It's interesting that

new InitialContext().list()

returns right bound proxy classes but direct lookup invoked on the same context

new InitialContext().lookup(name)

returns old proxy class ...

It looks like InitialContext implementation caches bound objects somewhere (in 
static variable?) and this cache is not cleared during re-deployment.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232308#4232308

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232308
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: @EJB injection after redeploy

2009-05-20 Thread vlotarev
I did some testing: replaced @EJB dependency injection by direct JNDI lookup 
but this didn't solve the problem. I noticed that the same $Proxy object is 
returned in response to JNDI lookup after several application re-deployments. 
Though JNDIView MBean shows different $Proxy objects after each re-deployment.
I think that this is a reason - JNDI lookup invoked from application returns an 
old $Proxy object that was created during the first deployment. Looks like a 
bug ... Does anybody can suggest any workaround?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232286#4232286

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232286
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: @EJB injection after redeploy

2009-05-20 Thread vlotarev
JBoss version is 4.2.3GA

I am making hot-deploy just copying corresponding EAR file in the server/deploy 
folder. Deployment itself went well except several warnings (I removed log 
entries related to entity beans deployment since as far as I guess the are out 
of interest).

INFO  [EARDeployer] Init J2EE application: 
file:/C:/jboss-4.2.3.GA/server/default/deploy/SV2Interface.ear
  | 
  | WARN  [EJBHandler] IGNORING DEPENDENCY: unable to find @EJB from interface 
only com.foo.service.SwService in ejb-jar.xml of SV2Servicenot used by any EJBs
  | WARN  [EJBHandler] IGNORING DEPENDENCY: unable to find @EJB from interface 
only com.foo.aaa.service.serviceRejet.IServiceRejetEnterprisein ejb-jar.xml of 
SV2Servicenot used by any EJBs
  | WARN  [EJBHandler] IGNORING DEPENDENCY: unable to find @EJB from interface 
only com.bar.bbb.service.SessionService in ejb-jar.xml ofSwServicenot used by 
any EJBs
  | WARN  [EJBHandler] IGNORING DEPENDENCY: unable to find @EJB from interface 
only com.bar.bbb.service.DbSearchService in ejb-jar.xml of SwServicenot used by 
any EJBs
  | INFO  [JmxKernelAbstraction] creating wrapper delegate for: 
org.jboss.ejb3.stateless.StatelessContainer
  | INFO  [JmxKernelAbstraction] installing MBean: 
jboss.j2ee:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,name=ShipService,service=EJB3
 with dependencies:
  | INFO  [JmxKernelAbstraction]   
persistence.units:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,unitName=SV2_Ship_Casa
  | INFO  [JmxKernelAbstraction]   
persistence.units:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,unitName=SV2_Reference
  | INFO  [JmxKernelAbstraction]   
persistence.units:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,unitName=SV2_Ship_Moro
  | INFO  [EJBContainer] STARTED EJB: com.foo.service.ShipServiceBean ejbName: 
ShipService
  | INFO  [JmxKernelAbstraction] creating wrapper delegate for: 
org.jboss.ejb3.stateless.StatelessContainer
  | INFO  [JmxKernelAbstraction] installing MBean: 
jboss.j2ee:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,name=SV2Service,service=EJB3
 with dependencies:
  | INFO  [JmxKernelAbstraction]   
jboss.j2ee:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,name=ShipService,service=EJB3
  | INFO  [EJBContainer] STARTED EJB: com.foo.service.SV2ServiceBean ejbName: 
SV2Service
  | INFO  [JmxKernelAbstraction] creating wrapper delegate for: 
org.jboss.ejb3.stateless.StatelessContainer
  | INFO  [JmxKernelAbstraction] installing MBean: 
jboss.j2ee:ear=SV2Interface.ear,jar=SV2InterfaceEJBModule.jar,name=SwService,service=EJB3
 with dependencies:
  | INFO  [EJBContainer] STARTED EJB: com.foo.service.SwServiceBean ejbName: 
SwService
  | INFO  [EJB3Deployer] Deployed: 
file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp5596106466848300323SV2Interface.ear-contents/SV2InterfaceEJBModule.jar
  | INFO  [EARDeployer] Started J2EE application: 
file:/C:/jboss-4.2.3.GA/server/default/deploy/SV2Interface.ear
  | 

As I mentioned in my first post all EJB's are located in the same jar (ejb 
module) that, in turn, is packaged in EAR application. I am accesing one EJB 
from another EJB (both of them are located in the same JAR).

Thanks,
Vadim

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232149#4232149

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232149
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - @EJB injection after redeploy

2009-05-20 Thread vlotarev
I am trying deploy simple application: two stateless EJB3 beans packaged in one 
ejb module that, in turn, is packaged as EAR application. One EJB injects 
aonther by simple @EJB annotation (via local inteface):

@EJB
  | private SwServiceLocal swService;
  | 

Everything works just fine after first deployment but fails after re-deployment 
(the first access to injected EJB) injection fails with the following exception:

  java.lang.RuntimeException: Non matching type for inject of field: private 
com.foo.service.SwService com.foo.service.SV2ServiceBean.swService for type: 
$Proxy433 of jndiName env/com.foo.service.SV2ServiceBean/swService intfs: , 
com.foo.service.SwServiceLocal, org.jboss.ejb3.JBossProxy 12:03:11,589 ERROR 
[STDERR] at 
org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:128)
  |  at 
org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:106)
  |  at 
org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:63)
  |  at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:111)
  |  at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:49)
  |  at org.jboss.ejb3.ThreadlocalPool.create(ThreadlocalPool.java:50)
  |  at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:90)
  |  at 
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
  |  at 
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
  |  at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
  |  at 
org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
  |  at $Proxy431.processAllOperations(Unknown Source)
  |  at 
fr.sncm.sgi.service.batchmanager.ServiceBatchManager.executeConnecteurInterface(ServiceBatchManager.java:789)
  |  at 
fr.sncm.sgi.service.batchmanager.ServiceBatchManager.programmeInterface(ServiceBatchManager.java:612)
  |  at 
fr.sncm.sgi.service.batchmanager.ServiceBatchManager.processPerformBatch(ServiceBatchManager.java:300)
  |  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:597)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  |  at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  |  at 
fr.sncm.sgi.interceptors.LogInterceptor.logThisMethod(LogInterceptor.java:31)
  |  at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
  |  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |  at java.lang.reflect.Method.invoke(Method.java:597)
  |  at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  |  at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
  |  at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
  |  at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |  at 
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessIn