How to perform a custom code injection?

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

how to integrate adobe photoshop shorcut into a java swing interphase?

176 byte By gunner99a at 2007-11-27 5:21:16
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

"IOException: Bad file descriptor" thrown during readline()

2634 byte By britty654a at 2007-11-27 5:21:25
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 ...

Choosing between RMI and Socket programming

424 byte By rahul_yadava at 2007-11-27 5:22:21
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 ...

How to force IPv4 with ServerSocket?

101 byte By Zeuxa at 2007-11-27 5:22:58
Hi!Is it possible to force ServerSocket to bind only IPv4 address?Thanks!

Regular Expression

310 byte By NourElsaftya at 2007-11-27 5:23:13
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 ...

Jfluid profiler

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.

NoClassDefFoundError AnnotationProcessorFactory

425 byte By ydriuttia at 2007-11-27 5:23:57
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: ...

openJMS chat example

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

This can be resolved through collection only..please help..

637 byte By nitin.vatsa at 2007-11-27 5:25:24
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 ...

cannot receive over ObjectInputStream... what is going on?

1664 byte By dew2hirooa at 2007-11-27 5:26:32
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 ...

Cant write an Image contained object to a file

1053 byte By chokkanathana at 2007-11-27 5:27:25
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 ...

cant write an image contained object to a file

1054 byte By chokkanathana at 2007-11-27 5:27:26
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 ...

threaded inner classes & heap memory exhaustion

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

Regarding Hash map and Hastable

102 byte By BaluChakrapania at 2007-11-27 5:27:48
HI,Can any one, pls tell me when to use Hashtable and Haspmap.regards,Balu

Inter Character Timeout for SocketChannel

463 byte By amitsax76@yahoo.coma at 2007-11-27 5:27:57
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 ...

Account removal (and exchnage Mailbox)

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

View number of outgoing ftp connections

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

Thread and Runnable passage of objects

2468 byte By EtherealSoula at 2007-11-27 5:30:24
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");// ...

Dynamic Class Loading - The Advantages & Uses

214 byte By notforgooglea at 2007-11-27 5:30:56
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,

ConcurrentHashMap Iterator

2168 byte By jbalagueroa at 2007-11-27 5:31:44
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 = ...

writeUTF() with null arg in Externalizable's writeExternal()

587 byte By moonusamya at 2007-11-27 5:31:56
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 ...

What is more flexible ?

518 byte By AdrianSosialuka at 2007-11-27 5:32:20
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 ...

difference beween HTTPS and SHTTP

53 byte By kiran@grdemettlea at 2007-11-27 5:33:05
what is the difference between HTTPS and SHTTP

Dynamic addition of junit test cases in a test suite

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

New to Threading

2883 byte By AsSiDuL0Usa at 2007-11-27 5:33:50
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 ...

Threads and GarbageCollection

200 byte By IcePlanta at 2007-11-27 5:34:46
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.

HashMap vs LinkedHashMap

199 byte By Remnahusha at 2007-11-27 5:35:34
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?

rmic error AbstractStringBuilder

1505 byte By hathaiduonga at 2007-11-27 5:36:05
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 ...

Why is <T> required in method signature, when a method takes generic params

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

Client / Server......project

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

Runtime Class Auto Casting

3928 byte By Mediahazea at 2007-11-27 5:36:25
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 ...

How to distinguish the right address to use

1089 byte By jadespirita at 2007-11-27 5:36:41
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 ...

how to make console menu

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.

Question abaout the FtpURLConnection

360 byte By Ioniviila at 2007-11-27 5:38:03
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 ...

StreamCorruptedException: invalid type code: AC

18333 byte By peter_gera at 2007-11-27 5:38:04
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 ...

Why is this not allowed ?

1068 byte By AdrianSosialuka at 2007-11-27 5:38:21
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 ...

run multi-thread programming on multi-cpu.

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

hi everybody

223 byte By sadasivaa at 2007-11-27 5:39:32
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

invoking event listener

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.

How to popup massage on taskbar similar MSN

521 byte By kaenkoona at 2007-11-27 5:40:25
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 to develop program Network traffice Monitor

211 byte By kaenkoona at 2007-11-27 5:40:27
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.

RuntimeException - ReadOnlyException

719 byte By ramboelmeioa at 2007-11-27 5:42:15
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: ...

Applet to Applet socketeering

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

Type parameter as bound of another type parameter

815 byte By AdrianSosialuka at 2007-11-27 5:43:12
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 ...

java.lang.IndexOutOfBoundsException despite setLength()

573 byte By swiergota at 2007-11-27 5:43:15
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 ...

how to communicate (transfer object instance) between to java vm?

94 byte By lihy70a at 2007-11-27 5:43:57
Hello, All If possible to transfer object instance straight between two java vm?

How to replace a method at runtime

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?

Creating RTCP header

464 byte By lkhi@123a at 2007-11-27 5:44:46
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 ...

if a command line argument is not passed for a main method what happens

180 byte By Krishreyaa at 2007-11-27 5:45:06
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