• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Issue with MDB and weblogic 9.2

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all...

I'm facing a strange kind of problem with MDB using weblogic 9.2
The code worked perfectly in weblogic 8.1
This is wht i'm trying to achieve..
i'm having a MDB which implements a onMessage().
I'm publishing message thru a standalone client. Publishing works fine..
The problem is onMessage(javax.jms.Message msg) is never been called .
when i monitor it shows that messages are recieved..
Am is missing something that is really important..

Here is my code ,

public class PaymentProcessorBean implements MessageDrivenBean, MessageListener {

public PaymentProcessorBean() {
super();
// TODO Auto-generated constructor stub
}

public void setMessageDrivenContext(MessageDrivenContext ctx)
throws EJBException {
// TODO Auto-generated method stub

}

public void ejbRemove() throws EJBException {
// TODO Auto-generated method stub

}

public void onMessage(Message message) {
ObjectMessage objMsg=(ObjectMessage)message;
try {
System.out.println(message);
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


here are the 2 xml files....

<message-driven >
<description><![CDATA[Description for PaymentProcessor]]></description>
<display-name>Name for PaymentProcessor</display-name>

<ejb-name>PaymentProcessor</ejb-name>

<ejb-class>com.exo.epayment.ejb.PaymentProcessorBean</ejb-class>

<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>

</message-driven>



<weblogic-ejb-jar>

<weblogic-enterprise-bean>
<ejb-name>PaymentProcessor</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>10</max-beans-in-free-pool>
<initial-beans-in-free-pool>2</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>jms/JMSQueue</destination-jndi-name>
<initial-context-factory>weblogic.jndi.WLInitialContextFactory</initial-context-factory>
<provider-url>t3://localhost:7001</provider-url>;
<connection-factory-jndi-name>jms/JMSConnectionFactory</connection-factory-jndi-name>
<jms-polling-interval-seconds>20</jms-polling-interval-seconds>
</message-driven-descriptor>
<jndi-name>PaymentProcessor</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


Am i missing something somewhere???
any help in this is highly appreciated..

thanks in advance.

Manoj
 
Manoj Raghuwanshi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved the problem. I thought weblogic will deploy the EJB as soon as it is uploaded to server but you need to start the ejb from admin console.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manoj,

I am having the same problem and I figured that I need to Initialize the MDB explicitly. It keeps showing me that MDB status is "initializing".

When I tried to Resume or Suspend the MDB, it told me "the destination is not available".

It is strange to say that the destination is not available as my producer can submit successfully to the Queue destination and I confirm that by checking the console and seeing that a new message is now in the queue.

Following are the settings on WLS 9.2:
JMS Module :
Name Type JNDI Name Subdeployment Targets
BatchQueue Queue ebp/jms/qd/BatchQueue JMS eBPJMSServer

Here are my MDB deployment descriptor excerpts:
-- ejb-jar.xml


-- weblogic-ejb-jar.xml



Where else can I look given the above ?
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manoj,

I am having the same problem and I figured that I need to Initialize the MDB explicitly. It keeps showing me that MDB status is "initializing".

When I tried to Resume or Suspend the MDB, it told me "the destination is not available".

It is strange to say that the destination is not available as my producer can submit successfully to the Queue destination and I confirm that by checking the console and seeing that a new message is now in the queue.

Following are the settings on WLS 9.2:
JMS Module :
Name Type JNDI Name Subdeployment Targets
BatchQueue Queue ebp/jms/qd/BatchQueue JMS eBPJMSServer

Here are my MDB deployment descriptor excerpts:
-- ejb-jar.xml


-- weblogic-ejb-jar.xml



Where else can I look given the above ?
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I realize this must be quite late, but just in case nobody ever got a work around for this, this is how we figured it out here.

On WLS9.2 you need to create the JMS store / server / queues while the server still does not have any application that is trying to consume these resources. Meaning, you should create all your JMS stuff on the server, do a restart to ensure freshness of the configuration, then deploy your EAR/WAR/JARs that consume the JMS resources.

Note : It was quite a while back but just remembered to update this post when someone asked me from another team.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic