?
Solved

package com.ibm.jvm.util.html does not exist

Posted on 2007-10-14
3
Medium Priority
?
1,451 Views
Last Modified: 2013-11-23
i am trying to compile this:

import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.ibm.jvm.util.html.Text;

public class QueueReceiveSynchronous
{
      public static void main(String[] args)
      {
            try
            {
                  // create a JNDI context
                  Hashtable properties = new Hashtable();
                  properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.exolab.jms.jndi.InitialContextFactory");
                  properties.put(Context.PROVIDER_URL,"rmi://localhost:1099/");
                  Context context = new InitialContext(properties);
                  
                  // retrieve queue connection factory
                  QueueConnectionFactory queueConnectionFactory =
                              (QueueConnectionFactory)context.lookup("JmsQueueConnectionFactory");
                  
                  // create a queue connection
                  QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
                  
                  // start delivery of incoming messages
                  queueConnection.start();
                  
                  // create a queue session
                  // set transactions to false and set auto acknowledgement of receipt of messages
                  QueueSession queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
                  
                  // retrieve queue
                  Queue queue = (Queue)context.lookup("queue1");
                  
                  // create a queue receiver and associate to the retrieved queue
                  QueueReceiver queueReceiver = queueSession.createReceiver(queue);
                  
                  // receive message using the synchronous receive method
                  Message message = queueReceiver.receive();
                  String messageText = null;
                  if (message instanceof TextMessage)
                        messageText = ((TextMessage)message).getText();
                  System.out.println(messageText);
                  
                  // clean up
                  queueReceiver.close();
                  queueSession.close();
                  queueConnection.close();
                                    
                  
            }
            catch (NamingException e)
            {
                  e.printStackTrace();
            }
            catch (JMSException e)
            {
                  e.printStackTrace();
            }
            
      }
}

C:\Projects\Leader\prototype\jms\openjms2>javac *.java
QueueReceiveSynchronous.java:17: package com.ibm.jvm.util.html does not exist
import com.ibm.jvm.util.html.Text;

does anyone know where to get this package?
0
Comment
Question by:mmingfeilam
  • 2
3 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 20086388
Are you using IBM's JVM to compile this code?

Michael
0
 

Author Comment

by:mmingfeilam
ID: 20087208
no, maybe that's why it's doesn't have that package?
0
 
LVL 5

Accepted Solution

by:
msmolyak earned 750 total points
ID: 20087553
If you are developing a client running against IBM server you may have to use their JVM. It comes with their development tools such as RAD. You can try to obtain it separately from http://www.ibm.com/developerworks/java/jdk/.

Before doing this, though, try to understand why you need this package. Your code looks like standard JMS code for receiving messages. Why does it need an IBM-specific class?

Michael
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Starting up a Project
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question