How to do HotSwapping without using IDE? - jvm

I've used DCEVM hotswap technology in eclipse and IntelliJ IDE which was pretty cool feature. By using DCEVM in IDE what I can do is, I can change into the source code i.e add/remove/edit method, classes, properties at the runtime without doing restart the program.
Now my question is:
I want to apply the same features in my running application which is run without using any IDE. To be more specific the running applications source code(compiled code) can change on the fly. And for that bytecode how to deploy on DCEVM for runtime hotswapping?
What I've found is:
We can do hotSwapping without using IDE for that we can write own JNI code to directly hook into JVMTI and trigger a hotswap.
any idea/help would be much helpfull. thanks

Fortunately I found the solution.We can use the HotSwapper plugin to solve this kind of problem. The same question is asked in dcevm discussion forume:
https://groups.google.com/forum/#!topic/hotswapagent/Uk3cUdkHNYQ
Although the information from this link https://news.ycombinator.com/item?id=3198497 is very helpfull but it was asked four years ago, so that I was stuck in.
Now the DCEVM is being more smart It can support various plugin such as Hotswapper, AnonymousClassPatch, WatchResources, Hibernate, Spring, Jersey2, Jetty, Tomcat, ZK, Logback, JSF, Seam, ELResolver, OsgiEquinox and even we can write own plugin too which is more easy to develope.

Related

How I can use the JavaFX framework?

firstly, I want let you know how useful this community is for me, I was stuck on an error
`Error: JavaFX runtime components are missing, and are required to run this application`
and thanks to this answer I actually solved: link
However I've a couple of questions. I noticed that IntelliJ doesn't change the configurations (Like set the VM option and pick the right library for the javaFX project), so each time I've to create a new JavaFX11 or 12 project I've to being throw all the manually settings again.
There's a way for set a "default behaviour" for the IDE ? It's really cumbersome.
The second question is, how I can use all the beautiful framework that the developer community offer for JavaFX? I've seen on openjFX a couple of interesting framework like TilesFX or CalendarFX but there's no information on how implement them on my IDE neither on GitHub nor here.
I have seen that most of them uses Gradle files, but honestly I don't have the faintest idea of what this kind of file does and how implement it on IntelliJ. Thank's to everybody.
Run the project with a more recent JDK like JDK11, for example.
If it does'nt work, you probably forgot to change the JDK of your builder in IntelliJ!
Open the settings and follow the path as bellow:
FOR MAVEN
FOR GRADLE

Mule - Updating third party library in runtime

I'm using Mule Server 3.8 EE which brings commons-lang 2.4 with it. A third-party library in my project needs commons-lang 2.6, because it uses a method that was introduced in this version.
So when I just start my application, I get a java.lang.NoSuchMethodError
Is there a way to update the dependency in the runtime? What I tried so far:
including commons-lang 2.6 in my app -> no effect, the one from the runtime is picked up first
replacing the jar directly in the runtime -> errors in studio, that the 2.4 jar is missing
so maybe i am late BUT -- this is your answer. Add the libraries that are newer in the jar distribution to the Build Path. Under Java Build Path screen you should see the libraries listed. I needed to use Apache http-client 4.5.6 and that's very interesting because it brings with it a lot of other dependencies, so your question was VERY relevant. The solution is to rely on JAVA (and not mule -- oops Anypoint or whatever) conventions and make sure the JVM loads my class files first. Then, it won't load the old ones from mule's jar. And so I went to the tab Order and Export, and moved Mule to the bottom. This simple, trivial change makes it work. I think if we would work with command line and vim, we would all know this. But all the IDE gui and everything else makes us forget the simplest things. Please use it in good health. :)

Eclipse 3.7 RCP Application with multiple plugins

