quarkus hot deploy without saving file - quarkus

I use hot deploy ./mvnw compile quarkus:dev. According to the documentation, I do only need to change the files without saving it and refresh the browser. However, in my case hot deploy does only work if I save the file before requesting the page. I used the getting-started-project from quarkus quickstarts. My question is: Is this the right behaviour (change file->save file->request page) and the following statement wrong (change file->request page):
https://www.baeldung.com/quarkus-io (section 4: hot reload)
In other words, changes made to Java files or to configuration files
will automatically be compiled once the browser is refreshed. The most
impressive feature here is that we don't need to save our files. This
could be good or bad, depending on our preference.

You absolutely need to save your files for hot reload to be triggered.
The update is based on the file timestamps to have changed.
What you don't need is recompiling your application or restarting anything.

Related

Can't save when running "jekyll serve" on Windows 8.1, Notepad++

I am trying to use jekyll locally to build my website. It is all set up, and I can build and serve and see results at localhost:4000. There are no errors.
The problem is that when I run "Jekyll serve" I can't save files. The save option is greyed out and "ctrl + s" wont work.
I can open and edit the files, can do "Save As" and do other things - basically anything except saving.
I can save files when I am not serving them.
From what I understand, Jekyll is intended to be used to allow saving while serving so we can see our changes as we go. The auto-regenerate function (now a default with serve) supports that use.
I suspect the problem relates to some sort of permissions-type rule stopping me from editing files that are in use.
But because I am self-taught newbie and am not a developer/programmer, I don't know if it is something to do with how I have set up jekyll, notepad++, permissions or something else entirely.
Here is my environment:
Windows 8.1 64-bit
Ruby v2.1.5p
Jekyll v2.5.1
wdm v0.1.0
RubyDevKit
Notepad++ (in admin mode)
Here is what I have tried:
Scaled back the listen gem from v2.10.0 to v2.7.11 (the earlier was listed as safe/tested on a jekyll on windows website)
Scaled back Jekyll from v2.5.3 to v2.5.1 (the earlier was listed as safe/tested on a jekyll on windows website)
Opened Notepad++ in admin mode instead of normal mode.
Tried executing jekyll serve --watch (in case watch enabled saving)
I have not tried re-installing ruby v2.1.3 (listed as safe/tested on a Jekyll on windows website) because Jekyll is otherwise working I don't want to try a re-install except as a last resort - as a newbie I found it a pain to install it on Windows in the first place.
Can anyone help me with this (probably simple) issue?
I thank you for any assistance in advance.
Okay. So I feel really stupid.
But instead of pretending this never happened, I had better post this answer in case anyone else has a blonde 'moment' (read: an entire day) like I did:
Firstly, you can't edit the _config.yml files while serving. You can edit the other files - html, markdown, etc - but not the config file.
Secondly, in Notepad++ you need to make an actual change to a document before the saving option will appear.
I was using the _config file as my 'test' document for regeneration. While I did open up other files to check when I first thought I had an issue, I THINK I may not have made any changes to them - so the option to save them was never activated. After that, I only looked at the config file after making changes.
So, I THINK I may have been able to save while serving all along.
However, if I am wrong and it wasn't my own stupidity (which I strongly doubt), the steps I took which fixed it were:
Those steps outlined in my question; and
A reinstall of Notepad++ (as kindly recommended by 'nerver nerver' who has since removed his/her comment after I said that did not work).
SORRY ... and excuse me while I go and crawl away and hide in shame ...
If the files you were editing at that time was only _config.yml then the expected behavior is that the saved changes are not reflected when the Jekyll server is running/watching.
This is because the server is started after reading the configuration settings in _config.yml, and then changes that happen to that special file after that are not monitored by Jekyll (this is current as of May 2015, in case this gets changed in the future). Currently this is by design. see this SO question as well
What that means is, you have been saving the file when Jekyll is running just fine, the changes just do not get updated. A way to check this is to make some changes, close the file, then open it again (if you want to be extra sure, open in another editor) and see if reflected changes show up.
Changes made to other files in Jekyll when the server is running will be reflected. For example, if I edit a typo in a blog post, edit CSS files or change some formatting, and save in any text editor, Jekyll will regenerate the file from scratch and you should be able to see the changes by refreshing the localhost:4000 page (or whereever your server is running at).
I'm not sure about running Jekyll on Windows, but on a Linux terminal, Jekyll actually notified the number of files that have changed (with a timestamp) and that it regenerated X number of files. Something like
<timestamp> 3 files have changed. Regenerated 3 files in 0.0536 sec..
Lastly, this is probably not your issue, but I thought I might add this here for future reference, do not edit the files inside the _site folder, as they are always deleted and regenerated whenever the server is started again. Editing those files by hand might save and display changes, but the changes will be lost (because they are, statically generated every time by Jekyll)
TL;DR You most probably have been saving your files! The changes in _config.yml are just not reflected once the server is running, and has to be restarted for the new configuration parameters to take effect.

rational application developer - WAS server synchronize

