How do I change the port number in Udacity GAE project? - eclipse

In the Udacity Developing Scalable Apps with Java course, I imported the Hello Endpoints project and tried to run it on Eclipse EE as instructed. However I got the following error message:
[INFO] ***********************************************************
[INFO] Could not open the requested socket: Address already in use
[INFO] Try overriding --address and/or --port.
[INFO] -----------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------
[INFO] Total time: 4.954 s
[INFO] Finished at: 2014-12-14T10:03:16-02:00
[INFO] Final Memory: 22M/221M
[INFO] -----------------------------------------------------------
How do I change the port number?

As you are building a Maven project, you can edit the pom.xml file and uncomment the <port>8080</port> value and set it to an unused port.

Related

Multiple tags for a Docker image built by Google Jib and Maven?

Using the jib-maven-plugin I'd like to build an image with mulitple tags. While mvn jib:build basically works fine, it "only" tags the image with latest.
My Maven pom.xml defines the following:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.8.0</version>
<configuration>
<to>
<image>my-private-registry.org/my-image</image>
</to>
</configuration>
</plugin>
The docs show that one can use jib.to.tags in the XML to define a list of tags. However, I'd like to run the build step in a Jenkins pipeline, i.e. I cannot hard-code the tags in the pom.xml.
Is it possible to pass the list of tags when running the mvn command, e.g. by setting some -D parameters?
Use -Djib.to.tags=a,b,c.
$ mvn package jib:build -Djib.to.tags=a,b,c
...
[INFO] --- jib-maven-plugin:2.8.0:dockerBuild (default-cli) # hello-spring-boot ---
[INFO] Tagging image with generated image reference hello-spring-boot:0.1.0. If you'd like to specify a different tag, you can set the <to><image> parameter in your pom.xml, or use the -Dimage=<MY IMAGE> commandline flag.
[INFO]
[INFO] Containerizing application to Docker daemon as hello-spring-boot:0.1.0, hello-spring-boot:a, hello-spring-boot:b, hello-spring-boot:c...
[WARNING] Base image 'gcr.io/distroless/java:8' does not use a specific image digest - build may not be reproducible
[INFO] Using base image with digest: sha256:34c3598d83f0dba27820323044ebe79e63ad4f137b405676da75a3905a408adf
[INFO]
[INFO] Container entrypoint set to [java, -Djava.security.egd=file:/dev/./urandom, -cp, /app/resources:/app/classes:/app/libs/*, hello.Application]
[INFO]
[INFO] Built image to Docker daemon as hello-spring-boot:0.1.0, hello-spring-boot:a, hello-spring-boot:b, hello-spring-boot:c
[INFO]
[INFO] A new version of Jib (3.0.0) is available (currently using 2.8.0). Update your build configuration to use the latest features and fixes!
[INFO] https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/CHANGELOG.md
[INFO] Please see https://github.com/GoogleContainerTools/jib/blob/master/docs/privacy.md for info on disabling this update check.
[INFO]
[INFO] Executing tasks:
[INFO] [==============================] 100.0% complete
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Using sbt run on simple tutorial example does not execute

On a Windows machine, I am running through the getting started tutorial here: https://www.scala-sbt.org/1.x/docs/sbt-by-example.html
I am able to start the sbt shell and compile but using the run command just hangs and I am forced to Ctrl-C to exit sbt.
Running scala against the JAR file directly also works as expected.
Sample output is the following:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from S:\foo-build\project
[info] Loading settings for project foo-build from build.sbt ...
[info] Set current project to foo-build (in build file:/S:/foo-build/)
[info] sbt server started at local:sbt-server-8c6933abcb6848dbd242
sbt:foo-build> about
[info] This is sbt 1.2.8
[info] The current project is ProjectRef(uri("file:/S:/foo-build/"), "foo-build") 0.1.0-SNAPSHOT
[info] The current project is built against Scala 2.12.7
[info] Available Plugins
[info] - sbt.ScriptedPlugin
[info] - sbt.plugins.CorePlugin
[info] - sbt.plugins.Giter8TemplatePlugin
[info] - sbt.plugins.IvyPlugin
[info] - sbt.plugins.JUnitXmlReportPlugin
[info] - sbt.plugins.JvmPlugin
[info] - sbt.plugins.SbtPlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.7
sbt:foo-build> compile
[success] Total time: 0 s, completed Feb 7, 2019 4:40:45 PM
sbt:foo-build> run
Terminate batch job (Y/N)? Y
This is enough of an answer for my own purposes.
I was able work around this issue by adding a line to my build.sbt file. After adding ThisBuild / scalaVersion := "2.12.8" I was able to use the run command. Following the tutorial linked in the main question I would not expect to have to do this but perhaps someone could shed some light.

Cannot deploy my application on OpenShift: "Failed to execute: 'control deploy' for /var/lib/openshift/XXX/jbossews"

When pushing new changes to my OpenShift repository, the application gets well built but cannot get deployed:
Repository ssh://XXX#myapp-mydomain.rhcloud.com/~/git/app.git/
The jbossews cartridge is already stopped
Stopping MongoDB cartridge
Stopping RockMongo cartridge
Waiting for stop to finish
Waiting for stop to finish
Building git ref 'master', commit 9a591e1
Using Maven mirror /var/lib/openshift/XXX/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml
Apache Maven 3.0.4 (r1232336; 2012-12-18 14:36:37-0500)
Maven home: /usr/share/java/apache-maven-3.0.4
Java version: 1.7.0_85, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-504.34.1.el6.x86_64", arch: "i386", family: "unix"
Found pom.xml... attempting to build with 'mvn --global-settings /var/lib/openshift/XXX/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml clean package -Popenshift -DskipTests'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myapp 1.0.0
[INFO] ------------------------------------------------------------------------
...
... downloading lot of Maven dependencies
...
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 20 source files to /var/lib/openshift/XXX/app-root/runtime/repo/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # myapp ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # myapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # myapp ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) # myapp ---
...
... downloading lot of Maven dependencies
...
[INFO] Packaging webapp
[INFO] Assembling webapp [myapp] in [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Processing war project
[INFO] Copying webapp webResources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp] to [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Copying webapp webResources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp] to [/var/lib/openshift/XXX/app-root/runtime/repo/target/myapp-1.0.0]
[INFO] Copying webapp resources [/var/lib/openshift/XXX/app-root/runtime/repo/src/main/webapp]
[INFO] Webapp assembled in [4153 msecs]
[INFO] Building war: /var/lib/openshift/XXX/app-root/runtime/repo/webapps/ROOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.312s
[INFO] Finished at: Sun Oct 04 13:23:39 EDT 2015
[INFO] Final Memory: 24M/160M
[INFO] ------------------------------------------------------------------------
Preparing build for deployment
Deployment id is 686f0e29
Activating deployment
Starting MongoDB cartridge
Waiting for mongo to start...
Starting RockMongo cartridge
rm: cannot remove `/var/lib/openshift/XXX/jbossews//conf/web.xml': No such file or directory
-------------------------
Git Post-Receive Result: failure
Activation status: failure
Activation failed for the following gears:
XXX (Error activating gear: CLIENT_ERROR: Failed to execute: 'control deploy' for /var/lib/openshift/XXX/jbossews
#<IO:0x00000001230388>
#<IO:0x00000001230310>
)
Deployment completed with status: failure
postreceive failed
Any idea what's happening?
I've created an app with all the cartridges you mentioned and everything works fine to me. However there's a difference: my web.xml configuration file is somewhere else, at src/main/webapp/WEB-INF/web.xml. My bet is that wherever you're calling this you have the wrong path to it, as you can see on:
rm: cannot remove `/var/lib/openshift/XXX/jbossews//conf/web.xml': No such file or directory
FYI, typically, when you get the error Failed to execute: 'control deploy' it means that something in the process of deployment has gone wrong and it stopped, so that error message is not the actual error.
I manually created an empty file /var/lib/openshift/XXX/jbossews/conf/web.xml, and this solved the issue: the rm command ended successfully, the deployment succeeded.

Error when running build as native Sencha

Mac-mini-2:sink eit$ sencha app build native
[INFO] Deploying your application to /path/to/www/sink/build/package
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/images
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies...
[INFO] Found 139 dependencies. Concatenating all into app.js...
[INFO] Processed sdk/sencha-touch.js
[INFO] Minifying sdk/sencha-touch.js
[INFO] Processed app.js
[INFO] Minifying app.js
[INFO] Minifying resources/css/app.css
[INFO] Minified sdk/sencha-touch.js
[INFO] Minified app.js
[INFO] Minified resources/css/app.css
[INFO] Generated app.json
[INFO] Embedded microloader into index.html
[INFO] Packaging your application as a native app...
[INFO] The application was successfully packaged
Failed to execute system command while signing application with error 256
Failed to package application
[ERROR] codesign_allocate: for architecture armv7 object: /path/to/www/sink/build/native//Sencha Touch 2 Packaging.app/stbuild_template malformed object (unknown load command 8)
/path/to/www/sink/build/native//Sencha Touch 2 Packaging.app: object file format invalid or unsuitable
How can I fix the above issue?
I got this error when I included the certificate file name in the certificatePath & didn't include 'certificatePassword' directive.
I hope this helps, but I'm fairly new to all this & fumbling around through various problems I'm having.

In PlayN, how can I build the HTML version of my project from the command line?

Currently I'm building it in Eclipse using the GWT plugin. I'd like to automate deployment to my development webserver using a script that does the GWT compilation from the command line.
I've followed the directions in the Running Via Maven section of the Getting Started page:
mvn -Phtml integration-test
But it tries to build all the versions, erring out on the Android build (which I'd prefer to skip at the moment) and throws a warning stating the html profile doesn't exist:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] MyPlaynGame Metaproject .......................... SUCCESS [0.375s]
[INFO] MyPlaynGame Core ................................. SUCCESS [1.638s]
[INFO] MyPlaynGame Java ................................. SUCCESS [0.319s]
[INFO] MyPlaynGame HTML ................................. SUCCESS [4.019s]
[INFO] MyPlaynGame Android .............................. FAILURE [0.308s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.903s
[INFO] Finished at: Mon Jun 04 22:17:33 PDT 2012
[INFO] Final Memory: 15M/255M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "html" could not be activated because it does not exist.
How can I get it just to build the html version?
mvn clean package -pl core,html
This will only compile the core and html packages. If you only want html, you still need the core package.
The output will be by default in the target folder.