New Relic Heroku Java Installation Fails - java

I just followed the steps at
https://devcenter.heroku.com/articles/newrelic#java-configuration
from step
Add the New Relic agent as a Maven dependency
up until step
Add the New Relic agent as a Scala+SBT/Play 2 dependency
to install New Relic add on for my web service (Jetty JAX-RS REST).
I customized the newrelic.yml (same folder as pom.xml) with my own app license_key and app name. However, when logged onto my Heroku app's newrelic page, I just see a bunch of configuration steps. After clicking on "Connect to my application", it just stalls. Needless to say, it's been over a couple of hours with my webservice taking traffic.
I have a feeling new relic isn't even running. I updated the newrelic.yml to have DEBUG logging, but there were no logs from new relic at startup. Does newrelic.jar expect the newrelic.yml at the root with pom.xml?
Thanks,
Luke

Turns out I had to add
$JAVA_OPTS
in
java $JAVA_OPTS -cp target/classes:target/dependency/* service.Main

Related

How to run new relic in Java Spring boot jpa application

I am trying to implement newrelic in my spring boot JPA project.
I am using this link to implement this. new relic guid for spring boot
Now I have installed newrelic-java-7.9.0.zip (new relic zip)from this link and changed the yml as per my requirment.
I am not able to understand what to do next as per the link. also how can run this in production environment.
AFter researching on internet I got this command to execute :
java -javagent:<path to your new relic jar>\newrelic.jar -jar <path to your application jar>\<you rapplication jar name>.jar
Now I have new relic jar but i don't have jar of my application in target folder. i am ruuning an application by clicking on play window. (Can not see any jar though target folder is getting created.)
How to run this in local
How to run this in production (How to make this command production ready)

Teamcity - How to run spring boot jar on server after Build and Deploy?

I have a Rest API based on Spring boot, embedded with jetty. Normally I start it with java -Dloader.path=blablabla -jar blablabla.jar. I've configured a teamcity Build step to look for new check-ins to the git repo, pull and build (maven) the project, generate artifacts..
Further, I've added a Deploy step which has dependency on Build step (successful completion and artifact dependency).. Here, I use powershell to push the artifacts to the server on which i want the rest service to run.
A few questions:
1) Powershell - Is it the right way to publish files to the server from teamcity?
2) How do i get the teamcity to actually start my spring boot app? Some sort of a remote command execution?
Note: Both teamcity server and the app server are Windows.
Solved it myself:
1) Yes, powershell does the trick pretty neatly.
2) Got it to work with a combination of [WMICLASS] 's create() and Start-Process. Check my answer here.
Cheers!

How to run AngularJS in eclipse kepler?

I'm new to Angularjs and i'm trying to run first angular program with Spring. I downloaded the code from here: http://javahonk.com/spring-mvc-angularjs-integration/. Imported it as a maven project. Downloaded JSDT and AngualrJs plugin from eclipse marketplace but it's still not running. There is no error message. I'm running this on tomcat 7. What am I missing?
Any help would be appreciated?
I'm not a Eclipse user. so I have no idea for that. But you can use nodejs as a static server. it is explained here
1) Install nodejs for your OS
2) Run this command in a terminal (console)
> npm install http-server -g
3) Start server
> cd /path/to/your/project
> http-server -o --cors
Now you can access your project from browser http://localhost:8080/yourfile.html
Work in Eclipse and just refresh page on browser to see changes.
If you are working on a Spring Application within Eclipse IDE, your best alternative would be to start you appliction using an embedded Application Server (Best I would recommand are Jetty or Tomcat if you ain't need EE level components).
You can follow this link, which holds basic steps for adding a new Application Server within Eclipse IDE.
Once you have added a new application server, you can deploy your application in it then launch it and you should have your applcation reachable at http://localhost:8080/SpringMVCAngularJS.
A good alternative when using Maven as a build tool, is using an embedded AS plugin such as Tomcat7 Plugin or Jetty Plugin. This plugin will provide the ability to start your applcation using the Maven different goals (which does not require adding a new AS into Eclipse IDE).
I've pushed a sample module based on the tutorial you mentioned. YOu can test the above described plugin as follows in a *nix shell (You may need to setup git if not already done):
git clone https://github.com/tmarwen/stackoverflow-showcase.git
cd stackoverflow-showcase/springmvc-angularjs
mvn tomcat7:run

setting development environment of Heroku template java application

I have installed Heroku java plug-in and trying to set example application i.e. "Web & Asynchronous worker with Spring, CloudAMQP". This project is following maven and application gets deployed on heroku thru maven.
Would it be possible to run same application using local java container, rabbitmq and worker running in same and/or different JVM?
Yes, Foreman will start any project that has a Procfile. If there are multiple processes defined it will start them all.
https://devcenter.heroku.com/articles/procfile#developing-locally-with-foreman
You'll have to build the project locally with Maven first. You can either set the config info for your rabbitmq instance into environment variable or save them in a .env file which foreman will pick up. You can look at your Heroku app with 'heroku config' to see the variables that the app is expecting.

Continuous deployment/integration on Heroku for Java web app

I have a Java web application that I have managed to successfully deploy and get running on Heroku using the 'git push heroku master' method, but I would like to automate deployment and have a full CI setup. I've had a go at using Atlassian Bamboo with the Heroku plugin but it's really only suitable for standalone .war files - I need to be able to specify additional config via the Procfile definition in my project.
What have other people used for CI/CD of Java web applications to Heroku?
Jenkins has a good Heroku Plugin, that allow you to deploy WARs and interact with Heroku in many ways, including setting variables, scaling your dynos and running one-off processes:
https://github.com/heroku/heroku-jenkins-plugin/blob/master/README.md
To change the Procfile on Heroku, you need to commit and push the new file. You can do that as a step on your CI build. Jenkins can run scripts as part of your build, where you could easily push a new Procfile if that is needed.

Categories

Resources