This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
running gcj compiled jboss client
- From: Ryan Boder <icanoop at bitwiser dot org>
- To: java at gcc dot gnu dot org
- Date: Wed, 6 Aug 2003 22:21:37 -0400
- Subject: running gcj compiled jboss client
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