Another GWT module may need to be recompiled - eclipse

I'll start with the other threads I've read:
GWT module may need to be (re)compiled REDUX
Some subtlety of GWT compilation - "gwt module may need to be (re)compiled."
Google App Engine - recompile GWT module
GWT Maven : Module 'xxx' may need to be (re)compiled
I have taken the following steps to fix this:
Cleared my browser cache.
Deleted gwt-unitCache folder.
Deleted *.nocache.js.
Deleted every file that was left over from a previous build. (I did this by looking at the date and time it was created.)
Run both maven clean and gwt:clean on my project.
Compile by right clicking on the project and going to Google > GWT Compile.
Run maven package.
Put the war in my JBoss EAP 6.1 (JBoss AS 7) folder.
Connect to it and still get the "GWT module may need to be recompiled" error.
What else could be causing this error to come up?

This has happened to me in the past when I imported a GWT project to a different computer. Seems you have already done some things I have tried. Before you start, right click on your project, hit Refresh, so you don't miss anything that's not in sync with the file system. There are multiple things it may be, so here's all the things I did to get it working:
Before the following steps also helps if you use the same version of GWT that was originally used to create your project. Also, make sure gwt-servlet.jar, gwt-servlet-deps.jar, validation-api-1.0.0.GA.jar, and validation-api-1.0.0.GA-sources.jar in your libs directory are the same as the ones from your GWT SDK directory (only if your app uses them).
Delete gwt-UnitCache
Open up the war directory.
Delete ALL compiled module folders.
Delete the war/WEB-INF/deploy folder.
Delete the war/WEB-INF/classes folder. It may be hidden in Eclipse, so you may have to do it via your file system.
Now, on the menus: click Project > Clean...
Make sure a build happens too. Either make "Build automatically" is selected, or use the option in the "Clean" dialog.
Do a GWT Compile. If you have more than one module, ONLY compile the main module. Any inherited modules will also be compiled.
I hope this helps. Ask if you need any clarifications.

Related

Grails asset-pipeline Shows wrong Build Path in Eclipse

My problem is resolved but I don't understand why it wasn't working.
Using: Grails 2.4.2, Groovy 2.3.7, Java 1.7, Eclipse- Indigo
I set my project up, and in the assets folder under grails-app I placed my static assets. I was also using twitter-bootstrap. The project would run, but nothing would be displayed from the assets folder. I did a Grails clean and got build path errors. in Eclipse right clicking the project name and going to Java Build Path and under the source tab there were links such as:
projectName/.link_to_grails_plugins/cache-1.1.7/src/java
or
projectName/.link_to_grails_plugin/asset-pipeline-1.8.11/grails-app/controllers etc
I deleted my target directory, and deleted all the links that were errors inside the Source tab. I restarted eclipse and refreshed, and voila it worked. The links came back, looked exactly the same but were now good apparently. I'm just not 100% sure why it worked though. The assets were in the right place, and never moved. Why did this work?
Eclipse doesn't parse BuildConfig.groovy or infer paths or dependencies - it gets all of that from Grails. You can force it to reconfigure the classpath by right-clicking on the project node in the tree on the left and selecting Grails Tools | Refresh Dependencies. That will cause Eclipse to run grails compile --non-interactive --refresh-dependencies and it gets classpath information from that.
When you restarted it must have determined that enough had been deleted that it needed to refresh itself, or it might just do that each time you restart.

Google App Engine, Maven and Eclipse development setup

