Publishing of JS files on tomcat in eclipse - java

I want my javascript files to publish automatically when I change them. The problem I am facing is when I keep the Publishing settings to "Never publish automatically", eclipse does not publish anything (which looks to be expected) . But when I keep the settings to "Automatically publish when resource changes", it publishes js files and restarts the server as soon as I change a java file to make the java changes effective. I end up waiting for 2-3 mins of server startup time for my project. In such a scenario both settings are appearing to be not useful to me.
Is there any setting by which I can avoid the java changes to get effective till the server is restarted but the JS changes start appearing without a restart ?

Yes, keep the publish resources option and disable "Modules auto reload by default" from the "Server Options" section in the same view (bottom).

Related

IntelliJ not updating Glassfish Deployment

IntelliJ is acting odd with its redeployment settings.
In the "updating applications" tab it has on the bottom for debugging:
,
I have tried to use all of the update options in order to update my application (update classes, update classes resources, restart), and NONE work to update my server. I have even closed and rebooted IntelliJ and the updates still don't appear.
The update is a simple alert message that is triggered when the index.html is loaded. It works when I load the html manually, but when I run the server, it does not alert, meaning it is still using a previous iteration of my server? This is really frustrating as I can't see any of my changes and don't know how to fix my server.
I am using the latest Glassfish server and latest IntelliJ IDE. It does update my resources EVENTUALLY, but not through some defined pattern as far as I can tell.
Below is the copy of my answer from your other post. I would suggest to close this one and to continue discussion in single thread (if still needed).
The expected sequence is as follows:
make a change to a resource
update the application on the server with the mentioned 'Update <> application' action: 'Update resource' choice should be enough for an exploded application, redeploy/restart may be needed for archive artifact
reload (refresh) the page, that uses the resource in browser
I suspect you're missing the last (3) step. Please note, step (2) only updates the resource on the server, and to see a change in browser (on client) you should reload the corresponding resources from server by refreshing the page manually.
Hope that helps,

Dev Machine JBoss Deploy, Quick Refresh of Webpage with Changes

I have a dev machine, which deploys a java project to a local jboss server.
I have an IntelliJ maven project that has some html/js/jsp/servlets, etc. Is there a way to edit the code of the html/js files and then do a refresh of the webpage and see the updated changes without having to redeploy?
When doing just front end apps, I can accomplish this with a node server using gulp watch.
I'm hoping for something similar with my jboss server setup (intent is to simplify architecture and try to get the same front end development speed but have it all contained within a war). If I need to some how use gulp watch with maven, I'm good with that too, as long as I can make changes in the front end code (html/js, I assume changes to jsp/servlets would require a redeploy) and refresh the webpage and see the changes right away. I've also seen people write scripts to copy files from source into an exploded war before, but nothing that was automatic like gulp watch. My googles have failed me, anyone know how to accomplish this?

IntelliJ productivity tips running tomcat

I'm developing using IntelliJ 11u on a spring mvc application using tomcat.
I tried the maven jetty plugin, but after a few builds I keep getting java permGen issues and then it just hangs. I was told this was because spring uses log4j and it has some sort of leaks?
Anyhow, I'm asking for tips to help fire up a server, tomcat, with my updated code so I can make quick updates and have tomcat reloaded.
Here are my current annoyances with tomcat:
Only code changes seem to get auto-reloaded, if I make changes to my view pages things don't get updated unless I redeploy. The maven jetty plugin seems to map to my view pages directly and I saw updates to my view pages instantly w/o it even redeploying.
if I have more than 1 thing running in intelliJ, like say I have a main program that I run, or a unit test, IntelliJ seems to re-order what gets run in the run drop down menu and also the shortcut keys get changed to the last thing I ran.
I use google chrome, for some reason when I start tomcat it brings firefox to the forefront and opens a new tab each and every time.
If someone can address any or all of the above issues that would be great as I hate this dance I have to go through just to update/redeploy my application. I wish it could just be a consitant method, using shortcuts or automatically without me having to close the tab created in firefox, and then minimizie it, or redploy for a simple view change etc.
You should configure IDEA to update classes and resources and enable a checkbox in the Run configuration to do it automatically on frame deactivation.
Browser can be changed in IDEA settings and you can disable opening browser at all in Tomcat Run/Debug configuration.
As for the Run panel tabs order, you can pin tabs using the tab right click menu, in this case they will remain in the Run or Debug panel in the order they were created.
Look at JRebel if you want an even more productive environment (It costs, but I find it is worth it). As you can see here, http://zeroturnaround.com/jrebel/features/, it increases the types of changes you can hot-swap (no waiting for a build). I am currently evaluating it myself and will probably pick up a full license.
BTW, if you develop in scala (it looks like you're not, but just in case) the plugin is free.

GAE - Development server in Eclipse doesn't update?

I'm using the Google AppEngine development server on Eclipse. My local webpage just doesn't seem to update until I do a number of restarts on the Development Server (using the Run or Debug buttons from Eclipse).
What am I doing wrong ?
The basic flow is:
Make change to .java file...
Save file
Run application (development server loading log shows in console)
Refresh web page in browser
P.S: The only way I can get it to work is to change the server port... and if I do that all the previous servers still show at their respective ports. They never stop.
You do need to restart the server to see most code changes you'll make. The easiest way to do this is with the yellow reload button that appears on the GAE pane - not the console, but the one that has the fancy "click here to launch" addresses.
If you do use the debug / run commands in eclipse, you will need to explicitly stop the previous run. You can do this from the debug menu (the stop button) or from the GAE pane or from the console pane.
You won't need to change the ports after this - the reason you have to do it now is that the first instance is still running, hogging the port. Once you stop it you'll be able to run it again on the same port... WITH your code changes! :)

Clean Working directory of Tomcat in Eclipse

When I work in on an servlet application in Eclipse, I have to choose Clean Working Directory in the server tab of Eclipse for the changes to be visible in the browser. Is there any way to make sure that I only have to build my servlet and the changes are immediately visible?
Doubleclick the Tomcat entry in Servers view, go to the Publishing section and select Automatically publish when resources change.
It by the way won't happen that "immediately". It might take around 3 seconds, you should see this activity in server logs. Although a slow starter, but Glassfish publishes in a subsecond. You may consider it instead for fast development.
Honesty, i do not think this is possible.
It is like programming in javascript and there is no way to see the result without clearing the browsers cache and reloading the page.

Categories

Resources