[Beginners Corner] - Re: Load Library problem
by PeterJ
How are you starting the app server? Are you trying to run it on os startup using a script in /etc/init.d? Or are your running it manually from a terminal.
If you are running it manually from a terminal, at the terminal, enter this:
echo $JAVA_HOME
If you do this, you should see:
/usr/java/jdk1.5.0_16
If you do not, then JAVA_HOME is not set properly.
Based on the starting part of the console log you posted:
tgcosta wrote : =========================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: /usr/jboss/jboss-4.2.2.GA
|
| JAVA: java
JAVA_HOME is not set properly. You should instead see:
tgcosta wrote : =========================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: /usr/jboss/jboss-4.2.2.GA
|
| JAVA: /usr/java/jdk1.5.0_16/bin/java
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165185#4165185
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165185
17 years, 11 months
[Messaging, JMS & JBossMQ] - check if message is in queue
by argol1278
hi all
My message driven bean can't reciver message and i wont to check where i made mistake in sending or in MDB
1) i am sending message form stateless bean could be there problem?
2) i must set this method setMessageListener() could it be constructor?
----------------------------------------
| InitialContext ctx = new InitialContext();
| QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
|
| Queue que = (Queue)ctx.lookup("queue/A");
|
|
| QueueConnection connection = factory.createQueueConnection();
|
|
| QueueSession session = connection.createQueueSession(false, javax.jms.QueueSession.AUTO_ACKNOWLEDGE);
|
| MessageProducer producer = session.createProducer(que);
|
|
| MapMessage mapMsg = session.createMapMessage();
| mapMsg.setString("subject", subject);
| mapMsg.setString("content", content);
| mapMsg.setString("mimi", mime);
| mapMsg.setString("mailTo", mailTo);
|
| System.out.println("EJB");
|
| producer.send(mapMsg);
|
|
--------------------------------------------
***********************************
***********************************
-----------------------------------------------
| @MessageDriven(activationConfig =
| {
| @ActivationConfigProperty(propertyName="destinationType",
| propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination",
| propertyValue="queue/A")
| })
| public class NotificationJms implements MessageListener {
|
| public NotificationJms() {
|
| try{
|
| System.out.println("JMS KONSTRUKTOR");
|
| InitialContext ctx = new InitialContext();
| QueueConnectionFactory factory =
| (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
| Queue que = (Queue)ctx.lookup("queue/A");
|
|
| QueueSession session = connection.createQueueSession(false, javax.jms.QueueSession.AUTO_ACKNOWLEDGE);
|
| MessageConsumer cons = session.createConsumer(que);
| cons.setMessageListener(this);
|
| connection.start();
|
|
| }catch(NamingException e){} catch (JMSException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
|
|
|
| public void onMessage(Message message) {
|
| System.out.println("JMS onMessage METODA");
|
| MapMessage mapMsg = (MapMessage)message;
| try {
|
|
| System.out.println(mapMsg.getStringProperty("subject")+
| mapMsg.getStringProperty("content")+
| mapMsg.getStringProperty("mimi")+
| mapMsg.getStringProperty("mailTo"));
|
| } catch (JMSException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165183#4165183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165183
17 years, 11 months