335 byte By
R.P.Roya at 2007-11-27 5:20:50
Hi,I've recently started to explore annotations and wonder if something like @Resource injection could be accomplished with a custom define annotation. My intent here, is to inject some runnable source in the generating class file.I'd appreciate if somebody could illustrate this concept ...
i have designed an application and i would like to open photoshop from this application that i have designed....can som1 help me out...thnk u Eshwar
I'm working on a system to send data to bluetooth devices. Currently I have a dummy program that "finds" bluetooth devices by listening for input on System.in, and when one is found, the system sends some data to the device over bluetooth. Here is the code for listening for input on System.in ...
Hi Guys,We have a product that need to be integrated with another product written in C++.The thing is both are running on different machines. we are planning to use RMI or Socket programs to make remote calls....Can somebody suggest us some pros and cons on the security and performance issues ...
101 byte By
Zeuxa at 2007-11-27 5:22:58
Hi!Is it possible to force ServerSocket to bind only IPv4 address?Thanks!
Hi all, I want to write a regular expression pattern to find any html beginning tag inside an html page, my knowledge with regex is what I learned in my SCJP preparation, and I think it is not enough.Sure all of you know the generic syntax of html tags.Thanks for help.Ahmad ...
203 byte By
ashhuua at 2007-11-27 5:23:15
Hello,I am using JFluid profiler that is working fine with Java standalone application.But i want use it for Internet Explorer JVM when applet is get loaded in IE.plz help me.
I'm trying to compute webservices.Reading documentation I found that I have to use <apt> ant task to create artifacts and war.I currently use jdk1.5 with Jboss and jaxwx2.0 of glassfish.I got this error :An exception has occurred in apt (1.6.0).....java.lang.NoClassDefFoundError: ...
7584 byte By
oll3ia at 2007-11-27 5:24:22
How do i run this chat example on openjms?package com.ociweb.jms; import java.io.*; import javax.jms.*; import javax.naming.*; /*** Simple console-based JMS chat room client. */ public class ChatRoom implements MessageListener {private String name;private TopicConnection connection;private ...
Hi everybody,I m working in a project in which I have to develop a code in java that checks the number (we call a sponsor in this case), we that number has a sponsor then it will get added under that sponsor, and it the number doesmt have any sponser number then it has to stored at some other ...
consider this code:clientDatagramSocket dgs = new DatagramSocket(9999);byte[] data = new byte[1024];DatagramPacket dgp = new DatagramPacket(data, data.length);dgs.receive(dgp);Socket sok = new Socket(dgp.getAddress(), 8888);ObjectOutputStream oos = new ...
HI, I am trying to save Vector object to a file which contains an image as one element.But i am not able to do that can anybody tell how to write the program.i wrote the following program to do that task but it's not workingcan anybody tell what changes i have to make my program to work ...
HI, I am trying to save Vector object to a file which contains an image as one element.But i am not able to do that can anybody tell how to write the program.i wrote the following program to do that task. but it's not workingcan anybody tell what changes i have to make my program to work ...
983 byte By
suppona at 2007-11-27 5:27:40
(_) how can i maximize my threading without running out ofheap memory?push it to the limit, but throttle back before anjava.lang.OutOfMemoryError.(_) within 1 threaded class ThreadClass, i have two threaded inner classes. for each instance of ThreadClass i onlystart one instance of each inner ...
HI,Can any one, pls tell me when to use Hashtable and Haspmap.regards,Balu
Hi,I am using java.nio to implement the HSMS communication protocols which use TCP/IP link. In HSMS there is a requirement to implement the Inter Character Timeout. Means, the time delay between the reciept of two consecutive bytes on the TCP link has to be within some limit.1. Is there any ...
411 byte By
JayMGa at 2007-11-27 5:29:09
Hi,I currently do creation of new user accounts (and modificaiton of exisiting accounts) in our AD using JNDI and it works really well. I'm now looking at deletion of accounts and I can't seem to find any information on how to delete accounts and more importantly remove exchange mailboxes ...
392 byte By
ansanesa at 2007-11-27 5:30:12
I have a Java application from a provider running on Solaris that makes ftp connections to a server. The java process memory usage is increasing constantly. I suspect that the ftp connections are not being closed and this is the cause for the memory not being freed. Can you tell me how can i ...
Hi all,I'm having a lit of trouble to put this working, I have a class responsible for the network communication of my program.It has to accept incoming request and deal with them properly.For that I have the following code:public void receive(){System.out.println("Receive start");// ...
Hi all, I am trying to understand where Dynamic Class Loading is used. I know that its core to the Singelton design pattern but is it used in RMI or similar tecchnologies, and if so how?Thanks,
Hello,I have the following ConcurrentHashMap that represents a cache:private final ConcurrentHashMap<String, dtoCache> cache;And I have the following method that iterates over the CHM, removing all entries that have expired:Iterator<Map.Entry><String, dtoCache>> itEntry = ...
In the writeExternal() method of a class implementing java.io.Externalizable, I call writeObject(String) instead of writeUTF(String) because the String arg may be null and writeUTF() throws a NullPointerException if the arg passed is null. My assumption is that writeObject() will take care of ...
Hi,Reading the generics faq, I have encountered this text:"In general, if you have an API that only uses a type parameter T as an argument, itsuses should take advantage of lower bounded wildcards (? super T). Conversely, ifthe API only returns T, you抣l give your clients more flexibility by ...
what is the difference between HTTPS and SHTTP
277 byte By
KVNa at 2007-11-27 5:33:07
HelloI would like to select some test cases from an existing test suite dynamically. How do I do this? The test suite class is found out dynamically and test methods from that class is also chosen dynamically and added to a new test suite.Thanks!!!!
Hello. I am trying to learn threading so that I can have a Socket do its work in a thread, but everytime I do, the repaint method doesn't cause the GUI to repaint. My actual code is too long to put here so I made a smaller program that simulates the way that my real program is using the ...
I understand that thread objects get garbage collected when thread's run() method finishes. Is this true? Also, wanted to know how and when threads in a ThreadPool would get garbage collected.
I've been evaluating HashMap vs LinkedHashMap and LinkedHashMap offers better performance and memory costs than HashMap.Does anybody know a reason to use HashMap against LinkedHashMap?
Hi I am trying to make a simple RMI code follow an example to understand RMI. However the classes compile ok but when i use rmic then it show me the error about AbstractStringBuilder (erroneous method access flag) Can you please tell me what should i do to fix that bug. Thanks a lotHere my ...
1632 byte By
appy77a at 2007-11-27 5:36:12
Hello Everyone, I'm new to Generics and I'm trying to understand Generics with respect to declaring a method with generic parameters. I know how to write the code for this, below is an example of what I've tried so far and it works. However, I don't really understand why I'm supposed to ...
637 byte By
sumi84a at 2007-11-27 5:36:24
Hi!!I'm planing to do a project in , controlling devices remotely through the internet using the standard IP addresses..I feel that I have to use a client server architecture for this but I don't know how to apply this concept since im not very experienced in this setting client server ...
Hello all, I am witting a little class that will parse a string argument containing fields from within any class and will assign the a value to the actual objects fields.ie - I want to write a class that given a string argument and an object, assign the fields of the object values based on by ...
We're making a P2P application for audio streaming. It's working, but we have this problem - if one would enter 'localhost' for the server address (because server is indeed on the local machine), this would register that peer by the address value of 127.0.0.1. If for server address a LAN ...
215 byte By
prnga at 2007-11-27 5:37:33
Hello everyone. I want to create console menu in java where you can navigate through menu items using keybord arrows, i.e. press up to highlight upper menu item and press down to highlight menu item under it.
What does the types -i -a -d stand for?, I have decompiled the ftpURLConnection to see how it works, and I found that all the work is done through the FtpClient class, that is ok for me, but since the ftpClient is controlled through the FtpURLConnection, then it seams that the "modes" of ftp ...
Hello!I'm just writing a small application which is supposed to send serialized objects via network. The first object a client sends to the server is correctly answered by the server (sends an answer object). However, every further object the client sends causes a StreamCorruptionError on the ...
Hi,interface IntegerComparable extends Comparable<Integer> {}interface StringComparable extends Comparable<String> {}class Test implements SelfComparable, StringComparable {public int compareTo(Integer o) {return 0;}public int compareTo(String o) {return 0;}}Why is the above not ...
2733 byte By
lihy70a at 2007-11-27 5:39:16
Hello everybody!just as you know, There is more and more multi-core-cpu or multi-cpu machine.I want to know how to use cpu effectively.If I create several threads, does java vm distribute these threads on each cpu?for example, run following code is faster about twice on two-cpu machine than ...
I have One doubt i.e with out form bean is it possible to do One request in struts frame work.If it's possible then Plz give some brief description How it can do .Thanks&RegardsSada
212 byte By
prnga at 2007-11-27 5:40:18
I'm new to reflection api and would like to know whether it's possible or not using Method class to invoke event listener without using awt or swing? And if it's possible some sample code would be nice.
Hi every body I am a student and do senior project. I have some problem to develope java programing with Windown XPHow I do popup massage on taskbar similar MSN. I would like to develop server/client, when server send massage to client the client respon show massage popup on taskbar (similar ...
How I do develop program Network traffice Monitorring . now I am do senior project. anyone Help me. I want example and example source code or lib .jar file please.thank you very much.
hello to everybody. I have a big problem! I have a List which i scan. During the scan i have to check if the object into the List has some parameters. What i'd like to do is remove the object if the parameters are not good and than continue to scan the list. How can i do?i tried to do this: ...
530 byte By
Nialsha at 2007-11-27 5:42:52
Hi,I'm almost totally new to networking programming so I have a really simple question to ask: How can I have an applet running in a browser on one computer open a socket to another instance of that applet running on another computer?I guess I just need a tutorial or example or something. I'm ...
Hi,class MyClass<T> {public <U extends T & Comparable> MyClass<U> get() {}}If you use a type parameter as a bound of another type parameter,then you can't use any other bounds on that parameter.Is it because you could end up with a type which could inherit fromtwo classes ...
Please take a look at the following code:RandomAccessFile file = new RandomAccessFile("file", "rw"); // the file didn't exist prior to this instructionfile.setLength(1000);file.write(buffer, 0, 200);file.write(buffer, 200, 200);The first write() works ok but the second one throws ...
94 byte By
lihy70a at 2007-11-27 5:43:57
Hello, All If possible to transfer object instance straight between two java vm?
291 byte By
hsy541a at 2007-11-27 5:44:17
I have a requirement that i need to replace a existed method with a new one, at runtime when invoke the method, without any change of the existed code both the host class code contain the method and other classes which refer to the method can not be changed. How can i implement this?
Hi all,I would like to create RTCP header [version(2bit),padding(1 bit), count(5 bit), payload(8 bit), length(16 bit), ssrc(32 bit)] in java.How can I declare 2 bit version, in case of c and c++ there is a possibility like allocating 2 bits even by using bitfield... Is anything in java like ...
What Happens if a main method does n't have command line arguments ? whether it will pass a default argument or it will take space as an argument after java filename