Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

madhankumar kumaravelu

+ Follow
since Nov 30, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by madhankumar kumaravelu


I have a command that uses hyphen in java.

If i use " \u002D", then it works fine in jre 1.7 but fails in 1.6

Please let me know the proper unicode wherein it should work for jre 1.6

6 years ago

Iam using JavaMailAPI,FreeMarker and Struts.

We need to send an email which should support Multi-Mime part.

But iam able to send only the html part formatted properly (i.e. for the person
who has only text rendering capability this functionality is broken.

Please find the below sample txt file template:

From: "Sample" <>
To: "{firstName lastName}" <{SampleEmail}>
Subject: Feedback regarding {sample}
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Sample_a495b9d27a9d44e"

Content-type: text/plain; charset=utf8
Content-Transfer-Encoding: quoted-printable

Hello How are you!

Content-type: text/html; charset=utf8
Content-Transfer-Encoding: quoted-printable



Please reply me with a sample code
6 years ago


I have a jsp screen1 with lot of radio buttons and a text box.

Once some of these radio buttons are selected and text box typed with a value
and submit button clicked, it has to update the postgre DB with the selected radio
button's text and the text box value.

On successfull updation of DB, it has to redirect to a jsp screen 2.

Currently i have the jsp screen 1 but i dont know how to get responses and proceed.

Please help me with a sample code.

It is urgent!

6 years ago
Please find below the details when clicked the "Details" button:

Java Plug-in 1.6.0_26
Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Server VM
User home directory = /home/mps
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>

load: class com.vbridges.verde.client.VerdeClientProxyApplet.class not found.
java.lang.ClassNotFoundException: com.vbridges.verde.client.VerdeClientProxyApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(
at sun.plugin2.applet.Plugin2Manager.createApplet(
at sun.plugin2.applet.Plugin2Manager$
Exception: java.lang.ClassNotFoundException: com.vbridges.verde.client.VerdeClientProxyApplet.class

6 years ago
Hello All

I have applet class loader issue.

Please find attached the screen shots.

I have already checked the following:

->The Java plugin compatability (i.e. the jre version in the workstation is higher the java applet)

Environment details:

OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

The thing is this issue is not occuring only in few servers though all of them have the same
environment as above.

Once cache is cleared then the issue is not occuring.

Please let me know what could be the issue.


6 years ago
No, i have to look in to Jersey.

6 years ago


I have an automated mail generated using JavaMail API application.

This mail will have an link as given below:


Here, {name} and {link_id} are linked in the database .

When i click the above link a web page should be opened (i.e. jsp) with
the following URL:


Here: '1234'(Auto generated) should be specific to the person who clicked the link

Can i use REST URI?

Please let me know with sample code since i dont know how to use.


6 years ago
Source code means the class files in the jar file.

You can substitute the servlet container by starting up an embedded one in the double-clickable jar file.

Can you detail the above comment?
6 years ago
Actually, i have implemented and tested with the Eclipse IDE.


I want to know the command that will create jar file.

The client should only double click it and the application should run.


The created jar file can only contain the souce code.
The client should have the same environment (e.g. postgre installed) to execute it?

6 years ago

I want to know only how to create an executable jar file in linux/windows and

whether it can contain all the technical stuffs i have mentioned.

Obviously i cannot be in a position to start coding now and deliver by friday.

Implementation and testing are done.

6 years ago


I have to deliver a pilot applicationfor a java project involving Struts, Hibernate, SFTP for encrypted file transfer,GNU Privacy Guard (GPG) for Decryption/Encryption
and postgre. This has to be executed in either Windows/Linux environment.

The client wants the executable file of this application which should run in both windows and linux.

I have to send an executable file to my client by friday (this week).

Please suggest me how to do this.

6 years ago
Sure, I will look in to it..

Hope Apache James Mail Server can be used for real time project (i.e. capable of sending mails to any external mail server not
just gmail)?



* @author madhan
* Copyright (c) Ian F. Darwin,, 1996-2002.
* All rights reserved. Software written by Ian F. Darwin and others.
* $Id: LICENSE,v 1.8 2004/02/09 03:33:38 ian Exp $

import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;

import java.util.Properties;

/** SendMime -- send a multi-part MIME email message.
* @author Ian F. Darwin
* @version $Id:,v 1.8 2003/05/31 21:18:35 ian Exp $
public class SendMime {

/** The message recipient. */
protected String message_recip = "";
/* What's it all about, Alfie? */
protected String message_subject = "Re: your mail";
/** The message CC recipient. */
protected String message_cc = "";
/** The text/plain message body */
protected String message_body =
"I am unable to attend to your message, as I am busy sunning " +
"myself on the beach in Maui, where it is warm and peaceful. " +
"Perhaps when I return I'll get around to reading your mail. " +
"Or perhaps not.";
/* The text/html data. */
protected String html_data =
"<HTML><HEAD><TITLE>My Goodness</TITLE></HEAD>" +
"<BODY><P>You <EM>do</EM> look a little " +
"<font color=green>GREEN</FONT>" +
"around the edges..." +

/** The JavaMail session object */
protected Session session;
/** The JavaMail message object */
protected Message mesg;

/** Do the work: send the mail to the SMTP server. */
public void doSend() throws IOException, MessagingException {

// We need to pass info to the mail server as a Properties, since
// JavaMail (wisely) allows room for LOTS of properties...
Properties props = new Properties();
props.put("", "");

// Copy the value of into
// props.setProperty("",

// Create the Session object
session = Session.getDefaultInstance(props, null);
session.setDebug(true); // Verbose!

try {
// create a message
mesg = new MimeMessage(session);

// From Address - this should come from a Properties...
mesg.setFrom(new InternetAddress(""));

// TO Address
InternetAddress toAddress = new InternetAddress(message_recip);
mesg.addRecipient(Message.RecipientType.TO, toAddress);

// CC Address
InternetAddress ccAddress = new InternetAddress(message_cc);
mesg.addRecipient(Message.RecipientType.CC, ccAddress);

// The Subject

// Now the message body.
Multipart mp = new MimeMultipart();

BodyPart textPart = new MimeBodyPart();
textPart.setText(message_body); // sets type to "text/plain"

BodyPart pixPart = new MimeBodyPart();
pixPart.setContent(html_data, "text/html");

// Collect the Parts into the MultiPart

// Put the MultiPart into the Message

// Finally, send the message!

} catch (MessagingException ex) {

/** Simple test case driver */
public static void main(String[] av) throws Exception {
SendMime sm = new SendMime();

If i execute the sample code above i get the following error:

DEBUG: setDebug: JavaMail version 1.4.4
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "", port 25, isSSL false
javax.mail.MessagingException: Could not connect to SMTP host:, port: 25;
nested exception is: Connection timed out: connect
javax.mail.MessagingException: Could not connect to SMTP host:, port: 25;
nested exception is: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Transport.send0(
at javax.mail.Transport.send(
at SendMime.doSend(
at SendMime.main(
Caused by: Connection timed out: connect
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at com.sun.mail.util.SocketFetcher.createSocket(
at com.sun.mail.util.SocketFetcher.getSocket(
at com.sun.mail.smtp.SMTPTransport.openServer(
... 8 more

Yes iam just aware and this is an real time project with strict deadline..

Please let me know how to do this with some sample code?