development environment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

development environment

Edgar Poce
Hi,

 I'd like to know what's the recommended environment configuration to
develop sling applications. I'm playing with sling and I don't need to
use a debugger to write and run scripts, but I'd like to use a
debugger to develop sling servlets. For the moment I'm running sling's
launchpad webapp inside eclipse with the jetty plugin but I wanted to
know whether there's a better configuration, I find my configuration a
little hard because it doesn't allow code replacement and I have to
reinstall my bundle if there's any code change.

Thanks in advance,
Edgar

Reply | Threaded
Open this post in threaded view
|

Re: development environment

Bertrand Delacretaz
Hi Edgar,

On Tue, Mar 18, 2008 at 6:01 PM, Edgar Poce <[hidden email]> wrote:
> ...  I'd like to know what's the recommended environment configuration to
>  develop sling applications. I'm playing with sling and I don't need to
>  use a debugger to write and run scripts, but I'd like to use a
>  debugger to develop sling servlets....

I'm not a fan of doing too much in IDEs, so the way I work is:

-Start the launchpad using mvn jetty:run, with
MAVEN_OPTS="-Dcom.sun.management.jmxremote -Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,address=30303,server=y,suspend=n" to
enable remote debugging

-Use Eclipse as the remote debugger

-After code changes, update the bundles using "mvn -P
autoInstallBundle install" which loads the updated bundle in Sling.

The debugger might get confused by the autoInstallBundle, sometimes
quickly disconnecting and reconnecting it helps.

There's probably a more integrated way of working with Eclipse, but
the above works fine for me.

-Bertrand

Reply | Threaded
Open this post in threaded view
|

Re: development environment

Felix Meschberger-2
Hi Edgar,

Am Dienstag, den 18.03.2008, 18:11 +0100 schrieb Bertrand Delacretaz:

> Hi Edgar,
>
> On Tue, Mar 18, 2008 at 6:01 PM, Edgar Poce <[hidden email]> wrote:
> > ...  I'd like to know what's the recommended environment configuration to
> >  develop sling applications. I'm playing with sling and I don't need to
> >  use a debugger to write and run scripts, but I'd like to use a
> >  debugger to develop sling servlets....
>
> I'm not a fan of doing too much in IDEs, so the way I work is:
>
> -Start the launchpad using mvn jetty:run, with
> MAVEN_OPTS="-Dcom.sun.management.jmxremote -Xdebug -Xnoagent
> -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,address=30303,server=y,suspend=n" to
> enable remote debugging

And I am not the best fan of mvn jetty:run, because launchpad/app is a
standalone application which you may use as :

java -Xdebug -Xnoagent -Djava.compiler=NONE \
    -Xrunjdwp:transport=dt_socket,address=30303,server=y,suspend=n \
    -Dorg.apache.sling.osgi.log.file= \
    target/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar \
    -p serverPort

You get the log messages to the console. To get them to the
logs/error.log file just omit the org.apache.sling.osgi.log.file
setting.

>
> -Use Eclipse as the remote debugger
>
> -After code changes, update the bundles using "mvn -P
> autoInstallBundle install" which loads the updated bundle in Sling.
>
> The debugger might get confused by the autoInstallBundle, sometimes
> quickly disconnecting and reconnecting it helps.
>
> There's probably a more integrated way of working with Eclipse, but
> the above works fine for me.

Of course you might want to use the CRX Feature for Eclipse from
http://www.day.com/eclipse/ which I heavily use to access the repository
from within Eclipse.

Added SLING-338 [1] to keep track of adding this information to the
site.

Regards
Felix

[1] http://issues.apache.org/jira/browse/SLING-338