Run PLay Framework 2.x in IntelliJ IDEA using SBT task auto stop server - intellij-idea

I try to run Play project in IntelliJ IDEA. i follow this document.
this is my config. api is my sub project
But when I hit run icon, my service start successful and immediately AkkaHttpServer - Stopping server. then I type api/run in sbt shell, my service start successful and work normally. this issue only happen when I check User sbt shell in config
this is my log in sbt shell
"C:\Program Files\Java\jdk1.8.0_251\bin\java.exe" -server -Xmx1536M -Dsbt.supershell=false -Didea.managed=true -Dfile.encoding=UTF-8 -Dsbt.version=1.3.8 -Dsbt.log.noformat=true -jar C:\Users\LAP13556-local\AppData\Roaming\JetBrains\IntelliJIdea2020.1\plugins\Scala\launcher\sbt-launch.jar early(addPluginSbtFile=\"\"\"C:\Users\LAP13556-local\AppData\Local\Temp\idea979.sbt\"\"\") "; set ideaPort in Global := 51722 ; idea-shell"
[info] Loading global plugins from C:\Users\LAP13556-local\.sbt\1.0\plugins
[info] Loading settings for project crm-server-build from plugins.sbt,idea979.sbt ...
[info] Loading project definition from C:\Users\...\crm-server\project
[info] Loading settings for project crm-server from build.sbt ...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[info] Defining Global / ideaPort
[info] The new value will be used by Compile / compile, Test / compile and 3 others.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[IJ]sbt:crm-server> api/run
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
[info] p.c.s.AkkaHttpServer - Stopping server...
[success] Total time: 26 s, completed Jul 31, 2020 9:26:28 AM
[IJ]sbt:crm-server> api/run // I type this command
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
Can anyone tell me the reason. Thank you.

Related

Automation test report issues with JENKINS/MAVEN/ECLIPSE

I am facing issues while generating reports after successful build using maven in jenkins.
First, I have created java code into my local machine using eclipse.
Second, After creating the code I converted it to the Maven and completed all required setup of pom.xml file inside jenkins using Maven.
Third, I ran the script it gives me the success response.
Below, it is my maven success build result logs.
Started by user jenkin
Building in workspace /var/lib/jenkins/workspace/TestProject
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 35275
[TestProject01] $ java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1/conf/logging jenkins.maven3.agent.Maven35Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven1 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.27.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12.jar 35275
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /home/user/Documents/eclipse-workspace/TestProject01/pom.xml clean install
[INFO] Scanning for projects...
[HUDSON] Collecting dependencies info
[INFO]
[INFO] ------------------< TestProject01:TestProject01 >-------------------
[INFO] Building TestProject01 0.0.1-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TestProject01 ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # TestProject01 ---
[INFO] Installing /home/user/Documents/eclipse-workspace/TestProject01/pom.xml to /var/lib/jenkins/.m2/repository/TestProject01/TestProject01/0.0.1-SNAPSHOT/TestProject01-0.0.1-SNAPSHOT.pom
[WARNING] Attempt to (de-)serialize anonymous class org.jfrog.hudson.maven2.MavenDependenciesRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] BUILD SUCCESS
[INFO] Total time: 2.821 s
[INFO] Finished at: 2019-02-05T19:09:16+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /home/user/Documents/eclipse-workspace/TestProject01/pom.xml to TestProject01/TestProject01/0.0.1-SNAPSHOT/TestProject01-0.0.1-SNAPSHOT.pom
/home/user/Documents/eclipse-workspace/TestProject01/pom.xml is not inside /var/lib/jenkins/workspace/TestProject/home/user/Documents/eclipse-workspace/TestProject01/; will archive in a separate pass
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /home/user/Documents/eclipse-workspace/TestProject01/test-output to /var/lib/jenkins/jobs/TestProject/htmlreports/HTML_20Report
Finished: SUCCESS
Now, The issue is I do not know how can I check if all testcases covered with success. Here, HTML report been generated but it stays the same after every build success which creating lot of confusion.
Please help!!!!!!!!

