Uploading different versions in GAE in Java - java

I'm writing a GAE project in Java and now, I'm trying to create a different version to use it for testing future changes.
I read about modules, app-engine-web.xml..., but I can't find how to deploy two versions.
I have seen posts that say that you can access it by changing the url:
"version"."app_id".app...
But I don't know what files have I to modify.

In appengine-web.xml you can use the version tag to specify a version. Likewise when deploying using appcfg you can use the -v argument to override that value with a different version.
So one approach is to have a production version specified in the config file and a testing version you deploy with
appcfg -v test_version ...

Related

Windows Service starting Java not working since Java Upgrade to 8

We've updated our buildserver (Atlassian Bamboo) to Java 8 (JDK).
Since then our integrationtests are failing because our started product does not open any port.
We are building with maven and as part of the integrationtest we are starting our builded product. Our product is a Rest-Api based in an OSGI (equinox) and Jetty.
I tried a lot of things, but nothing helped me to get the product start properly in the maven build.
When I log in on my remote machine and start the product manually everything works fine.
Some more information:
Our buildserver runs as a windows service and our product is written in plain Java.
Presumably you are affected by one or more of the issues discussed in Custom AMIs will not start anymore in Bamboo Cloud (BAM-16291), notably that Bamboo is not compatible with JDK8u60 yet:
Joda-time, one of the libraries used by Bamboo is not compatible with
8u60. We've fixed this problem, but the fix has not been rolled out
yet. Known breakages include S3 interaction and CodeDeploy plugin.
Most/All participants got things working again by downgrading to JDK8u45, as also recommended in Atlassian's most recent update:
Use JDK 8u45. The latest JDKs are incompatible with some 3rd party libraries we're using.
Try to match the layout and scripts of our stock images as closely as possible. This will make it easier for us to provide help if
anything goes wrong.
Choose Oracle if you have the choice between Oracle and OpenJDK flavor of JDK.

Spring Batch Admin - Override configurations are not recognized

I have downloaded the spring-batch-admin 1.3.0.RELEASE project, and updated all of the library references to the most recent RELEASE versions so that they are compatible with my spring-batch environment (eg. spring-xxx 4.1.4.RELEASE).
I have applied the environment settings and overrides per http://docs.spring.io/spring-batch-admin/getting-started.html . However, those overrides are not being recognized.
At least one email chain linked this symptom to the jira issues linked to https://jira.spring.io/browse/SPR-12111 , but those are allegedly fixed in spring core 4.1 .
Since the problem appears to be that the XML files in the project are not being scanned at all (only the ones embedded in the jar files), it seems to me that here should be some obvious way to work around this, even if it is not technically a "fix".
I am open for suggestions.
I resolved this by downloading the latest 1.3.1.RELEASE source from github and building it without any modifications.

Changing Java manifest.mf file and deployment to server

I'm developing an application that should run on a server. The application uses some external jars.
I have build the application and run it on a local machine without a problem.
Now, I need to deploy it on the server. The server has some of the jars located.
What should I do to make my application work on the server, using the jars that are already there?
I don't have much experience with Java, but I understand that there is a manifest file which has a class-path field that points to all the jars needed. Should I change the manifest "manually", so that it points to the location of the jar on the server? What do you do in situations like this, what is the correct procedure?
Also, if I use one version of jar during development, and there is a bit older version of that jar on the server, what should I do to perform the deployment correctly?
And what is the procedure in case of using maven, should I copy the jars from where it locates them on the local drive to one directory, or is there a way for maven to do it itself?
I'm using NetBeans btw.
Thanks
Re "using the jars that are already there":
See Introduction to the Dependency Mechanism, Dependency Scope: "provided ... indicates you expect the JDK or a container to provide the dependency at runtime."
Re "there is a bit older version of that jar on the server":
Update the library on the server or use the older when developing. I'd consider it a really bad idea to use different versions of a library for developing and runtime. This can lead to subtle errors that are hard to identify.
Re "And what is the procedure in case of using maven":
Does the introduction linked above help you in answering this as well?
Maven is supposed to work the same with any type of IDE.

Changing JVM version used by Groovy builds in Drone.io

I am working on a Java test project using Cassandra for persistence and Achilles as my client API for Cassandra. Also, for testing purposes I am running Gradle builds on this project in Drone.io.
The Achilles library depends on Java 7, which is one of the possible types of builds for Drone.io, but since this is a Gradle build, it is necessary to make it a Groovy build. According to this official doc page, it should still be possible to use Java 7 inside the Groovy JVM with just an additional command in the build script in order to change from the default 1.6 JVM:
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
However, after adding that line to the build instructions, I get the following error messages from the Drone.io build log:
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
This is apparently a frequent error for which I managed to Google a number of solutions.
My problem is that all of these solutions involve installing plugins and/or adding entries to the sources list, which doesn't seem to be very straightforward in the Drone.io virtual machine.
One solution was running sudo update-alternatives --install /usr/lib/mozilla/plugins/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnpjp2.so 1 (I updated the path from the original solution in order to reflect the VM's directory structure) to install the missing lib, but there is no libnpjp2.so file at this location in the VM.
Has anyone had better luck using Java 7 in Groovy/Gradle builds in Drone.io or has any idea of a workaround?
The best way to use Gradle with drone.io (and even in general) is via the Gradle Wrapper. This works with any drone.io build type, so you can simply select Java 7.

Where can I download common-annotations.jar

Have a Spring 2.5 webapp which runs fine under 1.6, but under 1.5 it can't find PostConstruct class.
Found the following which suggests I need common-annotations.jar (JSR-250) but cannot find anywhere to download it
The reference implementation is available here:
http://jcp.org/aboutJava/communityprocess/final/jsr250/index.html
Reference Implementation (RI) and Technology Compatibility Kit is part of glassfish.
In other words, you might end up having to download the GlassFish Application Server just to get the single jar file.

Categories

Resources