URGENT :Error while Running java application in crowntab(linux)

Hi,

I have java application on linux machine.

i created a jar file of my application with all dependencies like oracle drivers etc.

when i run my jar file from any path using

java -jar appjar.jar

its works fine for this or if i add it in .sh file with same comand and run that sh file it also works file.

Then i try to add it in crowntab entry. and schedule crown.

It gives me error

[error]

Exception in thread "main" java.lang.NoClassDefFoundError: oracle.jdbc.driver.OracleDriver

at java.lang.Class.initializeClass (libgcj.so.7)

at java.lang.Class.forName (libgcj.so.7)

at java.lang.Class.forName (libgcj.so.7)

at com.soft.mediator.db.DBConnector.init (DBConnector.java:88)

at com.soft.mediator.db.DBConnector.<init> (DBConnector.java:36)

at com.soft.mediator.XenerMediator.main (XenerMediator.java:113)

Caused by: java.lang.ClassNotFoundException: oracle.security.pki.OracleSecretStore not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/abc.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}

at java.net.URLClassLoader.findClass (libgcj.so.7)

at java.lang.ClassLoader.loadClass (libgcj.so.7)

at java.lang.ClassLoader.loadClass (libgcj.so.7)

at java.lang.Class.forName (libgcj.so.7)

at java.lang.Class.initializeClass (libgcj.so.7)

...5 more

[/error]

i tried to add all path in jar file, class path even on comand line but it gives me same error,

even i add oracle jar in my path seprately it gives me same error

any idea what is reason ?

[1646 byte] By [Akhnukha] at [2007-11-27 3:44:33]
# 1

When you do "java -jar abc.jar" the only classpath is the abc.jar and whatever Class-Path entries are in its manifest. Fooling around with -cp options and CLASSPATH environment variables has no effect.

I suppose you didn't create a manifest with an explicit Class-Path entry referring to the jar file containing the Oracle driver. You should do that. Read the jar tutorial for more information.

DrClapa at 2007-7-12 8:48:13 > top of Java-index,Java Essentials,Java Programming...
# 2

Thanks for reply

My problem solved problem was JAVA_HOME.

Actually on normal shell Jdk version was 1.5, but when it runs my crowntab command linux used jdk 1.4, although JAVA_HOME in etc profile was 1.5 , as it was getting jdk 1.4 so while loading drivers it also includes 1.4 libaries.

This cause exception in running my crontab entry so i set java_home as well in my shell file and add that shell script in crontab entry

Akhnukha at 2007-7-12 8:48:13 > top of Java-index,Java Essentials,Java Programming...