Unable to run project with anything but local codebase in Netbeans - netbeans

I'm trying to build my Java Web Start application using Netbeans.
I realized that if I change the codebase option in the properties options to anything but local I get an error saying
Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution.
A week or two ago I was able to run it with a "User Defined" codebase. I'm not aware of a change I've made that could have resulted in this. I can build the project, just not run it, is this to be expected?
Any idea whats causing this and how/if I can run this with a non-local codebase?

After figuring out why this was happening, it turns out that this is intentional. As when you run a project in NetBeans you are running it locally, it would be incorrect to try and serve it from a non-local codebase. Hence the ant script in the project ensures that you're running it with a local codebase.
However, you can always build it with a non-local codebase, deploy the jar file, and then test it out.
Sadly there is no way to create a different build profile to build it with a non-local codebase, when you want it, and built it with a local codebase at other times.

Related

C++ Builder XE5 - How to turn off Deployment Manager

I apologize if this is not the right place to ask such question, but I'm at my wit's end since Embarcadero's forum won't allow me to post any question there.
I have enabled the "Deploy" feature in the C++ Builder IDE, to test out about the depending dll & bpl files of my application, when I'm done, I found myself trapped in an annoying state - I can't perform any debugging without connected to a remote pc (with their PAServer)! This is causing a HUGE problem for me as I will not be able to debug my application if I'm away from the office, i.e. I'm on a field service at my client's place or at home.
I tried deleting the deployment profile, but it just get recreated every-time I compile my project and there is a DEPLOY command upon running compiling and running the source code. I have to wait until the connection attempt to the remote pc time-out to continue testing the application by manually clicking the .exe of my application.
Is there any way to turn off the "Deploy" feature so that I can do debugging on my local machine just as before activating the "Deploy" feature?
I've found out where the profile was hiding and deleted it, now I can debug as usual.
In the Rad Studio help:
ms-help://embarcadero.rs_xe5/rad/Connection_Profile_Manager.html
On occasion, I have this same problem with DelphiXE5 (where the problem is that I forget how to get back to the default environment without losing my remote settings.)
Remote Deploy active:
The Revert option for the normal build/debug environment:
And finally, the previous Remote Deploy settings available via the same Target Platform context menu (i.e., Properties):
The Default Connection isn't something to be setup. To the contrary, it's really not a connection at all. The Revert... menu item essentially means Revert to local build & debug.

Convenient way to run eclipse plugin

I have recently started developing an Eclipse plugin (which is basic stuff for now) and I am struggling with "default" way to run Eclipse plugin ("Run as Eclipse application").
The Eclipse is starting another instance with my plugin already installed in it (this is default behaviour).
The problem is that when I want to re-run my plugin project and I press "run" button again (or Ctrl + F11) (and the another Eclipse instance still running) I get following message:
"Could not launch the application because the associated workspace is currently in use by another Eclipse application".
The error makes sense, and when I close "testing" Eclipse instance I am able to run my plugin again.
The question is - "is it normal routine for plugin development?". Maybe I am missing something, e.g. special arguments for Eclipse?
This seems all pretty normal. The error message is since the run configuration is specifing a workspace and when you start a second instance using the same workspace it is locked and considered in use.
What I usually do when testing a plugin is to create a run configuration (click "Run...") where I disable all the plugins I wont need when testing. This makes sure that the test starts up a couple of seconds quicker. Make sure you save that run configuration as a *.launch file aswell, that makes it quicker to test the next time. Or it can be used to share the configuration.
There's a lot you can configure in the run configuration, such as eclipse arguments, vm argument, if you want environment variables set, etc. So be sure to experiment a little.
In your run configuration. Main tab->Workspace Data ->Location text box add this:
${workspace_loc}/../runtime-EclipseApplication${current_date:yyyyMMdd_HHmmss}
Note the suffix ${current_date:yyyyMMdd_HHmmss} by this every time you launch your application new workspace will be created. So you will not get any error message saying workspace is locked.
But be careful as the folder .metadata will be different for different instances as their work-spaces are different. Thus preferences stored/retrieved by different instances are NOT in sync.
You are probably missing one important point: Eclipse supports the Java hot code replacement. Therefore in many cases you can modify your Java code while your application Eclipse instance is running, save the code and continue without restarting.
If hot code replacement is not possible, Eclipse will tell you, so you always know whether the editing changes are applied to the running instance.
This works best with more recent versions of the JVM, so consider upgrading to the latest Java 7 version, even if you write code to be compliant with Java 1.5 or 6.

Eclipse code change working explanation

