Hi all, I need to make my thread sleep after certain amount of time. There are around 30 threads running. If my thread is in waiting state for some time, i am not able to know the time how much time it has to sleep. my problem is to find how much time the current thread is in waiting state to ...
Hello eveyone. I'm relatively new on generics, and I'm curious about something. Consider this code:...Vector v = u.getDataVector();for (Object elem : v) { Vector<String> st = (Vector<String>)elem; if(Long.valueOf(st.elementAt(0)) == c.getId()) {// Do your things.return; }}It works ...
Hi,how do I get advantage of the generic information in Class.forName method?I actually have the code:Class<?> myClass= Class.forName(myString);and I want a generic type for myClass (let T), so that later on I can create instances of myClass using:T myInstance = myClass.newInstance();How ...
Hello, all. Please forgive me if this is off topic, but I could not find a better place to start. If it belongs somewhere else, please direct me and I will post it elsewhere!I am trying to deveop a bit of a device that will run connected to the ethernet. I decided to begin with Dallas-Maxim's ...
I have an abstract superclass (NGEntity) and about a dozen subclasses. Each subclass implements an interface (EntityInt) as to simplify the <T extends ENtityInt> generic definition.public abstract class NGEntity{...}public class NGClient extends NGEntity implements EntityInt{public ...
Hi,I have two thread running, one of them opened up a model dialog and waits for user interaction. Between, I got a reference to the model dialog object in my second thread and I want to know the thread name which has shown/created this component. Is is possible?thanks in advance ...
1491 byte By
Goela at 2007-11-27 9:36:57
My applications are Java based Client Server Applications. The clients have been developed using Java Swings API.(JDK 1.5) The Database server is Oracle 9i. The clients are connecting to server through Oracle JDBC thin drivers(classes12.jar). We are NOT using any Connection pooling.In each of ...
Hi all,I have developed a client/server application and make use of socket to send/rcv data (data size: around 12KBytes), but I found that the input stream cannot fully read the data from server and the data I got an incompleted data. What happen with the socket and did anybody got the same ...
hi there.this is james mcfadden. i am planning to develop a streaming HTTP client-server application in Java. i know for a fact that i would need to develop a web browser, a web server and a media player application. i would also need to create metafiles.From what i know about the streaming ...
Hi it's me again,I tried to implement persistent connections to our project because of performance problems - as you can see some posts ago: http://forum.java.sun.com/thread.jspa?threadID=5188706&tstart=15If a request from the client (browser) is sent to our webserver, a new ...
397 byte By
mammaa at 2007-11-27 9:39:46
I am using Server socket to read from console .In the server socket , I am reading from client through InputStreamReader.In a different method, I am opening a new InputStreamReader to process the output of os command through exec().Whenever this method calls, the other InputStreamReader gets an ...
I have a code which actually runs some number of predefined threads (More than 1). The fucntionality of the thread code is to connect to another system through Socket Connections (using IP and port) and send a request to it and get back the response from that sys through DataStreams.While ...
Hi all,I have a really strange problem.I'm getting a file from a remote server (ftp "get"), the process ends with no exceptions, but when I go to the specific directory where the file should have been - there is nothing there.I tried to get the file manually through acommand line ftp and it ...
304 byte By
Raj@SAPa at 2007-11-27 9:41:28
Dear Friends,Good Morning. Please help me in resolving the following scenario.I want to select file from particular location and send that file to the specified printer. Is it possible, can u guys throw some light on this. It will be more helpful.Thanks in ...
1811 byte By
lokiea at 2007-11-27 9:42:29
Hello everyone,I'm new to network programming and I was just wondering if I could get some clarification and some advice on networking.Right now I have a serversocket program that accepts a connection from another server that is sending large strings (events), my server socket program takes ...
13168 byte By
4tha at 2007-11-27 9:43:39
[nobr]Hello above all to you steven ;-)I get this JNDI error performing my ldap password change:javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name ''The double quote above at the end of the error msg is actually 2 single quotes just to let you ...
Hi all,Am writing some data to a file using File connection. Am appending all datas to a StringBuffer and finally writes into the FileOutPutStream and flushing it. Am appending new line character ('\n') to StringBuffer and it is printing perfectly on console but not in file. In file ...
5725 byte By
Roddicka at 2007-11-27 9:44:33
i do a simple java chatting projecti want help in sending files between client and serverthis my client and server codehow can i change in this code to achieve this pointthanks a lot for caring//Server Classimport java.io.*;import java.net.*;import java.awt.*;import java.awt.event.*;import ...
5650 byte By
4tha at 2007-11-27 9:44:39
Hello,thats an image of my w2k active directory ldap tree: http://img248.imageshack.us/img248/918/adwn6.gifrunning the bottom code from Adler_Steven which i chnaged with my data i get this error message:Problem resetting password: javax.naming.NameNotFoundException: [LDAP: error code 32 - ...
1571 byte By
beejuma at 2007-11-27 9:45:58
Hi frnds,I have a problem sorting a date using comparator Interface. To the compare method I am passing Objects, which contains values retrieved from bean.I have hyperlinks for all the fields, upon clicking am able to sort all the fields except the date:The format of date is MM/DD/YYYY. It is ...
Are there still issues in java.nio.channels.Selector.select() when running on solaris.It perfectly works fine in windows XP. We are able to register a selector with a channel and successfully retrieve SelectionKey. But when doing a select after registration the selection key is lost (count = 0) ...
1770 byte By
MarcelSa at 2007-11-27 9:48:08
Greetings,I've been using HttpURLConnection to implement WebDAV on 1.3 and 1.4 JDK. I've now upgraded to 1.6 and am no longer able to cast from sun.net.www.protocol.http.HttpURLConnection to my extension.My custom HttpURLConnection does extend the sun class and when I retrieve the ...
Hello.I have the feeling that this is a basic question which might be asked more often. But strangely I didn't find this issue in the basic RMI tutorials and a google search didn't give me anything useful too.I am making a client/server program with RMI running on java 1.6.0. On the server I ...
456 byte By
Lizziea at 2007-11-27 9:48:25
I need to set my content type to be XML. I used the following:HttpURLConnection urlConn = null;URL u = new URL( url );urlConn = (HttpURLConnection)u.openConnection();urlConn.setDoOutput( true );urlConn.setDoInput( true ...
Hi--Been puzzling over this one for quite awhile, and I still can't figure it out. I'm trying to downcast a generic type to a subclass of a concrete type. Now admittedly that's messy and I'd like to refactor, but I'm still puzzled. Take the following code:public class Test1<T> ...
417 byte By
beejuma at 2007-11-27 9:51:11
I have a String in which i am storing the date which I have retrieved from database. How can I convert this String to a Date object and use Comparator for sorting.String strCreatedDate1 = ((CVendorEmployees) vendoremployee1).getCreatedDate().toUpperCase();The date format which I will retrieve ...
Hi, are there any good example of dynamic proxy with RMI, using the new RemoteObjectInvocationHandler class?I am currently implementing a Registry, and want to use dynamic proxy to wrap around the registry stub, to pass extra information to the client.I've tried it, but the program will hang ...
621 byte By
faliscoa at 2007-11-27 9:52:24
Hello, I am doing multiple requests to diferent web services from diferent providers. I want to do the requests simultaneously and I think the best way is using threads. I am thinking to create a main class that creates a thread instance for every request (max 5) and then wait for the responses ...
My program works in an intranet environment. Can I add proxy into my program to access internet?
527 byte By
VishVa at 2007-11-27 9:52:35
Hi,I am working on J2EE application and using Hibernate.Application is online submission form which contains questions. User has to respond to each question. when user fills the response and click on save. Responses will be stored into response table. Now i am having problem with one user's ...
537 byte By
Shigaa at 2007-11-27 9:53:15
HiI am really in need of a prompt help for sending a web page which contains some html content as an email body.I really have no clue about this.I have tried searching in google but could not find any thing in java.I have everything ready for sending an email, i.e. to, from and subject.The only ...
5623 byte By
lukaTNa at 2007-11-27 9:53:37
Hi,i want create a simple RMI program with SSL sockets but when i run the client i've this type of error:javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failureat sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)at ...
2067 byte By
Kurdta at 2007-11-27 9:53:47
Hi all guysI am sure you can help me with this, I am using jazzlib ( http://jazzlib.sourceforge.net/) ZIP library for deflating and inflating data, I was all day trying to find examples and I came with this:public byte[] compress(byte[] input) throws IOException{Deflater compressor = new ...
7802 byte By
lokiea at 2007-11-27 9:54:30
Hello everyone. I'm running into 2 problems that I can't seem to find functions for after reading the java API on socket and serverSocket.If a client closed a connection on my server, like if someone telnets into my server, then closes the console, i get the following:Event from: ...
Hi All,Interesting problem: I have an SSL-RMI server, running either as an application, or as a service using JS Wrapper, on PC-A, correctly serving content to a client running on PC-B. But when I flip the configuration, such that PC-B is now hosting an SSL-RMI server, PC-A's client is ...
2431 byte By
Mjacobsa at 2007-11-27 9:55:03
I have written code to transfer two files from the client to the server. Every time I transfer the file and try to decompress it using gzip, it says "corrupt input. Use zcat to recover some data." Is there any way I can fix this? Please help...Client side:for (int z = 0; z < files.length; ...
2423 byte By
Mjacobsa at 2007-11-27 9:55:04
I have written code to transfer two files from the client to the server. Every time I transfer the file and try to decompress it using gzip, it says "corrupt input. Use zcat to recover some data." Is there any way I can fix this? Please help...Client side:for (int z = 0; z < files.length; ...
1370 byte By
_dnoyeBa at 2007-11-27 9:56:05
After some usage of my program I realized that my TreeSet is giving me problems. Its a sorted set with compareTo based on name. When the name of an entry changes I need to resort the set.I know its bad for any equals or compareTo to change after the item was put into the set. So I figured I ...
Consider:public interface RootedNodeAlgo<R,T,J,E extends Exception> { public R forParentNode(RootedNode<J> n, T... input) throws E; public R forLeafNode(RootedNode<J> n, T... input) throws E;}public abstract class LeafSyntaxNodeBase extends SyntaxNodeBase implements ...
hi if any one having the coding to connect remote machine using RMI...it is possible to do it in JAVA ?because i need application like GoToMyPc...pls help
978 byte By
jahanuma at 2007-11-27 9:57:28
Hi guys, I have a slight problem here. My code is simple and is as follows:import java.io.*;public class Average {public static void main(String[] args) throws IOException {double numbers = 0.0;System.out.println("Please enter 5 numbers");BufferedReader br = new BufferedReader(new ...
Hello, can anyone help me out with how to ping a host using java I dont have to use Process p=Runtime.getRuntime().exec("ping ........instead I need some powerful mechanism.. i am working on java 2 sdk 1.5.Thank you
245 byte By
nichelea at 2007-11-27 9:57:34
Hi All,I'm looking for a good java framework that can help me with a UDP multicast application. Something like JGroup (that indeed is more that what I need) but with Apache license.Is there anything ?ThanksSte
Hi everyone,My application has space in the path and as a result space appears in the classpath. So rmi won't work and I'm always getting MalformedURLException. Also I won't be able to change classloader for distributed object, because I don't create it directly. I use Avalon framework.If i ...
Hello!I have this 2-class package which gets informations on Microsoft SQL Server 2005 tables and table content. It worked perfectly on J2SE 5. Today I moved to Java J2SE1.6 u1 and recompiled the project. Now, it triggers bizzare Steam Closed exceptions when trying to read a line from the ...
Hello. I'm having a bit of trouble figuring out how to correctly parameterize a function. Here is some sample code to show what I'm trying to do.interface SampleInterface<T> {}//Emulating a set of SampleInterfaceinterface OtherSampleInterface<T extends ...
2160 byte By
Sopha at 2007-11-27 9:58:50
HI,I have both RMI client and server in my machine.i started the server successfully withC:\Documents and Settings\benedict\workspace\RMIDemo\bin>java -cp C:/"Documents and settings"/benedict/workspace/RMIDemo/src;./;c:/"Documents and settings"/benedict/workspace/RMIDemo/bin/compute.jar ...
I am confused about some examples from Angelica Langer FAQ regarding method accessiblity.class Box<T> {private T t;...public int compareTo(Comparable<? super T> other) { return other.compareTo(t); }public Box<? super T> copy(){ return new Box<T>(t); } }public void ...
I am leaning concurrency programming in jdk 5, and ran into trouble with Executor framework, actually, it's a generic type problem.I want to use Executor.invokeAll to execute a collection of tasks, the signature of this method is:<T> List<Future><T>> ...
Hi allI have an arrayList object, 10 threads are populating data in to that arrayList object, another main thread will fetch data from that object. I am using iterator object to run the while loop with hasNext() method to fetch data in that main thread. but if that main thread runs before the ...