Réf. : Re: ClassNotFoundException in thread
Everything was fin until I migrated. Now the jobs run OK but they fire a ClassNotFoundException as shwon : You double checked that com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure is there in the jar and is in the right folder ?. Restarted Tomcat ?. Also try with a fresh copy of the jar. Anto, the class is there, both in the jar or in the classes directory (when I removed the jar of course). The package is well spelled, and java at the command line returns me a no main function error when I try to run it from the WEB-INF dir. Tomcat was restarted (both the server and the webapp) many times during this. I guess the problem is elsewhere :) Cyril - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Réf. : Re: ClassNotFoundException in thread
is there a static initialisation code in com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure ? or static properties whose values are taken from other methods? If anything in the static initialisation of class com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure throws an Exception, the class wil be considered as non-existent. (which is quite normal, sometinh that could not be create does not exist) Le Jeudi 2 Juin 2005 15:58, [EMAIL PROTECTED] a écrit : Everything was fin until I migrated. Now the jobs run OK but they fire a ClassNotFoundException as shwon : You double checked that com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedur e is there in the jar and is in the right folder ?. Restarted Tomcat ?. Also try with a fresh copy of the jar. Anto, the class is there, both in the jar or in the classes directory (when I removed the jar of course). The package is well spelled, and java at the command line returns me a no main function error when I try to run it from the WEB-INF dir. Tomcat was restarted (both the server and the webapp) many times during this. I guess the problem is elsewhere :) Cyril - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Is there life after /sbin/halt -p? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Réf. : Re: Réf. : Re: ClassNotFoundException in thread
Thanks for your answer but : is there a static initialisation code in com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure ? or static properties whose values are taken from other methods? If anything in the static initialisation of class com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure throws an Exception, the class wil be considered as non-existent. (which is quite normal, sometinh that could not be create does not exist) In fact, there is one static property : private static Logger myLog = Logger.getLogger( CreateFileProcedure.class ); but, as you mentionned in another mail, the Log4j.jar is not in common. this jar is in WEB-INF/lib (i've double checked ... kindda paranoid no ? :-) The line that crashed is the following : Object jobClass = Class.forName( getClassName() ).newInstance(); where getClassName() returns com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure The problem is when the Thread try to find the class, because a test JSP can execute this without Exception. What are the possible changes between the two platforms mentioned regarding threads ? (RHAS4 with JDK 1.4.2 and HP-UX11 with JDK 1.4.1). Java has enough memory, and is started in -server mode with -Xmx512m option. Both config files (from both platform) are identical - except of course the directories. I've though also of a ISO-xxx encoding instead of UTF-8 that could cause the problem, but not... This code is a year old, and was working fine in the old platform - that crashed unfortunately... so I had to migrate. Copying the JAR seems not enough to work properly. Any other idea for me to explore ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SOLUTION : Réf. : Réf. : Re: Réf. : Re: ClassNotFoundException in thread
Yeepeh !!! I've found the solution : All I needed to do was changing the loading of the class by : Object jobClass = this.getClass().getClassLoader().loadClass( getClassName() ).newInstance(); //Object jobClass = Class.forName( getClassName() ).newInstance(); I guess the OS and the JVM behave differently from HP-UX to Linux, now the class is found in the Thread. I don't know why the previous code was working in the previous platform... If there is a better wy to write this, please tell me :) Hope this help others people... Cyril ZEKSER Pour : Tomcat Users List tomcat-user@jakarta.apache.org 02/06/2005 17:02 cc : Objet : Réf. : Re: Réf. : Re: ClassNotFoundException in thread(Document link: Cyril ZEKSER) Thanks for your answer but : is there a static initialisation code in com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure ? or static properties whose values are taken from other methods? If anything in the static initialisation of class com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure throws an Exception, the class wil be considered as non-existent. (which is quite normal, sometinh that could not be create does not exist) In fact, there is one static property : private static Logger myLog = Logger.getLogger( CreateFileProcedure.class ); but, as you mentionned in another mail, the Log4j.jar is not in common. this jar is in WEB-INF/lib (i've double checked ... kindda paranoid no ? :-) The line that crashed is the following : Object jobClass = Class.forName( getClassName() ).newInstance(); where getClassName() returns com.nexans.statistic.client.model.send.intranet.handler.CreateFileProcedure The problem is when the Thread try to find the class, because a test JSP can execute this without Exception. What are the possible changes between the two platforms mentioned regarding threads ? (RHAS4 with JDK 1.4.2 and HP-UX11 with JDK 1.4.1). Java has enough memory, and is started in -server mode with -Xmx512m option. Both config files (from both platform) are identical - except of course the directories. I've though also of a ISO-xxx encoding instead of UTF-8 that could cause the problem, but not... This code is a year old, and was working fine in the old platform - that crashed unfortunately... so I had to migrate. Copying the JAR seems not enough to work properly. Any other idea for me to explore ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]