how to deploy a mdb on jboss?
yjyang Apr 18, 2003 4:51 AMwho can tell me how to deploy a mdb on jboss?
what do i need to do?
which files do i need except jboss.xml and ejb-jar.xml?
Do i need to modify jbossmq-service and jbossmq-destination-service?
i have deploy a mdb on jboss,but when i run its client,it tell me the error:
JMS_example-client:
[java] javax.naming.NameNotFoundException: QueueConnectionFactory not bound
jboss.xml:
JBoss JavaMail Sample Application
<display-name>Mailer EJB</display-name>
<enterprise-beans>
<display-name>MessageTester</display-name>
<ejb-name>MessageTester</ejb-name>
<resource-ref>
<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
<destination-jndi-name>queue/QueueConnectionFactory</destination-jndi-name>
<jndi-name>QueueConnectionFactory</jndi-name>
</resource-ref>
<!--resource-managers>
<resource-manager>
<res-name>queue</res-name>
<res-jndi-name>QueueConnectionFactory</res-jndi-name>
</resource-manager>
</resource-managers-->
client.java:
package JMS_example;
import javax.jms.*;
import java.io.*;
import java.net.*;
import javax.naming.*;
public class MsgListener {
private static final String QUEUE_CONN_FACTORY =
"QueueConnectionFactory";
private static final String QUEUE = "jms/Queue";
public static void main(String[] args) {
Context initCtx;
QueueConnectionFactory factory;
Queue queue;
QueueConnection conn;
QueueSession session;
QueueReceiver receiver;
TextMessage request;
try {
//Obtain an initial context
initCtx = new InitialContext();
//Lookup Connection Factory and Queue name
factory = (QueueConnectionFactory)
initCtx.lookup(QUEUE_CONN_FACTORY);
queue = (Queue) initCtx.lookup(QUEUE);
//Create and start a Queue connection using the Factory
conn = (QueueConnection)factory.createQueueConnection();
conn.start();
//Open a Queue session on this connection
session = conn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
//Create a listener to receive messages from the Queue
receiver = session.createReceiver(queue);
//Send every message received to Standard Out
while (true) {
request = (TextMessage) receiver.receive();
System.out.println("Message Received: " + request.getText());
}
} catch (NamingException ne) {
ne.printStackTrace();
} catch (JMSException jms) {
jms.printStackTrace();
}
}
}
Please help me to find the error or give me an example about the problems.Thanks