I'll try keep this short. I have Eclipse with an installed M2E (Maven to Eclipse) plugin. I have a GAE (Google App Engine) project I'm working on. Everything is working ok apart from one really annoying thing: I have to stop/start the devserver every time I make a change.
If you have any experience with this setup then you might be able to answer this simple question?
I start the development server with "mvn appegnine:devserver" on the command line. Now I would expect that if I made changes to a *.jsp for example that those changes would automatically be updated on the devserver. Is this what happens with you?
I have noticed that if I make changes to *.jsp files under my target folder then devserver will see those changes and updates as I would expect. I think my problem lies with Eclipse not copying changes to target folder, but not sure if is even suppose to?
Does anyone have any suggestions on how I should progress investigating this? I've ran out of ideas :-/
I thank you in advance for any comments you may have.
P.s I know I can run "mvn package" to update files, but this is slow and the devserver runs out of memory after a do it twice.
This can be little painful, depending on how you want to work and which version of eclipse you're using.
Install the m2e-wtp plugin if you haven't. It's the secret sauce that makes appengine projects work in eclipse. Note this isn't m2e - but another plugin.
Install the GPE - the google plugin for eclipse if you haven't
Make sure your project is being managed by m2e as a maven project.
Go into your project properties - enable it as an appengine project using the GPE (listed under 'Google'). Don't forget to tick HRD while you're here.
Go to your project build path (Properties -> Java Build Path).
Ensure on the source tab that your src/main/resources doesnt have an ** exclusion.
Ensure on the libraries tab your have the three libraries 'JDK', 'Google Appengine' and 'Maven Dependencies' and nothing else
Ensure on the order and export tab that the appengine dependencies are above the maven dependencies.
It sounds pretty ridiculous - i'm not really sure why its still so painful, but that is a good recipe for success. Once that's done, this should allow you to run in debug from eclipse itself, with hotloading of code, jsps, css, scripts etc. I've had this work in helios, indigo and juno.
You can read more about the m2e-wtp setup instructions here. They refer to GWT but it's the same for appengine (I'm not sure why the emphasis on using GWT on GAE) because its actually about the correct setup of GPE and Maven.
You will also find that you may need to repeat some parts of step 5 pretty frequently - if your app isn't loading properly take a quick look to ensure that your resources haven't been excluded. This happens when you update your project configuration using the m2e plugin.
The wtp-m2e plugin updates the target folder as resources modified - so this should also resolve your issues running from the command line, but i can't vouch for that - I prefer to run straight out of eclipse.
I have the same problem as you, however I resolved with other way. I use FileSync plugin (which can be found in the market place).
With this plugin you configure an input directory (webapp) and output directory (target).
Any change made to the webapp will be passed to the target.
I have helped too.
You can use rsync like this:
rsync -r --existing src/main/webapp/ target/ROOT
where "ROOT" is the project build finalName.
The below point worked for me.
Ensure on the order and export tab that the appengine dependencies are above the maven dependencies.

Eclipse JBoss hot code replace

I am using Eclipse 4.2 and JBoss 7.
I have Build automatically checked in Eclipse.
Even then I have to build and redeploy the EAR file to JBOSS to test any code changes I make in Eclipse debug mode.
Am I missing something here?
THanks,
What the "Build automatically" option in eclipse do is that when you modify the source code of a class, this one will be automatically compiled, which doesn't mean that all the whole project that contains the class (i.e. war, jar, ear ...) is redeployed in the server. But of course it helps in the speed of deployment, because the classes you've been modifying are already compiled when you manually build or deploy the project.
On the other hand, to avoid problems with redeployments, you'd better set up JBoss to delete the files related to the application keeps in the work directory, when the application is undeployed / redeployed. Look at this stackoverflow thread for more information.
Concerning the "Build automatically" option:
In order for the Deployment Scanner in JBoss to work, you have to have it turned on in JBoss.
Also, you need to add your project to the JBoss server in the Servers window. Look for the "Add or Remove..." option.
Once your project is added, any changes you make to your code will get detected and your module will be redeployed automatically in the background. Failing that and assuming your project doesn't have a snag, you can use mvn install & mvn jboss-as:deploy to manual update your module.
Beware, sometimes mvn doesn't pick up the latest java code. This seems to be a project configuration issue more than anything. Re-creating the project seems to correct the issue.
Also, keep an eye out for duplicate persistence.xml files.
You only need one.

