users@glassfish.java.net

issue with application client on distant computer

From: <forums_at_java.net>
Date: Wed, 1 Feb 2012 09:34:04 -0600 (CST)

Hi,

At first, sorry for my English and my low knowledge in EJB and RMI.
I’m new to EJB technologies but I’d like to use them for further
projects. So I tried to execute a classical hello world scenario involving an
application client and an EJB module. The application client access remotely
to my EJB module using injection (@EJB) and I distribute this client to end
user using java web start.

*My issue:*

When I launch the client from browser on the glassfish host, all is working:
my client access the EJB module and send me back the good result.

When I launch the client from browser on another local network’s computer,
I can download the client, I got the validation for execution screen, but
after that nothing’s happen. The javaw corresponding thread is still in
thread’s pool and I can wait lot of time without any change. So no error
message on client neither in glassfish logs.

When I launch another application client without distant EJB connection it
works fine on distant computer.

*My sources*
*Remote interface*

[code]
import javax.ejb.Remote;
@Remote
public interface ServiceBeanRemote {
    String service1();
    String service2();
}[/code]

*EJB module*

[code]import javax.ejb.Stateless;

@Stateless
public class ServiceBean implements ServiceBeanRemote {
    @Override
    public String service1() {
        return "service 1";
    }
    @Override
    public String service2() {
        return "service 2";
    }
}
[/code]

*Application client that bug on distant computers*
[code]//... several imports
import javax.ejb.EJB;
import service.ServiceBeanRemote;
public class Main {
    @EJB
    private static ServiceBeanRemote serviceBean;
    public static void main(String[] args) {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(new JTextField(serviceBean.service1()),
BorderLayout.CENTER);
        f.setSize(400,400);
        f.setVisible(true);
    }
}[/code]

*Application client that works*
[code]import javax.swing.JOptionPane;
public class Main {
    public static void main(String[] args) {
        JOptionPane.showMessageDialog(null, "Hi dude !");
    }
}[/code]

*My environment : *
Server one: windows 7 32bits – netbeans 7.1 + glassfish 3.1.1 – java 7 u2
Server two: windows 7 64bits – netbeans 7.1 + glassfish 3.1.1 – java 6
u25
Client 1 : windows 7 64bits – java 7 u2
Client 2 : windows XP 32bits – java 7 u2

I shut down all firewalls on my computers, and I tried on 2 differents
clients. I set two glassfish servers on two differents systems and I get the
same issue.
 


--
[Message sent by forum member 'paul_lautner']
View Post: http://forums.java.net/node/883201