changing date for a JVM

679 byte By ptoader at 2007-9-26 2:47:02
helloI have a problem related to the system date(the date from JVM)How can I change dynamically the date of a JVM?my problem: I have to create a test case fora triggerI want to create an object, and I need to changethe date to see the resultI want to create a 'contract' object whichwill ...

Primitive vs Object return Type (using Reflection)

500 byte By rgunder3 at 2007-9-26 2:47:03
HiI have a Method object and I call getReturnType() to give me the class of what it returns. I then need to see if the value returned is equal to another value or not, using .equals() preferably. The trouble is, a lot of the time the return type is a primitive, say 'int' and so I need to be ...

Servlet Pages getting hanged up

1201 byte By vinodkrishnam at 2007-9-26 2:47:22
I'm working on a web site using Servlets with MSSQL Server as back end.The problem is that the site gets hanged up once we browse it continuously for some time .There were times when we got them working for almost a day.WE have hosted the site through a vendor using Java Web server in Windows ...

german Umlaute in JAVA native Interface

523 byte By feyersinger at 2007-9-26 2:47:26
We use the JAVA Native Interface to communicate with C++ Objects.To transfer Strings from JAVA to C++ we use:const char *cText = env->GetStringUTFChars(parText, 0);For most of the Strings it works but for the german Umlaute it returns wrong values.We use the JAVA version:java version ...

Retrieving a value using Reflection

1795 byte By mperemsky at 2007-9-26 2:47:49
I'm trying to write a class that stores a list of field names, takes an object as a parameter, then builds a string based on the values contained within the field names stored in the array.The class uses reflection so that I can pass any object to this method.To keep things simple, I am only ...

Parsing XML from Socket input stream

914 byte By scaro at 2007-9-26 2:48:11
I create a sax parser to which I send the InputStream from the socketBut my HandlerBase never gets the events. I get startDocumentbut that is it, I never get any other event.The code I have works just like expected when I make the InputStreamcome from a file. The only differeence I see is that ...

Ldap Password Authentication Problem

916 byte By jessicamcpeake at 2007-9-26 2:48:35
Below is the code being used to authenticate to LDAP. When I set SECURITY_AUTHENTICATION to "none" it compiles and runs fine, but when I set it to "simple" to have it authenticate with the password to produces the following error:Authentication Exception: [LDAP: no such object]Unfortunately, ...

Java 1.4 NIO view buffers and arrays

1094 byte By llschumacher at 2007-9-26 2:48:38
Issue 1. The ByteBuffer class defines methods that can create views of a given ByteBuffer such as:CharBuffer asCharBuffer()DoubleBuffer asDoubleBuffer()LongBuffer as LongBuffer()... etc.Why is there no corresponding method in the view buffer classes to create a ByteBuffer view? The NIO class ...

readLine() issues

1878 byte By sbsquarepants at 2007-9-26 2:48:45
Hello... I'm having a bit of a problem with a readLine() statement, and hopefully someone can help me out with this. Just for your information, I have tried this with both a DataInputStream, and a BufferedStreamReader, and have the same results either way. To begin with, here is the snipet of ...

Receiving this error, even though the email address specified is valid:

382 byte By vasantis at 2007-9-26 2:48:49
Receiving this error, even though the email address specified is valid:Any ideas?Assert failed: javax.mail.SendFailedException: Sending failed;nested exception is: javax.mail.SendFailedException: Invalid Addresses;nested exception is: javax.mail.SendFailedException: 550 5.7.1 You Are Not ...

Retrieving special characters through an HttpRequest

297 byte By babaji at 2007-9-26 2:48:57
Why I can not retrieve special characters like accents, spanish chars, etc. through an HttpRequest? Instead of the special char I want to retrieve it always changes them to another symbol. For example (nio, informaci n)Is there any way to do it?Thanks in advance

Multiple Disk I/O

