ClassNotFound error

Hi All,

I am executing this code

logCat.debug("before getting the channel");

FileChannel fCh=new RandomAccessFile(lockFile,"rw").getChannel();

logCat.debug("before trying the lock");

but second line after the first debug statement is giving me java.lang.noSuchMethoderror error.

the first debug statement is being printed

i am using j2sdk 1.4.2_09 in my server.

please help

[538 byte] By [java_jamboreea] at [2007-11-27 4:06:39]
# 1
try:(new RandomAccessFile(lockFile, "rw")).getChannel();
calvino_inda at 2007-7-12 9:11:48 > top of Java-index,Java Essentials,Java Programming...
# 2
sorry Calvino it did not work...
java_jamboreea at 2007-7-12 9:11:48 > top of Java-index,Java Essentials,Java Programming...
# 3
the same code is working with the other instacnes of my server....but when i am executing this from my other instance...this is not working.......i think must be some problem with internal file locking mechanism
java_jamboreea at 2007-7-12 9:11:48 > top of Java-index,Java Essentials,Java Programming...
# 4

Hi,

The code you have pasted.. is working fine with me.. with jdk1.4

I tried running this program for a test.

/***************************************************************/

import java.io.*;

import java.nio.channels.*;

public class RandomTest

{

public static void main(String[] args) throws Exception

{

File lockFile = new File("Test.java");

System.out.println("Before");

FileChannel fCh= new RandomAccessFile(lockFile, "rw").getChannel();

System.out.println("After");

}

}

/***************************************************************/

Try compiling this code and run.

It is perfectly working with me.

chriscsita at 2007-7-12 9:11:48 > top of Java-index,Java Essentials,Java Programming...