I am currently using the Spring 3.0 framework in a websphere 6.1 environment. The IDE I am using is RAD (Rational Application Developer) 7.5. I was working on a problem last night and I found that my code wasn't being 100% refreshed on the server after making a change in my workspace. My question is what is the difference from websphere's perspective between the following:
Restarting the entire server with an EAR installed
Cleaning an EAR within WebSphere
Clicking on the project and selecting publish
Do other Application Server / IDEs have the same type of syning issues when developing J2EE applications?
With RAD here's the default behavior. When you 'clean' it gets rid of the compiled objects and recreates them via a 'build all' then does a 'publish'. When you 'build' it builds anything it thinks is necessary then does a 'publish'. When you 'build all' it builds all objects then does a 'publish'.
When you (or your IDE via the commands above) does a 'publish' it takes all of your compiled objects and deploys them onto the server that you've setup for this project (via a hot swap if the server is running). Hot swaps work well for some things (such as JSPs) but not as well for other things (configuration files, EJBs, etc). If unable to do a hot swap correctly you need to bounce your server.
For example, if you have RAD setup to automatically build, your server is running, and you change an EJB what will happen is:
1. The EJB will be compiled
2. If the project is OK RAD will deploy your changes
3. The server will probably not be able to pickup your hotswapped changes so the server will continue to run the old code
When this happens bounce the server and the code will be picked-up.
Restarting the server will take some time but surely reload the files if they exist on the file system. I am not sure about calling Clean from the Servers view.
If you call Publish within Servers view, RAD will restart the application on the server. Thereby changes normally get picked up.
You need to understand what kind of change you did and see what WebSphere Application Server requires to load the change. If you scroll to the bottom of the linked help entry, you can see for each JavaEE module type a link to a document which describes what needs to be done to pickup the changes.
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_app_hotupgrade.html
Otherwise, you should understand the whole lifecycle of what happens from the change to picking it up in the browser, e.g. change on the file, file gets compiled, prepare for deployment runs, classloader sees the change, notices that application needs to be restarted, user calls Republish to restart the application on the server, user refreshes the web page, Firefox shows within Firebug that the Last-Modified timestamp in HTTP header changed.
I am not sure what hot-swap means but when debugging the server, hot code method replacement can replace a class within the debugged server if there is no reference held to the class or the class structure has not changed.
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM
Related
We needed to test a functionality on WebSphere.
While the dmgr had the updated code, we needed the old code.
So we stopped auto synchronization, restored the old EAR from backup and copied the EAR to the profiles/installedApps/cell/ directory while all the while having backup of the new EAR in the same directory (with a different name like EAR_bkp).
After the testing was done, we enabled auto synch again and ran a syncNode command to manually sync the EAR, but we are unable to see the new changes. We see the EAR file imported to nodeagents/cells/applications directory but changes are not reflecting on the profiles/installedApps/cell/ directory.
What could be the issue? Please suggest.
WebSphere ND has management tools for handling a variety of application updates without having to tinker in the directories on the dmgr or nodes directly, Applications > Application Types > WebSphere enterprise applications, then select the app, then click Update. There are several options described in the attached link. Also look at the Rollout Update option mentioned on the same page.
Application update from console
I have installed the GWT SDK version as 2.8.1. I am able to run the application in GWT with Jersy. But, when I try to run the application in GWT Development mode(Super), URL is generating like http://127.0.0.1:9876. When I place this URL in browser not loading the expected UI page. I am getting the page like,
When I click on Dev Mode On button, I am getting this page.
Even I clicked on module name (gwtsample), then I am getting the page like below,
I have even added the GWT extension in browser level and tried the same. But, still no luck.
Instead of trying with the eclipse downloaded GWT SDK, I have externally downloaded the same version of GWT SDK and applied in the Project Properties > GWT > General Settings. Still, facing the same issue only.
I have observed one more thing is, in project facets GWT version is showing like 1.0 where originally I am using 2.8.1 version of SDK. My project is configured with Maven.
I have even gone through multiple questions and solutions which are mentioned in stackoverflow as well as other websites, still, no solution found.
Links which I referred was,
GWT Super Dev Mode
Debugging in GWT Super Dev Mode?
GWT Super Dev mode and in production
some other as well...
You have to compile your GWT application and host in a webserver.
Then navigate to this webserver with your browser. And finally press the DevModeOn bookmarklet to switch to superdevmode.
Drag the bookmarklets (Dev mode on/off) to your bookmarks bar
Compile your gwtsample project into a war
Deploy the war into a webserver like tomcat or jetty
Take your browser (Chrome highly recommended for GWT debugging) and navigate to your installation : for example http://localhost:8080/gwtsample
Now you are just seeing your compiled version in the browser
Next hit the "Dev mode on" bookmarklet.
You will see a message in the browser that compilation is taking place
Now you are in SuperDevMode
Change something in your code
Hit F5 in the browser. Now a recompile will happen and you will see your changes
You can always hit "Dev mode off" to switch off superdevmode. Now you will just see your original compiled application.
Extra : if you are using Eclipse I highly recommend using the branflake plugin : https://github.com/gwt-plugins/gwt-eclipse-plugin
He has some great videos of how to use it : https://www.youtube.com/watch?v=DU7ZQVLR5Zo&list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT
This way you don't even need to compile and host in some webserver as you can run with an embedded Jetty webserver.
You need a HTTP server to serve your HTML host page and webapp (Tomcat, Jetty, Wildfly, Apache+PHP, Rails, choose whatever you need).
Then, launch GWT's CodeServer with -launcherDir pointing to where your webapp lives. It will create a *.nocache.js specific for SuperDevMode, possibly overwriting your production one.
Now, load your webapp as usual from the web server, the specific *.nocache.js will compile your sources on the fly.
If you can live with a simple servlet container, then DevMode (instead of CodeServer) will do all the above setup automatically: use -war instead of -launcherDir.
You shouldn't need to open the CodeServer URL (on port 9876 by default) or use the bookmarklets with any recent GWT version, starting with 2.7.
I'm currently working on developing a custom workflow with many custom behaviors and scripts. I'm using the Alfresco Maven SDK to build and test my project as I develop it. This necessitates that I restart the repository-tier tomcat server every time I want to make a change/update my workflow files. I am getting quite frustrated with how long this takes each time, and it means that I'm wasting time while waiting for the server to restart, especially when I've made a small typo in one of my files.
I'm looking for a way (if it's possible) to update my files (in particular the bpmn process file) and apply these changes to my Alfresco instance without having to restart the tomcat servers each time. I've set to true in my service-context.xml, and I have also tried to redeploy the workflow from the admin-workflow-console, but my changes do not take place unless I manually restart the server.
I am using: Alfresco Community 5.2, Maven SDK 2.2
Any tips or suggestions would be very welcome!
Yes, you can do it by
workflow admin console
URL
http://<server>:<port>/alfresco/s/admin/admin-workflowconsole
Ex :: deploy alfresco/workflow/<workflow-definition>.xml
path for your workflow definition file.
Refer this docs for more information
https://community.alfresco.com/docs/DOC-5079-workflow-console
I'm using Jasper Reports as part of my Spring application. I deploy my application on a Tomcat 6 server through eclipse, so my project is a WTP project. The problem I have is that when I change a Jasper Reports file (jrxml) I need to restart the server in order to get the changes published. I already checked on the deployment folder and the .jrxml is updated, but for some reason the browser keeps getting the old report, I already cleaned the cache on the browser without luck.
Any ideas on how to solve this, is super annoying when doing development.
I suppose that you use ireport to change .jrxml, when you save changes in that, the eclipse will not be immediately notified that. So you need to fresh your project in eclipse, if necessary, clean and rebuild the project, and redeploy to tomcat.
Also, you can set eclipse to auto build project (Porject-->check Build automatically) and keep refresh the project. When you see the status 'Synchronized' of your project changes to 'Republic' in the 'Server' View, you can restart the server and see the changes. Press 'ctrl+f5' to fresh the page with refreshing all the cache.
I would like to know what is debug mode in jboss. I've used django before and when I turned on debug mode, any change I make while the localhost is running will be detected and refreshing the page will show the changes. Is that the same in jboss debug?
I use maven to install the project then start jboss in windows command console. How do I turn on debug mode for jboss 5.1.1?
Maven clean install takes about 8 minutes, then restarting the server is another 5-7 minutes. I am wasting a lot of time for many small changes.
You can enable remote debugging on the JVM allowing you to connect via your IDE and you can from there run your app in bebug (stop the execution and go step by step). Look on the statup script, the remote debug option has been put in comment. Debug allow you to update some class (you need to connect the IDE to it and update your class via the IDE, the JVM and JBOSS won't detect the change them self). But if you update any container managed part (EJB, persistance context, servlet) you will need to redeploy the application. So I don't think it will give you what you need.
Why do you do a clean install each time? A simple install should create your package and prevent any compilation, file copy if the source is older than the build artifact. You can also redeploy your application without shutting down JBoss. There is Maven goal for that. By default I think, if JBoss detect that the application file (ear or war) has been change (the timestamp is lower than deploy time) it will redeploy the application (some time redeploy is unfortunately not enough, most of the time class loader issue. Never get issue with JBoss as 7 but class loading has been redone).
If you can upgrade to JBoss AS 7, it is far quicker and Java EE 6 make your application lighter impacting positively the build time. But this may require to much refactoring.