506 byte By alikamran at 2007-9-26 2:49:18
Hi,I have a set of classes , one of which exclusively deals with Disk I/O. My other classes call this specific class quite often.The Problem is that whenever one of the outer classes has called the I/O class, the I/O class performs it functions and then 'dies'. Now if another class calls it ...

RMI puzzle connection problem on Saloris!!

801 byte By lilytsai at 2007-9-26 2:49:25
Hi everyone,we have a webpage running on java web server 2.0 on a Saloris system and rmi server running on another saloris system. For some reasons the connection is failed recently but there is no java programs been modified since last year in Aug. It seems the RMI server runs successfully and ...

listing all current sessions -- Please Helpppp!!!

303 byte By jmennen at 2007-9-26 2:49:27
I need to be able to list all of the current sessions on my computer. I need to find the name of a session so that I can pull the username from it. How can I get a list of all sessions? Is there a way to disable all the sessions, and then go in and create the session I need? Please Help!! ...

Summing integers in the form of Big indain...

590 byte By geotdw at 2007-9-26 2:49:50
Hey...I don't know much about the way little indian and big indian format works. All i know is the way the calculations are done in memory differ in both. What i'm trying to do is read a file of bytes into a buffer. Then add the buffer to find the checksum. The return is of type int and in ...

can I do this? String[] sarray = ArrayList.toArray();

250 byte By me_elf at 2007-9-26 2:50:03
I want to convert an ArrayList to a String arraythe error I get is thisError #: 354 : incompatible types; found: java.lang.Object[], required: java.lang.String[] at line 51, column 39can some one shed some light pls

ClassNotFoundException no security manager RMI class loader

4774 byte By brett_humphreys at 2007-9-26 2:50:21
Hello all,First off thanks for your help if you are going to respond to this, i really appreciate it.Now to my problem.Currently have a RMI server and RMI client that work when run from the command line. I set up the java.rmi.server.codebase property to the website on the local machine, and ...

Can enumerate all thread are waiting before a synchronized ?

98 byte By hoadx at 2007-9-26 2:50:45
Hi!Can enumerate all thread are waiting before a synchronized ?Thanks!

Accessing of Hard DIsk Serial Number

348 byte By airabhijit at 2007-9-26 2:51:00
Dear Readers,I develop Client Server Applications. I would like to know how we can access the hard disk from an application so that I get the Serial Number of the Hard Disk, the Floppy Disk number, CD Rom Drive Number and Network Card Number.Please suggest.Yours Truly,Sarwottam ...

JSP tag allow

102 byte By ajaantha at 2007-9-26 2:51:04
Hi buddy's How Custom JSP tag allows you to execute scripts on your host with NT

How to read the first byte character is between 'A'..'Z' or 0..9?

178 byte By airqq at 2007-9-26 2:51:12
hi all,How to read first byte character of a given string is fall between 'A'..'Z' and 0..9?please help and thanks.elvis,scjp

CORBA Errors

1034 byte By pizbp at 2007-9-26 2:51:13
I am new to CORBA Programming. Are the below errors very common errors occur due to some misunderstanding on Java ORB & CORBA Programming?ERROR: org.omg.CORBA.MARSHAL: minor code:0 complete: Maybeorg.omg.CORBA.MARSHAL: minor code:0 complete: Maybeat ...

Threads

255 byte By jayantis at 2007-9-26 2:51:14
HiI have this multi thread applet. When I run it, it runs fine for some time. After a couple of minutes the threads hang up. Does it have something to do with timeout. Please help me on this.ThanksJayanti

JSP vs Swing

149 byte By kalpesh_gupta at 2007-9-26 2:51:24
can we achieve all the functionality by programming in Swing,than what we get by JSP.moreover can we develop a website in Swing?

Problem in running ANT and J2ee

1674 byte By abhattachar at 2007-9-26 2:51:25
HiI am having a problem to run ant and j2ee in my machine. I followed the instructions for installation of ant and did the following:Assuming ANT installation dir : d:\java\ant13Path = d:\java\ant13\binANT_HOME = d:\java\ant13JAVA_HOME = jdk installation dir(1.3)CLASSPATH = I put j2ee.jar which ...

