sureshreddy govindu

Greenhorn
+ Follow
since Jun 08, 2011
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 sureshreddy govindu


<%=MyClass.myMethod(<%request.getParamet('test')%>); is it possible?

when i am trying this , rised jsp exception.
1)how can we pass dynamic paramer in declarative tags?

Thanks
10 years ago
JSP
HI,
I am new to dev.twitter.com, I want to get tweets from following users. using users stream concept, now tweets came with unnecessary data( this case network traffic high and performance of application down) , can you suggest me to get followers tweets only,


Thanks to advance,

11 years ago

Thanks to reply

.txt file,
i want to put password mytext.txt file.
12 years ago
hi all,

i am set password to file with java program .. how to achieve through java program??


Thanks



12 years ago
thanks to reply,


i am using rs 232 barcode scanner. this barcode scanner not give any doc and jar for java. if you know, give me url of the site.
12 years ago
hi all,


i have barcode code-39 format. how to i read this value from reader??? give me suggessions to plan???

--
suresh
12 years ago
hi,

we are implementing web application with jsp and struts with frames., when session was time out login page is displayed in the target frame. how to display login page with out frames???
12 years ago

deploying and run the application with pom.xml(maven) ., follwing error occur.,

java.lang.IllegalArgumentException: Document base D:\Workspace\Db\strutsandhibernte\src\main\webapp does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4249)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4418)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
12 years ago
how to implement plugin class .give example sites for reference..
thanks
12 years ago
hi,


i am trying to import mysql database dump through java porgrame., but it's not repond.,
give me help.

rt.exec("C:\\Program Files\\MySQL\\MySQL Server 6.0\\bin\\mysqlimport -hlocalhost -uroot -ptiger aaa -h /suresh22.sql");
i am trying this way for downloading attachments from gmail through java program. exception occur class cast exception

How can I download all emails with attachments from Gmail?

package mail;

import java.io.BufferedWriter;
import java.io.File;

import javax.mail.AuthenticationFailedException;
import javax.mail.Folder;
import javax.mail.FolderClosedException;
import javax.mail.FolderNotFoundException;
import javax.mail.Message;
import javax.mail.Multipart;
import javax.mail.NoSuchProviderException;
import javax.mail.Part;
import javax.mail.ReadOnlyFolderException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.StoreClosedException;
import javax.mail.internet.InternetAddress;

public class ReadEmails {

//Constructor Call
public ReadEmails() {
processMail();
}

//Responsible for printing Data to Console
private void printData(String data) {
System.out.println(data);
}

public void processMail() {
Session session = null;
Store store = null;
Folder folder = null;
Message message = null;
Message[] messages = null;
Object messagecontentObject = null;
String sender = null;
String subject = null;
Multipart multipart = null;
Part part = null;
String contentType = null;

try {
printData("--------------processing mails started-----------------");
session = Session.getDefaultInstance(System.getProperties(), null);

printData("getting the session for accessing email.");
store = session.getStore("imaps");

store.connect("imap.gmail.com","username@gmail.com","password");
printData("Connection established with POP3 server.");

// Get a handle on the default folder
folder = store.getDefaultFolder();

printData("Getting the Inbox folder.");

// Retrieve the "Inbox"
folder = folder.getFolder("inbox");

//Reading the Email Index in Read / Write Mode
folder.open(Folder.READ_WRITE);

// Retrieve the messages
messages = folder.getMessages();

// Loop over all of the messages
for (int messageNumber = 0; messageNumber < messages.length; messageNumber++) {
// Retrieve the next message to be read
message = messages[messageNumber];

// Retrieve the message content
messagecontentObject = message.getContent();

// Determine email type
if (messagecontentObject instanceof Multipart) {
printData("Found Email with Attachment");
sender = ((InternetAddress) message.getFrom()[0]).getPersonal();

// If the "personal" information has no entry, check the address for the sender information
printData("If the personal information has no entry, check the address for the sender information.");

if (sender == null) {
sender = ((InternetAddress) message.getFrom()[0]).getAddress();
printData("sender in NULL. Printing Address:" + sender);
}
printData("Sender -." + sender);

// Get the subject information
subject = message.getSubject();

printData("subject=" + subject);

// Retrieve the Multipart object from the message
multipart = (Multipart) message.getContent();

printData("Retrieve the Multipart object from the message");

// Loop over the parts of the email
for (int i = 1; i < multipart.getCount(); i++) {
// Retrieve the next part
part = multipart.getBodyPart(i);

// Get the content type
contentType = part.getContentType();

// Display the content type
printData("Content: " + contentType);

if (contentType.startsWith("text/plain")) {
printData("---------reading content type text/plain mail -------------");
} else {
// Retrieve the file name
String fileName = part.getFileName();
String root="D:/attachments/"+fileName;
File f=new File(root);
boolean flag=f.createNewFile();

Object o=part.getContent();


f= (File) part.getContent();
//System.out.println(flag+"--------------");
printData("retrive the fileNam22222222222222222222222e="+ fileName);
}
}
} else {
printData("Found Mail Without Attachment");
sender = ((InternetAddress) message.getFrom()[0]).getPersonal();

// If the "personal" information has no entry, check the address for the sender information
printData("If the personal information has no entry, check the address for the sender information.");

if (sender == null) {
sender = ((InternetAddress) message.getFrom()[0]).getAddress();
printData("sender in NULL. Printing Address:" + sender);
}

// Get the subject information
subject = message.getSubject();
printData("subject=" + subject);
}
}

// Close the folder
folder.close(true);

// Close the message store
store.close();
} catch(AuthenticationFailedException e) {
printData("aNot able to process the mail reading.");
e.printStackTrace();
} catch(FolderClosedException e) {
printData("bNot able to process the mail reading.");
e.printStackTrace();
} catch(FolderNotFoundException e) {
printData("cNot able to process the mail reading.");
e.printStackTrace();
} catch(NoSuchProviderException e) {
printData("dNot able to process the mail reading.");
e.printStackTrace();
} catch(ReadOnlyFolderException e) {
printData("eNot able to process the mail reading.");
e.printStackTrace();
} catch(StoreClosedException e) {
printData("fNot able to process the mail reading.");
e.printStackTrace();
} catch (Exception e) {
printData("gNot able to process the mail reading.");
e.printStackTrace();
}
}

//Main Function for The readEmail Class
public static void main(String args[]) {
//Creating new readEmail Object
ReadEmails readMail = new ReadEmails();

//Calling processMail Function to read from POP3 Account
readMail.processMail();
}
}

