[Java lista] JMS kerdes

István Viczián viczian.istvan at gmail.com
2009. Aug. 18., K, 14:48:36 CEST


Szia,

MDB-ben nem SessionContext, hanem MessageDrivenContext, vagy micsoda van.

Viczi

2009/8/18 zamek <zamek at vili.pmmf.hu>:
> 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
> ----------------------------------
>
> _______________________________________________
> Javalist mailing list
> Javalist at javagrund.hu
> http://javagrund.hu/mailman/listinfo/javalist
>


További információk a(z) Javalist levelezőlistáról