F
Flex
Why , When I run this code :
public class SendMessage {
static String jndi_url ="file:///tmp";
static String Topic_loockup_name = "TopicMsg" ;
Hashtable env ;
public void init () {
env = new Hashtable() ;
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, jndi_url) ;
}
public void SendMessage(int tipo, double Id,double x,double y,double sRay) {
//String topicName ;
TopicConnectionFactory topicConnectionFactory = null ;
TopicConnection topicConnection = null ;
TopicSession topicSession = null ;
TopicPublisher topicPublisher = null ;
Topic topic = null ;
Context jndiCtx = null ;
DataMessage dataMessage ;
/* Creates a new instance of datamsg */
try {
// Create the initial context and lookup
jndiCtx = new InitialContext(env);
topicConnectionFactory =
(TopicConnectionFactory)jndiCtx.lookup("TopicConnectionFactory") ;
I view this error message ?
The exception details:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
Had I to set some other ?
P.S. I use Sun IMQ server
public class SendMessage {
static String jndi_url ="file:///tmp";
static String Topic_loockup_name = "TopicMsg" ;
Hashtable env ;
public void init () {
env = new Hashtable() ;
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, jndi_url) ;
}
public void SendMessage(int tipo, double Id,double x,double y,double sRay) {
//String topicName ;
TopicConnectionFactory topicConnectionFactory = null ;
TopicConnection topicConnection = null ;
TopicSession topicSession = null ;
TopicPublisher topicPublisher = null ;
Topic topic = null ;
Context jndiCtx = null ;
DataMessage dataMessage ;
/* Creates a new instance of datamsg */
try {
// Create the initial context and lookup
jndiCtx = new InitialContext(env);
topicConnectionFactory =
(TopicConnectionFactory)jndiCtx.lookup("TopicConnectionFactory") ;
I view this error message ?
The exception details:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
Had I to set some other ?
P.S. I use Sun IMQ server