On Sat, Oct 23, 2010 at 6:29 PM, Muhammad Mohsen <m.gelb...@gmail.com>wrote:
> > 2.Modules > I simply created a class, suffixed it "Module" so it ended up being named > "DataAccessModule". > I added a > public static void bind(ServiceBinder binder) { > binder.bind(UserDAO.class, UserDAOImpl.class); > } > method just like my AppModule which works perfectly find. When I used the > "DataAccessModule" to bind classes. As I @Inject them. They couldn't be > resolved and I get a "Class not found exception". This module is under the > services package right beside "AppModule.java" > So why aren't my services resolved ? I think you want to put: binder.bind(UserDAO.class, UserDAOImpl.class); in your AppModule file instead of creating a new DataAccessModule for it. You can bind a bunch of different things just by adding them to the list. If you take a look at your web.xml file you'll see there is a filter set to "app" and that is going to load the AppModule. If you are wanting it to be separate in order to create a drop in autoloading module, you need to check out the documents on creating autoloading modules. http://people.apache.org/~uli/tapestry-site/ioc-autoload.html If you want to have a separate module for DataAccess, you might be able to add it to the web.xml or possibly use the @SubModule annotation (see the section about IOC Autoloading). If you have an interface and its implementation that you want to load with the binder.bind command, I think you'd usually put them in the services package, but don't think it matters because you are going to explicitly tell Tapestry where to find them when you call bind in your AppModule file. Mark