Well, that depends on your IDE and your app server, and unfortunately
I use Intellij and JBoss.

In JBoss the magic command is:

set JAVA_OPTS=-Xdebug -
Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS
%

which is in the JBoss startup script. I then set up a debug session
within IDEA that starts up JBoss inside IDEA and connects to it for
debugging purposes on port 8787 (IDEA conveniently knows how to do
this). Then I start the GWT module in hosted mode also in debug. As a
result the whole stack is running in debug and break points can be set
anywhere.

It looks like you can do a very similar thing with netbeans/glassfish:

http://weblogs.java.net/blog/arungupta/archive/2007/06/debug_applicati.html

I think you actually end up with two separate debug sessions, one for
your GWT app in hosted mode, and a second remote debug session for
what you have deployed on the app server. However this makes no
practical difference to debugging - GWT calls your server as per
normal and execution will halt at break points wherever they are in
the stack.

regards
gregor


On Dec 14, 3:27 pm, Bandesz <band...@blog.hu> wrote:
> Thx for the answer, but I need an exact howto, how can I debug the
> whole J2EE application with Hosted Mode using Glassfish and Netbeans.
>
> As I said, I searched a lot and haven't found a good description.
>
> Bandesz
>
> On Dec 8, 4:34 am, gregor <greg.power...@googlemail.com> wrote:
>
> > couple of approaches
>
> > 1) Simply use -noserver option. You need a build script to deploy your
> > RPC servlets and your EJB layer to Glassfish on demand and activate
> > remote debugging to make this work effectively, but lots of people do
> > it this way. See
>
> >http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...
>
> > 2) You can run your RPC servlets in hosted mode Tomcat instance
> > leaving your session beans on Glassfish with a bit more work. You need
> > to use trad JNDI to try for a local reference to your session beans,
> > and if that fails go for the remote reference instead. I don't think
> > the new annotation stuff works for this.That way you get a local ref
> > in production and a remote one in dev from the same code. If you use
> > the ServiceLocator pattern it makes this easier.
>
> > On Dec 7, 2:26 pm,Bandesz<band...@blog.hu> wrote:
>
> > > I'm developing a J2EE application with GWT using NetBeans 6.5,
> > > Glassfish v2.
>
> > > If I debugging only the web project, I can't use any Session Beans
> > > from EJB project, becase I get "Cannot resolve reference Unresolved
> > > Ejb-Ref..." error. I tried in every way to make <ejb-local-ref> tags
> > > in web.xml (or in ejb-jar.xml), but the error stays. (I see now that
> > > it's a dead end)
>
> > > If I debugging the enterpise project, everythings works except the
> > > hosted mode.
>
> > > I searched a lot, but I can't make this work, please help.
>
> > > Thanks,
> > >  Bandesz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to