Why is Spring Boot extremely slow to start up on Mac OSX Mavericks (10.9.2)? - spring

I don't have any other issues with java and STS starts up fine but when I try to run my app as "Run as Spring Boot App" (or any of the samples), the console is empty for up to 5 minutes, before I get the familiar "Spring Boot" ASCII art. Then it works fine.

Turns out there was an issue resolving the network host. I fixed it by executing this command from the console:
scutil --set HostName "localhost"

It must be something with you environment. You may try running the app in other IDE like Intellij. I presume it's the STS causing the problem. You may also try running it in fresh STS installation. I'm using latest OSX and Intellij and have no problems.
If you want to play around with this you could also analyse a java code dump to see what's happening inside your jvm: http://www.javacodegeeks.com/2013/02/analysing-a-java-core-dump.html

Related

Gradle > How to stop a Spring Boot application launched with gradle bootRun?

I started a spring boot application using gradle bootRun.
Doing ctrl-c in the terminal where I launched the command does not stop the application.
What is then the correct way of stopping it?
You can use the command gradle -stop to stop the Spring Boot application.
Not sure what operating system you are using but I am on a mac and was having the same problem, command + C wasn't working (on a mac the command key is equal to the Windows control key) but I used control+C and it did work. If you're on a Windows machine this doesn't help you but thought this might help others who are new to a mac.

Issues with two author instances of AEM of different versions in local

We're upgrading to 6.1 from 5.6, I have 5.6 setup on port 4502, I changed the port on the jar for 6.1 from 4502 to 4512 and started up both at the same time. But seems like both http://localhost:4512/ and http://localhost:4502/ take me to AEM 6.1.
Are there other configs that need a change to have two versions up and running at the same time?
You can run multiple instances of AEM on your local computer. In fact, as an engineer you should definitely run at least one author instance and one publish instance on your local computer so that you can test your work in both environments before committing any code.
You can rename the jar to cq-author-4502.jar, cq-publish-4503.jar or replace your port number. By naming the file cq-author-4512.jar and running java -jar cq-author-4512.jar, the instance will start up on port 4512.
If you want to start your instance using the start script, you need to update that script in the /crx-quickstart/bin directory. If you're on Linux or Mac update the start file. If you're on Windows update the start.bat file. Follow the instructions and replace 4502 with 4512 and author with publish if necessary. The /crx-quickstart/bin directory will be available after you run the jar file the first time.
First of all there is no useful and logical reason to have two instances that does not comply with author|publish configuration.
But you can start a... e.g. test|author configuration:
Open ../crx-quickstart/bin/start.sh or .bat
Change CQ_PORT=4504
Change CQ_RUNMODE='test'
if [ -z "$CQ_PORT" ]; then
CQ_PORT=4504
fi
if [ -z "$CQ_RUNMODE" ]; then
CQ_RUNMODE='test'
fi
Open ../crx-quickstart/conf/sling.properties
Change author by test
sling.run.mode.install.options=test,publish|...
And start the instances in any order that you like.
It might only be a caching issue in your browser.
When 6.1 has been started on 4502 and then you have an other AEM/CQ version on that port (stop 6.1, start 5.6.1 or something like that), your browser will sometimes show the cached 6.1 login screen or at least some of the 6.1 images that are cached. Press SHIFT-Reload and all should be well.

Blank White Screen at localhost:8080 with Tomcat 8 on OSX 10.8.5

I followed this tutorial exactly: http://examples.javacodegeeks.com/enterprise-java/rest/jersey/jersey-hello-world-example/
But I just see a blank white screen when I go to: http://localhost:8080/JAXRS-HelloWorld/rest/helloWorldREST/JavaCodeGeeks?value=enjoy-REST
I started tomcat by running the command catalina run
Should I be doing something differently to deploy the webapp?
I have just tested the sample application on Tomcat 8 and it works without any issue.
As expected it prints out the below message in the browser when called.
"Hello from: JavaCodeGeeks : enjoy-REST"
There are couple of things that I can think of might causing the problems in your case.
You are missing any of the steps specified in the tutorial.
You are not deploying the "JAXRS-HelloWorld.war" into Tomcat properly.
I hope have setup your CATALINA_HOME properly in order to call the "catalina run" in commadline.
To resolve your problems.
Instead of following the steps in the tutorial, download the attached project and generate the war file as specified and deploy it and see if it works.
To deploy the project in tomcat, you have to copy the "JAXRS-HelloWorld.war" file into $CATALINA_BASE/webapps folder and then start the server.
There are couple of ways to start the Tomcat server. One that you have chosen is the commandlne. To start the Tomcat server from caommandline either you have to change directory(cd $CATALINA_BASE/bin) to Tomcat home bin folder and the call catalina.bat/catalina.sh with run or start command Or set the CATALINA_HOME enviorenment variable and then call the same command from anywhere in your commandline.
Note:
Also check the Tomcat logs for specific issues or errors.

Unable to debug tomcat server using eclipse

I'm using:
Spring Tool Suite Version: 3.2.0.RELEASE
Tomcat v7.0.42
When I just run my tomcat server everything is fine but I'm unable to debug it even locally. It produces following error:
Startich Apache Tomcat v7.0.42 at localhost has encoutered a problem.
Server Apache Tomcat v7.0.42 bat localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
I've tried the following:
increase the timeout.
remove all the apps before starting the debugging.
install new instance of tomcat (the only configuration that I've did on fresh install is turning on Use Tomcat installation and Never publish automatically).
But it didn't help, I still can only run the tomcat, without the debug option. Does anyone know how to make this debugging work?
When I've used new, clear workspace for Spring Tool Suite, debugging started to work.
Cheers,

Issue with IOS Instruments running from command line on build machine

I've successfully run IOS UI Automation Instruments from command line on my local Mac. When it starts to test, the simulator will automatically pop up and then do the stuff.
However, when I SSH to a build server (with OSX and xcode, will use Jenkins eventually) and try to do the same thing, it doesn't work well.
Building process is fine, but as long as I run instruments, the terminal will then hang there without doing anything. I figure it has something to do with iphone simulator GUI but since it's CLI, I don't know what's going on...
Do you guys have any idea? Thanks!!
.
After executing the command from Jenkins through SSH; in most cases you would see a pop up window as in the screen shot. You will have to get past this screen to execute your tests. This post addresses how to get past that issue Stop "developer tools access needs to take control of another process for debugging to continue" alert
I've had the same issue. instruments -w "$DEVICE" were ignoring parameters.
Same with
DEVICE_TARGET='iPhone 6 (8.1 Simulator)' cucumber --format json -o test-reports/cucumber-8.1-iphone.json
It were ignoring DEVICE_TARGET parameter.
Solved via running Jenkins slave NOT as a SSH slave but as the Slave agent via java web start
http://i.stack.imgur.com/lNlPA.png
As i understand this issue is caused by OS X launchagent that managing sshd and performs scope of restrictions for remote users.
IMPORTANT! Slave agent should be started from OS X desktop, not via ssh! I've connected via VNC and launched slave java web agent on the OS X UI terminal.

Resources