简体   繁体   中英

Add shared project jars in websphere shared library

We can add project dependency jars (like spring jars, logging etc) in shared library, can we add shared project jars (like one that communicate with Database) in shared library?

Scenario:

I have these projects

  1. WebApp
  2. WebAppEAR
  3. CommonDB

I am using IBM Websphere server, hibernate, spring mvc

I added all spring, hibernate jars including CommonDB.jar in Websphere shared library. WebApp Application is running successfully with spring controllers but when my application try to hit DB it throws exception.

Caused by: java.lang.IllegalStateException: 

Actually WebApp is not loading <bean> DataSource. DataSource class is located in CommonDB project.

When I include CommonDB.jar in Deployment assembly of EAR WebApp runs successfully and fetches data from DB. I want to exclude CommonDB.jar from Deployment assembly and only want to add it in shared library.

Adding jars in shared library will work. Try figuring out which beans are not initialized and add them in Spring file to initialize. Also check other bean properties for dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM