elay Raja

Greenhorn
+ Follow
since Jun 10, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 elay Raja


thanks for your reply.. The link which you sent is related to MYSQL. The exception which is below is what i'm facing now.At the same time this error occurs in random i.e. whenever i write some byte to the socket. I hope you will clear now.Even i stopped the firewall in client & server machines & checked but again it does n't work

java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)


how to avoid this problrm???

thanks


hi,

I got this exception when i try to write a byte to vnc server through socket programming.What does this exception mean & how to avoid this problem???







thanks
YES. i want to record the screen interaction. My vnc session will be running in browser.I googled and i found tools to record a session.

Is it possible to write a java application to record the vnc session which is running in browser?

thanks
15 years ago
ya sure.

I had made the file instance to null in servlet code when ever i cancel the file upload in client side.

then i called the System.gc() method

or else you can delete the file using delete method on that file instance.

i hope you will get it. if not, reply.


Thanks
hi all,

Is there any other way to record a VNC session which is running in linux without using any tool ?


thanks
15 years ago
Is there any other way to delete the .tmp file?
[ December 29, 2008: Message edited by: elay Raja ]
I am uploading a file from flash to server using apache commons file upload API.

It works fine.Suppose if i cancel the upload,the .tmp file which is created in temp directory is not deleted.

So i added the following line in web.xml which i googled from apache site.
for your ref: http://commons.apache.org/fileupload/using.html

<listener>
<listener-class>
org.apache.commons.fileupload.servlet.FileCleanerCleanup
</listener-class>
</listener>
public static DiskFileItemFactory newDiskFileItemFactory(ServletContext context,
File repository) {
FileCleaningTracker fileCleaningTracker
= FileCleanerCleanup.getFileCleaningTracker(context);
return new DiskFileItemFactory(fileCleaningTracker,
DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD,
repository);
}

1.I just added the web.xml part only.It does not work again.
2. if i call the above method ,my code does not compile which narrates that the constructor DiskFileItemFactory(fileCleaningtracker,int,respository) not found

Is there any other way to delete the .tmp file
Yes.You are correct.
Thanks for your reply.
15 years ago
Let me explain now.....

I'm trying to upload a file from flash to servlet. I had written the flash code using Flex & Actionscript.For server side,i written one servlet to accept the upload file. I had mentioned the above servlet in web.xml.If i click the upload button in flash,i'm getting 500 response from http.

Then i look in to log file, i got the above exception:-

I checked in browser by typing the http://192.1.1.1/UploadServlet

I am getting servlet is not available,though i specified them in xml.I hope you will be clear about my problem now..

please help me....

java.lang.ClassNotFoundException: com.XXX.YYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
[Servlet] - Allocate exception for servlet ervlet
java.lang.ClassNotFoundException: XXXX.YYYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
[ December 21, 2008: Message edited by: elay Raja ]
15 years ago
If i give the url for example http://IPName/Servlet


then i 'm getting the error in log which is shown below.
though i had specified the servlet in web.xml


java.lang.ClassNotFoundException: com.XXX.YYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
[Servlet] - Allocate exception for servlet ervlet
java.lang.ClassNotFoundException: XXXX.YYYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

please help me to resolve this error ....
15 years ago
If i give the url for example http://IPName/Servlet


then i 'm getting the error in log which is shown below.
though i had specified the servlet in web.xml


java.lang.ClassNotFoundException: com.XXX.YYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
[Servlet] - Allocate exception for servlet ervlet
java.lang.ClassNotFoundException: XXXX.YYYY.Servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper$1.run(StandardWrapper.java:1077)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1073)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

please help me to resolve this error ....
[ December 20, 2008: Message edited by: elay Raja ]
15 years ago
I want to fix the length of the JLabel text in my application.

For example: JLabel test=new JLabel("Selected File Testing");

If i use the above string,then my design gets collapsed.

how to fix the length of the JLabel Text?

Please help me to resolve this issue...

here is my code...


getContentPane().setLayout(new GridBagLayout());
getContentPane().setBounds(500, 300, 500, 300);
getContentPane().setBackground(Color.decode("#C1CDAD"));
GridBagConstraints c = new GridBagConstraints();

c.anchor = GridBagConstraints.FIRST_LINE_START;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 0);
c.gridwidth = 1;
c.weightx=1.0f;
c.weighty=1.0f;
// c.gridx = 0;
c.gridy = 1;
getContentPane().add(fileSelectLabel, c);

c.anchor = GridBagConstraints.LINE_START;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 0);
c.gridwidth = 1;
c.gridx = 0;
c.gridy = 1;
getContentPane().add(statusLabel, c);

c.anchor = GridBagConstraints.PAGE_START;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 10);
c.gridwidth = 1;
c.gridx = 1;
c.gridy = 0;
getContentPane().add(pathField, c);
pathField.setEditable(false);
pathField.setBackground(Color.white);
pathField.setBorder(BorderFactory.createLineBorder(Color.decode("#98AFC7")));

c.anchor = GridBagConstraints.FIRST_LINE_END;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 10);
c.gridwidth = 1;
c.gridx = 2;
c.gridy = 0;
getContentPane().add(browseButton, c);

c.anchor = GridBagConstraints.LINE_END;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 10);
c.gridwidth = 1;
c.gridx = 2;
c.gridy = 1;
getContentPane().add(uploadButton, c);

c.anchor = GridBagConstraints.LINE_END;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 10);
c.gridwidth = 1;
c.gridheight = 1;
c.gridx = 2;
c.gridy = 2;
getContentPane().add(cancelButton, c);

c.anchor = GridBagConstraints.CENTER;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(20, 10, 20, 10);
c.gridwidth = 3;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 5;
getContentPane().add(uploadProgress, c);

c.anchor = GridBagConstraints.CENTER;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(10, 10, 10, 10);
c.gridwidth = 1;
c.gridheight = 2;
c.gridx = 1;
c.gridy = 1;
getContentPane().add(statusArea, c);
statusArea.setEditable(false);
statusArea.setBorder(BorderFactory.createLineBorder(Color.decode("#98AFC7")));

c.anchor = GridBagConstraints.NORTH;
c.fill = GridBagConstraints.CENTER;
c.insets = new Insets(0, 5, 0, 5);
c.gridwidth = 1;
c.gridheight = 1;
c.gridx = 1;
c.gridy = 4;
getContentPane().add(bytesLabel, c);
bytesLabel.setVisible(false);

c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.LAST_LINE_START;
c.insets = new Insets(0, 5, 0, 5);
c.gridwidth = 3;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 6;
getContentPane().add(warningLabel, c);
warningLabel.setVisible(false);
warningLabel.setForeground(Color.red)
15 years ago
Applet can connect with servlet using HttpURLConnection.
You have to make connection to servlet using HttpURLConnection API to a servlet.For example...the above code will be written in Applet

URL url=new URL("http://localhost:8080/Chat/ChatServlet");
HttpUrlConnection con=url.openConnection();
con.setDoInput(true);
OutputStream out=con.getOutputStream();
out.write(data);
You can wrap the outputstream to any stream. Try this.If you can't get it,i will send the code in detail.
View this Link:http://www.j-nine.com/pubs/applet2servlet/Applet2Servlet.html
15 years ago
I want to make connection to servlet which is residing in tomcat under form based authentication using j_security_check.
The code which i used to read the content from the given URL is shown below.
Actually the servlet is in server1.I am accessing from server2.
URL urlServlet = new URL("https://server1/TestServlet");
HttpsURLConnection con = (HttpsURLConnection) urlServlet.openConnection();
con.setDoOutput(true);
con.setUseCaches(false);
con.setDefaultUseCaches(false);
con.setAllowUserInteraction(true);
con.setRequestMethod("POST");
con.setRequestProperty("Date", new Date().toString());
con.setRequestProperty("Content-Length", "0");
con.setRequestProperty("Content-Type",
"application/xml;charset=UTF-8");

BufferedReader rd = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
System.out.println("XML is:"+line);
}
When i connect to this URL it will be redirected to login page,since it is in form based authentication using j_security_check.when i print the streams from the URL,the html content of the login page of my application is displayed.I had configured the SSL also.I want to read the content of the URL.Please help me to resolve this issue.
[ August 21, 2008: Message edited by: elay Raja ]
15 years ago