How to implement find method in JTable?

177 byte By amin_rashid at 2007-9-26 2:51:43
I have a tablewhose cells are editabel.i want tomakea function for find a string)from table cells) and replace itwith some other string..how to doit?

Contravariance and overloading

3400 byte By jstuyts at 2007-9-26 2:52:09
One of the requested features in the Bug Database is covariance and contravariance. Although I think covariance of return types is easy to achieve without modifying JVMs, contravariance of parameter types might be more of a problem.Take the following inheritance structure:C extends B extends AY ...

downloading file of a server with a servlet

172 byte By lauradl at 2007-9-26 2:52:17
hello,I want to send a file, that is in a directory of a web server, to de client. I want do it with a servlet, but I dont know how do it.Thanks

What is the best Java Compiler?

238 byte By Abu_ramla at 2007-9-26 2:52:38
What is the best java compiler for some one who has been using a visual basic in window Envirenment. I mean, graphical java compiler. I know already Jbuilder4.0, but not suite to my applications.ThanksAbu_ramla

Urgent!!!! Runtime.getRuntime().exec() in server side

3165 byte By souvikdutta at 2007-9-26 2:52:53
Dear All,I have an application on which, from client side I want to give some command (e.g. Dir, del *.class etc). Then I need the output of that process. But it is giving exception. I am using RMI for that. How to achieve this? Anybody have any idea? I am attaching the sample also.Thanks in ...

retrieve all class names in a package

104 byte By crazyreini at 2007-9-26 2:53:23
How can i get all classnames in a package at run-time?regardsReinhard

How to let a java window be "always on top"?

194 byte By modelart at 2007-9-26 2:53:28
I want to write an application with an windowbeing always on top. Thus, any other windows will not cover it. Does anyone know how to achive this?thanks

Solaris VM - Thread Implementation

300 byte By SolarOfBAUD at 2007-9-26 2:53:50
Can someone point me towards a technical documentation of the Sun Solaris JVM, more specifically how it handles Java Threads? Are they implemented as threads or processes, how are the shared variables handled (common memory space?), etc.?I need the info for a project evaluation. ...

getHostName() only returns short host name in Windows 2000

565 byte By jrg3 at 2007-9-26 2:54:00
I have an application server that uses rmi that runs fine in unix (several varieties), Windows 95, Windows 98, and Windows NT 4. It fails on Windows 2000.All the other OS's return the fully qualified hostname for the call server.rmiHost = ...

problems serializing a JInternalFrame

450 byte By jbarkerjava at 2007-9-26 2:54:04
HII have problems serializing a JInternalFrame. The exception is:"java.lang.Error: Do not use javax.swing.JInternalFrame.setLayout() use javax.swing.JInternalFrame.getContentPane().setLayout() insteadat javax.swing.JInternalFrame.createRootPaneException(JInternalFrame.java:400)"but the ...

Under a GUI, I need to run a perl script, how to do this?

1624 byte By seigot at 2007-9-26 2:54:10
Hi - I am writing a GUI for my clients and one of the things my program must do is run a perl script. I am able to run perl.exe but it seems like perl.exe is not running the script. I also tried to put the perl script in a batch file and then call the batch file from my java GUI program. I ...

2 Remote Interfaces for one object. Is it possible?

453 byte By natkinnat at 2007-9-26 2:54:29
Hello.I have an object that can be used remotely in 2 different roles. So I have 2 remote interfaces for it.It seems ok to me. When looking up for this object I just cast it to one of the 2 interfaces. I wonder if there's any reason why I should't use 2 remote interfaces for one object? I'm ...

Problem with binding Remote Object (JNDI/WebSphere)

315 byte By hairsinl at 2007-9-26 2:54:32
I am having a problem trying to bind a remote object to the WebSphere 3.5 JNDI name service (com.ibm.ejs.ns.jndi.CNInitialContextFactory). When I use ctx.bind(name, object), I am getting a java.lang.ClassCastException.Would be really grateful for any help as it is driving me mad!Lyndsey ...