Not able to execute scripts from Jenkins although working fine locally & via command line

I am Not able to run scripts from Jenkins. How ever working fine from Command line & Local. I am within office network. Getting Below Error. I don't understand why Jenkins is trying to download Maven plugin? I am new to Jenkins. Any suggestion will be appretiated.
[INFO] ------------------------< Test:Junit-Demo >-------------------------
[INFO] Building Junit-Demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.695 s
[INFO] Finished at: 2018-04-11T14:29:52-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.68.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding="UTF-8"
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
Maven, triggered by Jenkins, downloads the maven-clean-plugin as part of its normal execution. This happened on your location machine in the first run and was then cached in ~/.m2/.
Your Jenkins build agent, however, cannot connect to the server from which maven downloads artifacts:
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.68.215] failed: Connection timed out: connect
Make sure that there is no firewall involved blocking these connections or configure Jenkins to use a local artifact repository (like Nexus or Artifactory).
Missing some info to fully know what's wrong.
To use maven in Jenkins you have to install the jenkins maven plugin and call the binary in your Jenkins file.
Did you have to do any maven configuration for your local set up?
ie inside ~/.m2 is usually where you would set up your account for nexus credentials inside settings.xml.
You would have to do this same config on your jenkins machine, either in the Jenkins user account's ~/.m2 or inside the maven plugin folder.

nettyserver not started for Play2 in intellij

I'm new to Intellij IDEA for Play/Scala and apparently need to do something to start NettyServer when I Run a project. My run configuration ran once OK. Then I killed the server, made some changes and tried to run again:
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java -Dfile.encoding=UTF8 -Djline.terminal=none -Dsbt.log.noformat=true -Dsbt.global.base=/private/var/folders/97/16yb2phd7sz78q0sf5wl7z200000gn/T/sbt-global-pluginstub -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -classpath "/Users/j/Library/Application Support/IntelliJIdea2016.1/Scala/launcher/sbt-launch.jar" xsbt.boot.Boot run
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Loading project definition from /Users/jch/IdeaProjects/editor/project
[info] Set current project to ...
--- (Running the application, auto-reloading is enabled) ---
[error] p.c.s.NettyServer - Failed to listen for HTTP on /0.0.0.0:9000!
[error] (compile:run) play.runsupport.ServerStartException
[error] Total time: 3 s, completed Apr 4, 2016 11:24:31 AM
Process finished with exit code 1
What am I missing?
My Mistake. - Apparently NettyServer could not start because it was already running. When I browse to localhost:9000 it's up. A better error message would have helped, and IDEA apparently did not autoload into my browser because of the NettyServer exit code.

Cloudbees Deploy failure due to NullPointerException in RunTargetImpl.getClickStackConfigMap

