GWT Eclipse wont compile classes into war/WEB-INF/classes - eclipse

I use the GWT Version 2.5 , eclipse 3.7 and java 1.6.0_35
I am facing this problem since I manually deleted the classes in myProject/war/WEB-INF/classes . In eclipse everything looks fine, however when I compile with ant or gwt compile over eclipse it wont generate any new class in that particular folder. As consequence I receive a war file where the classes directory is empty. How can I fix it such that the classes are comming back to this folder?

Make sure the "Default Output Folder" in Project⇒Properties⇒Java Build Path points to the right place. Using built-in Ant, that's probably myProject/war/WEB-INF/classes.
Also, check "This Project has a WAR directory" in Project⇒Properties⇒Google⇒Web Application. For Ant, the path should be war.

Related

how to change GWT compile output path in Eclipse 4.6

I use eclipse 4.6 to compile my gwt project.
The output path is target/se-monitor-1.0-SHAPSHOT/.
I want to change the path to src/main/webapp.
I adopt change run configurations --> GWT compiler --->arguments---> working directory, but the result is src/main/webapp/war.
There is a war catalog.
How can I delete the war catalog?
I assume you're talking about GWT Eclipse plugin.
If so, then I do this by
editing the .launch configuration
going to the Arguments tab
manually entering extra argument -war <your_desired_location>
I don't know if Eclipse lets you edit this in any other way. It might, but I don't know.

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.

eclipse dynamic web project with groovy nature copies .groovy files

I have an eclipse dynamic web project, and it has some groovy files (not a grails project though, just using groovy for some small backend stuff). I have added src/main/groovy as a source folder. However, when I select "Run on Server", it copies the actual .groovy file as if it were a resource. Is there a way to fix this behavior?
I was running into the exact same issue here. I have a web project here using the following:
Eclipse Kepler
Gradle
Groovy
Spring MVC
I have a Tomcat set inside Eclipse, from the command line or from the Gradle view I can compile, assemble and generate war files, however when I try to "Run on server" the files being deployed to Tomcat are the .groovy files, not the actual .class files, even though they are successfully generated inside the build/classes/main folder
So, TO FIX this I deleted and then re-created the Tomcat server within eclipse, after doing that it was able to find and deploy the right set of files compiled by Gradle
Hope this helps

No build.xml file found when running an eclipse project

I am very new to gwt and in fact I don t really understand it.
I have a web project that had already been developped. I just want to change the toolbar that requires gwt in a RichTextToolbar.java file. So I downloaded Eclipse and its gwt plugin.
In a precedent question, I had the answer that I should take thes only file RichTextToolbar from my php/html directory, put in the src folder of my eclipse web application project; then run it and finally taking back the compiled files from the war folder and put it in my php/html directory.
Now, the problem is that when I debug or run the files in eclipse, I am told to choose ant. And then I have a message that no build.xml file is found. Could anyone help?
Best,
Newben
If your intention is to compile the Java code in GWT to Javascript, then you can use 'Compile GWT Project' option under GWT menu in Eclipse.

NetBeans -- Is it possible to bypass the IDE-generated Ant build for an existing project?

I have a Java project with sub-projects that is currently built using NetBeans's IDE-generated Ant scripts. I am converting the entire project to a Maven build.
My Maven build works fine from the command line and loads perfectly in Eclipse. However, the only way I can get the project to load as a Maven project in NetBeans is to delete the Ant scripts, i.e. build.xml and the directory nbproject for each sub-project. It seems that as long as I have the old IDE-generated build files, NetBeans recognizes the project as a NetBeans Java project only, not as a Maven Java project, even though there is also a pom.xml file present.
Short of deleting the IDE-generated build files, is there any way to tell NetBeans to load the project as a Maven project?
I have been told that we want to keep the Ant build for a while during the transition to Maven.
Using NetBeans 6.9.1, Maven 2.2.
Any help would be appreciated.
Thanks
Well, the nb ant project metadata has precedence over occurence of pom.xml file (that's how maven projects are recognized and loaded). The whole precedence order hardwired in the IDE, you could only influence it be uninstalling the j2se ant project type for example.
So, yes. You need to get rid of the ant project metadata before you can open the project as maven project. Depending on how and when you delete the metadata, you might need to restart the IDE as well to get the new stuff loaded.
Have you seen http://wiki.netbeans.org/MavenBestPractices? It indicates that you must install the NetBeans maven plugin first. Perhaps that's why your Maven projects aren't recognized.
I must note that I'm not a NetBeans user anymore!
Here is what I ended up doing:
I wrote an Ant script (ironic, huh?) that, for every subproject of my project, renames the file nbproject/project.xml if it exists to nbproject/nb_project_disabled.xml. If nbproject/nb_project_disabled.xml exists instead, the script renames it back to nbproject/project.xml. In this way, the script toggles the opening of the project as a NetBeans Ant build or as a Maven build.
It would be nice if NetBeans, you know, had a setting to open both kinds of projects. Currently (6.9.1), there is just the "Open Project" command. In Eclipse, there is the command "Import Existing Maven Projects" vs. "Import Existing Project Into Workspace" (i.e. native Eclipse format).