Our web-app inside .esb archive and it uses shared libraries which are also loaded via another esb archive.
One of this libraries - is Spring, Hibernate.
We include our web-app using <esb-depends/>, but also firstly specify the service with shared libraries.
The problem that our web-app .esb service doesn't want to startup if we start JBoss: it complains that it cannot find Spring classes, for example, ContextLoaderListener, but if we hotly re-deploy it, it works nicely.
How to fix it? It seems to me that JBoss App doesn't load all necessary libs in such situation when we use <esb-depends/>.
All you have done is to specify a dependency from your second esb artifact on the webapp, you have not specified the dependency that your webapp has on the first esb artifact.
You need to configure the webapp with the appropriate dependency.