tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyril.ZEK...@nexans.com
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" <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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message