Recent update: 2008-5-9

Cannot Retrieve from Hashtable to Create a List

4540 byte By jiapei_jena at 2007-11-15
I receive a Hashtable from people working on the back end of the application. I am trying to convert the Hashtable with key/value pairs into an ArrayList, which is an array of a bean class with two properties: country code and country name.I do not have compilation error nor runtime error. But, ...

Syndication with RMI?

1329 byte By Fascisticidea at 2007-11-15
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 ...

how can I read generic-type object with object stream?

1504 byte By enoaa at 2007-11-15
I declared a class like thisclass Storage<K extedns Key, D extends Data> implements Serializable {}class Key implements Serializable {}interface Data extends Serializable {}and I used ObjectOutputStream to save.Storage<MyKey, MyData> storage = new Storage<MyKey, ...

How to print values in a HashMap

1132 byte By Tammareddya at 2007-11-14
HiI am new to JavaI am using a HashMap where key is a String and the Value is again a HashMap..Firstly can I use it this way ...If not could you please suggest an alternative...If I can use it ...I am unable to print the values in the HashMap..Here "map" is a HasMap I am using..and I used ...

Is sockets and input/output-streams thread-safe?

679 byte By invictus2a at 2007-11-14
HiWhen creating a simple socket client application I would usually use BufferedReader on the inputstream, PrintWriter on the outputstream and a regular socket as the foundation running within its own thread and responding to events from the Swing UI. Now the question is:Is for instance the ...

updating already flushed data

687 byte By Joja at 2007-11-14
Using OutputWriter, is there anyway to update already flushed data ?Suppose i have run a java program from command prompt . Depending upon the notification from another program, this program has to write "current status=1" to the command line.Now , when the next notification from the other ...

get Roles realm/active directory

435 byte By hyrogen32a at 2007-9-25
Hi There,I've been making some progress recently with this, and Im just at the last hurdle. Im basically wanting cycle through the roles that a user belongs to, I've used request.isUserInRole(role) to check a user belongs to a given role. But, we have alot of roles and I just want to list ...

Finished Task

20 byte By martin_ms1985a at 2007-9-25
Finished Task

Network file access

924 byte By pramodnaira at 2007-9-25
I have to read a file in the network from a web application running under TOMCAT. How do I supply the credentials like username password. I am using FileInputStream to read the file. The default TOMCAT Local System account doesn't have privilages to access this file in network. I am getting an ...

rmi security error plz check..........

948 byte By snagendra_prasada at 2007-9-25
i jst removed GNU java and compiled the myRMIImpl prog it got comipled but i am geting errorwhen start server.............. this the error i am getting can u jst help me out............Exception occurred: java.security.AccessControlException: access denied (java.net.SocketPermission ...

generic array creation error - ArrayList

1018 byte By mScreenNamea at 2007-9-25
HiI have a problem with "generic array creation"1) If having an array ofArrayList<String>ArrayList<String>[]anArray=new ArrayList<String> [ 5 ];When compiling : ERROR as belowC:\Temp>javactest.javatest.java:8: generic array creation ArrayList<String>[]anArray = new ...

Socket connections if working under proxy server

2695 byte By a.riyaza at 2007-9-25
hi all,Here is my problem, i've one with static ip with no proxy, and other in a netwok connected to the internet thro a Http proxy, i opened a port in proxy server to connect,I wanna my pc in network to create a socket connection to static ip pc thro proxy server.For this i tried two way to ...

How to get LDAP Attribute type?

