Tuesday, August 30, 2011

Remote Debugging Eclipse Indigo & JBOSS 5.4

I am tired of putting logs and trying to identify the errors or track various stuff. So I decided to configure remote debugging for my project which is running in JBOSS server.

The steps to configure is given below.
  1. Make a backup copy of your current JBoss run.bat
  2. Open run.bat and find the lines that look like this:
    1rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
    2rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
  3. Uncomment the second line by deleting "rem", and save.
  4. Start Jboss. (It won’t do much until you connect a debugger to it.)
  5. In Eclipse, open your project, and on the toolbar click on the debugger bug arrow, then Open Debug Dialog. If you couldn't find it quickly, Go to Run, Debug Configurations , Select Java Remote Debugger and Click on New.
  6. Choose Remote Java Application, right-click, New… and update the port to the address in the line you uncommented (possibly 8787).
  7. Click Debug
  8. Set a breakpoint somewhere in your code or a library that has source attached
  9. Exercise your project (via a web service, for instance) and when it hits one of your breakpoints, it will break in Eclipse.

Saturday, August 27, 2011

How to check file size of directories in UNIX

#check partition sizes df -h  #check directory size du -s -h /var/log/  #check every directory and file sizes under a dir. du -s -h /var/log/*  #check individual size size du -s -h /var/log/lastlog 

Sunday, February 13, 2011

wget - GNU Wget Manual

GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.

Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant user's presence, which can be a great hindrance when transferring a lot of data.

Wget can follow links in HTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as ``recursive downloading.'' While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the links in downloaded HTML files to the local files for offline viewing.

Wget has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved. If the server supports regetting, it will instruct the server to continue the download from where it left off.

Tuesday, January 4, 2011

"connect by prior" in Oracle

For eg.

SELECT employee_id, last_name, manager_id
FROM employees
CONNECT BY PRIOR employee_id = manager_id;

A condition that identifies the relationship between parent rows and child rows of the hierarchy.

Tuesday, November 9, 2010

Telnet in Windows 7

Today I got an error while trying to use telnet in my windows 7 machine.

Refer this link and resolve this issue.

http://www.question-defense.com/2010/07/23/windows-7-telnet-is-not-recognized-as-an-internal-or-external-command

Tuesday, August 17, 2010

32 bit or 64 bit for web server

We had a confusion on how to go about the webserver, which 30 concurrent users are assumed to be using at a time. The application we are developing has a desktop component and webcomponent. So we decided to go with 32 bit OS for development and 64 bit OS for webserver. Webserver requires more RAM and also better configuration. I shall update this session on what all problems we will face during the course of project in this thread !!

Thursday, July 29, 2010

Data Transfer Object From Client to Server

I am designing a distributed application, and to satisfy a single client request, I found myself making multiple calls to a remote interface, which increases the response time beyond acceptable levels. I found out a solution by using DTO (Data Transfer Object).

When designing a data transfer object, you have two primary choices: use a generic collection or create a custom object with explicit getter and setter methods.

A generic collection has the advantage that you only need a single class to fit any data transfer purpose throughout the whole application. The main drawback of using collection objects for DTOs is that the client has to access fields inside the collection either by position index (in the case of a simple array) or by element name (in the case of a keyed collection). Also, collections store items of the same type (usually the most generic Object type), which can lead to subtle but fatal coding errors that cannot be detected at compile time.

Better option would be going with a DTO class object. In Dotnet, it already provides you with a DTO object called Dataset. You can add DataTables, their relationships and transfer across various modules.