fastdev in atlassian sdk 4.1

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 20, 2012

Fastdev in atlassian sdk 4.1 has changed.
When shift-reloading the browser, fastdev triggers a build, but in my case, doesn't install the modified plugin. With atlassian SDK 4.0 it was working fine, so I'm wondering what changed and if we need to configure our environment differently.

9 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 27, 2012

In 4.1 fastdev by default now uses the maven CLI and the pi command.

It should work in most cases. If it's not giving you an actual error, try running atlas-cli and then pi from the commandline and see if it installs properly.

If it simply won't work, you can revert to the "old" fastdev deploy by adding: <useFastdevCli>false</useFastdevCli> to your amps configuration in your pom.

David Jellison November 27, 2012

Thank you Jonathan. Using <useFastdevCli>false</useFastdevCli> in the amp confituration section of the pom works for me. The atlas-cli command is not recognizable for me, so perhaps there is a setup step or configuration change I am missing to use maven CLI and pi.

I used the 4.1 windows installer. Running atlas-version results in:

ATLAS Version:    4.1
ATLAS Home:       C:\atlassian-plugin-sdk
ATLAS Scripts:    C:\atlassian-plugin-sdk\bin
ATLAS Maven Home: C:\atlassian-plugin-sdk\apache-maven
--------
Executing: "C:\atlassian-plugin-sdk\apache-maven\bin\mvn.bat" --version
Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
Java version: 1.6.0_34
Java home: c:\Program Files\Java\jdk1.6.0_34\jre
Default locale: en_US, platform encoding: Cp1252

I'll run with the Fastdev CLi option off for now.

1 vote
Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2012

Same problem here. Cli does not work even for just generated plugin. Did I miss some necessary configuration to get cli work? I'm looking forward for fast fastdev, so I would like to get it work rather to fall back to old slow one :-)

Thanks for any advice

Here is stack trace when I run atlas-cli

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to execute mojo
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute mojo
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojoImpl(MojoExecutor.java:122)
        at org.twdata.maven.mojoexecutor.MojoExecutor$ExecutionEnvironmentM2.executeMojo(MojoExecutor.java:403)
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo(MojoExecutor.java:74)
        at com.atlassian.maven.plugins.ampsdispatcher.AbstractAmpsDispatcherMojo.execute(AbstractAmpsDispatcherMojo.java:65)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
        ... 16 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute mojo
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojoImpl(MojoExecutor.java:122)
        at org.twdata.maven.mojoexecutor.MojoExecutor$ExecutionEnvironmentM2.executeMojo(MojoExecutor.java:403)
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo(MojoExecutor.java:74)
        at com.atlassian.maven.plugins.amps.MavenGoals.startCli(MavenGoals.java:175)
        at com.atlassian.maven.plugins.amps.cli.CliMojo.execute(CliMojo.java:18)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojoImpl(MojoExecutor.java:120)
        ... 21 more
Caused by: java.lang.NullPointerException
        at org.twdata.maven.cli.AbstractCliMojo.openSocket(AbstractCliMojo.java:152)
        at org.twdata.maven.cli.AbstractCliMojo.displaySocketCliShell(AbstractCliMojo.java:138)
        at org.twdata.maven.cli.AbstractCliMojo.execute(AbstractCliMojo.java:80)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojoImpl(MojoExecutor.java:120)
        ... 27 more

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2012

This seems to be a problem with the CLI opening a socket. Do you have a firewall running? Also, do you have any ports blocked?

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 28, 2012

In my case, I'm running on localhost. There is a firewall on my machine, but it's not blocking local connections.

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2012

I'm running Jira also on localhost. Anyway, I also run apache on port 80, 443 and 10081 locally, could that be the issue? What port is used when CLI tries to open socket?

Thanks.

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2012

By default the CLI tries to open a socket listener on port 4330

If that port is already in use, the CLI will try to open a port using 0 which tells java to pick any available port.

