Found the reason for my problem.

You cannot put app resources in a JAR and put it in the webapp class path
(the class loaders will not find it there because the class loader in
command looks in the tomcat work directory for JARs).
The reason why the ZIP was not found is the ever present JVM problem with
%20 in URLs (as in "Tomcat%205" ;-). Will try URL decoding and if that does
not work rename the tomcat base dir to "Tomcat5.0".

So, thanks for trying to help me out anyway!

Cheers,

Oliver

----- Forwarded by Oliver Kuntze/PLZ/CSC on 18.08.2004 13:21 -----
                                                                                       
                                                 
                      Oliver Kuntze                                                    
                                                 
                      /PLZ/CSC                 To:      "Tomcat Users List" <[EMAIL 
PROTECTED]>                            
                                               cc:                                     
                                                 
                      18.08.2004 09:17         Subject: Re: Class loader looks in 
Tomcat work directory and not in webapp directory for 
                                               resources(Document link: Oliver Kuntze) 
                                                 
                                                                                       
                                                 



Hi QM,

thanks a lot for the prompt answer!

Unfortunately I have to provide some application resources in a JAR.

I am using hibernate in my persistence layer. I generate my persistent
classes and their O/R mappings directly from the database and deploy that
stuff to my app. If you don't want to specify all hibernate mappings that
hibernate should use one by one you have to provide these mappings in a JAR
and read it into hibernate. In that way I don't have to touch any classes
in my persistence layer. I just tell hibernate "Use whatever mapping you
find in this JAR.". The only thing I have to do when implementing the
persistence layer of a new app is then call the middlegen hibernate plugin
and generate the app specific bos and mappings. The rest is implemented in
framework classes that don't have to be changed.

I tried to rename the JAR to a ZIP but that does not get accepted and an
exception is thrown.

Do you have any ideas how to solve this problem?

Desperately,

Oliver



                                                                                       
                                                 
                      QM <qm300                                                        
                                                 
                      @brandxdev.net>          To:      Tomcat Users List <[EMAIL 
PROTECTED]>                              
                                               cc:                                     
                                                 
                      17.08.2004 22:28         Subject: Re: Class loader looks in 
Tomcat work directory and not in webapp directory for 
                      Please respond           resources                               
                                                 
                      to "Tomcat Users                                                 
                                                 
                      List"                                                            
                                                 
                                                                                       
                                                 
                                                                                       
                                                 




On Tue, Aug 17, 2004 at 08:43:54PM +0200, Oliver Kuntze wrote:
: For  the second resource lookup (the JAR) the class loader searches in
: "Tomcat 5.0\work\Catalina\localhost\rad_webmodule\loader " (Tomcat's work
: directory) and not in the webapp classpath under "Tomcat 5.0
: \webapps\rad_webmodule\WEB-INF\classes" (or in the WEB-INF/lib) where the
: JAR is located. Why?

That just seems to be where Tomcat5 deploys JARs from WAR files...
probably for easy access.

Is there any reason you're trying to manipulate JARs directly within
your app?  If you need to get to a set of files, why not place them
under a directory structure in the classpath?

-QM

--

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to