We are in the process of converting our appengine project that uses backends to one that uses modules instead. See https://developers.google.com/appengine/docs/java/modules/converting
This implies going from a WAR project to an EAR project.
However the appengine eclipse plugins only has support for pointing out a WAR directory.
Does anybody know how this work. I.e. should we point this to our EAR directory?
We faced the same problem when migrating from backend to modules.
it seems that currently the GPE doesn't support modules, how ever we did solve this with this hack:
We renamed our WAR directory to "default" (you can point the web application there (under Project Properties -> Google -> Web Application -> WAR Directory).
We also included a dispatch.xml file in that module's WEB-INF dir that tells appengine which module to serve according to urls.
the last thing we had to do is to have a custom script that compiles gwt/class to those directories and deploys to appengine.
here is the overview of the project's layout change:
OLD LAYOUT
project_main_dir
war
NEW LAYOUT
project_main_dir
default
WEB-INF
dispatch.xml
module1
WEB-INF
module2
WEB-INF
Related
I'm currently working on a web project that has some commom modules/ jars dependencies with other projects that run on the same server and I'd like to know whether it is possible to "pass" those depencies to the server so that i get "thin" wars. Our projects are built using ant's build.xml and we user Tomcat as the server.
Context:
Recently my company started using AWS on it's projects, so we had to add aws-sdk jars to all our projects and their .war grew substantially in size, so my goal here is to transfer all the common jars/modules (or aws-sdk at least) to the server /lib folder.
Currenty all the dependencies go onto the [project_name]/WEB-INF/libs folder, so I face the situation described below:
project1/
WEB-INF/
libs/
aws.jar
common.jar
myjar.jar
and
project2/
WEB-INF/
libs/
aws.jar
common.jar
itext.jar
And I'd like to extract those common [common.jar and aws.jar] jars to a common folder such as {tomcat_home}/lib or another.
Questions:
Is it possible ?
[if it is possible] How can it be done ?
I am currently working on an EAR application which has a WEB project and EJB project in it.
To work on eclipse with local set up i do so many build path setups and all.
All these buildpaths show up in .classpath of the project.
Now when i export the EAR and deploy on Server everything works on server.
My doubt is how does server know about my local system paths which are present in .classpath of my project.
Does it mean .classpath has no significance at runtime?
Please explain.
.classpath file is eclipse specific, it will not be bundled with the EAR. Eclipse uses it to set the classpath for the project.
An EAR has a well defined structure and Servlet container understands that structure, using it's knowledge it prods around in the EAR file and extracts classes to load in the runtime.
Obviously server doesn't have any knowledge of your local environment. An EAR (or WAR or JAR) file is a simple archive file (with some specification or the file order and all). You can unzip it using any utility (something like 7zip). Check the structure of the packed EAR, that will give you a better understanding of what goes to your server.
I have one parent project which has WAR and JAR project. Currently the .xml and .properties files are packaged with jar. My requirement is that I want the resources folder of jar project which as .xml and .properties files to be available in WEB-INF folder of the war when the war project is build.
So that I can edit the files when the war is deployed on server.
There are a few ways to share resources across multiple projects or modules:
Cut and paste them.
Use Assembly and Dependency plugins
Use the maven-remote-resources-plugin
the second approach is described here
the third approach is described here
I have a WAR file which contains some web application.
I have created a new java web application and i want to use some classes of the WAR which i already have.
How to add the WAR file as a dependency in my new Java Web Application in using eclipse.
I am running this application in Tomcat 7.0 server.
Thanks & Regards,
Rahul
A WAR file is not intended as a dependency, it has a structure specifically designed for deployment to application servers (that understand that structure).
I would move the classes you want to depend on into a separate jar and then have both the war project and your new project depend on it.
You could also create a client jar from the war project which your new application could depend on. However, if you go down the maven route, the Sonatype tutorial will say that each maven project should only produce one artifact.
I just created my first Web Application Project using the Google-Eclipse plugin. Amongst other artifacts, it autogenerated a war/ directory with several subdirectories and many files, including:
war/
WEB-INF/
lib/
<Lots of JARs here>
web.xml
appengine-web.xml
etc.
Several times now I've cleared out certain parts of this war/ directory (messing around with buildscripts and other Google-Eclipse plugin features - this is just a test/temp project for getting used to the plugin), and they magically reappear at some point in the future.
I'm wondering if, because I set this up as a Web Application Project (and it is thus managed by the Google-Eclipse plugin), is the plugin trying to preserve the structure of the war/, and as such, continuing to auto-generate any missing files?
If so, why? Exactly (which files/directories) what is it trying to preserve? Can I disable it?
And if not, then I obviously have something else going on here. In which case, has anybody else ever experienced this with the Google-Eclipse plugin, or just Eclipse in general? Thanks in advance.
This plugin only updates war/lib directory by adding dependencies. Actually it just copies jar files when you switch to a another version of Google App Engine SDK.
This should not be a problem.
War folder is the exploded package that later on you need to deploy to Google App Engine.
When you build or deploy file to GAE, this folder will be re-created/updated, and it contains the newly compiled jar and the necessary libs.
Read this.
War folder contains the generated javascript files which are deployed to the app engine.