In running the Java code below on a Solaris 10 based V890 I see the CPU the process gets ramp up very slowly so the process takes a long time to complete. We are working on moving our Siebel environment from windoze to Solaris and this apparent "slowness" is becoming problematic to Siebel 8. Has ...
I'm writing a web application using a proprietary Java 1.4 based content management API. When I'm working with Collections, Lists, etc. I get unchecked warnings. Here's an example:/* * References to generic type List<E> should be parameterized. */List searchResults = ...
Hi, I was wondering if it is save to surpress the unchecked warning in this code:public static <U extends Enum><U>> Class<U> classOf(U val) {return (Class<U>) val.getClass();}My reasoning is that since enums cannot be subclassed, val.getClass() will always be of type Class<U>. If ...
6415 byte By
4tha at 2007-11-27 11:13:23
Hello,1 week all was fine now its a mess again and i dont know...scroll down pls to the last try/catch block. The code within i commented with /* code */ only the:DirContext ctx = new InitialDirContext(propsPassword); String neuesKennwortAD = "\"" + neuesKennwortTemp + "\""; byte[] newpassword = ...
Hi, I have one application, where 3 devices work together. I have a Heart-beat in one of them(*) to know when someone has stopped to work.I have the problem here. I have done the Heart beat with connections UDP. I'm all the time sending messages UDP to *, and * receiving, but then , when someone ...
3556 byte By
ntalamaia at 2007-11-27 11:14:55
Hello all, I justify the "paradox" in the title later on. I have a class, let FileHandlerCU that has a method with the following signature:public boolean computationUnits.FileHandlerCU.WriteLineAtEnd(java.lang.String)Please consider the following code fragment://inside mainClass aClass = ...
181 byte By
cratnama at 2007-11-27 11:14:58
<p>Hi ...</p><p>My application takes input from a file. </p><p>Now, I want to change it so that it takes input from a local port ..</p><p>How can I do it?</p><p>Thanks,</p><p>RC</p>
Hi,I am trying to write a test case for a class that has a private instance member which happens to have a type that is defined as a static inner class of the enclosing class, i.e.:class A { private B b; public A(char c) {b = new B(c); } private static class B { private char c;public B(c) {this.c = ...
<p>Can we read and write contents on cvs fomat file using java.</p><p>If yes, then where i can find details for cvs format file and how to use it in java.</p>
Hi,I have a problem with DatagramSocket. Though I close() it and disconnect(), I cannot reuse the port allocated by previous socket in another socket:Caused by: java.net.BindException: Address already in useat java.net.PlainDatagramSocketImpl.bind0(Native Method)at ...
<p>Hello Friends,</p><p>I want to develop a simple JNDI application in which i do not want to use any external tools other than JDK. Can any one suggests me how i can fulfill my requirements. And if possible can you please suggest me any good tutorial sites...</p><p>thanks in advance.</p>
It has been given in Java Complete Reference update1.5 following lines in respect to Bounded Wildcards in chapter of Generics:-You can also specify a lower bound for a wildcard by adding a super clause to a wildcard declaration.Here is its general form:<? super subclass>In this case,only classes ...
Hi,I have a LinkedHashMap that needs to be updated on a regular basis. I can update the values and put them back into the LHM without any problems, but can't remove any entries without causing a concurrent modification exception.I want to remove key-value pairs when the value falls below 0. How ...
Hello, I posted I am trying to test RMI for further use in another project of mine but i am having trouble with the connection and security issues.Firstly my Client-Server test worked perfectly when they shared a package. Now ,however, i have moved them both into separate "project" files in eclipse ...
<p>Hi, I get with stream a sound file and I have to play it using an external program like VLC, reading the file continuously of a buffer. How can I do it? Would I have to controll VLC commands? I have been reading about it, but I have no idea how to do it.</p><p> Thanks.</p>
<p>Hi guys</p><p>im trying to figure out a basic how to type input to the screen and it be written to a file. The only problem is that my book is overcomplicating the matter and i cannot work out just the basic method- to expand upon later</p><p>can anyone help?</p>
<p>Hi,</p><p> I have an application (Applet) running on a OC4J instance. And also I have an application (Servlet, JSP) running another OC4J instance. These applications running on different browsers. I need communicate them. </p><p>Which method may I use? may be socket or something else?</p>
Ok i have a multicasting client that sends a request to a multicast address 224.0.1.1. Can anyone please tell me why whenever i run this, either no connection at all happens, or the packet sent back to the client is just a copy of the request message the client sends:import ...
818 byte By
oli_004a at 2007-11-27 11:18:40
HiI'm writing a small application that scansdirectories on a ftp server.However after 25 changeWorkingDirectory(directory)or listFiles(directory) the scanning thread just freezes.If I do aconnecting -> login -> changeDirectory -> listFiles() ->disconnectreconnecting -> login -> changeDirectory -> ...
Hi,After spending the last 8 hours trying to implement the "remove" method for Ternary Search Tree, I came to the sad realization that the algorithm is just way too complicated to implement (not the insertion or search methods though) -- there are just way too many scenarios to consider. Before I ...
Hi,I'd like to temporarily redirect IO fron within java code. The redirecting part is easy enough using System.setOut(printStream) but the lack of a corresponding System.getOut( ) is keeping me from restoring the old value. In other words, I want to do this:PrintStream newOut = ...PrintStream ...
<p>Hi all,</p><p>I urgently need a working code sample of a <b>client</b> which sends requests to a server that redirects the request to an RMI server via RMI servlet.</p><p>Does any of you familiar of such a code sample?</p><p>Thanks</p>
Hi all,I have been looking for a solution to this problem, and possibly a little guidance forabout a week now in regards to using an applet to communicate with a server using RMI through SSL.I am down to what (touch wood) is my last error before my test program works.This error doesn't occur when ...
I am using Java 1.6.0. When running the following code:import java.lang.reflect.Method;import java.nio.ByteBuffer;public class test{public static void main (String[] args){for (Method method : ByteBuffer.class.getMethods()) {System.out.println(method);}}}I get, amongst the output, two "array" ...
import java.util.EventObject;public class DataEvent extends EventObject {public DataEvent(){}}when i compile, it gives error like the following:Eventobject(java.lang.object) in java.util.Eventobject can not be applied to ()could anybody help me ...
3733 byte By
JTTa at 2007-11-27 11:23:29
I use OSGi and I create bundle called Server, which contains three classes and one of them is the bundle activator. I will publich the code of the three classes and then will write my problem. So the first class is calles "ServerThread" :public class ServerThread extends Thread implements Constants ...
898 byte By
Flossya at 2007-11-27 11:24:24
Hello, I am trying to parse a XML file and want to store the byte positions of start and closing tags so I can later use RandomAccessFile to get a particular xml element. But I am having some trouble with it...I haven't found any Xml parser api that would allow me to do this, so I tried to parse ...
<p>Hi</p><p>I want to create instant messanger using JAbber.But i want protocals and sourec code for JAbber.I search in JAbber site. But they give only applications source code.So where i get the source code for JABBER ? Pls Help ME</p><p>Thanks To All</p>
How to iterate over a collection of a MapI get a ClassCastException when doing the following pls help:ollection all=CDA.getC(VO);//some method returnign a collection for (Iterator it=all.iterator(); it.hasNext(); ) {HashMap element =(HashMap) it.next(); for(Iterator j=element.entrySet().iterator(); ...
I have a query which returns a collection through ORM.Now I parse that collection and do so processign based upon a particular value of key null and not nulland I have to create two separate collections out of this main collection.How do I do that?Collection will contain Maps.Collection c1=new ...
I was previously using Jdeveloper, and decided to migrate some code to Eclipse. The code below worked fine in my Jdeveloper(1.5.0_05) project, but upon migrating is an error that states. Cannot create a generic array of LinkedList<PlayerAction>. private LinkedList<PlayerAction>[] ...
317 byte By
BB81a at 2007-11-27 11:28:43
I do not understand much how to create a simple custom class loader. I found many explaination about it. I don't really get what it means.Can anyone explain to me in simple code? My custom classloader doesn't work at all. I want to load a class in another package. How can I do ...
Hello All:When I used the following codes in Applet. String urlstr = "https://www22.abc.com/csm/cgi/getdata.cgi?username=scott&function=cnet" url = new URL(urlstr); URLConnection con = url.openConnection(); con.setUseCaches(false); return con.getInputStream();// Line 257 I got this exception ...
1394 byte By
mjkhan21a at 2007-11-27 11:29:40
Hello.I'm trying to write a generic class that looks like the following pseudo-code.public interface Interface {public Interface getSibling(...);}public class Klass {...}public class MyKlass<T extends Klass, T2 extends Interface>extends T implements T2 {public T2 getSibling(...) {return ...
<p>Can anybody please clarify what does it exactly mean by fail-fast iterator. I had even gone through the entire API which says about this . but coudn't make it out</p>
614 byte By
yael800a at 2007-11-27 11:30:37
HI,I'm new in server side.I'll start a new job in these topic (I will learn @ job), but I want to start to learn myselp.Al I know is it will be with J2EE & serverside.I have programed in the client side with swing 7 months.I don't used J2EE so from wher should I need to ...
1567 byte By
T01deva at 2007-11-27 11:31:01
Hi,Ok, so multi-tjreading is the word. I implement the following:public void inits(){try {initAll(); // GUI initsdtartThreads(); // threads that need to run }}When I run this JAppjet ... nothing. Far be it from breaking down open doors (and answering my own questions) but am I right in assuming the ...
451 byte By
cheetaha at 2007-11-27 11:31:03
Hi all,I am writing an API to be thread safe. As I know if a share object is enclosed by a sychronized block, any attempt to lock the object that is already locked will be blocked. My questions are i.) is it using thread.wait() to cause those threads giving up the CPU resource? ii.) If using ...
Hi,I have a method a() in class A. I want to get the name of method and class which called method a. Is there any way of doing it ?I tried using StackIntrospector from org.apache.log.util package, and it solves my purpose. Is the same thing possible using standard java API's without using any ...
import java.util.*;import java.util.concurrent.*;public class NavigableSetExample{public static void main(String[] args) {System.out.println("Navigable set Example!\n");NavigableSet <Integer>nSet = new ...
i am really appreciate any help from you guys..I am blind in Collections .... I would like to use collections in my project ?Initially registration form ...I get value from registration form. and form values will be stored in database ..here can i use Collections ? which one i will use ...
1117 byte By
JayRoya at 2007-11-27 11:32:56
Hi all,I am investigating a problem and have narrowed down to a section of code where the Vector.get() method returns an empty string instead of null when the key queried doesnt exist. I know I can alter the code to check for null or empty string but I wanted to find out why?I am not sure if ...
Hi, We have a design where in a module can be executed remotely as well as locally. The remote implementation of the module uses RMI.The Issue that we are facing is as follows. We want the client code to remain unchanged even if the implementation is switched. Hence, the base interface which ...
hi iam trying to do read textfile information sending by client and reading from server.in the server side after completeing eof it wont terminate.before sending file client copy the text file data and overidethe text file with same data and then send.i need solution for this one any one help ...
2906 byte By
gconfa at 2007-11-27 11:35:43
I am using a ScheduledExecutorService to run a handful of scheduled tasks in a j2ee app and so far the experience hasn't been pleasant. One of the problems I am currently seeing is that the scheduler seems to randomly time drift for no expected reason and start running my tasks at a different ...
I have a class which extends java.util.Hashtable. The Key is String and value is a HttpClient object, but in future I can have Values as objects other than HttpClient. I was thinking to use a wildcard for storing the value, but the syntax isn't right. What is the right way to do it? Thanks.public ...
<p>I use a boolean flag that say modify allowed or not for a particular variable. I have a feeling that there is a more efficiant way to do it. My goal is that in-between submit->confirm->submit, no one would modify this variable</p>
Hi there,I am new to these forums and I am having an error with compiling my code.This is the code:Map words = new HashMap();String word;words.put(word, new Count(word, 1)); // this is the line that is not compilingIf anyone can offer me any help, that would be ...
Hi all, I need a help. I am using URL class to connect Google try{ URL url = new URL(" http://www.google.com"); URLConnection myConn = (HttpURLConnection)url.openConnection(); myConn.setRequestProperty("User-agent",""); buffer = new BufferedReader(new InputStreamReader(myConn.getInputStream())); ...
Hi,This is not what you may think -- it is not about getter and setters, allow me to elaborate. I have a data structure that requires a few modifications to the underlying data and many accesses (M threads add/remove, N threads access).To achieve concurrency, I am adding two minimalistic locks to ...