386 byte By
S1lv3ra at 2007-11-27 8:43:55
Hey guyz,I have a client application that uses a wordprocessor. it needs a binary file in a folder e.g. c:/emp/processor/the file is in my jar and i want to copy it to the location c:/temp/processor/I loooked all over the net but could not find a *** thing. The question is. How do i copy a file ...
I have a successful rmi callback when it uses annoymous port by using UnicastRemoteObject.exportObject(this) from client. But I get the following messages when I tried to specify port by using UnicastRemoteObject.exportObject(this, port) by client. My understanding is this tells the server to ...
Hello all,I apologise for re-posting.I have a data structure as followsConcurrentHashMap<String, Object>The Object corresponds to 3 listsList<Long>, List<Long>, List<Long>These long's correspond to file pointer positionsand the string is a file name.i.e. each file has a ...
2471 byte By
Samantha at 2007-11-27 8:46:17
Hi, I am trying to an image from an URL. I am able to get the image but the image is damaged. my code looks as follows. public static byte[] getImage(String imageURL){byte[] blob=null;if (imageURL!=null&&(imageURL=imageURL.trim()).length()>0){InputStream ...
2768 byte By
_dnoyeBa at 2007-11-27 8:47:30
When I export an object it creates a stub. I am wondering what is the lifetime of this stub. or more specifically, what is the lifetime of an exported object.It seems that if a client calls a method, and in that method I export an object, but I do not hold that object locally, and I do not pass ...
1778 byte By
jGarya at 2007-11-27 8:47:51
public class Utils {public static <T> void CopyToGeneric(Collection f, Collection<T> t) throws ClassCastException {if(f != null && t != null) for (Object o : f) t.add((T)o);}}... list = new ArrayList();list.add(new Integer(1));list.add("qqq");listOfStrings = new ...
Hello all,I have been working on a problem for quite some time now with no luck.I am writing a client to a web service from an outside vendor. The vendor is a certificate authority, although a non-standard one for sure, and they supply certificates for many applications in my industry. ...
Hi all, On the server side, there are 2 different socket factories being used:SSL server/client socket factory on port 3000server/client socket factory on port 1099When a request comes in, can we determine the type of socket factory being used?Thanks in ...
HI ,I am calling the method "sort(T[] ts, java.util.Comparator<? super T> comparator)" of Arrays class. I have overriden the comparator class called MyComparator with the following declaration.public class MyComparator<C extends Charge> extends DefaultChargeComparator {public static ...
309 byte By
Kilwcha at 2007-11-27 8:49:48
Hello,I know there is a way to set a way to set read timeout (sockect.setSoTimeout() called before sockect.getInputStream() and inpustream.read() ), but I would like to know if there were a Java way to set connection timeout (by any mean : API, properties, system/JVM properties) ...
... giving me a headache.Hi all,What I would like to do is specify access rights on some methods, like so:@Or({@Role("Administrator"), @Role("Engineer")})public void someMethod();This reads like "all persons having the administrator role or the Engineer role have access to the someMethod() ...
6862 byte By
ouendana at 2007-11-27 8:50:46
Hi, I'm coding a server-client app. The server is on a PC, and the client on a mobile phone. I want to transfer some files from the PC to the mobile phone, using obex get function. This is the code that I have:Server:public void run() ...
504 byte By
ViktorSa at 2007-11-27 8:50:51
I am writing an application that has a server and a lot of clients. Clients and the server send messages to each other. I am going to use RMI, but:1. I will have 1000 requests from clients to the server per second. Is it normal for RMI? How about performance?2. I know there are many different ...
My application uses RMI for communicating between two java processes.I'm observing some kind of memory leak in one of the classes in RMIlibrary. When observed through OptimizeIT, I see a large number ofObject[] being created by the ClassDefiner.defineClass() &ClassDefiner$1().run().These ...
Hi everybody,I'm new here and I'm also a newbie in this topic: Java networking. So I have a question to you, because I didn't find a solution in this forum. If there is already posted one, I'm sorry for opening a new thread - maybe you can link the answer to me :-)So, here is my problem:I ...
Hi All,I have 2 HashMaps in my Class. I execute query fetch the data from data base and put it on HashMap 1. Then i execute another query and fetch the data and put it on HashMap 2. But the HashMap 2 also update HashMap 1. I dont know why it is happening.Uzair
835 byte By
gyll35a at 2007-11-27 8:52:49
Hello,a collegue developped a standalone program. It's a client RMI. It works fine !I need this program to add it in my webapp. But an exception is thrown :java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refusedat ...
2758 byte By
rapthora at 2007-11-27 8:52:59
Hello,I have some Spring webapp that uses a controller to access some service object within a shared lib in Tomat. The shared lib provides service classes that are transactionized with Hibernate's TransactionManager. However, when trying to persist some Hibernate entity I get the following ...
3870 byte By
tufia at 2007-11-27 8:53:21
Hi, i've been dealing with a problem for a few days. Hope someone can help me. The situation:I want to visualise different types of sorting allgorithms (bubble sort, quick sort etc.) The program has to be modular. So, every algorithm implemets my custom interface SortModule. The algorithms ...
432 byte By
evelinea at 2007-11-27 8:53:47
Hi,for my web application I have to validate the user login (username and userPassword). The user-object is stored in the MS Active Directory . Now I want to use LDAP with the JNDI to compare the login values. In ADS it is not possible to read the entry of the attribute 搖serPassword? How can I ...
Given the object:public class TestObject{public Object[] oArray;public int[] iArray;}and the codeTestObject to = new TestObject();Field objectArrayField = to.getClass().getField("oArray");Object oArray = Array.newInstance(objectArrayField.getType(), 0);objectArrayField.set(to, oArray);Field ...
1361 byte By
kpmga at 2007-11-27 8:53:59
Hi All,We have a WebSphere/Java application that uses a file management applet on client machines. We encountered a frustrating upload limit of about 40 MB and found that the applet was throwing an OutOfMemory error. We've come across the HTTPURLConnection setChunckedStreamingMode() method ...
i'd like to understand the general flow control wheni assign a unique InetAddress to each of 256 threads andthen launch all 256 Thread simutaneosly.each Thread tries to make a java.sql.Connection withthe InetAddress that has been assigned to it.so:(1) when no connection is attempted, the ...
Why is the value in the following program being read as 255 instead of -1 ?The intent behind this program was to check whether the FileInputStream would be able to read -1 from the file, which btw is also the return value of read() when EOF is reached.import java.io.IOException;import ...
463 byte By
nthalia at 2007-11-27 8:55:42
Hi all,I'm embarrassed to admit it, but i have been doing a little bit of RMI on and off for probably 5 years, and don't have my basics clear on it.When I start an RMI server that i have implemented, how does it know where the RMI registry is? for instance, how does it know if the RMI ...
Hi,I am a bit confused as how wait() actually works. I know the purpose of this method but what I wanted to know is when a few threads waiting on a certain object lock and they are signaled via notifyAll(), how does one of the threads on the waiting list for that object lock gets the lock and ...
785 byte By
Turennea at 2007-11-27 8:57:02
Hi,I have been trying to upload a file using the HTTP post method for, and the ClientHTTPRequest class made available on the web at: http://www.devx.com/Java/Article/17679/0/page/3by its author, for more than a day. I am calling post, but the file is not being posted. The file should, according ...
My project requries a extra Attribute in LDAP ... i need to add this attribute for all the users .. how to do it ... help me out.
10261 byte By
Holoda at 2007-11-27 8:57:24
I have a java desktop application.It has to get file through httpIt gets jar file.Please, see my SSCCE:import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import ...
Hi,How to identify the length of doouble valueI am getting the double value like below 123456789123456789123456789123456789.22446688I need to find the length of this double value.I have tried the following ways:1)Pretty ordinary way, just converted the incoming value to String and find the ...
I want to create object of any defined type.Suppose I have got to create object of class "MyClass" and constructor values like int, string.This creation has to be dynamic in nature , meant , the class or constructor params can be had with any changing valuesExample : I call a method where I am ...
I need some urgent help....What socket should i use and how can i change the sender's ip address? I need this for my graduation thesis practical part, for a client who can send packets to a server and viceversa, without awearness of the server where from the packets arrive (if they addr is not ...
6536 byte By
samdanna at 2007-11-27 8:58:25
Hello there, I'm pretty new to LDAP programming, and I have been trying to create and add an entry to a directory using the code sample provided in the JNDI tutorial, but for some reasons, I didn't manage.the configuration file is well set up because I can't create, add, delete and modify ...
Hi,I am developing a batch framework using the Java 1.5 thread APIs. We have a requirement to save the state of the batch processes when it terminates abnormally or when it is killed for any reason. I have implemented this functionality using shutdown hooks. I have initialized the thread pool ...
1621 byte By
geffdea at 2007-11-27 9:00:15
I am building two applications (well, one application and one applet) that communicate over a network using TCP. The application, which is the server, is continually spitting out data from a sensor every 10 ms. The applet is receiving these data by reading through a buffered reader and graphing ...
Hi, I have a scenario, in which I have to run a Thread at every 15 minutes, If the first Thread is not Finished in 15 min then new Thread has to start. Currently I implemeted with java 1.5 schedulers, but the problem is if my first Thread is taking more than 15 min, then no new Thread is ...
Hello,to my environment:- java 1.5- tomcat 5.5i am trying to access remote mbeans from my web-app instances running on different machines for some clustering purpose. in general i am trying to access the oher remote mbeans from within a mbean itself using a rmi stub wrapped in some kind of a ...
I have written two classes in separate packages of the same project. One is beinng used as the server and the other is used as the client. I make the Registry entry in the Server Class as: PowerServiceServer svr = new PowerServiceServer(); // ... and bind it with the RMI Registry Naming.bind ...
3419 byte By
Mjacobsa at 2007-11-27 9:02:54
I am trying to call a method on the server from the client. I called a new instance of the class and wrote the new instance as an object to the ObjectOutputStream. I wrote an interface on the client side. Am I able to do this?(or allowed to) Oh yeah the server is on a different machine. The ...
94 byte By
kpba at 2007-11-27 9:03:12
Hi,could you advise me free javalibs for working with ftpthank you
585 byte By
MePacoa at 2007-11-27 9:03:14
Right now I have some code that creates and starts threads to perform certain tasks. Some of the threads I care about so I wait for them to finish (join() with a reasonable timeout value). The problem is that there are some threads that I don't care whether they execute successfully or not so ...
hello,i'm planning to implement file transfering b/w two computers on network or internet using java...how do i get started with?wat all i need to know?pls reply..thanx
Hi,I have a HashMap storing objects of type Employee. This map is keyed by employee id. I have a data feed sending me employee updates at a rate of up to 200 to 300 employee updates persecond. What I need to do is get the employee id from the data feed and check if it is in my Employee HashMap. ...
523 byte By
Jubaera at 2007-11-27 9:04:41
Hi thereI am using JDK 1.4 and thus I wrote my code for tracerout like thisCmd = "tracert host X";Runtime r = Runtime.getRuntime();Process p = r.exec(Cmd);This works perfectly and gives me results between host X and my machine.Now I would like to run my code from my PC but it should give me the ...
Hey, I am not quiet sure if this is the correct forum to place this question in, but i went with it because of the stamp networking.I am building a program that grabs sites of the web and decodes the HTML and then displays a web page. I would like to know how I would make the links from the ...
How come only partial page is refreshed in web- browser. ?
3609 byte By
rcauvina at 2007-11-27 9:05:40
I am having trouble with an HTTP POST returning different results froman equivalent HTTP GET. If you go to the following URL in a browser: http://transit.511.org/tripplanner/itinresults.asp&fs=714+Montgomery+Styou will see that it displays a web page containing the following text:"We found ...
121 byte By
mammaa at 2007-11-27 9:06:18
Where can I find a good tutorial on generics that will consist examples and settings of ide to use itThanks
Greets,I'm developping a huge application and got a latency/block problem using the write(ByteBuffer) method on a Socket from a socketchannel connection.Running java 1.5 (diablo) on Freebsd 6 servers, 4Gb ram (2.2 allocated to jvm), with dual xeon dual-core (total 4 cores)Here is the ...
How to set this from within a program. I know how to add it to the command line with -D but how do I do it from with an application ?