hashmap

80 byte By RaviKumar.Avulaa at 2007-11-27 9:06:49
how to extract values from one hash map and put it in to another hash map

IllegalMonitorStateException - Lock lost, but why?

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

Problems running an interactive Process: the process's output isn't appeari

4739 byte By Daniel.Wintersteina at 2007-11-27 9:07:19
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 local or non-local

204 byte By eddiecjchianga at 2007-11-27 9:07:26
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

Broken Pipes

1067 byte By sun_java_helpa at 2007-11-27 9:07:50
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 ...

How to find out the name of the user who is logged into Windows with JNDI

615 byte By buddylighta at 2007-11-27 9:10:51
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 ...

programmatically find out if rmiregistry is running?

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

sockets & streams vs socketchannel

149 byte By invictus2a at 2007-11-27 9:11:23
HiI am getting confused with all this sockets/streams and socketchannels...Which is the better way of doing network programming?

getting chunked response from the server

2198 byte By gaurav_abbia at 2007-11-27 9:11:50
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 ...

How to Convert Binary Data in Binary File

298 byte By Mohamed_Asifa at 2007-11-27 9:12:54
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

thread suspension problem

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

java NAT server?

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

Accessing the RMI object from EJB

3087 byte By yogendra_ga at 2007-11-27 9:13:52
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 = ...

Can I make a file uneditable?

220 byte By Kami_Pakistana at 2007-11-27 9:14:09
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...

XMLDecoder and System.in

1615 byte By AndreasLa at 2007-11-27 9:14:23
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 ...

java.io.NotSerializableException: magick.MagickImage

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

ByteBuffer Entering Double in array

325 byte By Joseph.Kubenaa at 2007-11-27 9:15:37
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 ...

Some basic questions about rmi registry context "bind" and "lookup"

3716 byte By lwintfelda at 2007-11-27 9:16:52
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 ...

We can taken the folder as inputstream and move to another ?

1277 byte By javaskilleda at 2007-11-27 9:18:12
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 ...

Mails Receiving

2079 byte By rajeshkrishnan83a at 2007-11-27 9:19:02
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 ...

java.io.StreamCorruptedException in Spring HttpSpringInvoker (help)

2465 byte By garethcpa at 2007-11-27 9:19:19
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 ...

static detection of deadlock in code

275 byte By bobby_dublina at 2007-11-27 9:19:29
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

lan searching

229 byte By atul_jaina at 2007-11-27 9:19:42
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

Memory management HashMap versus ArrayList.

873 byte By monaPillaia at 2007-11-27 9:19:43
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 ...

Proxy Handling

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

RMI-IIOP over SSL

137 byte By jw010707a at 2007-11-27 9:21:23
It is very difficult to find examples of RMI-IIOP over SSL.Can anyone give me a simple example about it? Thanks in advance.

Exception handling

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

javax.naming.NoPermissionException; remaining name '"...

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

LDAP Booster Pack from SUN and old JNDI classes 1.2.1

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

BAD_PARAM/201. vmcid: SUN minor code: 201

6269 byte By S_Chantia at 2007-11-27 9:23:54
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 ...

IPAddress to Country Resolution

96 byte By anamupotaa at 2007-11-27 9:24:45
I would like to if there are any API's for resolving IPAddress to Country?Thanks.

How to narrow Class<?> to Class<? extends junit.framework.TestCase>

677 byte By Kunal@nitsa at 2007-11-27 9:24:57
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<?> ...

Handles in Maps

447 byte By olliegatora at 2007-11-27 9:25:02
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 ...

performance of BlockingQueue (again)

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

Problem with unicode

804 byte By lokisapocalypsea at 2007-11-27 9:26:03
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 ...

LDAP 636,error: unable to find valid certification path to requested target

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

why to compute serialVersionUID with methods and constructors involved?

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

Httpclient and url rewrite

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

Generics - re-writed version

2867 byte By franciscodiaztrepata at 2007-11-27 9:27:44
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 ...

How do you add an object to a collection typed witha wildcard?

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

MappedByteBuffers on 32-bit vs. 64-bit systems

3628 byte By StuThompsona at 2007-11-27 9:29:56
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 ...

convert string to code

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

Inserting image

96 byte By sudharsha at 2007-11-27 9:30:37
How to insert images into Database using Servlets.How we can retrive those images.

JDBC Connections

59 byte By sudharsha at 2007-11-27 9:30:44
How to connect Oracle DataBase through Java Program?

Hi

26 byte By @Aneesa at 2007-11-27 9:30:55
What is Java beans?

Upcasting to generic list doesn't work?

728 byte By justinlawlera at 2007-11-27 9:31:07
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 ...

java.lang.ClassCastException

1021 byte By manchzeka at 2007-11-27 9:31:51
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 ...

Active Directory Using Java

304 byte By rajeshkrishnan83a at 2007-11-27 9:32:52
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 ...

how to feed CharsetDecoder (nio Buffer problems)

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

expungeStaleEntries in WeakHashMap

531 byte By nishantagrawala at 2007-11-27 9:32:58
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 = ...