Instant update of basic cloudbees java application run locally - java

Trying to run basic java application (backbone.js and jax-rs) I was pleasantly surprised that modifying js or html file in src/main does not require application rebuild. Just refreshing it in browser is enough to update the application.
However changing java file, I can't find how to make application be updated locally.
Using Eclipse it's automatically compiled into target/classes, however applicaiton is not updated in browser. I can't find any bees command to cause update. I don't see compile command also.
Killing running tomcat and 'bees run' makes the trick, but the question is, if instant update is possible in case of basic java web application?

I'm not sure how to do it with a normal Java app. One option would be to use Playframework has this auto-reloading stuff built in, and is supported well on CloudBees. http://wiki.cloudbees.com/bin/view/RUN/Playframework

You need to use something like JavaRebel or Javeleon if you wish to reload Java classes in a running application.

Related

Fastest and Easy way to apply changes made in Java spring apps while running app locally?

Previously, I used to work with Angular app development, we had a hot reload button (in VS code) that enabled us to instantly apply the latest code change while the app was running locally.
I am looking similar way to re-apply code changes when the JAVA spring app is running locally. My JAVA project uses Maven to build. As of now, I first stop the local server intellij server panel on IntelliJ. Then I run 'mvn clean install' to apply the latest code changes that were made while the app was running. And then deploy the JAVA spring app in the local WebLogic server.
The process takes 5-10 mins to apply the latest code changes made while running the JAVA spring app.
Is there any other way to achieve this? And also to apply new changes, do we need to maven build the project every time and deploy it?

Install and uninstall a java application in ms-windows

I have created a java application.
I also created another java application which install the first application.
The program runs perfectly.
However the program isn't displayed in control panel->programs.
I also want to create an uninstaller (let's say unintaller.bat). But i want to works like any other uninstaller. When someone goes to Control Panel->serach program->uninstall this program it will run the uninstaller.bat
In other words, the concept is how to declare the java application in windows...
Any idea???
Installing an application doesn't necessarily mean registering it with the operating system. For example, for a Mac, I can open an App without having it added to the Applications folder.
Same with Windows. Just because a new file can be added to the Start menu, it doesn't mean it was registered.
Use a Windows installer. There are tons that are open source, and even MS provides a free one: http://support.microsoft.com/kb/942288.
This will allow you to install an uninstall an application using standard tools. Yes. It can be called from a bat file.
Java open source installers: http://java-source.net/open-source/installer-generators

Export Processing Project as aWeb App

I've made a cool processing project that I would like to embed on the web; however, it uses 3rd party Java libraries to access an sqlite database. For this reason, the normal export-to-javascript which has worked well for me in the past is just not capable enough here. How can I make my Processing project into a Java applet that will allow it to be run remotely?
This depends upon what version of Processing you are using...
It was only in the final move to 2.0 that they got rid of the 'Export to Applet' option, so if you can make do with a 2.x-beta version, you're golden.
Of course, that's just through the PDE - so failing the ability to move to an earlier version, the library itself should be able to handle it still, from a different IDE, say Eclipse or NetBeans...
I guess the other option would be to see if you can port your library to a JavaScript library ?

Updating existing installation using java web start application

I have been using Java web start for my application and I know accessing the application using web url will guaranteed the most recent version but I am curious to know if there is any way we can force the java web start application to automatically uninstall the existing version and update the application to the latest version while accessing through the shortcut.
I don't think there is a way to do that. Since you are using the shortcut you are using the local downloaded copy of the JNLP file when starting javaws. You (or your users) will have to click on the 'start with webstart' link on the site to ensure that the newest JNLP is downloaded which can then include the update application jars.
We do not allow shortcuts for our JNLP webstart applications which means the users must always use the link on the webpage to start our application for this exact reason.
You can use javaws -uninstall to remove all applications from the cache.
Or javaws -uninstall <jnlp-file> in order to remove a specific application.
The application should update itself automatically. If you want to be sure only the new stuff is downloaded you can delete the cache (this sometimes help when there are problems). The location of cache under Windows 7 is usually at ..user\AppData\LocalLow\Sun\Java\Deployment\cache\

Java service wrapper to create service for Java UI application

I have created a Java application which needs to run as a service. For service wrapper I tried using tanuki and other wrapper softwares.
Now, my application does run as a service - however, it runs as a service under SYSTEM and not under currently logged in user.
My application has a UI, which does not show when the application is running as a service. I doubt that this has happened because the service is running under SYSTEM and not under currently logged in user.
When I run the application (without installing it as a service), the UI does show up and I could see the java process running under the current user's id, whereas it runs under SYSTEM when installed as a service.
Now, there is nothing to my application if there is no UI. I need to application to run as a service when the system boots up and the UI needs to show up as well.
Has anyone tried to do what I am doing here and has faced a similar issue. If so, how did you go about resolving it?
Is there a different wrapper service that I could use and not have this issue.
Tanuki's documentation does explain setting a java application as a service, but does not talk about a java applicaiton with a UI and running it under the currently logged in user.
Update
Just so that folks here could get a bit more idea as to what is it that I am trying to accomplish - the behavior that I am trying to have with my app is similar to how Dropbox or Yahoo Messenger or any other software has which starts with Windows boot and continues to run in the background, allowing the users to interact with it using the system tray icon. So basically all of this has been built in Java/Swing. Now when it has come to deployment of the app - I can run it standalone but running the jar file or by creating and running an executable wrapper for it. However, I want the software to start with Windows boot and continue to run as a service in the background, while allowing the user to make changes and interact with it via lets say bringing up the UI from a system tray icon that it sets.
As of now, it does run as a service successfully. It performs all the actions that it ideally should - there just is no system tray icon to bring up the UI and make changes to its configuration.
Update - 2
Ok.. I tried advanced installer and it does wrap up everything for me to generate an exe installer for windows. Now all I need is to auto-start the software. Can anyone help me with this? I don't see an option in Advanced installer to automatically have the program add itself up in the auto-start.
Link to tanuki's doc http://wrapper.tanukisoftware.com/doc/english/faq.html
Rohan,
Please take a look at the following page:
http://wrapper.tanukisoftware.com/doc/english/prop-ntservice-interactive.html
You will need to mark the Service as interactive and then run as the SYSTEM user in order to get your GUI to show up on the first logged in desktop.
The problem is that Microsoft changed what services are allowed to do starting with Windows 2008 and Vista. This means that starting with these versions, the GUI will always show up on a sandboxed desktop which the user will need to switch over to.
If you want to show a GUI on all desktops, in all versions of Windows, you will need to run the JVM within the desktop.
Cheers,
Leif
I wanted to comment on your question, but I don't have enough reputation to do it. So I'm misusing the answer function now.
I have a similar problem. I used the tanuki wrapper for a while now on a Windows XP machine and the Swing GUI was shown to all users who logged in.
Now I migrated to Windows 2008 Server and configured the current version of the tanuki wrapper like this:
wrapper.ntservice.interactive=true
wrapper.ntservice.hide_console=true
(see documentation here and here)
The Windows service runs under the LOCAL SYSTEM account.
But the GUI is still not shown. Did you find any solution to the problem?
Don't think you should have a UI with a service. Put it in the startup group instead ?
What's does the UI and application do?

Categories

Resources