Recent update: 2008-5-9
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, ...
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 ...
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, ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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
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!
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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: ...
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 ...
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 ...
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 ...
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 ...
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() { } ...
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 ...
106 byte By
Mhmh at 2007-9-19
hi all...is there any way to clear the contents of the DataInputStream ?thanks
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
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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? ...
#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 ...
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 ...
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.
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 ...
i need to add some files to a zip file, using a java program. can someone help me
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 ...
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 ...
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
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 ...