what is debug mode and how do i turn it on using jboss in windows command console? - debugging

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.

Related

Alfresco: How to update repository-tier workflow files without restarting the tomcat server?

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

Why is IntelliJ skipping breakpoints while remotely debugging

I have been asked to debug a Java application installed in Apache Karaf (OSGi) running in a VM hosted on my dev machine. My colleague has been able to do remote debugging successfully using Eclipse. My tool of choice is IntelliJ and in my attempts to debug remotely, IntelliJ connects successfully (via socket). If I pause the debugging session, the Karaf console freezes as expected and resumes when I click continue. But when I am paused I can see the following message in IntelliJ and my breakpoints are ignored.
Target VM is not paused by breakpoint request. Evaluation of methods is not possible in this mode.
What does this mean? I have searched and also gone through the documentation for IntelliJ. Why can Eclipse allow working breakpoints and IntelliJ doesn't?
Firstly, one presumes that you have started up your OSGI container (for example, Fuse Fabric) in debug mode. Often this is done by adding the argument debug to the start script.
For example:
c:\> startfabric.bat debug
As Tim noted, you just now need to make sure that your source code is exactly synced with whatever is deployed to the OSGI container.
To be sure, check out the exact same source code version as what is deployed to the server, and choose Build -> Rebuild Project. If necessary, do a mvn clean install on your machine, and deploy a bundle / feature that you have built yourself - then you know that the code you have locally should exactly match what is deployed.
Lastly, check your debug panels in IntelliJ, and remove any Watch expressions that might be interfering whilst in debug mode.

Is it mandatory to install tomcat 7 to install klaros test management community edition even though there is tomcat installed and running

We are trying to install the Klaros-Testmanagement test case management tool (Community Edition). While installing, the Apache Tomcat application container will be installed by the package automatically.
My doubt is even though there is tomcat running, why tomcat server needs to be installed again.
Is there any work around for this?
Klaros-Testmanagement is supported and tested with the supplied Tomcat version only, which also contains some configuration changes from a vanilla Tomcat distribution.
The rationale behind this is to update the distribution on a regular basis and ensure that JVM memory settings and other parameters are configured properly.
If you are feeling adventurous you can try using another version of Tomcat or a completely other application server.
For this you may download the .war only distribution and install it in your container.
Make sure you are picking up configuration changes in the conf and bin folders by diffing them to a vanilla tomcat distribution.
You definitely have to:
Raise memory limitations, esp. MaxPermSize when running under Java 7: -XX:MaxPermSize=192m -Xms256m -Xmx768m or more if needed/available.
Disable session persistence: Uncomment <Manager pathname=""/> in conf/context.xml
Beware that other configuration changes may arise in future releases without further notice, so you are pretty much on your own if things stop working.

is it possible to run gradle in live mode

In sbt there is a live mode, if I use sbt ~run, then every time a java source changed, it will reload automatically. playframework also support that so that when change a source code, we don't reload manually. For gradle, I am running spring boot, but need to shutdown it and then startup after change some code, even if I am using --daemon, it still need some manually work. Anyway to load the code automatically?
A live mode for Gradle is in the works but not currently available. Plugins such as spring-boot may of course provide their own solution.

RAD (Rational Application Developer) -- Clean vs. Publish vs Restart

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

Resources