935 byte By
syt000a at 2007-11-27 6:56:13
I have a client/server app that uses RMI to communicate. I have a few questions. I'm new to RMI so if what I'm asking doesn't make much sense, correct me.I deploy the client and server. Now I update the remote interface to add new functionality by adding a new method, I thought that this ...
Hi,I have a table wherein every time I add a new row it will automatically scroll to the last row. But if i add a row with a bigger height, the last row is not totally shown. Please see my code below.private void scrollToLast(JTable table){int lastRow = table.getRowCount() - 1;Rectangle rec = ...
Dear colleagues.There is some inconvenience concerning using of java annotations. I annotated some interfaces and methods within them. Then I made some derived interfaces and classes and tried to get my annotations here. Unfortunately annotations whose had been made for base classes were ...
2032 byte By
Mata at 2007-11-27 6:57:33
anyone have any suggestions for emulating this behavior described below?I need a way to have an indexed list, which will store undefined indexes. Hashtable<Integer,blah> could do it, but the thing is that the integers are unordered. they aren't indexes.The other way to describe it is an ...
I am a student developing an application where two remore users are posting images and drawing on a paper (like a shared whiteboard) - could anyone advise me as to how best go about this? how to deal with concurrency and making sure it is synchronised. How to keep the two applications in sync ...
Hi everyone,I found this example in the FAQ:interface Acceptor<V> { void accept( Task<V> task, V v);}interface Task<U> { void go(Acceptor<? super U> acceptor);}class AcceptingTask<U> implements Task<U> { public void go(Acceptor<? super U> acceptor) {U ...
1435 byte By
fraksiaa at 2007-11-27 6:58:02
hello, what i want to do is something like:public class AClass<K extends SomeObject>{SomeObject[] AnArray;public void amethod() {AnArray=new K[10];}}So I want to create an array of some kind of object at runtime without already know the kind of the object. The thing is that I think that ...
1741 byte By
Yeva at 2007-11-27 6:58:58
have rather weird problem. Web application executes LDAP search against Active directory GC. It does it in a standard steps: 1. Creates hash table with parameters 2. Creates InitialDirContext 3. Execute search using search objects, filter etc. 4. Enumerates result using hasMoreElements and next ...
I have an application where I wish to take 4 byte arrays and push it down one socket in one continuous stream. Then the other end will take it and decode it into four byte arrays again. Anybody have a solution for this? The byte arrays are in a ring buffer so i would have to be writing data ...
so,i can not solve this problem :i have wrote a eseay RMI API:import java.rmi.*;public interface Calculator extends Remote{public int addNum(int x,int y) throws RemoteException;}import java.rmi.*;import java.rmi.server.UnicastRemoteObject;public class CalculatorImpl implements ...
7772 byte By
lokiea at 2007-11-27 6:59:34
Hello everyone. I was wondering if its possible to overload the toString() function of the Map datastructure supplied by java.I looked it up and it says:public class HashMapextends AbstractMapSo I looked up AbstractMap and it says:public abstract class AbstractMapextends Objectimplements MapAnd ...
Hi,I want to know if there is any way to know the threads that are instantiated at runtime from outside the class or package. To be more clear, I am building a module to enhance JSWAT (Open source java debugger ) to visualize the concurrent execution(monitor based) of multithreaded ...
hi,If anybody have the DBSCAN implementation please send to me.
344 byte By
Pachia at 2007-11-27 7:00:45
Hi All,Developing a chat application. Wanted to store the data according to the scope. The scope will be different for different rooms. My doubt is can a variable name(scope name) be declared as a List name? Everytime a new scope is created, a new list has to be generated at the server ...
62 byte By
hsy541a at 2007-11-27 7:01:06
When I did it I got a java.lang.IllegalAccessException.
hello friends!!in one of my projects i'm having two parallel threads running, each having a BufferedReader object. Each of these objects gets inputStream from a common socket.the problem is, when something is input into the socket, only one of the threads reads that input at a time.. while i ...
173 byte By
sim085a at 2007-11-27 7:03:43
TCP works only with IP right? Then if I want to communicate with a devise that does not have an IP (my television) I cannot use TCP right?Regards,Sim085
199 byte By
Ehsan.Sa at 2007-11-27 7:03:54
HelloI have a queue that is filled every week and accessed by other programs. How can I make this queue thread safe and allow programs to access it one by one.cheers,ehsan
2748 byte By
RMI_SSLa at 2007-11-27 7:04:09
HI everyone.I wrote a server in RMI which is secure with SSL.When I run the program I receive a lot of exception.I'm little novice so I need some explanation.The code where I'm create the SSL socket is:public class RMISSLServerSocketFactoryimplements RMIServerSocketFactory, ...
Hello, may I know how can I wait for all the threads in a fixed thread pool to be completed, without calling shutdownNow?Executor pool = Executors.newFixedThreadPool(nThreads);for(int i = 0; i < 10000; i++)pool.execute(new StockHistoryRunnable(code));// blah blah blah//// I would like to ...
Consider:public interface SyntaxNode extends Node<SyntaxNode>public interface ParentSyntaxNode extends SyntaxNodepublic class StatementListNode extends ParentSyntaxNodeBase // < implements ParentSyntaxNode{private Set<? extends StatementNode> _statements;public Set<? extends ...
Hi,i've got an application with several threads which:- perform database operations (insert, update, select ..)- call external programs using Process p=Runtime.getRuntime().exec(cmdString); sometimes they got BLOCKED.1. How can I know the cause which blocked my threads?2. What "Good Practices" ...
9660 byte By
asyed01a at 2007-11-27 7:05:33
Hi Folks!I am new in java and working on a client server application. I am running server on port 5000. After that client connects to server on this port. Now after client connects I want to send 2 numbers to client to process. In my code I on server I am not able to send those 2 numbers to ...
I am not sure if syndication if the proper term. Syndication usually refers to rss, but what we want to do is not rss.So here is what we want to do, and I'd like your opinion on the use of RMI to do it.It is a application that will run on users computers, active in the system tray, and that ...
I'm fairly new to the more advanced concepts of java programming so I apologize in advance if this is a dumb question. Any help would be appreciated as I'm always wanting to increase my understanding.Here is a bit of background info:I am using two Vectors to update two JLists. The first ...
Hi -I am new to java and i have a task to complete using ThreadPooling. I am using JDK1.4 so i have decided to use the api provided by Doug Lea. Basically i will have to process around 20000 documents daily which are in the database and each document has an ID associated and there is no ...
2184 byte By
suppona at 2007-11-27 7:06:43
i have an object, to which i append a container.this container has objects of type that are not known on theremote host.// this is the local machinepublic class Record1 implements Interface1, Serializable { public double d = -1; public List<String>;} ....public class Agent implements ...
Hello all,I wish to have a lock with the following features.1. My main thread will create a lock with counter 5. Then my main thread will spawn n threads to perform some task. My main thread will wait for the lock forever, until the counter become 0.2. The worker threads will decrease the ...
11904 byte By
choey2k5a at 2007-11-27 7:06:53
I have created a simple 1:1 chat application to practice the java.net package.I know it's more efficient to split it to the Server version and the Client version, but I really wanted to do it this way =pHere's how it works: run the app and create a server; then, run it again to connect to ...
Hello all,I plan to have a List, where n number of Threads will accessing the List.When two or more thread trying to remove an equals items from the List, only one of the thread will remove successfully (i,e, remove(Object o) will return true). The rest of the threads will realize remove(Object ...
Current, I have a method, which will perform lock on void MyWait(){CountDownLatch.aWait// We can have access to the Stop lock.}void MyStop(){// Signal Stop lock.}This works fine until we need to stop the thread from keep waiting on CountDownLatch, when there is a stop signal. (The method who ...
245 byte By
puspaa at 2007-11-27 7:08:23
I need to solve a program using linked lists...the program details are as follows.this is a hierarchy of employee and supervisor.how will i print the names of the respective employees and supervisors whichever i need?
It seems the SocketChannel is always readable after send a request. I tested and found that but I'm not sure if it is right? More detail: --Create a SocketChannel, connect to server in non blocking mode, register to Selector for connecting (SelectionKey.OP_CONNECT) , after finishConnect(), ...
351 byte By
xemaa at 2007-11-27 7:11:07
Is there any performance related disadvantage for using BigInteger.The reason why is use BigInteger is to convert a byte array to hex string.I have seen other functions which does the same. but since Biginteger does that in a single line of code i chose it... and now i wanna know any way the ...
2321 byte By
Galstuka at 2007-11-27 7:12:39
Using Java 6.0 and getting unchecked conversion warning on an ArrayList cast when reading an ArrayList of String[] from a serialized file at compile time.The general thrust of the code follows:private static java.util.List<String[]> databaseAlias = new ArrayList<String[]>(); // ...
1424 byte By
yann74a at 2007-11-27 7:14:34
I have a problem with ZipInputStream. Essentially, I receive and InputStream (that's why I cannot use ZipFile), and I need to unzip it and read all its entries. The problem is that the entries are xml files, so I need to build the dom, but when I call DocumentBuilder.parse, it reads all the ...
2233 byte By
MithunKa at 2007-11-27 7:16:31
Hi all,I am trying to execute below code,public static void main(String[] args){HttpClient client = new HttpClient();// an example only... replace this with your siteGetMethod method = new GetMethod(" http://www.google.co.in/");try {// get the response code, hopefully "successful" (SC_OK, or ...
If I have a Socket listening for data and im using an ObjectInputStream,how do I retrieve the data of any failed readObject() attempts?Should I subclass an InputStream and override the read methodsto copy the data (or at least make it accessible during an error)?I could then reset the copy ...
import java.util.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.PrintWriter;import java.net.Socket;import java.net.UnknownHostException;import javax.swing.table.DefaultTableModel;public class tClient{ static int port = 8084;static String ...
HelloSun developed RMI and Java RPC for java.I have not so much experience with both of them but from what i see and what i read they are not widely spread. In my environment there is nobody how could tell me who and which industry use them.But since the web services get more and more use in ...
64 byte By
Priyoa at 2007-11-27 7:34:30
Sample code to explain the concept of Executor in JDK 1.5
1739 byte By
arsia at 2007-11-27 7:34:54
Hello,This class (see below) is working fine the way it is but I have a little problem, I need to execute aprox 500+ commands and each command takes between 30sec to 3 minutes to complete which translate into hours for the job to finish.I want to speed the process by multi-tasking and executing ...
I have several TreeMap classes in the app I'm working on and one is acting funny. The Class I'm 'putting' into the Map includes Integer, Strings and Calendar objects. After loading the Map I go through the keys (integer values) loading the values to a table control and find that all of the ...
2987 byte By
lifesuna at 2007-11-27 7:35:16
I have this exception :java.lang.ClassCastException: Prova.Types_Stubat Prova.Types_Stub.metodo(Types_Stub.java:36)at Prova.Client.connessione(Client.java:25)at Prova.Client.main(Client.java:47)The Source Code is : package Prov;import java.rmi.*;import java.rmi.registry.*;import ...
346 byte By
txatia at 2007-11-27 7:35:30
Hi,I have to read text (lines) from several files, and after that, I have to wait until new information is written to the file (as log files). The new data should be processed as it comes (in real time).how can I wait until the new information is written?The goal is not to make a sleep() of ...
17337 byte By
julsorioa at 2007-11-27 7:35:42
Hello everyonei'm trying to develop a Java Chat,i've been using source code from another chat to personalize minethe interfaceimport javax.swing.*;import java.awt.event.*;/** * * @author Juli醤 Osorio Amaya */public class InterfazChat extends javax.swing.JPanel {JButton jButton1;JScrollPane ...
Hi,I have to load a class from another directory. This class is in no package! I specify a path for the URLClassLoader but the compiler interprets this as package for the class and of course complains that the package is wrong.the code:public class Main {public static void main(String[] ...
285 byte By
KKera at 2007-11-27 7:36:44
Okay, I've been developing a Java chatroom, and I want to, when someone enters the chatroom, have the user register his username with the server. When I do that, it lets people know who's in the chatroom. Whenever I try it, it makes some crazy unstoppable loop of foreverness.
Hello All,I have installed jdk1.4.2_06 in different windows boxes. I am running the same java program in both the boxes. For box#1 it is throwing the above error while copying a file bigger 64M, but, for the box#2 it is throwing the same error when the file size is bigger than 32M.I tried to ...
I want to get whether a file is open to be written by other program. How can i do that?