Heroku error running play framework 2 - java

I don't know why my Heroku application is in crashed state.
Log and code at https://github.com/jstar88/LibreTitan/blob/master/log.txt
Running application at http://libretitan.herokuapp.com/

The problem is that your database is in an inconsistant state, so Play wants to run DOWNS evolutions, but you have not started your server with -DapplyEvolutions.default=true and -DapplyDownEvolutions.default=true. If this is a production system, I would not recommend doing that until reading about and fully understanding how Play's evolutions work because DOWNS could cause destructive changes to your data. The documentation can be found here:
http://www.playframework.com/documentation/2.1.0/Evolutions
Since you are running on Heroku, be sure to also set evolutions.use.locks=true so the evolutions will still work if you scale to more than one dyno.

Related

how to get correct exit code via java code from an spark app in cluster mode in kubernetes

I'm running a java spark app in cluster mode in kubernetes. At the moment I'm
using the SparkLauncher's java API to add a listener to get
notifications about the lifecycle from the running app. As far as I
understand the listener way is not fully implemented when running in
k8s. the code i'm using closes the spark context on the driver pod. this
results is state LOST in the java sparkapphandle.listener.
So my question is, which technically way should I use to get notified
about the state of the app I submitted. At the moment it is enough to
know the exit code of the app, not the progress or the state of every
executor.
I see the following tools
history server
rest api
task metrics
watcher api (https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/WatchExample.java)
I mean I see logs which contains infos i'm interested in. I believe it
is the class LoggingPodStatusWatcher.scala which logs these infos.
So can someone help me to point me to the smartest way to gather the
exit code programmatically from the app I started
thx
marko
My latest findings how to answer this questions, is to use the fabric8io library by using the wach api.
examples can be found here.
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java

Hibernate transactions rolling back in tomcat server

I am encountering a very weird problem in production. I have deployed a new application in production which is run in Tomcat server(version 7) using Windows services. This application is basically a batch processing which processes around 100-200 records at a time and generates their output in a flat file. When we run this application in production, the record's status changes from pending to verified(which is correct) and generates the flat file without any exception. However, when the batch process completes, all transactions are rolled back like nothing happened. Means, the record's status changes to pending, flat file is empty etc. This same application when running in staging or QA environment, it is running fine.
Can someone help me with this problem or at least guide me where should I start looking into it?
Since I don't know where the problem is, I am not attaching any sources or any error logs. Please let me know what details should I share?
Thank you

How to run a REST server on Cloud

So I have a rest server, in Java. Sometimes the server can crash because of problems or errors in Java, memory outage and more. My problem is that I want this server to always run even after it crashes. Whenever the machine is running, I need the server to run. I know about cron jobs but I am thinking of many scenarios that this would fail. Are there better practices?
Ideally You should handle all the error scenarios . Memory management has to be done by the programmer.
In case you want to start your service whenever machine is started, You can put those scripts in the startup services available in each platform(Linux,Windows) . This will make sure that your service will be started automatically after every restart of machine.
To handle failures, its better to setup alarms Example: Send out an email when memory is full or automatic kickoff of scripts to clean up.

Monitoring multiple java web applications and services

We have multiple java web applications and processes that are deployed on a server. we would like to find a mean to easily monitor these applications and check their status remotely. by motoring we mean the following :
Check if the websites are up, send notifications by email otherwise.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
? not sure if there are other ideas about monitoring
My question is that is there any application that is already available that provide such functionalities or some of them? if not do you know what API can be used to build such applications (in JAVA).
UPDATE:
The tool should be free
Thanks in advance for any help!
For monitoring Java applications as well as website availability, issuing custom commands in your servers and in general, monitor applications go for a general-purpose monitoring solution, like Pandora FMS. I'll try to answer your questions in order:
Check if the websites are up, send notifications by email otherwise.
Doing a network check to TCP port 80 and parsing a 200 OK response.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Easy thing to do with the log retrieval feature. Check it out in the wiki.
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
I'd suggest using Pandora Agents in this case. Quite powerful, yet very low resource consumption. They allow to do post-actions if your app is down, your CPU is high, or in general terms, anything you can measure happens. Check out the server monitoring more deeply: http://pandorafms.com/monitoring-solutions/server-monitoring/
On Linux, you an use monit. You can use it to any monitor services such as apache as well as wildfly running behind apache. It is actually easy to configure and it also gives all that you have requested.
If you want to monitor java processes, there is nothing better than MoSKito: http://www.moskito.org.
The only problem is that it covers much more, than you stated as your requirements, you will also get:
health thresholds and notifications
detailed performance metrics of your java code
dashboards with most important information about your app
mobile applications to monitor your app on the run
detection of slow transactions in your application
and more more more ;-)
http://www.moskito.org
http://newest.moskito.org/moskito/ (nightly build of the UI)
Step by Step guide: http://blog.anotheria.net/msk/the-complete-moskito-integration-guide-step-1/

how to create dev server on app-engine

I have a server running on app-engine. I am working on version 2 of my server, which serves as the backend for a mobile app. How do I a dev and a staging server so that I can test before replacing the production server? Does anyone know of a tutorial somewhere that addresses exactly this issue? It would be nice if I could set things up the way Google Play sets up android publication: I can publish to Alpha; then move the apk to Beta; and then to production. I will take what I can get at this point, but that structure would be nice.
You can use versions for this purpose. This way you can talk to myApp.appspot.com for a "production" version, to beta.myApp.appspot.com for a beta version, etc.
EDIT:
All versions run in different instances, but they all talk to the same datastore. It is a good option to test changes that do not break your data model - i.e. a beta version does not make changes in the datastore that break the production version.
If you want to test it in a local environment before pushing it to app engine. I would recommend have a separate box/server and deploy your code there and run the application on that server. Run application as web application in debug mode so you can see errors or problems that occurs. Connect your phone via Wi-Fi to your LAN and make sure the port you are using such as 8080 is open in your hub/firewall.
This way your server's services can send data and receive data without actually deploying on app engine.
This link might be useful:
https://developers.google.com/appengine/docs/java/tools/devserver
I implement using http://www.streamhead.com/google-appengine-staging-server/. It's better than versioning. But thanks everyone for helping.

Categories