Jayashree Gopal

Greenhorn
+ Follow
since Nov 06, 2001
Merit badge: grant badges
For More
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 Jayashree Gopal

I did not understand how does the output come. I have replaced the first element of the array in the modify method.SO,shd not it give me null for the other elements of the array when i print them??
I have written a program which uses Arrays. Here is the code of the program...
when i check the output....it gives me bicycle,mango,grapes and pineapple
here is the code snippet.......
public class FruitArray
{
String fruit[] = new String[4];

public static void main(String args[])
{
FruitArray f = new FruitArray();
f.amethod();
f.modify();
}

public void amethod()
{
fruit[0] = "Apple";
fruit[1] = "Mango";
fruit[2] = "Grapes";
fruit[3] = "Pineapple";
}

public void modify()
{
fruit[0]="Bicycle";

for(int i=0;i<fruit.length;i++)
{
System.out.println(fruit[i]);
}
}
}
Please explain this behavior...

Jayashree
I am planning to get myself certified as a Java programmer. I have started with Marcus Green tutorials on jchq.net.I am working on Java and related technologies.
Please let me know which is the best way to study for this exam. Wht period of time shd i study before i give this exam.
There are lot of resources on the net.Hence i am confused.Let me know the names of five best sites for material to study for this exam.
Thanks for all the help!!!
Jayashree
I have written a simple Java program which i am using to send a message from one email id to another. I am using a linux m/c with squid for our proxy. WHen i try to execute the program, i find tht the control does not pass into the try block at all. COuld somehow let me know my mistake.
Here is the code:
public class MailMessageWithCommands
{
public static void main(String args[])
{
try
{
String host = null;
String from = args[1];
String to = args[2];
Properties props = new Properties();
props.put("proxyHost","196.100.110.4");
props.put("proxyPort","25");
props.put("mail.smtp.host",host);
System.out.println("properties");
Session newSession = Session.getInstance(System.getProperties(),null);
System.out.println("session");
MimeMessage message = new MimeMessage(newSession);
System.out.println("MimeMessage");
message.setFrom(new InternetAddress(from));
System.out.println("from");
message.setRecipients(Message.RecipientType.TO,to);
System.out.println("to");
message.setSubject("Hello");
System.out.println("subject");
message.setText("Using JavaMail for the first time");
System.out.println("text");
//Transport transp = new Transport(newSession,host);
Transport.send(message);
System.out.println("transport");
}
catch(AddressException e1)
{
System.out.println(e1.getMessage());
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
System.out.println("Message sent Successfully");
}
}
I tried to use system.getProperties.put()...however,it gave me a compile time error.
I even tired to pass the ip add and the port of the m/c however, it gives me an error while sending. It always listens to port 25,instead of the port no tht i specify.
Thanks in advance.
Jayashree
22 years ago
Hello,
The mail.jar has been added to the classpath and is present in the root directory of javamail. I tried to run the same program keeping it in the same directory as that of mail.jar .However,the problem still remains unsolved.
22 years ago
Hello,
I am using the JavaMail API for the first time. I have written a program which uses the JavaMail API to write a message. This file compiles properly but when i run it thru the command line it gives me a NoClassDefFoundError. I have ensured tht the .class file is in the same directory from where i am trying to access it.
I have stored the .class file under e:\Prog\javamail\demos and while using the command line i go to this path and give the command line.
I am attaching the code herewith:
Please let me know if there is any error in this code:
import javax.mail.Session;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class MailMessage
{
public static void main(String args[])
{
try
{
String host = args[0];

Properties props = new Properties();
props.put("mail.http.yahoo.com",host);

Session newSession = Session.getInstance(props,null);

MimeMessage message = new MimeMessage(newSession);

message.setFrom(new InternetAddress("gjaya26@rediffmail.com"));

message.setRecipients(Message.RecipientType.TO,"gjaya26@yahoo.com");

message.setSubject("Hello");

message.setText("Using JavaMail for the first time");

//Transport transp = new Transport(newSession,host);

Transport.send(message);
}

catch(AddressException e1)
{
e1.getMessage();
}

catch(Exception e)
{
e.getMessage();
}

System.out.println("Message sent Successfully");
}
}
22 years ago
I am assigned the task of developing a Java Mail application. I have a web server(Tomcat) and the client interfaces need to be developed. Where and how do i begin.I am using a proxyserver for connection to the internet. Can somebody explain how will the architecture be like.
In the very first place, i am getting confused with two different things.
If i say, send email to hotmail account, wht steps do i need to take care in order to enable my server to send the msg across.
Please help me to begin!!!
Jayashree
22 years ago
We r using bridge2java from ibm to expose the methods of msxml4 parser. we have successfully compiled all the .java files and converted the .class files into a .jar file.This has then been put in the classpath of Tomcat(our web server). When we tried to write a servlet referring to one of the classes,namely,DOcument40 object, it gave us the foll error...
java.lang.UnsatifiedLinkError.It was not able to refer to the .class file of Document40.
Please let me know the reason....