If you are using Eclipse and your development server is running in the debugger, when you save your changes to this file, Eclipse compiles the new code automatically, then attempts to insert the new code into the already-running server. Changes to classes, JSPs, static files and appengine-web.xml are reflected immediately in the running server without needing to restart
plz any one can explain this ??????????
For classes like JSP-files:
Its debugging using JPDA.
The IDE attach via socket to the JVM your running app and hot-redeploy the not-permanent-code (aka PermGen).
There are different techiques and frameworks for that:
http://en.wikipedia.org/wiki/Java_Platform_Debugger_Architecture
It doesn't happen automatically. Check Project --> Build Automatically option. It should have been checked.
If you un-check it; then project will not be build/deployed automatically.

How to run GWT RequestFactory Validation Tool on Eclipse project

I've got a Android AppEngine Connected Project I'm trying to build using GWT2.4 RequestFactory and Objectify on my Eclipse IDE.
Apparently I need to run the RequestFactory Validation Tool because I'm using ServiceName and ProxyForName annotations (these are required especially when working on the Android client side). My problem is the Eclipse can't validate it and the solution provided at http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#IDE_configuration is enough to make me rip my eyes out.
Since I'm working on a Windows machine, the shell script provided is not very useful. Trying to run Validation Tool from a cmd propt returns the error message:"This tool must be run with a JDK, not a JRE"
Can someone explain how this Tool is supposed to be run? Is there a way to use it as an External Tool in eclipse?
Normally if you follow carefully the instructions in the link you show, and run the GWT Development Mode from Eclipse, the Validation should be done automatically at the time you access the development URL with your browser.
For the record, I've actually had some problems with it, but launching the application several times maked it work.
Well, I ran into the same problem as well. When I tried annotation processing (under Java Compiler-> Annotation processing )was being disabled. So RequestFactoryDeobfuscatorBuilder was not being generated. Try enabling that and rebuilding your project.
I've just recovered from two days of hunting this bug down in a project that used to run validation properly but stopped.
In my case I had a new-ish generic BaseRequestContext and a specific sub-interface that extended it. My parent interface declared a method that didn't match the Locator's exactly (e.g. getThing(T) vs get(T)) and this wasn't reported as an error but did stop the validation tool from completing.
Apt is also removed in Java 8 : http://openjdk.java.net/jeps/117 . So beware.
Switching back to Java 7 will fix the issue if you are using Java 8.
I understood why the error happens sometimes in a project: the compiler was complaining it cannot find the directory .apt . But when I tried to create it manually it was not possible (under windows). I think the validation tool mutes the exception of not being able to create the directory: try renaming .apt in your validation tool calls (do a text search in your project)

P2 headless update not working

I have taken the org.eclipse.equinox.p2.examples.rcp.prestartupdate project and adapted it for use in my RCP application. I then setup an update repository that gets updated as part of my nightly build.
When I open my application it goes through the motions like it is updating - it finds the update site, generates an uninstall and install operand for each bundle correctly and says that it finished with no errors. The problem is that the plugins never actually get installed in the plugins folder even though the profile gets updated (a subsequent run states there are no updates). Next time my build runs it correctly identifies there are updates, but the same thing happens again.
I have spent days debugging and the only thing that looks out of the ordinary (not that I fully understand what is going on) is that during the final configure phase none of the TouchpointData objects have any instructions so it doesn't look like configure is doing what it should.
I really have no clue where to look next and would like to see if anyone else has any ideas.
Update:
I finally figured out what was going on.
The problem started when I built my product without the generating the metadata repository. When building through Eclipse I didn't check the "Generate metadata repository" in the export product wizards because I didn't need a p2 repository, just the product. The problem is that without checking that button the product does not install as P2 enabled causing side effects such as not generating a profile among other things.
I tried to compensate for this by manually creating a profile in code which I have since found out is a really bad idea. My original problems were created because my profile wasn't set up correctly.
Once I started exporting the product with "Generate metadata repository" checked the update started correctly installing the new plugins.
The problem I have now is that although the plugins are being installed correctly, the executable is getting trashed and I cannot launch my application any more. I am building my update site through Hudson and the binary folder which is present when I use the Eclipse Export Product wizard is missing. I am assuming that is what is going wrong now.
Any ideas why the binaries would not be building in my headless PDE build?
Figured this out also. I had assumed that all I needed was the individual launcher plugins for the platforms I wanted to build on. Since I was trying to understand the process I was copying over plugins one by one to the build server. It turns out to include the platform specific binaries in the build you need to have the org.eclipse.equinox.executable feature from the delta pack. Once I added that to the build the binaries started showing up in the output. With the binaries the update mechanism works exactly as intended.
I had assumed that all I needed was the individual launcher plugins for the platforms I wanted to build on. Since I was trying to understand the process I was copying over plugins one by one to the build server. It turns out to include the platform specific binaries in the build you need to have the org.eclipse.equinox.executable feature from the delta pack. Once I added that to the build the binaries started showing up in the output. With the binaries the update mechanism works exactly as intended.