526 byte By Paivia at 2007-9-24
I would like to know the type (Integer, Boolean, IA5String.... etc) of an attribute, but I have not found a method for that. I have investigated Java SDK 1.5 and also Sun LDAP JDK. Using Sun LDAP JSK if I print.out attribute "abc" (using netscape.ldap.LDAPAttributeScema.toString() I get the ...

1 key and many values ......................?

227 byte By help_eachothera at 2007-9-24
Hii JavaitesI want to associate two distinct values to an key.How can it be done.right now i m able to associate 1 value to a key , using HashMap.Can anyone tell me how to do that.Thanx

Advanced for:loop 4 HashMap?

215 byte By TiGra at 2007-9-24
Hi guys, is there a way to iterate a HashMap using advanced for:loop schema, somth. likefor(MyKeyObject key: HashMap hm){System.out.println(hm.get(key)); }Thanks in advance!

Obtaining generic return type of method in super class

1870 byte By deissenba at 2007-9-24
Hi,I already posted this the reflection forum and was recommended to repost it here:I'm fighting with the generic reflection API of Java 1.5 to determine the (generic) return type of method 'process' in class Example2:public class Example1<E extends Collection> { public E ...

HashMap

1499 byte By mary_the_codera at 2007-9-24
Hello, I'm experiencing something strange with HashMaps.I have a HashMap<Territory, Player>. Every Territory key is unique, but there are only three different kinds of Players. Everytime I do a put(territory, player) into the HashMap, it'll update that pairing in the HashMap, but it ...

Finding Power of negative exponents by recursions

916 byte By JollyJoea at 2007-9-24
I want to create a method which finds the power of two integers (base, exponent) recursively.Thats sounds easy, but how will i find it, if the exponent is negativeexample : 2^ -9 = 1 / 2^9 Here is what i have, but this only works if the exponent is positive.public static double recursivePow(int ...

shuttin' down remote computer from a server runnin' java application

305 byte By jaypangmia at 2007-9-24
I'm familier with shuttin' down / Rebootin' ...... local computer from Java Application using Runtime.exec(). But wat I opt for now is to shutdown/reboot remote computer. And I wonder if RMI can be used to solve it and if it can then how? Plz help me through ...

Enum and EnumMap

1127 byte By haison3000a at 2007-9-24
Hi all,I have a question regarding EnumMap. I don't understand why there is a constructor EnumMap(Class<K> keyType) . Why this constructor needs to have a class Keytype. Isn't the key type of the map whould be K which is already in the template of EnumMap.Looking at some sample ...

help with FTP! Thanks

332 byte By darngara at 2007-9-23
HiI need to implement a transfer file component, I have been working with a simple ftp server and ftp client, all work fine, but in Internet packets are lost so the ftp client and server are not synchronized.Anyone knows about an open source code where I could seek information to solve my ...

Bug: Missing compile-time error in array with type variable ?

1937 byte By manuel_trumma at 2007-9-23
Following code snippet compiles without error or warning, but fails to run.IMHO, this contradicts the design principle of generics that guarantees that if the entire application has been compiled without unchecked warnings, it is type safe.static <T> void betweenArrayAndCollection(T[] a, ...

Is this a bug or limitation?

1103 byte By kobevalianta at 2007-9-23
public class Test { public static void main(String[] args) {ArrayList<String> list = new ArrayList<String>();list.add("string");//*new stylefor(String s:list) {list.remove(s);}//*//*old stylefor(int i=0; i<list.size(); i++) {list.remove(list.get(i));}//*/ }}It took me one hour to ...

LDAPS getting MalformedURL Exception

4157 byte By dwyutzy at 2007-9-22
I have SSL working locally under Tomcat and SunONE AS v7, but when I deploy to our Solaris box, I get the following exception. What the heck is going on? I have the SLL cert properly installed on Solaris so I'm sure that it's not that...[30/Sep/2004:15:41:57] WARNING (27676): CORE3283: ...

Backwards compatibility question

1569 byte By RGibson at 2007-9-22
The following code - legal under 1.4 (and beta 1 I think) - no longer compiles under 1.5-beta2.import java.util.Date; public class ReverseDate extends Date { public ReverseDate (Date date) {super (date.getTime ());} public int compareTo (Object o) {return -super.compareTo (o);}}I get the ...

Playing mp3's with javax.sound

343 byte By Aemota at 2007-9-21
I am trying to play mp3's with Java. I know how to find out what it supports and play the supported types but I was wondering how I would go about playing mp3 data through my SB mixer?How would I be able to get the mp3's format, frame rate, etc. so I can specify it as a format without ...

Forbid loading of GUI classes

1088 byte By frans_lundberga at 2007-9-21
I am creating a piece of software that runs computation tasks in a secure Java sandbox. These task are not allowed to access the file system etc. However, I also want to forbid the tasks to display anything on the computer screen.Since there is no java.security.Permission that needs to be ...

Exceptions arsing while accessing DataSourcefrom a stand alone java clie

1974 byte By goldappserver1a at 2007-9-20
Dear all responders,can any one help in resolving my problem?the problem description is as follows:i am using sun one application server 7.0 to deploy a J2EE Apllicationso i have created a data source using the admin page with the name"nodbsession".now i want to access this datasource using a ...

Printing from within an applet

4525 byte By MNU2JAVAa at 2007-9-20
I am attempting to print the contents of a JEditorPane which is included within an applet...i've attempted to follow Printing In Java docs but need help.Here is the code:public class MyApplet extends JApplet implements Printable{ //Construct the applet //code here public MyApplet() { } ...

Scope of try/catch/finally

950 byte By wholdera at 2007-9-20
I suppose this is just idle speculation, but I've often wondered why the Java language was notdefined to place variables declared within the scope of the try block be valid inside the matchingcatch and/or finally blocks. Almost every type of open/close I/O operation, such as file access orJDBS ...

files

106 byte By Mhmh at 2007-9-19
hi all...is there any way to clear the contents of the DataInputStream ?thanks

Can I use the Mozilla HTML component in Java using JNI?

224 byte By BC2a at 2007-9-19
I've never used JNI before, but i read that I can use libraries of other languages like C++ in Java.If that's true, I think it must work, to use the Mozilla HTML component in a Java application.Florian

how to Write a file from hex format to another format

764 byte By privieta at 2007-9-19
hi I am trying to create a file (IBM AFP-printer format) from the hex file which i have created after reading that IBM afp file. Now i have to do some changes in that hex file data and store it back to the same format.I have tryed storing it using:Writer out = new ...

converting Java to Win32

222 byte By a13519a at 2007-9-19
Is there any tools or IDE can convert Java execution context to a .exe file, Including the JVM and class files? So we will not worry about decompling of our product code.Any advice?Thanks,a13519

javax.naming.CommunicationException

1099 byte By sguddimathGa at 2007-9-19
Hi, I am using Visual age 3.5.3 and websphere 3.5.5 I am trying to run my application on my localhost using "iiop://localhost:900"Bootstrapport = 900 it gives me exception javax.naming.CommunicationException: Caught CORBA.COMM_FAILURE when resolving initial reference=NameService. Root exception ...

Problems moving from 1.3.1 to 1.4 (StreamCorruptedException)

5414 byte By discgolfer at 2007-9-19
Hi all,I'm having a terrible time moving my existing project from 1.3 to 1.4. The GUI (running on W2k) works fine, but the server side of the app (running on Solaris 2.6 w/ current patches & Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)) is giving me fits in a couple ...

how to stop a waiting thread ?

726 byte By dimitrovnikolay at 2007-9-19
Hello all, I've written a simple network application, but I've got problems stoping it. A thread (called runningThread in the app) is waiting for clients :public void run(){while(isRunning){XXX) Socket client = serverSocket.accept();...........}} My question is how to stop it from another ...

SAXException

538 byte By mausamgautam at 2007-9-18
Hi FriendsI am using jaxp.jar Package To Parse the XML file.I attached Attribute to Element Now the Problem is When Any Attribute contains "&" opeatator like C&F then during parsing It gives me SAXException.I try to avoid this problem by using "C&F" It works fine ButI dont know how ...

(RMI) Downloaded ed remote object doesn't "work".

1621 byte By ghido10 at 2007-9-18
Hi, I implement an application service that as its field has a Display object which extends the JPanel class.public class Display extends JPanel{....} The service has a method that allows the client to obtain a copy of that object,....private Display display = new Diaplay(); // service ...

TimeZone ID's and their definitions

175 byte By robdey at 2007-9-18
Hi,I am trying to find out how the Java supplied Timezones are defined and what their relevant Daylight Saving Start/End dates/times are. Can anyone help.

JNDI lookup from Tomcat to EJB Container

549 byte By wfrank at 2007-9-18
Hello!i am currently trying to use a combination of Catalina and an external EJB Server (running on another machine).i am really struggeling with doing the jndi lookup. i have no idea where and how to set the properties in the web server and do the mapping from the ejb-refs to the jndi name? ...

Unsatisfied link error in javax.comm

665 byte By avepraveen at 2007-9-18
#ACL (4872882).. Returning...C:\WINDOWS\AveCache\storage\1native\win32com.dlljava.lang.UnsatisfiedLinkError: nSetOwnerat javax.comm.CommPortIdentifier.nSetOwner(Native Method)at javax.comm.CommPortIdentifier.<init>(CommPortIdentifier.java:506)at ...

URLConnection

729 byte By xeneve at 2007-9-18
I posted a similar question in the programming forum without any response. Hope some guru will help me.Why when reading content from 10 differents urls (using URL.openConnection().getInputStream() in a thread for each) is 4-5 times SLOWER than reading from these same 10 urls in a for loop (one ...

How to connect to the net through proxy

140 byte By janu1 at 2007-9-18
Can anyone give me a sample code for connectingthe net through proxy in a simple java program?Thanks in advance.

Fast Data Transfer over the Internet

434 byte By arunje at 2007-9-18
Hello friends:i need your help to transfer Data.i have few servers and some of them are really stuffed with huge amount of data on them.i want to move my data to other servers.i dont have a telnet access and more ever i dont want to remain connnected till the time the task is over.can you ...

create a zip file

95 byte By roomari at 2007-9-18
i need to add some files to a zip file, using a java program. can someone help me

returning data from Threads that dies...what to do?

1520 byte By MmarcoM at 2007-9-18
hi all,i have to implement a timeout inside a class that executes some operations, such asclass Connection {public HashMap execute(String code, HashMap inData) {HashMap retParams = new HashMap();TimerThread timer= new TimerThread();timer.setData(code, inData);timer.start();.....the timer does ...

JAVA ENCODING PROBLM

2024 byte By kapil_ji at 2007-9-18
Hi I have a problem in detecting the encoding of content of any file at runtime.to genrate the problem please follow the steps:1. create a text file with wordpad(Windows) with just 1 or 2 line for example: JAVA PROBLEM2. save this file with name test1.txt by selecting save type as Text ...

Extracting text from .doc,.ppt,.pdf files

163 byte By Rama71 at 2007-9-18
How can i extract ascii text from the file types like .doc , .ppt , .pdf ,. xls ..etc. Any tips/hints would be helpfulThanksRama

JNDI Event Notifications .. ?

500 byte By 3lok at 2007-9-18
Hi,My application is One server and sevelar clients.when Client came up it will one register Object(java or non java) with few parametrs , then Server need to get Notification abt that object. How can i do all this tuff... what i need .. whats software i need. i need any LDAP or jndi is ...