Exception is below:

subject=iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Retrieve the Multipart object from the message
Content: APPLICATION/OCTET-STREAM; name=Split.java
gNot able to process the mail reading.
--------------processing mails started-----------------
getting the session for accessing email.
java.lang.ClassCastException: com.sun.mail.util.BASE64DecoderStream cannot be cast to java.io.File
at mail.ReadEmails.processMail(ReadEmails.java:124)
at mail.ReadEmails.<init>(ReadEmails.java:24)
at mail.ReadEmails.main(ReadEmails.java:179)
Connection established with POP3 server.
Getting the Inbox folder.
Found Email with Attachment
If the personal information has no entry, check the address for the sender information.
Sender -.suresh reddy
subject=iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Retrieve the Multipart object from the message
Content: APPLICATION/OCTET-STREAM; name=Split.java
gNot able to process the mail reading.
java.lang.ClassCastException: com.sun.mail.util.BASE64DecoderStream cannot be cast to java.io.File
at mail.ReadEmails.processMail(ReadEmails.java:124)
at mail.ReadEmails.main(ReadEmails.java:182)


12 years ago
how to back up mysql dump from java ., below program not running., (exception occur)

package scjp;

import java.io.*;
public class sampledb1 {

public static void main(String[] args) {


try {



Runtime rt = Runtime.getRuntime();

rt.exec("/C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump -u [root] -p[tiger] [ mysql] -r /D:/backup.sql");
}

catch(IOException ioe)
{
ioe.printStackTrace();
}

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


Exception is ::

java.io.IOException: Cannot run program "/C:/Program": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at scjp.sampledb1.main(sampledb1.java:15)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more
12 years ago
hi,


having mysql database running at different locations., i want to synchronize all the databases by end of the day. how achieve it., through java program???
(i thing running the timer job at exactly end of the day. and export databases and send it through mail., ) it's good way or not???
12 years ago
hi,

in my application take email address, how to check given email id is valuable or not., (i mean sureshreddy.2040@gmail.com is google email., this email is there or not there in google database, same yahoo., and same tcs, and same to all databases),
12 years ago
thanks to reply,

it was resolved, i got it with JNA . Thanks a lot ,

now i am facing another problem , deployed the application in the server , after deploying the application when access the application from client machine , the application see the printer on the server machine.., i want to access the application from client machine the application search the barcode printer from client machine only., (present it's seems server machine),

i used the code for accesing the usb printer is below

CLibrary.INSTANCE2.A_GetUSBBufferLen();

int nUSBDataLen;
byte[] pbuf;



nUSBDataLen=CLibrary.INSTANCE2.A_GetUSBBufferLen();
// nUSBDataLen = A_GetUSBBufferLen()+1;
pbuf = new byte[nUSBDataLen];
CLibrary.INSTANCE2.A_EnumUSB(pbuf);
CLibrary.INSTANCE2.A_CreateUSBPort(1);

12 years ago