I'm a newbie in RAD ide and currently I always restarts the server everytime I make a change.
I'm wondering what is usually the most efficient way when deploying an ear file to WAS upon code changes.
1) If the WAS is auto synchronize, does it mean that on every ctrl+s I make, it will redeploy immediately?
2) If auto synchronize is off, does changing a resources like jsp or xhtml pages would reflect without restart? How about changing java codes?
As much as I would like to try these right now, I do not have a license of RAD at home.
Thanks in advance for all the help.
In general you should try to avoid restarting server as much as possible, as it takes time. It is better to Republish, or remove and then add application to server.
1) If the WAS is auto synchronize, does it mean that on every ctrl+s I make, it will redeploy immediately?
Not immediately, it depends on the Publishing interval setting in the Server settings > Publishing (I don't remember the default, it is about 10-15 sec).
2) If auto synchronize is off, does changing a resources like jsp or xhtml pages would reflect without restart? How about changing java codes?
Restart has nothing to do with that, only republishing.
Behavior depends on other publishing options - In the Publishing settings for WAS in server settings you have the following options:
Run server with resources within the workspace
Run server with resources on Server
If you run from workspace, changes will be detected and application will reflect changes (if change in the java code application will be restarted).
If you run with on Server setting, then changes will not be reflected until republish not restart.
Restart is only required, if you change some settings on the server, e.g. changing datasource settings, security settings, etc..
For synchronizing - if you have large project, and making lots of changes it is usually better to temporary remove application from the server to avid constant republishing or disable automatic publishing.

Force JBoss to reload JavaScript files

I am using JBoss Application Server 4.2.
I have noticed that when I update an .xhtml file, my local server will immediately reflect the change. However, if I update a .js file, it will not update until I restart the server. This is a huge hassle when I am working with .js files; any time I want to test a change, I need to restart the server.
Is there a way I can force JBoss to stop caching the file? Please note, solutions like this one don't work; the framework automatically includes the .js file, and I cannot change the <script src="..."> text manually.
This isn't a very elegant "solution," but I have three workarounds I've been using which mitigate the problem. I'll post them below for anyone else who has the same problem as I did:
Edit the .xhtml file on the server to add a dummy GET variable to the filename in the <script src="..."> tag. See here. In my case, because I'm using an external framework, this meant editing a XML file, which the server apparently doesn't cache.
Advantages: this will reload properly every time.
Disadvantages: I have to make sure I don't deploy the code to production with the dummy GET variable. Also, I lose any breakpoints in my debugger, which doesn't recognize that it's the same JS file.
Edit the file on the server, then make the exact same changes dynamically in Chrome debugger. See here.
Advantages: no need to worry about breakpoints or deploying bad code. No need even reload the page.
Disadvantages: the changes disappear as soon as I hit the reload button. Also, it's easy to make a mistake when synching the code.
Put the JavaScript code in the .xhtml file under its own <script> tag, then migrate it over to the .js file when ready to commit the changes.
Advantages: page reloads properly each time.
Disadvantages: migrating the code to the .js is a hassle, and it's easy to accidentally introduce bugs.
Neither of these solutions is perfect, but they work as decent patches. Of course, if anyone has a real solution to actually make the server stop caching the file, I'd still love to hear it.

Clearing cache in the server

This is related to my problem here:
Editing velocity template of Liferay changes not showing or takes a while
I've tried to investigate the caching problem and tried different things. Here's what I found out.
I just found out that my css is also delayed in showing the updates. I tweak my css file adding comment and testing it on my browser. Now just requesting it on the URL it will just give me an older version of the file. now if i put a query asking for version, (eg. mystyle.css?v2) it will pull the latest file and it records it. I can even see different version, eg. (mystyle.css?v1) or (mystyle.css?v2. I've cleaned my cache so it's definitely on the server side (i think).
Is there a way I can clear my cache?
Thank You!
you can activate Liferay's developer setting by including the properties that are in ROOT/WEB-INF/classes/portal-developer.properties.
Explanation: Liferay minifies and caches CSS and Javascript - once this is done it will not examine those for changes. The developer settings will disable that.
However, you don't want this setting active in production as this will mean that you'll have to load dozens of files instead of very few combined+minified, well cached, files.
I assume you are using this for development, not in production.
If you're having these problems in production, you should rather work with a proper theme plugin and redeploy that.

How do you flush Netbeans synatx error information?

Opps: This is the same as: Is there a way to reset the error badges in Netbeans? but I don't know how to mark it as such ...
My version of NetBeans 6.9.1 is currently showing a large number of syntax errors in many files, in many projects.
But, if I look at the errors, they are invalid. For example, one error says that an import is referencing a non-existent file. However, that file exists and has no syntax errors.
More importantly, despite all of the errors, the code compiles cleanly and runs correctly.
My guess is that NetBeans is caching some data (OSGi?) that is out of date or has been corrupted. This has happened before, but in the past it wasn't this bad and it magically cleared itself.
I've tried starting and stopping NetBeans, but that doesn't do it. If, as in the above case, I use NetBeans to resave the imported file, it goes away after a minute, but for large projects this is very time-consuming. (Note that I am using jVi, and saving with that embedded editor doesn't not fix the problem, it has to be the NetBeans save command).
I'd really like to find a simple way just to force the whole internal state to refresh itself. Does anybody have any ideas?
To clear this error you need to shut netbeans, go to the .netbeans folder in your home directory C:\users\.netbeans for Win 7,
in there you will see a folder for the version you are using.
in there is a folder called var
delete this folder then re-run netbeans.
This clears the cache in Netbeans allowing it to re scan the folders correctly.
I found a useful plugin you can use called Cache Eraser.

Resources