Specify deployment path when deploying to GAE? - eclipse

I have a GWT app that runs locally using GAE GoogleAppEngine already. Everything works fine and is deployed to the war folder src/main/webapp.
appengine.xml is located at: src\main\webapp\WEB-INF\appengine-web.xml
Problem: when I rightclik project > Google > Deploy to App Engine, then Eclipse tells me that appengine-web.xml could not be found under target\project-0.0.1-SNAPSHOT\WEB-INF. Which is true as this only contains the classes folder. BUT why is this target folder generated at all?
When deploying locally, everything is just placed in src\main\webapp and works fine. How can I tell the Eclipse Google Plugin to look at this location, and not at target`?

Found it:
search for "target" on the whole project, which should bring up 2 config files: org.eclipse.wst.common.component, com.google.gdt.eclipse.core.prefs. replace the target path with: "/src/main/webapp"...

Related

JBoss 6.1.1.EAP Module Deployment: Class not found

The structure is as follows:
Actually deployed module is EAR.
EAR contains WAR module, and WAR module contains another JAR module.
In this last JAR, there are some generated classes and their parent folder is also used as source folder. Its path is "target/generated-sources/java".
The problem that is killing me, is that the deployed application throws ClassNotFoundException on server start, and the classes in question are the generated ones.
Now the trick:
if I explicitly change the Deployment Assembly in WAR project in Eclipse not to contain JAR project as "project", but as an archive from the JAR's project "target" folder, JBoss sees the generated classes and starts.
This solution however works only until next eclipse maven project update, so manual edit of deployment assembly is not really a solution.
Any ideas how to deploy or reorganise packages correctly?
OK, seems I have found the solution.
I looked through the build-path of the mentioned JAR file and saw that the entry Output folder pointed to target/test-classes.
After changing this entry to target/classes the application deploys and starts without any missing generated classes.
This is what worked for me:
Expand the 'target' folder of your maven project inside Eclipse (Project Explorer View);
Refresh it (F5);
Right click on your project on 'Servers' tab, then select "Full Publish";
Start your JBoss.
I had to enforce the JBoss Tool "Full Publish" to get an updated version of my target folder by Refreshing it manually on eclipse.
I don't know why but sometimes the Publishing from maven projects (even Full Publishes) do not copy classes from the target Project as it is in the file system. Maybe it's using some outdated memory info or some cache...
Anyway, this is what works for me.
After an update to Eclipse 4.15 and JBoss tools I got this problem too.
My solution: project -> properties -> Java Build Path --> Source
There my Output folder from my source was linked to project/target/classes, I changed this to project/target/project-projectversion/WEB-INF/classes
When I looked into the standalone JBoss folder I saw the folder structure of my source, but the classes where missing, when I changed the output folder the classes pop up and everything worked like before.
I am pretty sure the update made the problems.

Confusing Structure of Plugins and Platforms Folder

I am using Ionic framework to start on a Cordova hybrid mobile application.
Installing Ionoic via NPM was successful and had no issues.
I am running the below command in a directory as shown below.
C:\wamp\www\my_cordova\> ionic start myapp
This creates a new folder called myapp inside my_cordova folder, which is fine.
But it also creates the plugins folder in C:\wamp\www\ folder. This is the case always how much deeper I create the folder structure. Even if I start a project in C:\wamp\www\my_cordova\level1\, still the plugins folder is created in C:\wamp\www\ folder.
The same happens for platforms folder too when I add them. They are created in C:\wamp\www\ folder.
Is this expected or is it something wrong from my side? I expect all the folders(plugins and platforms) to be created within the same folder directory where I start the ionic project.
It's a problem with the CLI. As the path has "www" in it, these issues happened.
When I tried the CLI commands in another path which does now have www in it, all went fine.

Can't run app engine project with maven layout

Having created maven project under Eclipse I configured app engine settings and set my WAR directory to target/Site-0.0.1-Snapshot (I'm using app engine plugin). Deploying the project to app engine works just fine however I can't get the project running locally. When I start it just copies the entire contents of target/Site-0.0.1-Snapshot to target/Site-0.0.1-Snapshot/WEB-INF remaining the lib directory empty and throwing ClassNotFoundException. What can cause such strange behavior? May be I'm having something misconfigured?
Answering my own question.
The problem has been solved checking the "Launch and deploy from this directory" option.

deploy netbeans Java EE web project

Hi
I am new to deploying web projects. I want to deploy my Java EE Netbeans project on a different remote server. I just kept the .war file in the tomcat webapp folder and it worked fine. But I could not see the images and CSS effects in the webpage. How do I bundle my images, CSS files, scripts etc. in the .war file?
If you have a Netbeans web application project there is a folder WebPages under the project node. You can for example create a folder resources (right click on WebPages --> new folder) and put all your images, css files and scripts in it.
Then they are automatically included in the war.
(The WebPages folder in the project window is mapped to the project-name/web on file system.)
Have a look into this document: http://www.examulator.com/moodle/mod/resource/view.php?id=455 and see how it works instead of relying only on the IDE provided features, then use the IDE (like Netbeans) build the project and see the war file which IDE created for you.

Deploying a WAR in Tomcat / Eclipse

I use Tomcat 6.0 and Eclipse 3.0 under Linux and I try to deploy a WAR in Tomcat. The problem is that the server is managed by Eclipse and I have some Eclipse project deployed. I tried to modify the server.xml file then launch Tomcat via Eclipse but it doesn't work:
Could not load the Tomcat server configuration at /Servers/Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete.
I tried to extract the war in the webapps directory but the webapp is still inaccessible.
What is the best practice to deploy a War ?
Tomcat behaves differently in development and production mode. When you develop your webapp in Eclipse there is no reason to deploy a WAR file of your application as a WAR during development.
Just go to the "servers" view and add a new server (you should already have done this otherwise you could not create your Dynamic Web project). In the server view you should see the server you created (Tomcat at localhost or something similar) just right click it and go to the Add and Remove section. Here you can add and remove the Dynamic Web projects you created in Eclipse. Once you added your project, all you have to do is click the green start button in the servers view and your app should be available in at localhost:8080/mycontext.
When you're done building your app just right click the project and go the the Export section in the menu. You should be able to export a WAR file. Once you have your WAR file you can upload and deploy that on a Tomcat instance that is NOT tied to Eclipse running in dev mode.
Yes, in a way, you can deploy a war in the dev mode.
I have the same problem.
I have an Eclipse webapp project, which Eclipse deploys to an instance of Tomcat run by Eclipse, so I can hot-edit the project.
This Web project needs to use resources published by another webapp that has to be run within the same instance of Tomcat. The other webapp is a completed project by someone else, so it is already in a war form.
I needed to File->Import the war as an Eclipse project and let Eclipse deploy it to the same instance of Eclipse, in order to run it in the same instance of Tomcat in which my webapp also runs.
The problem is that some wars work this way but some others do not, while all of them work perfectly fine in a stand-alone Tomcat (started by startup.sh). I can't figure out why.
This is old but is one of the first answers in google search.
You can import the war file:
A Web Archive (WAR) file is a portable, packaged Web application
that you can import into your workspace.
Before importing a WAR file,
you should first determine if the WAR file contains needed Java™ source
files. When importing a WAR file into an existing Web project, the imported
Web deployment descriptor files are either not changed or overwritten by the
ones included in the imported WAR file, based on your response to the prompt
that is provided. In either case, this action does not represent a
merging of the two sets of deployment descriptors.
To import the
Web project resources in a WAR file into your workspace, complete the following
steps:
Select File > Import
.
In the Import dialog, select WAR file and
then click Next.
Locate the WAR file that you want to import using the Browse button.
The wizard assumes you want to create a new Web project with the
same name as the WAR file. If you accept this choice, the project will be
created with the same servlet version as specified by the WAR file and in
the same location. If you want to override these settings, you can click New and
specify your new settings in the Dynamic Web Project wizard.
Click Finish to populate the Web
project.
Source: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.wst.webtools.doc.user%2Ftopics%2Ftwimpwar.html
If all you have is a binary WAR (no source code), it cannot be installed within Eclipse. This can happen in certain scenarios outside of normal development workflows. Here's the work-around solution:
Launch another instance of Tomcat (outside Eclipse).
Modify the tomcat-users.xml file to enable admin
Go to http://localhost:8080/manager/html
Scroll down to WAR file to deploy
Click Choose File (next to Select WAR file to upload) and click Deploy.