Saurav Chetia

Greenhorn
+ Follow
since Oct 28, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Saurav Chetia

Hi there !
We can call abstract methods... isn't it?
We have this <B>AbstractMethodError</B> in java.lang package which is said to be thrown when an application tries to call an abstract method.
However, I could call <B>Process.default()</B>(java.lang.Process class) method in my application. There was no compiler error or runtime exception.
Can anybody explain under what conditions is this <B>AbstractMethodError</B> thrown ?
Can anybody give more information on 'Calling abstract methods'?
Thanks
-Saurav
14 years ago
Hi All!
I wanted to know how to use com.ibm.websphere.naming.WsnInitialContextFactory in WebSphere Appl Server (WAS)5.0.x ?
I could use this in WAS 4.0.6 successfully. However, it is not working in WAS 5.0.x ?
I read that the difference is between how JNDI name space is implemented in WAS 4.0.x and WAS 5.0.x.


WAS 5.0.x uses the Interoperable Name Service (INS) protocol
The initial context factory now uses a default provider URL of corbaloc:iiop:localhost:2809.
In previous versions of WAS, the initial context factory used a different ORB implementation, which used legacy protocol. In the legacy ORB, the bootstrap host and port values defaulted to localhost and 900, respectively.


Can someone tell me how to get this working ?
Thanks
-Saurav
14 years ago
Hi !
How can one get the exception -javax.jms.InvalidDestinationException ?
I know that I have to make my application use some invalid queue or topic. I could use an invalid queue and hence, got this exception.
However, how can I use some invalid topic ?
I am using WebSphere 4.0.3.
It seems the topics are created dynamically.
Topic creation
So if I give an arbitrary name for a topic while using TopicSession.createTopic(String topicName) it gives me a topic created dynamically.
If I use static topics (created as some JMS Administered objects) I get the exception - javax.naming.NameNotFoundException.
My question is how to use some invalid topic and get this javax.jms.InvalidDestinationException ?
Thanks
-Saurav
Hi Michael !
In my program I just want to execute one program (as subprocess) and provide it with some input. I am not doing both - providing input and getting output.
I used the code as posted earlier. However, the program just hangs :-(
From the API reference -

The created subprocess does not have its own terminal or console. All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.


Keeping this in mind I gave very small input. Still it hangs.
I tested the code on Windows NT 4 and Solaris 8.
I have not found any solution for this requirement. Is it feasible ? or is it one of the shortcomings of Java ? I'm sure there is some workaround for this which I have to figure out.
Thanks
-Saurav
14 years ago
Hi Michael !
Getting the output of the subprocess is working fine.
I am facing the problem of providing input to the subprocess. Please let me know how to do this.
I am posting a dummy code. To run the sample please replace 'somecommand' with a command which takes input.

Thanks
-Saurav
14 years ago

The problem is in this line of code -
"theNumber=barcode.charAt(number); "
You'll get a character literal from the string and then you are assigning that to an integer.
So the integer value of that ASCII char is assigned.
You can try this to obtain the integer value from the String 'barcode'-
theNumber=Integer.parseInt(barcode.substring(number,number+1));
14 years ago
Thanks Michael!
That was a simple method to obtain information from a class file.
I just had doubt related with JVM implementation of JDK versions and the Class file format supported. Got the information from the Sun's JVM Specification.
Thanks again
-Saurav
14 years ago
If I have a java class file and I want to know about it's version(major and minor) how to obtain those values ?
I used com.ibm.toad.cfparse package. Using the ClassFile class I tried to get the major and minor versions but I get the default values of MajorVersion : 45 , and MinorVersion : 3.
I used the ClassFile constructor with InputStream argument.
Can someone tell me what am I am I missing here ?
Or else please suggest some other technique to get those information.
Thanks
14 years ago
Here is the code -
import java.awt.*;
import java.awt.event.*;
class colorTest extends Frame {
java.awt.Choice ColorChooser = new java.awt.Choice();
ColorChooser.insert("Green",0);
ColorChooser.add("Red");
ColorChooser.add("Blue");

public colorTest() {
super("ColorTest");
}
public static void main(String args[]) {
colorTest test = new colorTest();
}
}
When I try to compile the file I get the error as given below. What could be the problem ? -
javac colorTest.java
colorTest.java:7: <identifier> expected
ColorChooser.add("Red");
^
colorTest.java:8: <identifier> expected
ColorChooser.add("Blue");
^
colorTest.java:7: cannot resolve symbol
symbol : class add
location: package ColorChooser
ColorChooser.add("Red");
^
colorTest.java:8: cannot resolve symbol
symbol : class add
location: package ColorChooser
ColorChooser.add("Blue");
^
4 errors
15 years ago