running gcj compiled jboss client

Ryan Boder icanoop@bitwiser.org
Thu Aug 7 02:21:00 GMT 2003


Hi,

I was able to compile my jboss client with gcj as well as the jboss-j2ee.jar
that the client needs. The first thing it does is create an InitialContext
and then gets a remote object reference from it. The problem is that with
Suns java it works but with gcj a NamingException is thrown when I try to do
anything with the InitialContext. Is this a bug or am I doing something
wrong. Here is a code snippet to show what I mean. The NamingException is
thrown when I try to either lookup the home interface or even just list the
bindings as shown (using gcj 3.2.2 from RedHat 9)...

        // Get an initial context based on the jndi properties.
        InitialContext jndi = null;
        try {
            jndi = new InitialContext(properties);
        } catch (NamingException e) {
            System.out.println("NamingException getting Initial Context: " +
e.getMessage());
            return;
        }
        
        // Get a remote home reference.
        ScheduleRemoteHome home = null;
        try {
            NamingEnumeration enum = jndi.listBindings("");
            System.out.println(enum.toString());
            //Object o = jndi.lookup("ScheduleEJB");
            //home = (ScheduleRemoteHome) PortableRemoteObject.narrow(o,
ScheduleRemoteHome.class);
            //home = (ScheduleRemoteHome) o;
        } catch (NamingException e) {
	    // THIS ALWAYS HAPPENS WITH GCJ, but not Sun
            System.out.println("NamingException Getting Home");
            return;
        }

-- 
Ryan Boder
http://www.bitwiser.org/icanoop



More information about the Java mailing list