Location of config file for devmode in Eclipse? - eclipse

I have a multi module GWT project (say a.gwt.xml, b.gwt.xml, c.gwt.xml) that I am building in eclipse and testing in devmode. All was working well until I deleted one of the gwt module file and associated source. Now when I try to launch devmode from eclipse it fails with the following error message.
Loading modules
com.fubar.b
[ERROR] Unable to find 'com/fubar/b.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method
I assume that this means there is a stale reference to the now defunct b.gwt.xml but I can't seem to find it in any of the config files. Any ideas?
At present I am working around this by doing a copy+rename a.gwt.xml -> b.gwt.xml (so there are effectively 2 copies of the a module names a + b) which works fine but compiles 2 copies of same module :(

What I think is your runtime configuration which is gone wrong. Individual projects should be fine. Open the runtime configuration which you were running and check the entries in GWT! If the module you have deleted still exists here, then you need to remove it.
Runtime config for project

You can refer to the following Video.
http://www.youtube.com/watch?v=UW4WSYs1bKE
To rename
Right Click on the project.
Select Run As ---> Run Configurations.
In the Arguments Tab, change the Old Module Names in Program
Arguments.
Also Make sure, in GWT Tab, Selected module name is correct.
ALREADY I HAVE ANSWERED THIS HERE : GWT:how can i rename my module

Related

Set a classpath just for jUnit in Netbeans [duplicate]

We have an application developed in NetBeans, based on the NetBeans platform. There's a 3'rd party program that we have a runtime dependency on, more specifically a jar in the other progams lib folder.
How should we include the other progam's jar in our classpath?
The recommendation from the other progam's manufacturer is to set environment variable CLASSPATH to include
C:\Progam Files\Other Program\lib\theJAR.jar
And if that's not possible, we should copy theJAR.jar to JRE-HOME\lib\ext
We must not copy theJAR.jar anywhere else, that might cause it to stop working...
Now NetBeans takes no notice of what's on environment variable CLASSPATH. Their recommended way seems to be to make a wrapper, but that would lead to copying the jar, unless there's some way to make a wrapper module that points to CLASSPATH?
At the moment we are copying the jar into JRE-HOME\lib\ext. But then there's unnecessary hassle when we install some java update.
Do you have any solution to this problem? It seems like something that might be simple, but I haven't found the right place to look yet...
Edit: The application is ant-based.
From the documentation for the Module System API's overview of the runtime infrastructure (bottom of the page under the section "Common Problems and Solutions"):
Q: Can my module add a library JAR to the classpath from outside the
IDE [read: platform] installation?...
A: Not easily. You have a few options:
Add an entry to ide.cfg [your app's .config file]. For example:
-cp:a c:\eak\lib\eak.jar This startup file provides the ability to add classpath entries to the IDE's Java invocation.
...
It goes on to list two more options. The second option is the same solution you've come up with. The third is to "partition your module and use a new classloader" which I can't recommend either way since I have no experience doing this (but it's worth a read).
Assuming that this first option is what you are looking for, you will need to add a custom .conf file to your project and point to it in your project.properties file, like so: app.conf=nbproject/my.conf. This will add your custom .conf file to your app's install directory instead of the default config file that is normally added. Of course, you'll need to add the -cp:a c:\eak\lib\eak.jar entry to this custom config file in order to load the .jar.
During development you'll need to add the following entry to the project.properties file: run.args.extra=-cp:a c:\eak\lib\eak.jar. This will pass the command line option to your debug instance.
You can add that .jar file by following the steps below:
In the left side panel named "Projects" open your project and right click on the "Libraries", then select "Add JAR/Folder...".
Then select your .jar file from the location where you have stored it in the next dialog box that opens and then press "Open".
Vola Finished!!! (with the same process you can add other libraries also like JavaCV, JMF,etc)
And Now You Can Use That .Jar File From Your Project Library.
Hope It Helps.

Nutch Exception: ''..cannot be resolved to a type"

I followed the steps using this site : http://wiki.apache.org/nutch/RunNutchInEclipse
I encountered a problem while running which that says
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
String cannot be resolved to a type
Exception cannot be resolved to a type
System cannot be resolved
at org.apache.nutch.crawl.Crawl.main(Crawl.java:53)
The build was successful.
I am using nutch 1.4.
Moreover, I would like to tell that i didnt understood the point 3 of section "Establish the Eclipse environment for Nutch" and skipped it. I guess the problem lies there only.
Can you please help me as the more I try to resolve it, the more i get frustrated.Trying it from past 2 days.
It's a humble request please help.
Do you want it to run from eclipse? AFAIK only if you want to modify Nutch code it makes sense to run from eclipse and do all set up. In case if you want to run from eclipse for some reason, 3rd point means: You need to add those path. i.e within plugin folder there are many other folder. You need to manually expand each folder and add src/test and src/java. Ex: there is folder called creative commons. In that there src and within that there is java and test folder. You need to select both. Similarly do for all directories within plugin folder.

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.

Delete GWT module development mode?

I have a GWT application with several modules. I have deleted one that I don't need anymore (JasperReportTest) - I deleted JasperReportTest.gwt.xml file and classes referring to that module.
But when I try to run my application in development mode I get this in my console:
Loading modules
com.mycompany.myapp.JasperReportTest
[ERROR] Unable to find 'com/mycompany/myapp/JasperReportTest.gwt.xml' on
your classpath; could be a typo, or maybe you forgot to include a
classpath entry for source?
If I run compile everything works fine. How can I delete the module, so development mode won't try to load it? I searched project for string "JasperReportTest" and I didn't find it. Where is loading of this module written?
Solved - problem was that in Run configurations I had that module in startup command
Have a look at the Google → Web Toolkit in your project's properties.
I was getting the same behaviour, and the good place to remove the reference to the unwanted module is in "run configuration" dialog but in the "arguments" tab', not in GWT one.

GWT tries to load a deleted module

I am using Eclispe with Google plugin for AppEngine and GWT. Recently I created a test GWT module, but eventually it has been deleted from the project and I can not find any sign of it in the project now.
However, whenever I run the web app locally, I get in console the following message:
Loading modules
com.piq.exemity.Test
[ERROR] Unable to find 'com/XXXXXX/Test.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
Has anyone got any idea where it can be hiding?
Open Run Configurations... from the Run pulldown menu and go to tab Arguments. In the Program arguments box delete the path to your deleted module.
It could be there in two places -
When you invoke GWTC (via the compile option in Eclipse), the module name com.xxx.Test is passed to the compiler. This causes GWT to look for com/xxx/Test.gwt.xml file
You could have a module that inherits the module "com.xxx.Test". Check your gwt.xml file if this is the case
I think (1) is more likely the culprit.