Biswajit Paria

Ranch Hand
+ Follow
since Feb 02, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Biswajit Paria

More information:
I am using weblogic v7.0 and applications are deployed in admin server only.
17 years ago
System.out.println("about to leave loop() - " + name);} public static void main(String[] args) { TwoThread tt = new TwoThread(); tt.setName("my worker thread"); tt.start(); try { System.out.println("another thread calling......"); Thread.sleep(700); } catch ( InterruptedException x ) { } Thread t = Thread.currentThread(); String name = t.getName(); System.out.println("Test name="+ name); tt.loop(); }}

Here tt.start() will create a new Thread and will execute loop() separately.

While Simply calling tt.loop() will be excecuted in main Thread.
[ July 17, 2007: Message edited by: Jim Yingst ]
Hi All,
I am using weblogic JDBCConnectionPoolRuntimeMBean (weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean) to get detail status regarding JDBC connection while running an application on Weblogic.

Using:

Then I used

Using that above code, I get total number of try that connection pool tries to reconenct database but failed(at the time while database was not available or there is any network problem between application and database.)

Problem, I am facing:
Though the above code works fine, but after database is up and Network problem resolved, I still find the same count for connBean.getFailuresToReconnectCount(), it is not reset

I want, after database and network issues resolved, this count should be reset to Zero.

I tried to use reset() method, but it does not work.


Please advice.

Thanks in advance.

-Biswajit.
17 years ago
Hi,

I am trying to compile my classes in JDK1.4 version and few classes depends on other classes which are complied in JDK1.5 version .

I am getting the following error:

bad class file: /home/w3eqadm/emtclients/companypage/build/script/emtclients/companypage/lib/emt.jar(com/csfb/equity/edge/util/ApplicationProperties.class)
class file has wrong version 49.0, should be 48.0



I am in a situation that, I have to compile classes in JDK1.4 which are depending on classes complied in JDK1.5.

How can it be possible? Please advice.

Thanks,
Biswajit.
17 years ago

I was expecting error as my Cat object created at line 4 is not serialized but when i replace line 4 with
Animal a=new Animal() which is superclass of Cat i am getting error


if your Cat class is not Serializable, you will obviously get java.io.NotSerializableException exception....

The following senario where you would not get any exception:

1.If your Super class Animal implements Serializable interface then Cat class will not throw exception even it may not implement Serializable.

2.Your Super class does not implement Serializable and subclass Cat implements Serializable...then your above code will not throw exception...

Is there any way in which I can run a class without the main method?


NO. JVM requires main() method to run a class. In other way you can do ...like,if you have a class called Test class having main method, then you can create a thread object of the class that you want to run not having main() method...then call start() and it's run method will be executed..(provided your class should implement Runnable interface).
17 years ago

<notes>
<note date="23/09/07">
<to>jane</to>
<from>Anne</from>
</note>
</notes>

in the above note element I've date as an attribute.
But date can also be defined as a child element like <to>and <from> of note

What difference does it make having date declared as a child element or as an attribute of note element.


Then date would be an attribute for note and would be child for notes
It can be possible if you define your DTD/Schema accordingly...

This is just my hello world program.. I thought i can just place it in webapp->class.. Is it compulsory to make it placed inside a package???



be sure that you have servlet class file(make a jar file) in lib folder in WEB-INF ..
17 years ago

Can an interface be declared as abstract??



Interface is always abstract...
any method you declare there in intrface...you have to implement or make your class abstract...
Anyway...you can make as...
public abstract interface <interface_name>...
17 years ago


code:

Class CardBoard{
Short story=5;
CardBoard go(CardBoard cd){
cd=null;
return cd;}
public static void min(String ags[]){
CardBoard c1= new CardBoard();
CardBoard c2=new CardBoard():
CardBoard c3= c1.go(c2);
c1=null;
}
}



There would be only one object for Garbage collection.
While you pass c2(copy of reference)in method go() and made it null, still it's original object's reference is maintained by c2,see before line CardBoard c3= c1.go(c2);

and finally you made c1 as null so Object referred by c1 becomes eligible for garbage collection....

package pack1;public class TestSupSub{public static void main(String []args){SuperClass s= new SubClass();s.disp();}};



Hmmmm...I got your point...
ok..In your Test class while you are calling s.disp();, it means...your compiler is dreaming that you are calling SuperClass's method (it is called runtime polymorphism), So it does not warn you...but actually at runtime you will get subclass's method call...

Now if you do like new SubClass().disp() your compiler will warn you that it is not visible to it. as you know that protected method it not visible to other classes unless extended....
17 years ago
What about -Dsun.net.inetaddr.ttl parameter?
Could anyone please look into it?

Thanks,
Biswajit.
18 years ago
Hi All,

The following jdk parameter will expire the IP cache in JDK 1.4.
-Dnetworkaddress.cache.ttl=60

Could you please let me know,whether this option will work in JDK 1.3 too.
or there are any other option in JDK 1.3 to expire IP cache?

Regards,
Biswajit Paria
18 years ago
In more Specific, Why out of 'ss' in test()method is different for two cases?
Thnx.
18 years ago
Hi All,

Here is the following program, I got strange output for instance variable for the following program.

****************************
abstract class A{
public A(){
init();
}
public abstract void init();
}

public class Test extends A{

//get output for two cases, Why it is different?
//public String ss = "blank";//First Case
public String ss ;//Second case

public void init(){
System.out.println("init-ss-1: "+ss);
ss ="init";
System.out.println("init-ss-2: "+ss);
}

public void test(){

System.out.println("ss****:"+ss);
}

public static void main(String[] args) {
new Test().test();
}
}


Could you please explain, why the output is different in two cases?

Thanks,
Biswait.
18 years ago