Alex Marks

Ranch Hand
+ Follow
since Sep 12, 2005
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 Alex Marks

I am writting a simple program to send the email. But i face to an problem/exception as below:
java.lang.NoClassDefFoundError: com/sun/activation/registries/LodSupport.
What do i need to do to solve such exception ?
Thank you very much for your help and have a good day !
13 years ago
Good Day to everyone,
I have developed a Chat Program in Java as my assignment, so far it works fine but my lecturer as me to improve it to overcome the potential problems. I really really dont know what the potential problems are. Would you please help me by identifying the potential problems for that problems ?
Thank you very much for any suggestions ! Thank you !
13 years ago
Thank you very much Frank Carver for your suggestion, i will try! Hava a nice day !
13 years ago
Hi everyone.
I have a strange problem with sending email via a servlet. The code was fine and i am able to send the email. But after sending about 3 times with a account (yahoo or gmail), i encounter an exception: javax.mail.AuthenticationFailedException. Then I change to another account. It works fine. After 3 times, the exception occurs again.
Please help me with this problem.
13 years ago
Thank you very much for your suggestion, i have found the solution.
13 years ago
Hi Everyone,
I have the problem with refresh page. I have 2 JSP pages, a.jsp and b.jsp. In a.jsp, I display the information which is stored in the session. In b.jsp, I make some modifications to such information. When i come back a.jsp, the page still display the old information, but after press F5 or refresh button of the web's browser, it displays new information. I would like to ask if there is any way to over-come this problem.
Thank you for your help so much and have a nice day.
13 years ago
I am dealing with the Callable Statement. Here is the code:

int id = 0;
String cal = "{ ? call returnlastrow }";
CallableStatement statement = null;
id = statement.getInt(1);

I encounter an exception as : java.sql.SQLException: Malformed SQL92 string at position: 5. Expecting "=" got "c" 0

Please help me solve this problem. Thank you for your help.
I am using the TOMCAT as the web server for application development. Is there any way to make my pc as the Web Server, that outside users can access like the real host. I heard that it can be done be using LINKSYS router ?
if posible, please help me. Thank you very much !
13 years ago
Makarand Parab, Thank you very much, finally it works. Thank you again and again Cheers.
13 years ago
Makarand Parab, would you please more specific about your code? i think i could not get you ! thank you for you help !
13 years ago
Annie Smith, actually the code above I copy from the Internet and modify, but someone can use it,someone cannot use it,i am the one cannot use ! really dont understand why it cause error !
Hope to get helps from others ! thank you very much !
13 years ago
Thank you very much for your advices.
I have tried to search throught Internet, I manage to find the code to send Email with SSL. However I encounter problem. Here is the code.
public class SendingEmail {
private static final String SMTP_HOST_NAME = "";
private static final String SMTP_PORT = "465";
private static final String emailMsgTxt = "Test Message Contents";
private static final String emailSubjectTxt = "A test from gmail";
private static final String emailFromAddress = "";
private static final String SSL_FACTORY "";
private static final String[] sendTo = { ""};

public static void main(String args[]) throws Exception {


new SendingEmail().sendSSLMessage(sendTo, emailSubjectTxt,
emailMsgTxt, emailFromAddress);
System.out.println("Sucessfully Sent mail to All Users");

public void sendSSLMessage(String recipients[], String subject,
String message, String from) throws MessagingException {
boolean debug = true;

Properties props = new Properties();
props.put("", SMTP_HOST_NAME);
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "true");
props.put("mail.smtp.port", SMTP_PORT);
props.put("mail.smtp.socketFactory.port", SMTP_PORT);
props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
props.put("mail.smtp.socketFactory.fallback", "false");

Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {

protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("", "123456");


Message msg = new MimeMessage(session);
InternetAddress addressFrom = new InternetAddress(from);

InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++) {
addressTo[i] = new InternetAddress(recipients[i]);
msg.setRecipients(Message.RecipientType.TO, addressTo);

// Setting the Subject and Content Type
msg.setContent(message, "text/plain");
The error is : Credentials Rejected.
Please help me to solve this problem ! thank you ! forgive me if this thread is not related to Servlets.
13 years ago
Annie Smith, I have tried your solution and I have the same error. Any ideas from you ? Thank you in advanced.
13 years ago
thank you very much Annie Smith, let me try your solution and let you know the result later ! thank you again ! cheers !
13 years ago
I am using a Servlet with to send a email. But i faced a error while sending email. Here is the code:
Properties props = new Properties();
Session mailSession = Session.getDefaultInstance(props,null);
Transport transport = mailSession.getTransport();

MimeMessage message = new MimeMessage(mailSession);
message.setContent("This is a test","text/plain");
message.addRecipient(Message.RecipientType.TO,new InternetAddress(""));

The error i get is : javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first 38sm1046192nzk

Thank you for your help and looking for your replies.
13 years ago