views:

61

answers:

1

Hi everybody!

i have one eclipse project(A) with a small spring application and another one with a web application using GWT (B).

project A exports its ressources via build path / order and export. project B imports the ressources via build path / projects.

eclipse adds the files to the build path and to the system class path of the run-targets but this results in strange spring-errors because the files are not being loaded with the web-classloader.

for correct behaviour on the webserver-targets the exported ressources (.class, META-INF/spring/*) of project A have to be copied in project B/war/WEB-INF/classes.

how can i accomplish this task using eclipse?

thanks a lot for your help!

+1  A: 

your last assertion is wrong, your exported resources can (and should) be copied to B/war/WEB-INF/lib as a jar file. You can achieve this by adding projectA as a J2EE Module Dependency of projectB. This insructs Eclipse+WTP (you are using WTP, right?) to deploy projectA as a jar to the web container that you are using (tomcat?).

This is an unfortunate duplication of classpath information in eclipse projects. The fact that you exported the build path resources of projectA is sufficient for regular java projects, and also for static compilation, but not for runtime of WTP web projects.

alt text

Yoni