What is the right way to make an RCP application that is “ready for plugins”? I have struggled to do this basic concept and am trying to accomplish this in Eclipse 3.7 (latest 3.x version).
Step 1
I would like to explore this by using 3 eclipse plugin projects:
• HelloWorldRCP
• HelloWorldPluginA
• HelloWorldPluginB
Would it make sense to make HelloWorldRCP with all the common things such as a menu-bar with an Edit menu including cut, copy and paste menu items? The HelloWorldPluginA could add an additional menu-item called “Alpha” and HelloWorldPluginB could add yet another menu-item called “Beta”? However, the cut, copy and paste functionality could still work within Plugin A and B?
Step 2
Next, how do I deploy this as a “product”? I have made a new product configuration and defined the dependencies from the default runtime configuration that was made. I do notice that there are a lot of dependency jars that are included, but I don’t think I use them. For example, I don’t use data-binding to my knowledge, but it keeps coming up as a required dependency.
I go to Export | Eclipse Product and an executable environment is created in my desired folder. However, when I copy this to another machine it seems to keep referencing the original machines Java installation location. How does one get around this?
I have tried to bundle a jre with the Product Export but nothing is created. I have also just tried copying my jre6 as a jre folder. This does seem to work.
Next problem here is the 32/64 bit Java execution environments. What is advised here? I have been aiming to build on 32 bit only and then hopefully that will run on 32 or 64bit platforms. Is this correct?
Step 3
I need to web-start this now. The old way of initiating an Eclipse 3.5 application, using a startup.jar has changed. I now use the equinox launcher and reference it in the jnlp instead of the startup.jar. However, I keep getting an exception which seems related to the 32/64 bit equinox win32_64 jar. I notice that the export writes a folder and not a jar. I read somewhere that this is a “clever trick” to allow compatibility for both 32 and 64bit runtime environments.
The problem here is that I need a jar and not a folder so that I can sign the jars required and deploy accordingly.
Does anyone have a Java Web-start example for and Eclipse 3.7 RCP application? Or any advice?
You are going to need a lot of time to learn everything you've asked about here.
Here is one of the best places to start... http://www.vogella.com/eclipse.html
That site covers a lot of basics. But you need a little more than basics.
The best example of a working RCP product with some of the features you require can be found at ... http://max-server.myftp.org/trac/mp3m
This guy (Kai) makes all of the source code available via SVN, and he has some very advanced stuff going on in his application. He also has a good blog with some advanced RCP tips and tricks. http://www.toedter.com/blog/
Another thing you'll want to investigate is Tycho. I realize that you didn't mention anything about building your application, but I've found that using Tycho for building has made my most recent foray into Eclipse RCP 100 times better than the other times I've done RCP work. So, my advice, get to know Tycho. http://wiki.eclipse.org/Tycho/Reference_Card
The learning curve of Eclipse RCP is somewhat steep, but I think it's worth the effort.
Good Luck!