Does anybody know how to access modem?

217 byte By Alimbo at 2007-9-26 2:55:40
Hi,Q: What API should I use to implement modem dialer functionality,basically to access Internet (PPP), only dialer functionality isrequired? How to access modem dialing functions in Java? thanks.

About buffer read

373 byte By pwang2000 at 2007-9-26 2:55:50
hi, I am new to the java.io and had a question aboutreading certain bytes into a buffer.DataInputStream in;Byte buffer[] = new byte[MAX_BUFFER];in.read(buffer);Here I have to predefine MAX_BUFFER in order toread from a stream, can I know the size of the inputin advance of actually ...

rMI ran once and then crashed

280 byte By sseans at 2007-9-26 2:56:12
I wrote asmiple rMI client /server each accessing one method on each side. I ran it last night.Tonigh without touching the programs I compiled them again using javac...and they are not compiling. It doesnt recognise the interface.strange.

calling another program

596 byte By yeti17 at 2007-9-26 2:56:20
I have gone thru the jni tutorial and I understand the HelloWorld example... my problem is, in the tutorial the java part calls a C program that they then write... I need to call an existing program that is not written in java? I have this program's header file and that is all.How do I use ...

RTF Editor Page breaks

247 byte By byronl at 2007-9-26 2:56:28
Does anyone know of any way to create page breaks using the RTFeditor and the DefaultStyledDocument. I have tried to do this by adding the text "\page" to my document but it doesn't seem to be working. Thanks in advance,Byron

Class Unloading

309 byte By alikamran at 2007-9-26 2:56:29
Hi,Is there any specific 'event' that is called whenever a class is unloaded from memory. I mean if I want to do something speacil like cleaning up objects or writing to disk, I would like to do it when my class unloads. Is there a way to achieve this effect?Thankx in advance... ...

requestFocus() to textfiled ?

396 byte By geotdw at 2007-9-26 2:56:34
Hey..I have a dialog with 3 radio buttons and one textfield. Now i've had the requestFocus on the textfield.I already have something typed int that textfield by default, so when thefocus is set to that textfield, it goes tothe beggining of the text, i mean thecursor. How can i end up putting ...

Class.forName() with dynamic String

1875 byte By pjungwirth at 2007-9-26 2:56:44
I'm trying to create objects of a class whose name depends on a runtime database lookup. So my code looks like this:package com.mycompany.ourproduct.ourpackage;. . .String className = rs.getString(1);Class c = Class.forName(className);. . .When I run the program, I get a ...

help!! recursive function call

2238 byte By liberticide at 2007-9-26 2:56:55
[code] /** *The function which build the category tree */ public String categoryTree(Statement stat, boolean isMore, int id) { if(!isMore) { return ""; } else { String sql = " select t_category_relation.category_relation_id, t_category_relation.level_in, " + " t_category_item.category_item_id, ...

Read Serialized Objects from UNIX

818 byte By bugurlu at 2007-9-26 2:56:57
When I try to read the serialized objects in UNIX from NT application, java.lang.ClassNotFoundException is thrown. I get a message "object not visible from this context" when is.readObject() is executed.Thanks in advance, Bulent Ugurlu //Declare the local variablesjava.net.URL url ...

Query VM for number of object instances, possible?

435 byte By jtolip at 2007-9-26 2:57:05
I have a super duper java guru question:Given a class object (or equivalently a class name and it's respective class loader), is there a way to determine if any instances of this class exist in the VM? I don't care how many, I just want to know if there are any at all. Perhaps another way to ...

JNI memory control: DLL -> Java reference passing

4112 byte By gregstef at 2007-9-26 2:58:25
I'm having great difficulty trying to pass data structure ptr's as object ref's through (*env)->CallVoidMethod(): I believe the memory is getting released by the DLL by the time the Java method executes, or I'm just lost beyond words. Here's the src. Java && C sides...TestData ...