That being said, if port 4330 is NOT already in use, but for some reason can't be opened, it will fail.

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2012

if you start atlas-cli BEFORE ever running FastDev, it should work as FastDev is smart enough to pick a different port.

atlas-cli is not that smart and just uses the default port unless you do:

atlas-cli -Dhttp.port=[some other port]

David Jellison November 29, 2012

This looks like the same behavior I was seeing.

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2012

Hi there,

I have discovered few new things. The error "unable to execute mojo" appears when I try to run atlas-cli when app is running with cli fastdev. When I run the app with disabled fastdev cli, atlas-cli works like a charm. So that is not the issue why cli fastdev does not work for me, I belive it's just conflict of two CLIs above one app.

Anyway, when I try to reload plugin in fastdev for the first time after jira starts cli actually starts, but it stays here:

[INFO] [talledLocalContainer] [INFO] [amps-dispatcher:cli]
[INFO] [talledLocalContainer] [INFO] [jira:cli {execution: virtual-execution}]
[INFO] [talledLocalContainer] [INFO] [cli:execute]
[INFO] [talledLocalContainer] [INFO] Opening port 4330 for socket cli access
[INFO] [talledLocalContainer] [INFO] Waiting for commands...

No matter how time I wait, fastdev stays waiting for commands.

Any clue why that happends?

Thanks.

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2012

Jan, what happens if you navigate away, make another change, and then do FastDev again? e.g. does it work the second time?

Also, are you using shift-reload or are you using the fastdev button in the dev toolbar? Does it make a difference?

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2012

and here is some screenshot...

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2012

When I press shift + reload it jumps to waiting for commands right away. I can't press the button, it's disabled even after reload.

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2012

Hi,

is there anybody who is facing or solved the same problem? I really do not know where is problem. Thanks.

0 votes
Royce Wong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2015
0 votes
Evan Bollig July 11, 2014

Found this same problem on OSX 10.9.4, AMPS 5.0.3 (Confluence 5.5.3).

To fix:

  1. Append /usr/share/atlassian-plugin-sdk-5.0.3/apache-maven-3.2.1/bin/ to the path (so FASTDEV is using the right "mvn" command)
  2. Add
    &lt;useFastdevCli&gt;false&lt;/useFastdevCli&gt;

    to the AMPS configuration.

0 votes
Andrew Moe April 16, 2013

Have you tried the useFastdevCli false setting mentioned above? That's what fixed it for me.

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2013

Is eveyone that's having this issue running Windows?

leonizm April 16, 2013

I'm experiencing this issue both on my mac OS X 10.6.8 and window 7 (64bit) machines.

brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2013

Are any of you going to be at AtlasCamp this year?

If so, please let me know so we can meet up and try to resolve this.

I can't re-create it no matter what I try.

I am going to fix the NPE when you try to start atlas-cli AFTER fastdev cli in the next amps release though.

0 votes
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013

We've had quite a few reports of this problem and still don't quite understand the root cause. I've created https://ecosystem.atlassian.net/browse/AMPS-940 to investigate.

0 votes
Andrew Moe February 17, 2013

I have the same problem - I fixed using by adding <useFastdevCli>false</useFastdevCli>

as suggested above.

leonizm April 16, 2013

Anyone figured out a solution for this problem because I'm still seeing this issue even sdk 4.1.7.

0 votes
NikitaM December 4, 2012

Same problem : (

0 votes
David Jellison November 26, 2012

Did you figure out this problem? I have the same issue.

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 26, 2012

My solution was to rollback to SDK 4.0 ... I didn't check if there is a new version yet, nor if this is a bug or a misconfiguration.

It's too bad, cause 4.1 has support for test-resources connected to a mysql, something we absolutely need.

Jan Prokeš
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2012

There is no need for rollback to sdk 4 if you have problem just with cli fastdev. Just put this into your poms properties:

<useFastdevCli>false</useFastdevCli>

After that rerun your app and you'll be fine, at least I am.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events