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 ...
helloi was reading this article http://www.jivesoftware.com/jive/entry.jspa?externalID=701and i wanted to track my GC logs. we start our jvm using this script. can someone please tell me what arguments would i need to and how i would edit this script to start the JVM in verbose mode or start GC ...
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.
68 byte By
chnada at 2007-11-27 7:02:43
can i run GC from my jconsole when i connect to it an remote?
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 ...
1723 byte By
Valasua at 2007-11-27 7:05:02
I would like to suppress the following messages appearing in the console.How to do that?--Jun 11, 2007 1:38:05 PM ClientCommunicatorAdmin restartWARNING: Failed to restart: java.net.ConnectException: Connection refused: connectJun 11, 2007 1:38:06 PM ClientIntermediary closeINFO: ...
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?
739 byte By
kaouaa at 2007-11-27 7:09:52
Hi,I've created an MBean, i've put it in a first project (A) and put its implementation in a second one (B).I have access to the methods thanks to the interface from project A in the following way :MBeanServerConnection conn = connectToJMXServer();CachesMBean caches = ...
Hie ,I want to know the specific Mbean name or the Domain under which i can get the "Memory usage" or such critical attributes of specific application in jboss and in weblogic application Server.Thanks
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 ...
I am trying to get JMX over SSL to work with a standalone server java app using jconsole as the client. I am configuring JMX via a file specified with the com.sun.management.config.file system property on the command line.I have it working fine without SSL, but with SSL enabled ...
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 ...
Hello,Is there any example how we could secure the JMX management and monitoring with Kerberos based authentication? At least what steps are required to achieve this?Thanks,Istvan
Hello all.I'm new at JMX and trying to use it in our systemThe code looks like that//create serverJMXServiceURL addr = new JMXServiceURL("rmi", "127.0.0.1", port);RMIConnectorServer connector = new RMIConnectorServer(addr, null, server);JMXHelper.registerMBeanOrAdapter(server, ...
64 byte By
Priyoa at 2007-11-27 7:34:30
Sample code to explain the concept of Executor in JDK 1.5
The java process is running as a NT service, so I think I can't use the ctrl+break option.I need to have this dump generated both on demand and also when the JVM crashes?I have used IBM's core dump analyzer to analyze the core dumps generated by Websphere's JVM. Would this work for a Sun JVM ...