This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!

madhankumar kumaravelu

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

Recent posts by madhankumar kumaravelu

Hello

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

Thanks
Madhan
6 years ago
Hello

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" <feedback@sample.com>
To: "{firstName lastName}" <{SampleEmail}>
Subject: Feedback regarding {sample}
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Sample_a495b9d27a9d44e"

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

Hello How are you!

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

<html></html>

------=_Sample_a495b9d27a9d44e--

Please reply me with a sample code
6 years ago

Hello

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
JSP
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(Applet2ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3025)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:662)
Exception: java.lang.ClassNotFoundException: com.vbridges.verde.client.VerdeClientProxyApplet.class


7 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-1.40.1.9.10.el6_1-x86_64)
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.

Thanks
Madhan


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

Thanks
Madhan
7 years ago

Hello

I have an automated mail generated using JavaMail API application.

This mail will have an link as given below:

http://{name}.mail.application/link/{link_id}

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:

http://link.mail.application/1234

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.

Thanks
Madhan





7 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?
7 years ago
Actually, i have implemented and tested with the Eclipse IDE.

1)

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

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

2)

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


7 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.

7 years ago

Hello

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.

Thanks
Madhan
7 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)?

Thanks


/**
*
*/

/**
* @author madhan
*
*/
/*
* Copyright (c) Ian F. Darwin, http://www.darwinsys.com/, 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.io.*;
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: SendMime.java,v 1.8 2003/05/31 21:18:35 ian Exp $
*/
public class SendMime {

/** The message recipient. */
protected String message_recip = "madhan1979@gmail.com";
/* What's it all about, Alfie? */
protected String message_subject = "Re: your mail";
/** The message CC recipient. */
protected String message_cc = "madhan1979@gmail.com";
/** 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..." +
"</BODY></HTML>";

/** 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("mail.smtp.host", "www.gmail.com");

// Copy the value of Mail.send.host into mail.smtp.host
// props.setProperty("mail.smtp.host",
//props.getProperty(MailConstants.SEND_HOST));

// 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("madhan1979@gmail.com"));

// 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
mesg.setSubject(message_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
mp.addBodyPart(textPart);
mp.addBodyPart(pixPart);

// Put the MultiPart into the Message
mesg.setContent(mp);

// Finally, send the message!
Transport.send(mesg);

} catch (MessagingException ex) {
System.err.println(ex);
ex.printStackTrace(System.err);
}
}

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


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 "www.gmail.com", port 25, isSSL false
javax.mail.MessagingException: Could not connect to SMTP host: www.gmail.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
javax.mail.MessagingException: Could not connect to SMTP host: www.gmail.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at SendMime.doSend(SendMime.java:104)
at SendMime.main(SendMime.java:115)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
... 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?