I am very new to Spring but so far I have been really impressed. To get my feet wet I wanted to replace the EJB layer of one of my Struts based web applications with Spring and Hibernate. I created new java beans to represent my old entity beans, DAO beans to implement my finders and some new business java beans to represent my old session beans. This stuff works great when I use just a standard Java application to create the context. My problem is with my web app. While the Spring context is initializing it can't find any of my DAO and buisiness logic beans. These beans are in seperate jar files from my web teir. To make jars like this accessible to a web app I usually place them in the top directory of an ear file allong with the war file for the web app.
Unfortunatly by doing this the context can't find the classes when it is instantiating itself. Of course this sounded like a classloader problem so to test this I droped my DAO and business jars into the WEB-INF/lib dir of my project. Of course everything worked when I did this.
Unfortunatly this is not a solution for me. WSAD is very restrictive in the way it likes to build and package projects. For this to work I would have to be exporting my DAO jars from WASD and importing them into the WEB-INF/lib dir of my web project for every change I made. I don't mind placing third pary jars their but I don't like to place my own jars that are generated from othe projects in my workspace. The way WSAD wants you to do this is to use the project utility aproach in the EAR file. If I do it this way WSAD will automate the whole process.
So... Anyone else out there using WSAD and Websphere server have this working? I'm not too up on classloaders but I think if there is someway I can get Spring to use the same class loader as the Websphere server I should be fine.
Oh. and to get the whole context up and going I am using the Struts Plugin provided in the Spring jar.
Thanks


Reply With Quote