Java-index »» Core »

datagram packet

140 byte By ballanianga at 2007-11-27 10:55:59
<p>Hi,</p><p>I wanna save a datagram packet (byte format) inside a table and send it after a while to a client.</p><p>How can I do this.</p>

want free java api's for ftp over ssh

215 byte By prithvi123a at 2007-11-27 10:56:14
<p>Hi all</p><p> I have to write java code for ftp over ssh.</p><p>I am serching for free java api's for secure ftp </p><p>i found api's but all paid</p><p>can any one please tell me about free availble api's</p>

javax.comm APIs availability

221 byte By arun.blorea at 2007-11-27 10:56:48
<p>Is that javax.comm APIs now available inside the jdk1.6.0 ?</p><p>Otherwise what location it is available ? </p><p>Please provide the correct link if anyone knows.</p><p>Thanks in advance.</p><p>Regards,</p><p>arun</p>

Javax run time error NullPointer from method " public void serialEvent( )"

1417 byte By nerdEvera at 2007-11-27 10:57:06
hi lads, i got two pc commicate with each other through serial cable, but on the receiver end, i need 2 classes, class A is for taking the incoming data and put them into an array X, and the other class B will access the array X and taking the content out for further processing.in class A, there is ...

Why this code generates Warnings ?

447 byte By pbulgarellia at 2007-11-27 10:59:15
This code is a example:ArrayList<Object> al = new ArrayList<Object>();Object[] objArray = new Object[100];objArray[0] = al;ArrayList<Object> al2 = (ArrayList<Object>)objArray[0];Why lineArrayList<Object> al2 = (ArrayList<Object>)objArray[0]; generates Warnings ?and how can I ...

ReadWriteLock held by "Thread[null]"?

1408 byte By preaneya at 2007-11-27 10:59:16
I have what appears to be a deadlock in my application, but the thread dumps don't indicate where it is.There is a data structure that uses a ReentrantReadWriteLock, and readers get the read lock, while writers get the write lock.When the problem occurs, it looks as though two threads are waiting ...

Is a synchronized (this) {} block sufficient here?

1030 byte By monocongoa at 2007-11-27 10:59:44
I have lots of code which uses JAXB Marshaller and Unmarshaller class member objects (i.e. I create these in the constructor of a class and use them in several methods of the class). Unfortunately I've just found out that these two JAXB classes are not thread safe (see ...

*** No address (A) records available for www.nec.ca

316 byte By ballanianga at 2007-11-27 10:59:51
Hello,I'm developping a DNS server.When I send a response from my cache (static Map<String, byte[]> reponseCache = new HashMap<String, byte[]>()) the client say *** No address (A) records available for www.any.comIt 's like a byte[] corruption ...Who can ...

ThreadLocal variable

270 byte By rinoa_fftsya at 2007-11-27 11:00:31
<p>hi do you have a good example on how to use threadlocal in a java program..</p><p>I want to use it in my program so that each thread will create a separate copy of jdbc connection. i dont know how to set this..Please help me.</p><p>thanks in advance for your help</p>

Why is a Collection an Interface?

480 byte By BHARGAVAa at 2007-11-27 11:01:05
Hi, I am just curious about why there are interfaces for Collection, List, Set etc,. and abstract classes each implementing the interface .. Why couldn't they have just started withAbstractCollection , AbstractSet etc., And am I right about a convention not being followed about naming interfaces ...

PPPoE packets

278 byte By anamupotaa at 2007-11-27 11:01:31
<p>Dear All,</p><p>I would like to know if ther are any APIs for capturing PPPoE packets,</p><p> I am currently working with jpcap library which enables the packets to be captured.</p><p> However i am getting difficulty in casting those packets to PPPoE form</p><p>Thank You</p>

ResultSet to Collection Conversion

254 byte By Abhi_The_Software_Nerda at 2007-11-27 11:02:02
<p><b>Hi</b></p><p>Am working on a Velocity project and wud like to know how resultset oject is type converted into an object of any type which inherits collection interface. If u cud attach the code then it wud have been really helpful</p><p>Regards</p>

Why are enums with constant-specifics methods no enums?

963 byte By isEnuma at 2007-11-27 11:03:09
I'm working on an application which uses reflection to determine how a certain object should be represented in the GUI.If an object is an enum it will be represented as a drop-down box.Yesterday however our code broke on a newly added enum which uses constant-specifics methods.To illustrate it ...

Receing strings

275 byte By Thandoa at 2007-11-27 11:03:59
<p>I have a JAVA Server and an AMX Controller. I have established an IP session between these 2. My AMX Controller is sending strings to my server.the problem is that the server is not picking them up.</p><p>what line of code should i use to receive strings to my server.</p>

