object reference

486 byte By Tamil_CSEa at 2007-11-27 5:45:07
Hi,I got "[100, 200] []" for the following program. Can anyone explain me why s2 is not printing [100,200]?public static void main(String[] args){Stack s1 = new Stack ();Stack s2 = new Stack ();S1 e1 = new S1 ();e1.convert (s1,s2);System.out.println (s1 + " "+ s2);}public void convert(Stack s1, ...

LDAP: Problem with retrieving all the baseDns available

1077 byte By Parul82a at 2007-11-27 5:45:26
Hi,My question is regarding LDAP.I'm new to JNDI and LDAP as well.I'm developing a Client UI for LDAP, where I need to show a tree view for all the DNs available in a particular LDAP and on just clicking on the nodes the client can get the information about the users and attibutes which is ...

a NIO NOOB question

2862 byte By omerk76a at 2007-11-27 5:47:02
Hi all, I apologize if this question is not in the rigth forum.I'm new to nio, and my knowledge comes from Ron Hitchens's book:"High Performance Java IO And Regular Expressions".There are 2 issues that I couldn't understand from reading the book:1. when I have data to send, how do I do it ...

Access linux file system from windows and vice versa

159 byte By Rgsa at 2007-11-27 5:47:25
FriendsDo anyone of you have any idea about how to access linux file system from windows using java. Thanx in advance.RegardsRakesh

synchronized native method causes lock to be released

1735 byte By alok_sa at 2007-11-27 5:47:36
I've a synchronized method which calls a native synchronized method. On return from the native method the lock acquired on the object is lost. This causes IllegalMonitorStateException when the method is returned. I've pasted the code below. Has anyone else experienced this? I've tried with ...

RMI Version Compatibility and Alternatives

1095 byte By triplesuba at 2007-11-27 5:48:11
I hope someone can help me.I am working on a system which will generally be running on Java SE 6. However, there is one small part that runs as a thin client on a different machine using a J2SE 1.3 VM. This thin client will talk to a server program that should reuse a component from the main ...

Any Authentication Patterns?

515 byte By sim085a at 2007-11-27 5:48:13
Hi,Basically I want to develop a server/client socket application. However I want to make the server handle actions depending on the access privileges of the client.I could just code something out and get something working, however I am sure that the result would be mediocre and easy to hack by ...

Thread Priorities and Thread Pooling , which approach is best ?

604 byte By Jasdeep.Singha at 2007-11-27 5:48:21
Hi all,I am developing an application which must process requests depending on the priority of that request.So i want to process the requests of same prioriy with one thread .say requests of higher priorty with hight priority thread.I am unable to figure out architecture for the solution.Shall ...

Deserialization of a String

1098 byte By Witroba at 2007-11-27 5:48:34
Hello, What I want to do sounds quite easy, but im just getting errors I have an API which stores and reads Strings in a property file. I use the API to store an object as a String by serializing it. This seems to be working. I have problems to deserialze this String an obtain the object.I ...

Why am I still getting ConcurrentModificationException?!

25080 byte By ProGrapea at 2007-11-27 5:49:46
Here is a simple test that I ran on a collection that I have implemented, in which I try to add multiple objects to the collection in multiple threads. I have labelled the methods which modify the colleciton as synchronized, so I had thought it would not allow more than one LinkedCollection.add ...

can not load oracle db driver

3662 byte By jin412a at 2007-11-27 5:50:04
After load the following code and I got an error message"can not load oracle db driver"can you help me? thanksimport java.io.*;import java.sql.*;import javax.servlet.*;import javax.servlet.http.*;public class DBPhoneLookup extends HttpServlet { public void doGet(HttpServletRequest req, ...

Managing Threads

1931 byte By ProGrapea at 2007-11-27 5:51:21
Hullo.I've been fiddling around with multi-threading but it's still very new to me. For the code below, please just assume the existence of classes LinkedCollection (which implements java.util.Collection) and Berk (which implements java.lang.Runnable), as they aren't a part of my ...

final all methods and final class vs. final only class

437 byte By MartinBoehma at 2007-11-27 5:52:26
I've got a final class where all methods have to be declared final. Now I read that the final declaration of the methods is obsolete.Obviously the methods can't be overridden, but isn't there a difference betwenn final declaration of the class plus their methods on the on hand and only ...

Porting a Kernel module in Linux to Solaris 10

679 byte By shenbagaraja at 2007-11-27 5:52:41
Hi all,I have implemented Ipsec in Linux as a kernel module programming..In my code i have used Hooks for getting the N/W packets for processing...once i got the packet i will do all the processing (AH header addition/removal)then put back the packet in the stack......... And now i am trying to ...

Error : java.net.ConnectException

3893 byte By lifesuna at 2007-11-27 5:52:42
hi, I have this exception : java.net.ConnectException: Connection refused: connectat java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.PlainSocketImpl.doConnect(Unknown Source)at java.net.PlainSocketImpl.connectToAddress(Unknown Source)at java.net.PlainSocketImpl.connect(Unknown ...

sorting

196 byte By msnma at 2007-11-27 5:53:06
There are 100000 records in a table and i need to sort them.But retrieving of this data is happening in batch mode say 10 .so how to sort 100000 records.please suggest.

this.getClass().getClassLoader().getResourceAsStream(log4j.xml)

494 byte By JeeDevelopera at 2007-11-27 5:53:12
Hi everybody while reading xml file by this.getClass().getClassLoader().getResourceAsStream(joe/log4j.xml). getting following error java.net.MalformedURLExceptionjava.net.URL.<init>(URL.java:571)at java.net.URL.<init>(URL.java:434)at java.net.URL.<init>(URL.java:383)(1) where ...

Downcasting using information gained from getClass()

558 byte By BarryMcHoulla at 2007-11-27 5:53:46
Hi guys, i'm trying to downcast an Object type back to its original type but i cant seem to get it to work. I am accepting an undefined number of variables as a method parameter. I am receiving it as an Object array(using the basic method(Object args[]) method descriptor). When i come to use ...

Sorting

196 byte By msnma at 2007-11-27 5:53:47
There are 100000 records in a table and i need to sort them.But retrieving of this data is happening in batch mode say 10 .so how to sort 100000 records.please suggest.

RMI and Threads: Calling wait() on a remote object

12417 byte By Fokko_Stalmana at 2007-11-27 5:54:10
I created a counter as a remote object.Multiple clients are displaying the counter value.If one of the clients increments the counter, I want the displayed counter value on every client to be updated to the new value (of the counter on the server).Therefore every client starts a new thread to ...

Have I missed something with <? super T>

1004 byte By Phuckstera at 2007-11-27 5:55:11
Hiya, I tried searching for this, but it's so difficult to figure what the subject is. Anyway the following fails to compile on 1.6 U1 and I can't figure out why?interface Foo<T> {}interface FooListener<T> {void fooArrived(Foo<T> theFoo);}class ...

NIO and CORBA

707 byte By wigoea at 2007-11-27 5:55:20
I recently update a large multi client COBRA application from Visibroker to Sun COBRA Object Broker.As you know Sun's ORB uses NIO for its communication from client to server. A problem arises if one client should drop communication and the NIO Selector routinelocks up all the other clients. ...

Need Help in Threading Design

1544 byte By dawuada at 2007-11-27 5:56:21
We need to create a web application that needs to work with various companies. We would like to work with these companies simultaneously so that we can reduce the time taken. The situation would be the following: A client requests something then we would go to the various companies and make the ...

Day Light Savings problem

831 byte By AravindUSAa at 2007-11-27 5:57:21
Hi All,How to retreive the time for the GMT-5 timezone with the DST applied. Below is the sample code to convert the date to a specific timezone. SimpleDateFormat sdf = null; Date date = null; sdf = new SimpleDateFormat("M/d/y h:m:s a"); date = sdf.parse("5/1/2007 10:30:00 AM"); ...

Implementing Comparable for multiple types

650 byte By shdwfeathera at 2007-11-27 5:57:24
I am currently refactoring some legacy code to make use of Java 5's generics, and I ran into a problem.Foo extends Parent and implements Comparable. Bar is a sibling of Foo and does not implement Comparable. Now, in the legacy code, Foo is Comparable to both Foo and Bar, and in order to use ...

How to make a jar file with a security.policy file?

516 byte By a-lazy-rabbita at 2007-11-27 5:59:06
My programme has 2 parts:Server and Client.In the Client,it contains a security.policy file,which is produced by the RMI plug-in.The Server is Ok,and when run the Client in the eclipse environment,it's OK too,but the problem is when compress the Client to a jar file,it doesn't work.I think it ...

set the default printer setting to landscape in Excel

393 byte By venkat418.mecha at 2007-11-27 5:59:26
Hi,Is it possible to set the default printer setting to "1 page wide" and "landscape" whenever the user clicks print in Excel? I am trying to create an Excel report using XML and XSL. Though the report is created, I am not sure if I can control the printer page setting for MS Excel. Kindly let ...

session sharing

728 byte By ravi_eze@yahoo.coma at 2007-11-27 6:00:07
Hi,We have a web application the applicaiton works fine in unit testing but in production it gives aproblem. One user data is being served to another user whole of the session seems to be replicating for another user.We have no staic variables defined anywhere in the application. so, i want ot ...

how to communicate numbers from Java to C++

412 byte By BrigitAnanyaa at 2007-11-27 6:00:29
I am calling a Java executable from a C++ program.I need to communicate some ints and doubles from Java to C++.I am trying to make a file of them and in C++ I wait until the file has been made.However if I convert them to strings and make a file of chars, the problem is that in Java chars are 2 ...

downloading images...

241 byte By Vive_JavaNETa at 2007-11-27 6:00:40
hi, i am new to java networking. Can anyone tell me, whether I can download the images those are visible in a web page and save them in a desired location, on my system? If we can do this, how can this be done? plz help me out!

Port questions with RMI

2199 byte By garytse_hka at 2007-11-27 6:00:51
I'm getting confused about the RMI registry and the ports...Here's the scenario:I have a machine running a firewall. It blocks every ports by default unless I explicitly open them. I start rmiregistry using "rmiregistry 1099", just to be sure it is running on port 1099, so far so good.I ...

invoked method break

546 byte By myururdurmaza at 2007-11-27 6:01:16
hihow to break this invoked method's action from other threads ?Method met = servlet.getClass().getMethod(mname,new Class[] { this.getClass() });met.invoke(servlet, new Object[] { this });Like Other thread's content:met.break();Notes:i cant change invoked method's source ...

Warning eith deprecated api

343 byte By pandev84a at 2007-11-27 6:01:47
Hi frnds,i have compile my application with j2sdk1.4.0_01.when i compile with jdk1.5.0_01 i got following warning[unchecked] unchecked call to addElement(E) as a member of the raw type java.util.vectorso please any one help me,why this warning came and what is solution for that.thanks ...

problems when using getRuntime().exec()

1496 byte By Sorin_Ciolofana at 2007-11-27 6:01:51
Hello!I'd like to start a process which will run a C executable.The C executable named dbc is placed in the folder /home/swkm/services/rul_hyb/rul-1.0/bin and accepts as an argument the name of a database, for example, myDB I tried the following code: File f = new File(filePath);Process ...

Java primitive type casts problem

301 byte By lalbabua at 2007-11-27 6:01:56
What do you expect the output of the following Java statement?System.out.println(((double) ((long) (Double.parseDouble("4.56") * 100)))/100);Ans: 4.56, right? But it is not like that. Can anyone give a valid reason why JRE returns 4.55 for ...

LDAP error on win 2003 machine

441 byte By helloamitka at 2007-11-27 6:02:09
hi....i get a connection refused error in my java program.... this program is being run from the command prompt on a win 2003 machine.... the same program works perfectly fine when run on a win 2000 machine.... i try to connect onto the same ldap server, which is on port 3268, in both ...

Basic Extending Generic Classes Question

6827 byte By DartmanXa at 2007-11-27 6:03:48
I'm only just getting started on converting my code to use Generics, and have some questions. Although this is Spring/Hibernate code, the problem just seems to be in extending the classes.First, here is the GenericDao interface:public interface GenericDao <T, ID extends ...

Networking in Java pls HELP

682 byte By manishmulani@nitka at 2007-11-27 6:04:54
hello friends,i'm trying group chat kinda thing in Java.. i think i can do it using UDP sockets etc.. which has MultiCastSocket class...but as UDP is not that reliable, i'm trying to do it using TCP .. but i'm not able to find such analogous classes.in TCP, i've a Server class which will ...

JNDI Tutorial > LDAP Setup > Providing Directory Content

412 byte By jeff_seattlea at 2007-11-27 6:05:36
Ref: http://java.sun.com/docs/books/tutorial/jndi/software/content.htmlI am having problems using ldapmodify when loading the configuration file "tutorial.ldif".$ ldapmodify -a -c -v -h backbone.seamonkey.bigfish.lan -p 389 -D "cn=admin, dc=seamonkey, dc=bigfish, dc=lan" -w xxxxx -f ...

Problems creating a root context using DirContext::createSubcontext

2238 byte By jeff_seattlea at 2007-11-27 6:05:40
I am new to both JNDI and LDAP, and I am having a problem with the following basic JNDI code sample. When trying to create a rootContext with ctx.createSubcontext, an exception is thrown stating:javax.naming.OperationNotSupportedException: [LDAP: error code 53 - no global superior knowledge]; ...

how does isReachable work

142 byte By leon_wa at 2007-11-27 6:05:52
i am quit confused about the implementation in jdk, does it try to establisha TCP connection on port 7 (Echo). thanks in advance

JNDI: DirContext::list throws on exception when existing context is in LDAP

1652 byte By jeff_seattlea at 2007-11-27 6:05:55
I was able to import tutorial.ldif using LDAP Browser/Editor without incident: http://www-unix.mcs.anl.gov/~gawor/ldap/ My LDAP now has the following tree:o=JNDITutorial ou=Groups5 cn entries ou=People10+ cn entriesHowever, when calling DirContext::list("ou=People"), it throws the following ...

Gridbaglayout

228 byte By haiprathi@gmail.coma at 2007-11-27 6:06:51
i have 10 components in a panel but when i tried to align using gridbaglayout its not getting positioned in specified instruction when i apply north for 2nd component its applied to all components ..can anyone pls help me

Sun JAR file format

765 byte By JonBa at 2007-11-27 6:07:15
Is the JAR file format based on the ZIP64 file format or original ZIP file format?I'm creating large JAR files, greater than 4GB and some around 25GB. I've been able to create them OK and extract them OK through my code but almost everything I read (forums & bugs) says the JAR file format ...

Generics bounds behaviour

1948 byte By ibanna at 2007-11-27 6:07:34
Hi, I encountered a problem while using generics.Here is the code that dont compile using javac (but does using eclipse compiler).public interface MyThing {}public interface MyObject<S extends MyThing>{public S getMyThing();}public class MyObjectHandler{private MyObject<?> c;public ...

Help needed in NIO client and server....

712 byte By JDvlpra at 2007-11-27 6:07:37
Hi,I am developing client and server using NIO...My client will send a file to the server... but the server doesn't know the size of the file it has to receive... So i could not allocate size to the ByteBuffer directly...So i m sending another bytebuffer from client, which has the size of the ...

Serializable & Cloneable

417 byte By Palani@javaa at 2007-11-27 6:08:05
Hi all,I am new to java. When I looked into the API, I found that both Serializable and Cloneable interfaces don't have any methods. My question is: Shouldn't both of them be a keyword(just like abstract, final, synchronized, etc.) instead of a dummy interface? What is the need for going for ...

List<List><String>> is not a List<List><?>> ?

1306 byte By hemalpandyaa at 2007-11-27 6:08:18
Just when I thought I was beginning to get a handle on the wildcards...List<?> is a List of objects of "some unknown type" List<List><?>> is a List of (child) Lists of objects of some unknown type, each child list being a list of the same type.List<String> can be ...

how to remove range from vector...

428 byte By pandev84a at 2007-11-27 6:08:43
hi frnds,i have to delete bunch of record from vector for a specific range.i use removeRange() from java.util.vector but it give following compile time errorremoveRange() has protected access in java.utl.Vector and void type not allowedso please anyone one tell me,how i can solve my problem and ...

How to uplaod a file to FTP that contains a Key

631 byte By nikku3881a at 2007-11-27 6:08:44
Hi all,Ive got this problem which is killing me.I generated a file public.dat and put a key in it...The code is as[ObjectOutputStream f = new ObjectOutputStream(new FileOutputStream("public.dat"));System.out.println("\nStart generating RSA key");KeyPairGenerator keyGen = ...