First a little background:
I'm working on an enterprise application (ear) with an EJB module & an Application Client module. I also use hibernate JPA for persistence, and swingx for GUI. Those are the only third parties atm. This application is deployed on Glassfish.
Everything was going well until I deployed my application for the first time and tried starting it by Java Web Start. I've hit major road blockers - JWS doesn't like hibernate3.jar, complains it's not signed, although it is. I've described the problem here if you're interested. Anyway it might be related to this unresolved bug in JVM. There are other things I don't like about JWS but that doesn't matter now.
Current approaches
Given this problem I thought I'd deploy the application myself (I plan to write some kind of auto-updater to keep everything synchronized). So I followed the instructions from here and everything was cool, except the fact that the application container I need to deploy to the client is around 40 MB!!!. That's way too much!
Ok, so I said I'll drop the application container, create a standalone client do the EJB lookup through JNDI and include only the minimum.
And here I'm stuck!
This is the JNDI lookup I use:
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
prop.put("org.omg.CORBA.ORBInitialHost", "bogdan-pc");
prop.put("org.omg.CORBA.ORBInitialPort", "3700");
try {
InitialContext ctx = new InitialContext(prop);
DatabaseCacheEJBRemote service = (DatabaseCacheEJBRemote) ctx.lookup("ejbs.DatabaseCacheEJBRemote");
System.out.println("count: " + service.getProductionCount());
} catch (NamingException ex) {
Logger.getLogger(MyFrame.class.getName()).log(Level.SEVERE, null, ex);
}
1) I thought that if I include appserv-rt.jar & javaee.jar should be enough. Apparently I need other stuff from GF... The question would be what is the bare minimum I need to deploy to the client to get EJB's lookup working?
2) Why do I need to include all the ejb-module dependencies (like hibernate libraries)?. I'm not using anywhere in my client stuff from hibernate...
Thanks for reading this long post!
EDIT:
Some details about my environment:
- Java 1.6.0_21
- GF 3.0.1
- Windows(XP/2003/7)