Category Archives: Java

Lucene 2.3 – working example of Indexer and Searcher

Hi All, Now days I was working on Lucene a Java API that offers you search capability for your application. Lucene is a powerful search library that lets you easily add search to any application. One of the key factors … Continue reading

Posted in Java | 3 Comments

How to change Eclipse SVN Plugin Password

Subclipse does not collect or store username and password credentials when defining a repository. This is because the JavaHL and SVNKit client adapters are intelligent enough to prompt you for this information when they need to — including when your … Continue reading

Posted in Articles, Java | 38 Comments

A simple class for converting any Java object to XML string

In need to save XML representation of your Java object Here is a simple 200-line class that will do this using reflection. But don`t worry, there is some very powerful caching going on, so that the performance will be very … Continue reading

Posted in Articles, Java | 3 Comments

Java.io.IOException: Invalid header signature; read

Hi, Today I was creating a Java Program to read a Excel files (created by importing text log files)  using  POI HSSF and faced the following errors: java.io.IOException: Invalid header signature; read 8751655596022002505, expected -2226271756974174256 .  After a analysis i … Continue reading

Posted in Java, Troubleshoot | 10 Comments

com.sun.mail.smtp.SMTPSendFailedException: 530 authentication required (#5.7.1)

Errors: DEBUG SMTP: use8bit false MAIL FROM:<nitingautam@……com> 530 authentication required (#5.7.1) com.sun.mail.smtp.SMTPSendFailedException: 530 authentication required (#5.7.1)     at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1333)     at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:906)     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:535)     at javax.mail.Transport.send0(Transport.java:151)     at javax.mail.Transport.send(Transport.java:80)     at practical.Mailer.main(Mailer.java:37) QUIT com.sun.mail.smtp.SMTPSendFailedException: 530 authentication required (#5.7.1) … Continue reading

Posted in Java, Troubleshoot | 23 Comments

Testing Your Controllers

One of the reasons for setting up this page was I wanted to write something somewhere about the new testing techniques I've been using over the past few days. I'm working on a Java web application, using a fairly standard … Continue reading

Posted in Java | 1 Comment

Unit Testing with Junit, Spring and Hibernate – Part 2

This is a continuation from my previous post on Spring and MockStrutsTestCase and focus on testing Hibernate DAO’s. As I mentioned in the previous post, Spring framework provides a nifty base class (AbstractTransactionalDataSourceSpringContextTests) that provides automatic transaction rollback, exposing a … Continue reading

Posted in Java | 1 Comment

Achieve Automatic Transaction Rollback with MockStrutsTestCase and Spring

Spring provides a convenience base class (AbstractTransactionalDataSourceSpringContextTests which extends the TestCase class from Junit) to automatically rollback any updates made to the database at the end of a test method. This works great when integration testing Service and DAO beans … Continue reading

Posted in Java | Leave a comment