First, a little background :
I am working on an enterprise application (ear) with an EJB module and Application Client module. I also use hibernate JPA for persistence and swingx for the GUI. These are the only third parties. This application is deployed to Glassfish.
Everything went fine until I deployed my application for the first time and started to launch it using Java Web Start. I got into the main road blockers - JWS does not like hibernate3.jar, complains that it is not signed, although this is so. I described the problem here if you are interested. In any case, this may be due to this unresolved error in the JVM. There are other things that I don't like about JWS, but that doesn't matter now.
Modern approaches
Given this problem, I thought that I was deploying the application myself (I plan to write some kind of auto-update so that everything synchronizes). Therefore, I followed the instructions here , and everything was cool, except that the application container that I need to deploy for the client is about 40 MB !!! . It's too much!
Okay, so I said that I would close the application container by creating a standalone client, doing an EJB search through JNDI and turning on only the minimum.
And here I am stuck!
This is the JNDI search I am using:
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 turn on appserv-rt.jar and javaee.jar, that should be enough. Apparently, I need other things from GF ... The question is, what is the minimum minimum I need to deploy to the client in order to get the EJB job?
2) Why do I need to include all the dependencies of the ejb module (for example, sleep mode libraries) ?. I do not use anywhere in my client from hibernate ...
Thanks for reading this long post!
EDIT:
Some information about my environment:
- Java 1.6.0_21
- Gf 3.0.1
- Windows (XP / 2003/7)
source share