facebook

[Closed] Exporting WAR with Dependent JAR

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #244718 Reply

    jackcollins
    Member

    I’m running into a problem deploying a WAR file the includes dependent project(s) in JAR files. The JAR files appear in the WEB-INF/lib directory but don’t seem to be on the class path. When starting the webapp under tomcat 5.5 I get the following error:

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘SessionFactory’ defined in URL [file:/usr/java/apache-tomcat-5.5.12/webapps/siteAdmin/WEB-INF/classes/siteAdmin-data.xml]: Initialization of bean failed; nested exception is java.io.FileNotFoundException: class path resource [com/company/catalog/model] cannot be resolved to URL because it does not exist
    java.io.FileNotFoundException: class path resource [com/company/catalog/model] cannot be resolved to URL because it does not exist
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:180)…………..

    Any thoughts?

    #244721

    Riyad Kalla
    Member

    I take it that com.company.catalog.model package is from the JAR file deployed in your WEB-INF/lib directory?

    #244722

    jackcollins
    Member

    Yes. It is packaged into a JAR called catalog.jar in WEB-INF/lib

    #244725

    Riyad Kalla
    Member

    Jack,
    If you open the JAR and see a root directory of “com” then the JAR is correctly packaged and this is most likely a class loader issue. Have you tried, in some normal class, accessing a calss from within the JAR and printing it to the console just to see if it could be found?

    e.g.: System.out.println(SomeClassFromModelPackage.class);

    #245396

    jackcollins
    Member

    It turned out to be Spring configuration issue. When configuring org.springframework.orm.hibernate3.LocalSessionFactoryBean I needed to provide “mappingJarLocations” rather than “mappingDirectoryLocations”

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: [Closed] Exporting WAR with Dependent JAR

You must be logged in to post in the forum log in