Java-index »» Core »

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

How detect method calls that are not already in 1.4

842 byte By christoa at 2007-11-27 5:53:03
My program is compiled with JDK 1.5 or 1.6 and retroweaved to 1.4.If I do not take care I may typeint i=65;Character.isDigit(i); instead of Character.isDigit(char)i);Without casting to char it uses a method that exists only since 1.5 but notyet in 1.4.There are a few other methods that had been ...

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

About JProfiler Anybody pls help me

328 byte By doubtinswinga at 2007-11-27 6:01:05
Hi all,I am using JProfiler for our application. If i take a heap snapshot, the recorded objects are not at all displaying in the heap walker tab. and in the memory view nothing is displaying in "All Objects" tab. And in the backend, it's throwing "error iterating over heap".Any help would be ...

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

Controlling the case of an attribute name

1682 byte By aakturea at 2007-11-27 6:05:19
Is it possible in a standard mbean to control the case of the attribute name? For example, I have a simple MBean:public interface EJBMBean { public Stats getstats(); public void setstats(Stats stats);}public class EJB implements EJBMBean { public Stats stats; public EJB(Stats stats) {this.stats ...

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

creating custom protocol handler

378 byte By satoto01a at 2007-11-27 6:09:33
Hi all java's guru I hope that you guys can help me. I,ve been trying to develop custom protocol handler that handles this kind of url:jdbc://driver_type/database_url/statementI have override the URLConnection class but i get confused where to set the input stream and output stream.Your guys ...

synchronizedList vs. synchronize(myList)

1599 byte By bensteina at 2007-11-27 6:09:55
The API states that when a list is created using: List<String> sList = Collections.synchronizedList(new ArrayList<String>());that iterations over the list must be synchronized as well by usingsynchronized(sList) { Iterator<String> i = sList.iterator(); while (i.hasNext()) ...

-XX:+HeapDumpOnCtrlBreak

140 byte By samueltoa at 2007-11-27 6:10:31
Is -XX:+HeapDumpOnCtrlBreak available on JDK 1.5? It works on jdk1.4.2_13 but it is not recognized in jdk1.5.0_12. I tested on Linux.

hashtable problem

378 byte By jamesgoslina at 2007-11-27 6:11:10
hi all ,i am using a program in which i m getting live data from e-signal account i m retrieving data from server usiing socket then parsing and storing it into hashtable now my problem is that each moment the data is changing how can i store the data in hashtable since for i have to generate ...

MulticastSocket problem!! pls help

217 byte By manishmulani@nitka at 2007-11-27 6:11:33
suppose a server listening to a port ( say 4444 ) wants to multicast a msg to a group of clients on internet.. then what should b d common group id( Class D ) and port number which all the clients have..

Weird Read timed out exception

2373 byte By swiergota at 2007-11-27 6:11:34
I'm writing a client/server for sending files. Both client and server classes have the following fields:BufferedInputStream isb;BufferedOutputStream osb;BufferedReader isc;BufferedWriter osc;And their constructors do:isb = new BufferedInputStream(socket.getInputStream());osb = new ...

client disconnecting in a client/server pair

1761 byte By Japhetha at 2007-11-27 6:11:42
I have a client and server that communicate using tcp and send strings to each other using printwriter and bufferedreader.the server has a loop for receiving messages that waits until bufferedreader.readLine() doesn't return null. On the server, calling bufferedreader.readLine() when there is ...

Please comment, vote on the idea and suggest on this sample code

4742 byte By Thomas.Mathewa at 2007-11-27 6:11:44
//@Compiled with javac -version 1.6.0_01-ea//@Executed with the details as below:/*java version "1.6.0_01-ea"Java(TM) SE Runtime Environment (build 1.6.0_01-ea-b01)Java HotSpot(TM) Client VM (build 1.6.0_01-ea-b01, mixed mode, sharing)on Microsoft Windows XP PC over Intel Celeron ...

convert

139 byte By somlia at 2007-11-27 6:12:25
I m trying out to convert dat file whose content is in binary form to text file.so that this dat can be inserted into the data base.

JDBC and locking - problem with insert

3885 byte By hOOkDKa at 2007-11-27 6:12:46
Hello you :)I've ran into a mind bugging problem - of which I thought was simple - it might still be - just I may be overseeing things..I want to do the following (of which the sql works fine - I've tested it outside java developer):Lock a table, select records (for investigation) - if ...

NoSuchMethodError

82 byte By helpme@fasta at 2007-11-27 6:13:04
i found NoSuchMethodErrorfor each classcan some body help me?