• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to compile the EJB client codes at the remote JVM?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Folks,

I am new to EJB.
I read some simple examples about EJB.
I am confused how to compile codes on client site.
For example: the following is EJB client code.


import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import examples.*;


public class SessionTest {

TestSessionBeanHome testSessionBean;

public void main() throws Exception{
//Look up home interface
try {
InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("TestSessionBean");
testSessionBean = (TestSessionBeanHome)PortableRemoteObject.narrow(objref,

TestSessionBeanHome.class);
} catch (Exception NamingException) {
NamingException.printStackTrace();
}

}


in this code I need to compile with TestSessionBeanHome.java using javac. but this file is on remote site, different physical machine. How can I get TestSessionBeanHome.java file? It doesn't make sense I need to copy one from server site.

If it is in the same JVM (local), I know just do

import examples.TestSessionBeanHome;

Please help. Thank you very much.

Chaohua
 
author
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The EJB interfaces (home and remote) needs to be packaged on the client side

-Debu
 
chaohua wang
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Debu,

Thank you very much for your response.
But Do I need to manually to copy Home and Remote object to client site?
there is anyway to generate client stub, which contains Home and Remote object?

I used Webservice. I know the client site of webservice can generate server site objects from published service using wscompile (a Compiler).

Chaohua
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic