DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    InitialContext - Newbe question

    Hello guys and girls!

    I'm working on some fairly easy school project, but I just can't figure out an error message.

    The whole thing is to connect to an server and get some message (string).

    When trying to compile in JCreator I got:

    H:\java\inl4\klient\inl4client.java:23: cannot find symbol
    symbol : constructor InitialContext(java.util.Properties)
    location: class javax.naming.InitialContext
    Context initial = new InitialContext(p);


    Why??

    The code is:
    import javax.naming.*;
    import javax.rmi.*;
    import javax.ejb.*;
    import java.util.Properties;
    import inl4.*;

    public class inl4client
    {
    public static void main(String[] args)
    {


    Properties p =new Properties();

    p.put(Context.INITIAL_CONTEXT_FACTORY,"com.caucho.burlap.BurlapContextFactory");
    p.put(Context.PROVIDER_URL,"http://iago.eki.mdh.se:8080/inl4r/burlap");

    Inl4remoteHome home=null;
    Inl4remote remote=null;

    try {

    Context initial = new InitialContext(p);
    Object ref=initial.lookup("inl4r");
    home =(Inl4remoteHome)PortableRemoteObject.narrow(
    ref,Inl4remoteHome.class);

    remote=home.create("sometext");

    String password = remote.getPassword();

    System.out.println(password);

    }
    catch (Exception e) { e.printStackTrace();

    }


    }
    }

  2. #2
    Join Date
    May 2004
    Posts
    219
    InitialContext doesn't have a constructor that takes a Properties object.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links