how to extract values from one hash map and put it in to another hash map
3166 byte By
maxpga at 2007-11-27 9:07:00
I have some kind of synchronization problem. somehow I get an IllegalMonitorStateException when calling notify on an object, but this object is within a synchronized block! The code looks like this:private volatile Set<K> set = new HashSet<K>();private Map<K, ...
I'm trying to run an interactive Linux process from Java. That is, a program which prompts the user for input as it runs. I want to catch the output and feed in appropriate responses. See the sample code below.When I try to run this, it hangs. The process sits there without terminating or ...
How to find out whether a RMI calling client is on the same physical machine as the server.Taken into account the machine may have multiple NIC and hence multiple possible IPs.Regards
I get a broken pipe error while uploading feeds to an ftp server,,,,any resolutions?2007-06-26 06:04:49,430 INFO [STDOUT] java.net.SocketException: Broken pipe2007-06-26 06:04:49,430 INFO [STDOUT] at java.net.SocketOutputStream.socketWrite0(Native Method)2007-06-26 06:04:49,430 INFO [STDOUT] at ...
Hello,We have 17 schools in our company which we serve. Every school has a shortcut name like EKS or ASR. Every school has 1 IT teacher which can log into a jndi desktop application where he can set passwords for teachers/pupils if they forgot theirs...When the IT teacher press the button to ...
108 byte By
nthalia at 2007-11-27 9:11:01
Is there a way to programmatically find out if the rmiregistry is running?Thanks,Nilesh
HiI am getting confused with all this sockets/streams and socketchannels...Which is the better way of doing network programming?
hi all,i'm working on a issue in which when my http client recieves chunked response, it fails while writing the data in the internal process, i want to simulate it and for this i need to run a server which should respond with a chunked response so that i can see what's going wrong in my ...
hi,my telecom client puts a binary file which is asn.1 encoded with BER.how to handle binary data in java.how to convert binary to hexa to ascii formathow to convert binary to octet to ascii formatplease help me in this.regards,s.mohamed
2362 byte By
kulkuria at 2007-11-27 9:13:22
I have a swing problem, which needs some threading code, but I barely understand it.My text field components change the underlying data when the focus is lost. When I click on a different tab in the JTabbedPane while editing a field, at the time the ChangeListener runs, the focus is not lost, ...
1193 byte By
hos123a at 2007-11-27 9:13:37
Hi thereI am trying to set up a practical for a computer science module and need to check the feasibility of creating software that acts like a DHCP and NAT server in java. I'm pretty sure the DHCP is possible using datagrams, but I'm not sure that a NAT server is possible. So far what I ...
Hi I have registered an RMI object in the JNDI tree of the Weblogic server. This RMI object is supposed to be accessed by multiple Session Beans. I lookup the RMI object and get the instance. But when I try to narrow it , it throws the ClassCastException. Following is my code : Object obj = ...
Hi there!!In fact my java app creates a config file on the client's machine and I want that after the file's creation the client or any user can't edit the file,,,is it possible some way?Thanks...
Hi,I have an issue when using the XMLDecoder class in conjunction with System.in.What I want to achieve is basically to be able to send the contents of an XML file to stdin of the Java application. However, when doing so, the readObject call to the decoder does not return anything until either ...
667 byte By
Samantha at 2007-11-27 9:14:55
Hi, I was trying to use Jmagick and I have a MagickImage object. I wanted to convert it into byte[]. But I have this exception. The following is the code that I have used.<code>ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream = new ...
i am using a java application to communicate with a server written in C# the server side looks at a double reading the Most significant byte first to the least. my doubles are being entered into the byte array which i am sending least significant to most significant. why is this, is there an ...
We have more processing to do than can be accomplished with a single computer. To solve the problem I've implemented a distributed computing solution using RMI. (The first time I saw RMI was about 2 weeks ago, so please bear with me!) The implementation is a proof of concept not a fully ...
i need to move all content in some folder and move to another we can ? import java.io.*;public class TestOut{public static void main(String args[]){try{File file=new File("c:\\from");InputStream fis=new FileInputStream(file);File file2=new File("c:\\to");OutputStream fos=new ...
Dear all,Greets for the Day.I am here by sending a java program to receive a mails from my inbox but if i run it i am getting the following error.Please help me to rectify the problem and get the result.Thanks for your help.Regards,Rajesh.Program is import java.util.Properties;import ...
Hi,I encountered the following exception during the retrieval of Object[][] from the service.org.springframework.remoting.RemoteAccessException : Cannot access HTTP invoker remote service at [https://test.org.net/context/remotin...vokerService]; nested exception is ...
hello all,are there any static deadlock detection tools out there for java?i have read something about lock_lint provided by sun, is lock_lint compatible to java 1.3?any other tools out there worth mentioning?thanks for your replyrob
hi! i am planning to develop an application which finds the live hosts on a local area network and then lists the shared folders on each machine. basically i want to search for files and folders on lanplzzz.... help
Okay, here is my question. I have been trying to research on the memory hit an application is going to incur if it uses a HashMap instead of an ArrayList and I have not been able to find a satisfactory answer. Suppose I have say 10,000 objects and the way I access them is such that 50% of time ...
4445 byte By
tigerxxa at 2007-11-27 9:20:43
Hi Guys, I was trying to create a connection to our proxy server and tried to fwd the requests coming to my ip to proxy server.I have tried using Proxy class. But the issue is that I am getting invalid proxy exception please help me with this. The code I have used is pasted belowimport ...
It is very difficult to find examples of RMI-IIOP over SSL.Can anyone give me a simple example about it? Thanks in advance.
882 byte By
mahiva at 2007-11-27 9:22:49
If I write a program that will generate OutOfMemoryError, and catch it using Throwable then the line after catch does not execute, but if I use Error instead of Throwable then it gets executed. Why so?import java.util.*;class TestExcep {public static void main(String[] args) {Vector v1 = new ...
1019 byte By
JesseKoa at 2007-11-27 9:23:41
Hi!I use fscontext-1_2-beta3 to be my file system service provider. It worked fine on windows system, but failed after migrate to AIX. The following error message is what I got:javax.naming.NoPermissionException; remaining name '"/usr/...../jndi/jdbc"'[java]at ...
1034 byte By
4tha at 2007-11-27 9:23:53
Hello folks,I am using W2K server for accessing Active Directory with JNDI but i need some Controls/Extensions which - so i have read it in a java/ldap book - i should find this stuff under the link: ...
When i am trying to execute the code of CORBA "BAD_PARAM/201. vmcid: SUN minor code: 201 " exception comes. The flow of code and function calls are as follows.//-Change of Static IP code startsMOData[] mo;mo=new MOData[1];mo[0]=new MOData();mo[0].identity=idn;mo[0].attributes=new ...
I would like to if there are any API's for resolving IPAddress to Country?Thanks.
What I am trying to do is load a class using Class.forNameClass<?> clazz=Class.forName(......);and pass that loaded class to a methodaddTestSuite having the following signatureaddTestSuite(Class<? extends junit.framework.TestCase>?Now Class.forName(.....) returns Class<?> ...
Hi,I have three methods for manipulating data: addData, delData, modData.All the changes in the data are done through handles which are stored in a map.In each method I want to:1. lock the map2. get the data handle3. lock the data handle4. unlock the map5. manipulate data6. unlock the data ...
1132 byte By
androsa at 2007-11-27 9:25:49
I'm migrating from 1.4.2 through 5.0 to 6.0, and would like to usethe Collections classes. I'm torn, tho: my current implementation usesa home-grown blocking queue where one writer and many readers process "records". The readers currently sleep for a period of time if the queue isempty. The ...
Hello all. I am running a program that uses characters to send instructions to a machine we use here. The original version of this program was done in C but is now being ported to Java. One issue I am running into is the display of an extra character. I converted the character to an integer and ...
775 byte By
4tha at 2007-11-27 9:26:36
javax.naming.CommunicationException: simple bind failed: rhein:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to ...
872 byte By
joerg04a at 2007-11-27 9:26:39
I have to do some work on serialization and through my research Ifound it quite curious that the algorithm for the serialVersionUID (suid)considers methods and constructors in addition to fields. Yet, the serialization specification says methods and constructors are not involved to incompatible ...
312 byte By
Suveleea at 2007-11-27 9:26:49
I am writing a java application to access a web based application using httpclient. If the server is using url rewrite mechanism, what changes do i need to do for a normal POST request? Any idea how does the browser send the request in such scenarios?Thanks in ...
Hello all. I am building a small app that requires a persistence manager to save objects in an xml repository file.I am trying to use generics to see if I can avoid casting objects from a general super class to concrete class. Lets say Entity and Person.For a store method. I wrote this:public ...
2768 byte By
dukhaa at 2007-11-27 9:28:16
Hi All,I want to add an object to a collection typed with a wildcard but I can't figure out how to do it.I've been thru the generics tutorial again and I now understand that I can't do exactly what I want to and why. However I don't know how to do it right. I copy some code below to show ...
Hi all,In the course of performance testing and optimization of my large-file, I/O intensive application, it has become apparent that it could benefit from switching the stream-based input to a NIO MappedByteBuffer approach. The micro-benchmarks look good (5x speed improvement on read ...
203 byte By
elmoftya at 2007-11-27 9:30:32
hi everybody if i have string of code like this "if(x == 5)y=5;"how can i convert it to real code to run in runtime ?Note: i checked Reflection API and i do not find any thing
How to insert images into Database using Servlets.How we can retrive those images.
How to connect Oracle DataBase through Java Program?
26 byte By
@Aneesa at 2007-11-27 9:30:55
What is Java beans?
Hi, I have two obects:A extends Band two methods:public List<A> getAObjects(){return new ArrayList<A>();}andpublic List<B> getBObjects(){return getAObjects();}But I get errors in method "getBObjects()". How come? Surely I can do this cause Object A is an instance of object ...
Hello,I want to pass an object called UserNodeData through RMI from the server to the client.In the client side i create an object with the type of the interface of UserNodeData (the interface is called RemoteLinkman) . Here is the piece of code that make the error (client side) : RemoteLinkman ...
Dear All,Greets for the Day.I would like to get the user details, based upon the user login.Active Directory using java.Can you please tell me how i get the details from Active directory using Java.Reply me soon.Thanks for your ...
1501 byte By
HolgerKa at 2007-11-27 9:32:57
Hi there,I have no idea how to feed bytes into a CharsetDecoder in presence of multibyte sequences. I am trying something along the following lines.If a multibyte char is being fed (I tried c3 +a4 = ?, the first call to decode returns UNDERFLOW with bout.hasRemaining() == false as expected, but ...
In WeakHashMap.expungeStaleEntries method of JDK 1.5, I see following code:e = (Entry<K,V>) queue.poll()But while creating Entry, only key is added to WeakReference:Entry(K key, V value, ReferenceQueue<K> queue, int hash, Entry<K,V> next) {super(key, queue);this.value = ...