classpath - java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.FileChannelImpl -


i working on application executes jython 2.5.3 script java 1.6.027. script open file using codecs library , looks this:

try:     codecs import open codecs_open except importerror:     print 'error', 'could not import.'  codecs_list = ['latin-1', 'utf-8', 'utf-16', '1250', '1252']  def open_file(filename, mode):     '''     doc     '''     encoding in codecs_list:         try:             f = codecs_open(filename, mode, encoding)             f.read()             f.close()             print 'info', "file %s supports encoding %s." % (filename.split("\\")[-1], encoding)             ...         except:             ... 

when execute script debugging in eclipse, works ok, when execute part of java application invokes script, error:

exception in thread "main" java.lang.noclassdeffounderror: not initialize class sun.nio.ch.filechannelimpl     @ java.io.randomaccessfile.getchannel(randomaccessfile.java:253)     @ org.python.core.io.fileio.fromrandomaccessfile(fileio.java:173)     @ org.python.core.io.fileio.<init>(fileio.java:79)     @ org.python.core.io.fileio.<init>(fileio.java:57)     @ org.python.core.pyfile.<init>(pyfile.java:135)     @ org.python.core.pytraceback.getline(pytraceback.java:65)     @ org.python.core.pytraceback.tracebackinfo(pytraceback.java:38)     @ org.python.core.pytraceback.dumpstack(pytraceback.java:109)     @ org.python.core.pytraceback.dumpstack(pytraceback.java:120)     @ org.python.core.py.displayexception(py.java:1080)     @ org.python.core.pysystemstate.excepthook(pysystemstate.java:1242)     @ org.python.core.pysystemstatefunctions.__call__(pysystemstate.java:1421)     @ org.python.core.py.printexception(py.java:1053)     @ org.python.core.py.printexception(py.java:1012)     @ org.python.util.jython.run(jython.java:264)     @ org.python.util.jython.main(jython.java:129) 

the java application able execute others similar jython scripts. have detected class sun.nio.ch.filechannelimpl in library rt.jar, inside /bin/common/ folder , included in classpath via jvm.cfg file:

...     #library path ./bin/common;... ... 

the same way other libraries work fine.

i have been stacked problem few days, appreciated. thank you

the problem has been resolved reinstalling java runtime environment, in case version jre-6u45


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -