Hi there,
 I am new to appfuse, spring, maven and aspect oriented programming. I am
trying to do the following.
I have a simple domain object called Project. I'd like to inject a
hierarchyService (spring bean)  into the object.
However, when I run the app, hierarchyService is null. I am attaching
pom.xml and applicationContext.xml 


Followed the following steps:

1) Add @Configurable to the java class Project.java
@Configurable
public class Project {
      private HierarchyService hierarchyService;

     public void setHierarchyService(HierarchyService service) {
       this.hierarchyService = service;
    }
}
    Provided a setter for hierarchyService which is a spring bean.

In my controller class, 
 Project p = new Project("Project 1");
When I inspect p in the debugger, hierarchyService is null.

2) Being new to maven and not fully understanding it, did the following
       Added a aspectj-maven-plugin in defaultGoal - package
     Added dependency for spring-aspects and aspectjrt
   Also added the aspectj-maven-plugin under integration-test.

3) Not sure if this was needed or not, nevertheless downloaded aspectj and
installed it in c:\aspectj
   Added c:\aspectj\bin to path. Checked ajc is there.

4) This is how I am running the app.

When I run mvn jetty:run-war
I see the following output

[INFO] [aspectj:compile {execution:default}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]


Please let me know what steps am I missing.



http://www.nabble.com/file/8207/applicationContext-resources.xml
applicationContext-resources.xml 

http://www.nabble.com/file/8206/pom.xml pom.xml 
-- 
View this message in context: 
http://www.nabble.com/Having-trouble-getting-Dependency-Injection-to-work--%40Configurable---Newbie-Help-tf3689810s2369.html#a10315786
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to