Appengine datastore lost with server restart on Mac with Intellij - java

I've been developing on and off with Appengine for a while now. I use Intellij for my IDE and I have a Java instance of Appengine.
When running the dev server locally, the database is lost between each restart of the server. This is because Intellij rebuilds the WAR each time and the datastore which is located in the WAR is lost. I know in the documentation that it says the datastore will be persisted; but the documentation implies that you are using the Eclipse plugin.
It used to be that I didn't have this problem because there was a startup param that would specify a different location for the datastore which I setup outside the WAR. I've lost this param and can't find any documentation on it.
Please help

The following VM param allowed me to change the datastore directory.
-Ddatastore.backing_store=PATH_TO_DATASTORE/local_db.bin

The plugins are just calling the local development server. For Java, the command line equivalent is calling dev_appserver.sh (or .cmd for Windows folks). If you call:
./dev_appserver.sh --help
you can see an option --generated_dir=DIR that should work for you. Just include this in your IntelliJ run configuration (borrowing Eclipse terminology) and you should be good to go.

Related

HEROKU - can't deploy java app with jdk11

Current approach:
As suggested there https://devcenter.heroku.com/articles/java-support, I've created a system.properties file in a root folder, with java.runtime.version=11
Still jdk 8 is installed as seen in the picture
JAVA_HOME
Not sure what am I missing here?
For any one who is still facing this issue. My problem was i was on a different branch so i had to run git push heroku yourbranch:master.
I would suggest using Docker. It will easier to configure and you will be able to run it locally and it should behave the same as in Heroku. Moreover Heroku has good support for deploying using Docker.
You can check out deploying process here: https://devcenter.heroku.com/categories/deploying-with-docker
Process of building docker image will be different depending on what build system you use.

How to deploy an unmanaged plugin and restart the Neo4j server from maven?

I am trying to make my development process as automatic as I can.
I am using maven and got the deploy to work by simply putting the jar in my server folder when building the project (like this).
This works fine, but I still have to restart my server manually. I found this solution to run a command after install.
I can run neo4j to start the server, but can not find out how I can restart (or stop and then start). I tried neo4j restart and got the following output:
This command is not supported by the Neo4j utility. Please try "Neo4j.bat help" for more info.
When running Neo4j.bat help I get the following output:
Proper arguments for this command are: help console
Something does not seem right... I am using Neo4j version 2.2.0.
This could be a bad approach, if so let me know. How do you setup your environment when developing unmanaged extensions?
You can use chaining of commands
neo4j stop & neo4j start
If you run on windows I recommend you to upgrade to latest version of Neo4j, because it supports PowerShell instead of old batch files.
http://neo4j.com/docs/stable/powershell.html
In Neo4j 2.3.0 you have powershell modules that should allow you this kind of functionality.
http://neo4j.com/docs/stable/powershell.html

Work with docker and IDE

To share installation, we decided to work with docker. For each project, global dependencies are installed inside the container.
We are developping with Python (and Java, but at this time, let's speak about Python only ;) )
Working with Vim (for example), I want to use code completion, but because the entire libs are installed in container, my vim installation on host cannot access them. This is true with Java, Javascript, and so on and it's absolutly normal...
But is there any solution to be able to work with container, getting access to libs for IDE, without to install IDE in the container itself ?
But is there any solution to be able to work with container, getting
access to libs for IDE, without to install IDE in the container itself
?
The trick is to run your IDE from the container. Your IDE is installed on your host, you just run it in the container.
For this to work, you need an IDE container that has:
all the system requirements your IDE needs
can display GUI applications
has a volume mounted on the location of your IDE on your host
An example of all this with a well known Python IDE instead of vim is discussed here:
Warning: this has been validated on Ubuntu 14.04 only.
PyCharm Docker Integration
Why don't you checkout the official image for python?
https://registry.hub.docker.com/_/python/
It doesn't provide exactly what you're looking for but it supports a workflow where the container is built the same way as it should be run on your development machine (dependencies listed in the "requirements.txt" and downloaded using pip).
Hope this helps.
You may also try using cloud-based IDEs like eclipse che or cloud9.
It has support for docker and runs in a browser.
Update:
I just found out that eclipse che and cloud9 are not mature enough to run java apps, so you might want to try Intellij: https://github.com/marioluan/java-data-structures

Can this java application run on Heroku?

I have no experience setting up java applications and no experience with Heroku but I have this java application I would like to know if I can easily run on Heroku.
https://github.com/difi/oxalis is the github repo and here is some install instructions for a standalone server:
make sure that Maven is installed.
make sure that Tomcat 7 and Metro 2.1.1 are installed
make sure that the Tomcat manager is available on port 8080 with user manager/manager
make sure that Tomcat is also up
and running on SSL at localhost:8443
make sure that keystore.jks is
installed in a known directory (separate instructions for
constructing the keystore)
change
oxalis-commons/src/main/filters/soc.properties to reflect your local
preferences
Is this possible to set up on Heroku?
It seems like it should run on Heroku but a few changes might be necessary. You will not need to run Tomcat with SSL since Heroku provides the HTTPS in front of the Tomcat app. You will probably have to update the Maven build to pull in Tomcat via webapp-runner. The properties file should probably be replaced with Config Vars. The only part that seems like it might be tricky is the Metro piece. It's not clear how Metro is being pulled into the system and used.

How to do Java web development without a local environment

I started a new job recently. I've been a Java & XML web developer for two years. The new place I'm at has several large web applications, but none of them deploy to my local JBOSS server because some genius decided to create a Java Project instead of a Dynamic Web Project. I tried following the steps to convert the project but that creates a bunch of errors which I cannot resolve.
The people I work with are all consultants and never give me a straight answer on how I can develop/test my changes locally.
Has anyone had to program in a similar situation? If so... got any advice?
I've worked on projects like that, but with Tomcat as the server instead of JBoss. I develop in Eclipse using a normal Java project, and I follow these steps:
Run an Ant script to build the project into a new WAR in a temp workspace directory.
Use an Eclipse plugin to stop the local test server.
Run an Ant script to copy the WAR to the proper directory for Tomcat to pick it up and deploy it.
Use an Eclipse plugin to start the local test server.
Tomcat's fast and the project isn't huge, so this whole process takes 12-15 seconds. With JBoss being a full enterprise app server, I'd think it might take more time.

Categories

Resources