RMI and versioning

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 ...

JTable Scrolling to Last Row

831 byte By GideonRaya at 2007-11-27 6:57:13
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 = ...

Java inherited annotations

1078 byte By fusionsoft-onlinea at 2007-11-27 6:57:19
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 ...

Noob seeks to emulate javascript array

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 ...

java networked application

321 byte By coffeeandsunshinea at 2007-11-27 6:57:39
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 ...

Example from Angelica Langer FAQ - need help

1806 byte By AdrianSosialuka at 2007-11-27 6:57:50
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 ...

creating array of generic object

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 ...

Error in finalizer after LDAP search with referrals

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 ...

Multiple Byte Arrays Down One Socket

576 byte By DJHotIcea at 2007-11-27 6:58:59
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 ...

old problem

2205 byte By cuongdeutsch2@yahoo.coma at 2007-11-27 6:59:12
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 ...

Is there a way to overload the Map's toString() function?

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 ...

Finding the thread ids instantiated at runtime

1083 byte By ramaniarun01a at 2007-11-27 6:59:37
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 ...

DBSCAN

77 byte By itsnava4u@yahoo.co.ina at 2007-11-27 7:00:43
hi,If anybody have the DBSCAN implementation please send to me.

Can a variable name be declared as List name?

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 ...

How to ivoke a method on an object of a private class

62 byte By hsy541a at 2007-11-27 7:01:06
When I did it I got a java.lang.IllegalAccessException.

two threads having a common input reader

535 byte By manishmulani@nitka at 2007-11-27 7:03:32
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 ...

TCP works only with IP right?

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

Accessing a queue

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

problem with RMI with SSL

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, ...

Waiting all threads in a fixed thread pool

875 byte By KwangHooia at 2007-11-27 7:04:18
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 ...

Why Are These Type Incompatable?

2191 byte By DejasPerPera at 2007-11-27 7:04:41
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 ...

Threads BLOCKED

406 byte By tlloretia at 2007-11-27 7:05:06
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" ...

Is it a port problem?

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 ...

Syndication with RMI?

1329 byte By Fascisticidea at 2007-11-27 7:05:46
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 ...

Should I use synchronization for this scenario

3489 byte By trusted_uniksa at 2007-11-27 7:05:56
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 ...

Thread Pooling Design Question

809 byte By novicekumara at 2007-11-27 7:06:22
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 ...

remote class loading for the purpose of casting

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 ...

Lock with counter

697 byte By KwangHooia at 2007-11-27 7:06:50
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 ...

Connection is good, but Client & Server can't communicate

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 ...

Which List should be used, to remove in a thread safe way?

705 byte By KwangHooia at 2007-11-27 7:06:59
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 ...

WaitForMultipleObject feature in Java

1272 byte By KwangHooia at 2007-11-27 7:07:14
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 ...

solving a program using linked lists

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?

NIO The SocketChannel is always readable after send a request?

925 byte By nightingalea at 2007-11-27 7:10:52
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(), ...

Is there any disadvantage of using BigInteger?

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 ...

Problem reading ArrayList of String[] from serialized file

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[]>(); // ...

Strange behavior of ZipInputStream

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 ...

HTTPClient.executeMethod(getmethod) is throwing java.net.UnknownHostExcepti

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 ...

Sockets + ObjectInputStream, Retrieving Invalid Data for Security

606 byte By TuringPesta at 2007-11-27 7:27:53
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 ...

illegal monitor exception

6908 byte By jamesgoslina at 2007-11-27 7:27:56
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 ...

which one:rmi, rpc, webservice, cleint server

489 byte By thomas-spa at 2007-11-27 7:30:51
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 ...

Executor interface in JDK 1.5

64 byte By Priyoa at 2007-11-27 7:34:30
Sample code to explain the concept of Executor in JDK 1.5

Need help making this class Runnable.

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 ...

TreeMap error

870 byte By ThrowCodea at 2007-11-27 7:35:11
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 ...

RMI PROBLEMS (CAST)

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 ...

Wait until file updated

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 ...

Help with Java Chat

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 ...

URLClassLoader interprets path as package

3007 byte By MarkusKuhlaa at 2007-11-27 7:36:27
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[] ...

Java Chat Username Registration Error.

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.

Insufficient System Resource to complete the requested request

554 byte By Lets_Make_it_Simplea at 2007-11-27 7:36:59
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 ...

How to know whether a file is open?

94 byte By youhaodiyia at 2007-11-27 7:37:13
I want to get whether a file is open to be written by other program. How can i do that?