tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject SOLUTION : Réf. : Réf. : Re: Réf. : Re: ClassNotFoundException in thread
Date Thu, 02 Jun 2005 16:42:00 GMT

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" <>
                      02/06/2005 17:02         cc :                                      
                                               Objet :  Réf. : Re: Réf. : Re: ClassNotFoundException
in thread(Document link: Cyril    

Thanks for your answer but :

> is there a static initialisation code in
> ? or static properties whose values are taken from other methods?

> If anything in the static initialisation of class

> throws an Exception, the class wil be considered as non-existent. (which
> 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

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:
For additional commands, e-mail:

View raw message