[Java lista] JMS kerdes
zamek
zamek at vili.pmmf.hu
2009. Aug. 18., K, 14:14:28 CEST
István Viczián írta:
> Szia,
>
> akkor a sima sendStatus helyett
> ((MyBean)context.getBusinessObject()).sendStatus-t kell használnod,
> különben az annotáció nem érvényesül.
Igy csinaltam az MDB-ben:
@Resource
private SessionContext context;
...
protected void sendStatus (Message message) throws Exception {
message.setJMSCorrelationID(this.processId);
BGProcessorMDB bgpm =
context.getBusinessObject(BGProcessorMDB.class);
bgpm.sendStatusImpl(message);
System.out.println("BGProcessorMDB sending status message,
processId:"+this.processId);
}
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private void sendStatusImpl(Message message) throws Exception {
TopicPublisher publisher =
statusSession.createPublisher(statusQueue);
publisher.publish(message,DeliveryMode.PERSISTENT,
Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
publisher.close();
}
eredmeny egy szep kover exception:
MDB00050: Message-driven bean [EJBDemo:BackgroundCounterMDBBean]:
Exception in creating message-driven ejb :
[com.sun.enterprise.InjectionException: Exception attempting to inject
Env-Prop:
com.ct.ejb.utils.bgprocess.BGProcessorMDB/context at Field-Injectable
Resource. Class name = com.ct.ejb.utils.bgprocess.BGProcessorMDB Field
name=context at java.lang.String@com.ct.ejb.utils.bgprocess.BGProcessorMDB/context@@
into class com.ct.ejb.utils.bgprocess.BGProcessorMDB]
com.sun.enterprise.InjectionException
com.sun.enterprise.InjectionException: Exception attempting to inject
Env-Prop:
com.ct.ejb.utils.bgprocess.BGProcessorMDB/context at Field-Injectable
Resource. Class name = com.ct.ejb.utils.bgprocess.BGProcessorMDB Field
name=context at java.lang.String@com.ct.ejb.utils.bgprocess.BGProcessorMDB/context@@
into class com.ct.ejb.utils.bgprocess.BGProcessorMDB
at
com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:387)
--
thx,
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: zamek at vili.pmmf.hu
----------------------------------
További információk a(z) Javalist levelezőlistáról