Referencing a GWT project from another GWT one - Problems

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.
I have imported iServe in Eclipse (it has multiple modules) as separate Maven projects referencing its other and can run it successfully through Runas -> Web application in development mode.
If I do that and run the other project through the console as mvn gwt:run, I call initiate PetalsMBP through iServe. However, that means that the two programs have to run as is, without communication with each other.
I have also imported the second project into eclipse as a java project successfully (converting into a Maven one causes problems - various lifecycle configurations ones), but whenever I try to add to to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"
Are my problems related to the fact that PetalsBPM is not a Maven project in Eclipse (I doubt it)?
Am I doing something wrong, i.e., this is not the way to reference a project from another one? should I add a reference to the first project's (iServe) gwt.xml file?
Is there a way to do what I want without having to wrap the second project as a jar and calling it from iServe? I would prefer not to, since producing a jar every time I make a slight change is not exactly efficient!
P.S: The second project is a regular GWT project with an entrypoint, not just a module. Should I remove this?
UPDATE: Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:
I created two new simple GWT projects and tried to reference one
from the other. Worked fine
I referenced the project I actually want
to use (PetalsBPM) from the simple one I just created. Also works
fine.
I referenced the new simple project from the original one I
want to use (iServe). Also works fine.
Tried doing what I actually
want to do, copying the settings from 2&3. Produces the same error
"CreateProcess error=206, The filename or extension is too long" if
I reference PetalsBPM (does not when I remove it from the referenced
projects)
So, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there. Still it did not work. :(
Any more ideas?
I met the same type of error "Create Process, error=206, path too long etc." a hundred times.
Then, I found a solution/explanation in google-groups, it solved my problem.
I post the content and link as it might help others.
This website (StackOverflow) really helped me a thousand times.
Thanks to you all !
solution/explanation :
(Response from Stephen Johnson)
(...) if you're using eclipse plugin go to Project | Properties, choose
Google \ App Engine \ ORM and only include directories that you have
classes that you want enhanced. By default it does the entire project
so that includes a lot of needless files. (...)
Link :
original post # google-groups
Read the exception message again. Somewhere along the way Maven is generating a path that is too long for (some) Windows API to handle, try moving your workspace to a directory straight below C:\.
I just tried "skolima" reply and it worked for me. In Eclipse I clicked File->Switch Workspace.
Three things to note:
After I created the workspace in "C:\workspace" I had to update my Project->Properties > Java Build Path > Libraries > Add External JARs...
I'm using Windows 7.
I'm using "Eclipse Java EE IDE for Web Developers"
I hope this others.

How do you import a Java Class Library into a Java Web project (using NetBeans)?

I've already tried the options "Add folder...", "Add Library...", and "Add JAR/Folder...", but it's not working this time -- I've done this several times before without any problems.
I've also tried to add the folder / JAR file (.war-file) manually to the projects properties in every thinkable way, but still no success.
And so far, Google hasn't helped either..
Any help would really be appreciated.
(This is for a Java Web project with JavaServer Faces, using NetBeans 7.1)
Solved: I never found out what caused the problem. I ended up re-installing entire NetBeans, and re-created (a thousand times) the project I was trying to import. And in the end, I got it working.
Put the JAR file in the WEB-INF/lib directory of your web project. All JARs in the WEB-INF/lib and all packages in WEB-INF/classes are automatically in the CLASSPATH.
Can you make "Hello, servlet" work? If not, why bother with JSF? Do a simple web app successfully and build up from there.
I had this problem with netbeans, but it seems like all the answers I found are for Eclipse (I guess am wrong) as I dont see any WEB-INF/lib directoryin NetBeans, though I have a WEB-INF directory.
so here what I did.
I remove the tomcat server on NetBeans, go to C:\apache-tomcat-7.0.30\lib , put the jstl-1.2.jar file their, restart NetBeans and add a new (Tomcat) server, create a new web app, and their, I could find the jstl-1.2.jar file in the Libraries > Apache tomcat.
and for unknown reason, it worked.!