overriding tailMap() method

1011 byte By ebroCasea at 2007-11-27 11:04:05
Hello there, This is my problem. I am working on a dictionary program using the TreeMap structure. I would like use the trailMap() method to get a subMap of higher keys and their values. But, I want to put a limit on the number of keys I am getting back. I have more than 2 thousands of entries in ...

Not able to Notify a thread.

1218 byte By Tarusa at 2007-11-27 11:04:25
Hi,I am struck with an issue where i am not able to notify a Thread which is in wait state. My goal is accept a request , publish the request on to JMS BUS, Subscribe for the response & reply back to the caller. Module which accepts the request is multithreaded. Each thread publish different ...

networkaddress.cache.ttl

584 byte By renena at 2007-11-27 11:05:47
For better or worse, our organization relies on dynamic dns addresses to connect to our branches (static IP addresses are VERY expensive here). Because of this I have set networkaddress.cache.ttl to sixty seconds. Which will work. But, it seems silly to have to change this setting for entire server ...

Tomcat client + JBOSS server

1778 byte By fausto_minottia at 2007-11-27 11:05:51
Regarding to JBossIDE-Tutorial.pdf I worked through this tutorial and I reached my first EJBNow Im trying to deploy the application as clent and server using Tomcat 5.5 and JBOSS 4.2.0GA ( on two different host placed in the same lan )I have the same project on the JBOSS and the new one in TomcatIn ...

ThreadPoolExecutor - thread creation madness

747 byte By javadude.101a at 2007-11-27 11:06:22
Hi all,I am trying to use a Thread Pool for a task server. My testing involves running 10 concurrent jobs that each serially call the server 100 times.The maximum load on the server (for this test) is therefore 10 tasks at any given point in time. The Thread Pool is creating between 50 and 100 ...

adding to an arrayList

486 byte By jjmclella at 2007-11-27 11:06:38
Hi there,I'm trying to add an integer to my arrayList but I can't do it b/c the arrayList is defined as holding my user-defined object type...I couldn't even create an arrayList to hold integers. Here's what I mean:ArrayList<Polygon> sourcePatch = new ...

Diff. between running java code in a single processor vs multiprocessor

653 byte By chaos_begins_herea at 2007-11-27 11:06:46
Hi,This is a general question and I tried to find answer for it, but couldn't find so came here as usual. When designing a new Java project do we need to consider whether the application will be running in a single processor/multi processor. Does our design affect assigning thread to different ...

RMI COMPILING & SECURITY ERRORS

643 byte By GegegegegeRisea at 2007-11-27 11:06:49
HAY I HAVE CREATED A SIMPLE CLIENT AND SERVER USING RMI,EVERY THING IS COMPILED, but when i try to execute the server by assigning security privilages i get an error msg, i.e Remote Exception: java:.rmi.serverException: remoteException occured in serverthread; nested exception ...

RMI Server Class path issue

390 byte By brajesh_rathorea at 2007-11-27 11:09:19
hi , i am facing classpath issue when try to run rmi server. i have a jar file(RmiServer.jar) for rmi server , which contain some other jar file .when i run this jar file it throws ClassNotFoundExceptionthe java classloader are not able to load class from jar(RmiServer.jar)file. pls. tell me what i ...

How to load specified version of oracle.jdbc.OracleDriver?

1044 byte By dfundaka at 2007-11-27 11:09:30
Hi.I've faced problem while working with application that accesses different versions of Oracle(10gR2 and old one 8.0.5).I have 2 jdbc libraries: classes12.zip(Oracle 8.0.5) and ojdbc14.jar(Oracle 10g).In both libraries there is class oracle.jdbc.OracleDriver.Is there any way to load specific ...

Java Code for sending SMS

1396 byte By Cochua at 2007-11-27 11:09:34
Hai all,I am trying to develope a java code that sends SMS . I downloaded and installed the J2ME Wireless Toolkit API and am able to compile the following code. But upon running it shows unsatisfiedLinkError. Please tell me what I need to do to solve this problem?import java.io.*;import ...

Synchronized objects

299 byte By _AM__a at 2007-11-27 11:10:37
<p>Apologize if it's a too basic questoin</p><p>I have a class A with two synchronized methods 1 and 2. </p><p>Now class B access Class A's method 1</p><p>Class C access Class A's method 2</p><p>In this case, whether this two threads can have access on Class A object </p><p>Thanks in advance</p>

Codebase setting in a local network

926 byte By Sandmann6a at 2007-11-27 11:10:40
Hello,Im now confronted with a codebase setting problem in a network:Right now Im running Client and Server on the same machine and I have the Codebase Setting on the server like that:-Djava.rmi.server.codebase=file:/C:/RMINORMICEXAMPLE/SERVER/NEWSERVER/bin/ This start-argument works fine, when ...