I've juste created an new app in cloudbees with clickStart "Jetty 9 Embedded App" and when Jenkins build the generated project(without any change) I get this error.
Can you help me to find the problem origin ?
thanks.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.919s
[INFO] Finished at: Fri Sep 27 06:49:44 EDT 2013
[INFO] Final Memory: 16M/40M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /scratch/jenkins/workspace/code-elevator-2/pom.xml to /home/flagadajones/hudson_home/jobs/code-elevator-2/modules/localdomain.localhost$jetty9-embedded-clickstart/builds/2013-09-27_10-48-58/archive/localdomain.localhost/jetty9-embedded-clickstart/0.1-SNAPSHOT/jetty9-embedded-clickstart-0.1-SNAPSHOT.pom
[JENKINS] Archiving /scratch/jenkins/workspace/code-elevator-2/target/jetty9-embedded-clickstart-0.1-SNAPSHOT.jar to /home/flagadajones/hudson_home/jobs/code-elevator-2/modules/localdomain.localhost$jetty9-embedded-clickstart/builds/2013-09-27_10-48-58/archive/localdomain.localhost/jetty9-embedded-clickstart/0.1-SNAPSHOT/jetty9-embedded-clickstart-0.1-SNAPSHOT.jar
[JENKINS] Archiving /scratch/jenkins/workspace/code-elevator-2/target/jetty9-embedded-clickstart-0.1-SNAPSHOT-jar-with-dependencies.jar to /home/flagadajones/hudson_home/jobs/code-elevator-2/modules/localdomain.localhost$jetty9-embedded-clickstart/builds/2013-09-27_10-48-58/archive/localdomain.localhost/jetty9-embedded-clickstart/0.1-SNAPSHOT/jetty9-embedded-clickstart-0.1-SNAPSHOT-jar-with-dependencies.jar
Waiting for Jenkins to finish collecting data
channel stopped
[cloudbees-deployer] Deploying as (jenkins) to the flagadajones account
[cloudbees-deployer] Deploying code-elevator-2
[cloudbees-deployer] Resolved from archived artifacts as /home/flagadajones/hudson_home/jobs/code-elevator-2/modules/localdomain.localhost$jetty9-embedded-clickstart/builds/2013-09-27_10-48-58/archive/localdomain.localhost/jetty9-embedded-clickstart/0.1-SNAPSHOT/jetty9-embedded-clickstart-0.1-SNAPSHOT-jar-with-dependencies.jar
com.cloudbees.plugins.deployer.exceptions.DeployException
at com.cloudbees.plugins.deployer.impl.run.RunEngineImpl.newDeployActor(RunEngineImpl.java:150)
at com.cloudbees.plugins.deployer.impl.run.RunEngineImpl.newDeployActor(RunEngineImpl.java:52)
at com.cloudbees.plugins.deployer.engines.Engine.process(Engine.java:173)
at com.cloudbees.plugins.deployer.engines.Engine.perform(Engine.java:112)
at com.cloudbees.plugins.deployer.DeployPublisher.perform(DeployPublisher.java:103)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:812)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:784)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:957)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:734)
at hudson.model.Run.execute(Run.java:1600)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:485)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: java.lang.NullPointerException
at com.cloudbees.plugins.deployer.impl.run.RunTargetImpl.getClickStackConfigMap(RunTargetImpl.java:256)
at com.cloudbees.plugins.deployer.impl.run.RunEngineImpl$DeployFileCallable.<init>(RunEngineImpl.java:297)
at com.cloudbees.plugins.deployer.impl.run.RunEngineImpl.newDeployActor(RunEngineImpl.java:141)
... 13 more
Build step 'Deploy applications' marked build as failure
Finished: FAILURE
The clickstart generates an invalid configuration for the deployer plugin. Remove the target from the deploy publisher and add it back again. The issue is that the Maven artifact selector is not selected and the clickstart has fed incorrect configuration for the target, which means that you can't just select the maven artifact selector, instead you need to remove the target and add it back again...
Nuts I know, I shall be chastising the clickstart maintainers on Monday rest assured ;-)

Error While Test The Project On Maven

i am using maven i don't have more knowledge about maven when i am install my project then it will successfully build but when i am test my project with maven it will give me an error like
Unable to copy an artifact to the working directory
i gave all permission to my project directory detail error as below so how can i resolve my
problem and how to run my project
so please help me
E
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 24 seconds
[INFO] Finished at: Thu Jan 27 17:44:59 IST 2011
[INFO] Final Memory: 35M/84M
[INFO] ------------------------------------------------------------------------
[INFO] Unable to copy an artifact to
the working directory Embedded error:
/home/nayan/workspace/ONiT/mediaPlayer/target/classes
(Is a directory) [INFO]
This looks like some of the previous tests are still running at this point and blocking maven from writing in the target directory.
As this seems to be an reactor build, do the modules themself build correctly ? I.e. can you run mvn test in each module directory seperately ?