Best IDE for Grails 1.1.X development [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been on a frustrating quest to find an IDE which provides reasonable support for Grails 1.1 development. My minimum requirements are:
Supports running tests within the IDE
Supports debugging within the IDE while running either the tests or the app itself
Provides code-completion, including dynamic finders added to domain classes
Here's a rundown of my experience so far
Eclipse 3.4.2 (Ganymede)
Using the latest plugins available from the update site, Eclipse's support for Groovy/Grails is truly pathetic. It provides little more than code completion and spurious errors
NetBeans 6.7 Beta
As soon as I imported the project, NetBeans began scanning it. The Navigator view was waiting for the scanning to finish before showing it's contents. About 20 minutes later, both the Navigator view and I were still waiting. Also, support for code completion on dynamic finders is poor, and for some reason it copied all the plugins into $PROJECT_ROOT/web-app/plugins.
IntelliJ 8.1.2
Although the general consensus is that IntelliJ is the best IDE for Groovy/Grails, it does not work well with Grails 1.1.X. The root cause of the problem appears to be the change in the location of the plugins folder. IntelliJ is unable to build the app because it can't find classes I'm importing from plugins, even though those plugins are listed in application.properties
So my question (finally) is whether anyone has found an IDE (not TextMate or Vim) that works with Grails 1.1.X when the plugin folder is in it's default location, i.e. under $HOME/.grails/1.1.X/plugins?
If so, I'd be really grateful for information about:
Which IDE to use (including version number)
Which plugins (if any) need to be installed
How to import an existing project into the IDE
How to run the app, the tests, and debug from within the IDE (if it's not obvious)
Thanks,
Don
NetBeans 6.7 now with Grail 1.1 support
I'm unclear on which version of IntelliJ IDEA the author of that blog post tested, tha didn't work with Grails 1.1.1.
Idea 8.1.2 works very well for me on OSX with Grails 1.1 and 1.1.1. Grails is installed under /Developer/grails-1.1.1 (with a symlink at /Developer/grails ), and the plugins are in the ~/.grails/1.1.1/plugins directory.
I didn't have to install any extra Idea plugins. What I did have to do was tell it where the plugins were, and install the missing ones once I had upgraded to 1.1.1. IDEA's grails integration can even recognize the plugins from the Grails repository and install them from the IDE.
NetBeans 6.7 RC3 works much better with Grails 1.1.1 than the versions before. Debugging only works in attached mode, i.e. you start your application from the command line (grails-debug run-app) and then attach the Netbeans Debugger (port 5005). My experience is that the watches do not show the correct values of the running process. Automatic code formatting is horrible.
IntelliJ 8.1.3 worked good for me with Grails 1.1. Debugging was working correctly (most of the time, from time to time, the status of the debugger does not match the actual process' status) and code formatting is quite good. After I switched to Grails 1.1.1 IntelliJ refuses to start my app ("error running MyApp: Grails are not configured") although grails is installed and GRAILS_HOME is set correctly. The trick is to change the facet in the module settings of your project. There you have to configure the location of your grails 1.1.1 installation. Then IntelliJ crashed while starting your app and you have to do the configuration again . With a little bit of luck it works then and everything is fine.
I've spend a lot of time with these issues in the last days and I am quite angry about that. Therefore I'd like to recommend to go away from grails and to use ruby on rails with NetBeans 6.7 instead. Then you can start to focus on your business, not on configuration and installation issues. If you really need to stick with grails, use IntelliJ and pay for it. It's worth it. Do not even think about using Eclipse, if you do not want to go crazy.
I've been playing around with the version 9 milestone 1 release of IntelliJ and so far have not had any problems working with grails apps.
One thing i did notice was that the project explorer doesn't always refresh properly when files are added via an automated process. sometimes i have to close and re-open the project to see the new files, but that could just be a beta issue in general and not related to the grails support.
They've added a lot of Groovy and Grails support to the latest version of the Spring Source Tool Suite. It doesn't ship with these plugins by default, but there are options to install them as extensions from the dashboard page.
Some of the nice features include the ability to run grails commands in the IDE and support for editing GSPs. The Groovy language support has gotten much better too with the latest release of the plugin. You can read more about that here.
The Spring Tools Suite is also an excellent choice for grails/groovy development. I use it and do not have any cause for regret.
I've been using Netbeans 6.7 for some time and it's very slow, the code completion rarely works. Basically I'm using it as an editor and to format my code.
I used the EAP version of IDEA 8.1 and it was really nice - very easy to setup and develop in compared to the other IDEs. Sorry I don't remember exactly how to import an existing project but it was fairly straight forward.
If cost is not an issue, then IDEA would probably be the best choice.
I use STS (SpringSource Toolkit), I like it better than Intellij or Netbeans. I am using 2.3.3.M2

Differences between CruiseControl (original) and CruiseControl.NET

Are there any differences between the original CruiseControl and the .NET port? I've compared the 2, but can't find any big differences except the language it has been developed in. I want to use either one of them for (automated) testing of web applications, using Selenium and Subversion, perhaps even Groovy but don't know which to choose.
[edit]
After looking at CC and Hudson, I've chosen Hudson for it's simplicity, it already has plugins to run Groovy scripts and Selenium as well
Choose me, choose me! (I work on the original CruiseControl.)
I've never used CC.NET but from what I know I agree that they are pretty comparable. Probably the most important difference is cross-platform vs. Windows only.
Now I wonder how long until someone comes by and says their both crap and you should try Hudson? ;)
(And of course there are lots of other choices...)
CruiseControl.NET (cc.net henceforth) has build queues (http://confluence.public.thoughtworks.org/display/CCNET/Project+Configuration+Block), which allows you to serialize builds that depends on a certain build order. I'm in the process of emulating this behavior in the java version of cruisecontrol but the functionality doesn't map one to one. The reason however, that I'm at all moving from the .net to the java version is that the .net version core dumps with mono (cc.net nightly build and mono nightly build as of two months ago). The fault lies with monos thread handling but voids attempts to get cc.net up and running.
The documentation on this can be tricky to find, if you don't notice the version numbers that the configuration examples/documentation adhere to (confluence.public.thoughtworks.org has the updated configuration documentation whereas ccnet.sourceforge.net has not. I know that the ccnet is most likely a dead site, but if your're not carefully reading the datestamps on every page you're visiting, this may bite you).
Furthermore, the sourcecontrol blocks for cvs and svn in cc.net are more granular and featurerich than their counterpart in the java version, but this has not been a problem in my work. The java version is also easy to extend/modify re: plugin behavior, but you would really just like to see this kind of work going upstream instead of forking.
I'm fairly impressed with both the java version and the fork in .net (modulo mono runtime behavior), but you really do not want to try any of the other forks of cruisecontrol. I've had peripheral experience with hudson, and the features were just not compelling enough to veer me from cruisecontrol. Hudson has a (somewhat coloured) comparison map of Hudson and CruiseControl (java) at http://hudson.gotdns.com/wiki/display/HUDSON/Home
A viable alternative is the python implemented buildbot (http://buildbot.net/trac). It does not have fancy gui dashboards and the setup is somewhat more commandline-bound, but if you're doing distributed builds, it's very easy to set up and get running.
I think for you it will come down to operating system, original can run on nix, and .net version runs on windows.
There are other automated build utilities that can do this as well, such as TeamCity in the windows space, and cruisecontrol.rb in the ruby world.
Also there is a PowerShell based build utility called pSake that can poll subversion and perform tasks.