In W2K AD:After first login of user he must set his own password how to do?

304 byte By 4tha at 2007-11-27 11:11:05
Hello,how can i set the attribute (if its an attribte to be set...) with JNDI that the user is forced to enter a new password the next time he is logging into windows ?I know or I still remember a bit there was a thread about that but i had no luck with the search... please help ...

which data structure?

213 byte By TJayseea at 2007-11-27 11:11:31
<p>Hi there...</p><p>Could you let me know what is the most efficient data structure to use (in terms of storage and access) if I have to store around 1 million <key,value> pairs?</p><p>Thanx :)</p><p>Tariq</p>

RMI Server / Socket Permission

638 byte By Carraa at 2007-11-27 11:11:38
Got an RMI Server running and clients can connect from the localhost. The problem comes if they want to connect from another pc.Got a policy file like:grant codeBase "file:/D:/RMIServer/classes/" {... permission java.net.SocketPermission "localhost", "accept, connect, listen, resolve";...}Is there ...

Class transfer

461 byte By nille40a at 2007-11-27 11:11:53
Hi,I need to transfer classes between nodes when a deserialization has failed. My problem is that I need the binary class file for this transfer to succeed. I currently use a custom class loader and retain the class data for transferrable classes, but I need to extend this to classes loaded by the ...

how to scan neighboring device IP's using java?

235 byte By rameshsa at 2007-11-27 11:11:56
<p>hello,</p><p>how to scan neighboring device IP's using java like IP scanner.</p><p>is it possible?.</p><p>I need to scan available devices in my network range and show their IP addresses in separate table.</p><p>is it possible?</p>

Problems using RMI between linux and windows.

699 byte By cambieria at 2007-11-27 11:12:07
I have problems using RMI between linux and windows.This is my scenario:- Server running on linux pc- Clients running on linux and windows PCsWhen a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark ...

Synchronized issue

924 byte By karachitea at 2007-11-27 11:12:12
Hi,I have a synchronized block and Im sending a request to another application (blocking operation). So until i get response, I need to wait(), so that i wont end up consuming too much CPU. I want to wait() but i do also like to ensure that no other thread will enter this synchronized black in the ...

Serialized Java with regard to Siebel

1329 byte By vinman6967a at 2007-11-27 11:12:23
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 ...

Unchecked Warnings

1223 byte By Anthony_Smitha at 2007-11-27 11:12:56
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 = ...

Type safety with getting the class of an enum

1645 byte By kevin.mcguinnessa at 2007-11-27 11:13:02
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 ...

try/catch block contains only Dircontext instance -> ssl connect app freeze

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

How to know when one device doesn't work...?

505 byte By berlinerwurma at 2007-11-27 11:14:03
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 ...

Paradox of automatic type wrapping and reflection?

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

How to read input from a port ?

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>

JMX notification alternatives

3468 byte By Toxica at 2007-11-27 11:14:59
Hello, I had the inital idea to implement an alarm system using jmx notifications. From my interpretation this generates alot of code clutter in every class looking to send alarms. Even the base class of javax.management.Notification has a minimal constructor requiring a local variable ...

JMX implementation In Apache HTTPD server

259 byte By LifeLearnera at 2007-11-27 11:15:19
<p>I need help in configuring a httpd server for JMX. Specifically, I would like to monitor app and system statics the same way one can use JMX Attributes in Weblogic. </p><p>Also, does JMX expose system stats such as CPU, Memory Utilzation?</p><p>Thanks.</p>

Acquring A Static Inner Class via Reflection

1912 byte By aria_kokoschkaa at 2007-11-27 11:15:47
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 = ...

JMXMP w/ TLS

1616 byte By blaine.simpsona at 2007-11-27 11:15:51
Some years ago, I ran JMXMP with TLS using the jmx remote RI. It was very easy to set up.Now I want to do the same thing, but want to use J2SE 1.5 as much as possible. According to the latest jmx remote RI docs, I should be able to use JMXMP by just adding the jmxremote_optional.jar to my Java 1.5 ...

Can we read and write contents on cvs fomat file using java.

158 byte By java_insighta at 2007-11-27 11:17:06
<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>

How to unbind DatagramSocket

659 byte By fordfrog2a at 2007-11-27 11:17:08
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 ...

avoid requirements for JNDI

289 byte By darshgohela at 2007-11-27 11:17:20
<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>

Generics

737 byte By student-javaa at 2007-11-27 11:17:26
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 ...

LinkedHashMap: How to remove element?

1110 byte By hasman001a at 2007-11-27 11:17:29
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 ...