> I'm afraid you'll still have 2 java processes.
> One for the client, one for the server... In fact, the GWTShell plays the
> role of the browser.
>
Exactly so - what I do is start JBoss in remote debug from within IDEA
(debug session 1), then start GWT hosted mode in debug, also in IDEA
(debug session 2). IDEA just switches between them as you step through
break points, I guess that netbeans would do the same. Yes, the dev
shell is just playing the browser.
In my option 2 above you also use two debug sessions like this, but
the difference is that here the GWT debug session includes the GWT RPC
servlet layer. I've found this is useful if you have, say, a session
facade of EJB session beans, independently tested and stable, because
you can simply restart the GWT dev shell in debug while working on the
RPC servlet layer without redeploying the whole ear to the remote
server all the time, but you can still have the second remote debug
session on the remote server to step through EJB code etc if required
This is example of how I did this for connecting a GWT app to
jackrabbit running as a RAR on JBoss - it works for both GWT hosted
mode (using RMI to jump from hosted mode Tomcat to jackrabbit on
JBoss) and deployed. You can use the same trick for session beans (or
I guess any Java EE resource) using local/remote interfaces, and
probably Spring as well, but I haven't tried that. Of course, if you
have a lot of such resources, this code gets tedious, which is where
the ServiceLocator pattern comes in....
Properties jndiprops = new Properties();
jndiprops.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
jndiprops.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
jndiprops.put(Context.PROVIDER_URL, "jnp://localhost:
1099");
InitialContext ctx = new InitialContext(jndiprops);
// try for JNDI same VM
try {
log.info("Looking for local JCA jackrabbit
connection.....");
repos = (Repository) ctx.lookup("java:jcr/local");
log.info("Local JCA jackrabbit connection found.");
} catch (NamingException e) {
log.info("Failed getting JCR on local JNDI, trying
RMI....");
}
// so try RMI (for GWT hosted mode)
if(repos==null) {
ClientAdapterFactory adapter = new ClientAdapterFactory
();
RemoteRepository rr = (RemoteRepository) ctx.lookup
("jnp://localhost:1099/jcrServer");
repos = adapter.getRepository(rr);
if (repos!=null) {
log.info("Obtained jcr over RMI....");
} else {
log.error("Fatal error: Unable to obtain local or
RMI jcr connection - stopping....");
throw new Exception("JCR ( Jackrabbit)
Unavailable");
}
}
> I'don't see how it could be possible to embed the GWTShell process in the
> J2EE one.
>
> Regards,
>
> 2008/12/14 gregor <
greg.power...@googlemail.com>