You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Neo Anderson <ja...@yahoo.co.uk> on 2009/08/03 18:03:51 UTC

Tapestry 5 IoC binding interface with impl problem

In the AppModule I add the following information to bind IAccount with AccountDAO class.

		ApplicationStateCreator<IAccount> account = 
			new ApplicationStateCreator<IAccount>(){
				public IAccount create() {
					return new AccountDAO();
 				}
			};

                configuration.add(IAccount.class, new ApplicationStateContribution("session", account));

And in the service package, I create a class e.g. RdbmsSecurity.java in which I validate user information (e.g. id/ password). 

	@Inject
	private IAccount accountDAO;

        public Boolean validate(String account, String password){
             ...
             ...
             User user = accountDAO.findUserByAccount(new User("-1", account, "", password));

        }

The problem is that it looks like accountDAO is always null. It seems to me that the IAccount does not successfully bind with AccountDAO class; however, I do not see any error indicating such problem. 

Am I missing any setting?

Thanks for help.


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 03 Aug 2009 16:35:33 -0300, neo anderson  
<ja...@yahoo.co.uk> escreveu:

> Thanks for reply.

:)

> I am a bit confused now. Would you please give a bit more explain on how  
> to add make AccountDAO a service?

Using binder.bind() in some modules's bind(ServiceBinder) method or  
creating a buildXXX() method in some module class.

> in AuthService.java
>
> 	@Inject
> 	private IAccount accountDAO;

Shouldn't be above link be private IAccountDAO instead of private  
IAccount? Then IAccountDAO should be a service, having AccountDAO as its  
implementation.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by Neo Anderson <ja...@yahoo.co.uk>.
I do not inject RdbmsLogin.java because this is JAAS login implementation. The way I invoke RdbmsLogin is as follow:

in AuthService.java

public class AuthService implements IAuthService{

...
	public User authenticate(User user){
	...
		RdbmsCallbackHandler handler = 
			new RdbmsCallbackHandler(account, password);
		try{
			LoginContext context = 
				new LoginContext(JAAS_REALM, handler);
			context.login();
		}catch(LoginException le){
			le.printStackTrace();
		}
	...
	}
...
}

in RdbmsLogin.java 
...
import javax.security.auth.spi.LoginModule;
...
public class RdbmsLogin implements LoginModule{
	@Inject
	private IAccount accountDAO;
	...
	public boolean login() throws LoginException {	
		...
		flag = validate(account, password);
		...
	}
	private boolean validate(String account, String password){
		...
		User user = accountDAO.findUserByAccount(...);
		...
	}
}

Is there any appropriate place that I can inject RdbmsLogin? I am confused because the way to invoke JAAS login  is done by LoginContext.login(); so as I understand it won't use RdbmsLogin directly. Or would you please to tell me/ or give me a hint which place would be appropriate to inject RdbmsLogin?

Many thank you for your help. 


--- On Mon, 3/8/09, Thiago H. de Paula Figueiredo <th...@gmail.com> wrote:

> From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> Subject: Re: Tapestry 5 IoC binding interface with impl problem
> To: "Tapestry users" <us...@tapestry.apache.org>
> Date: Monday, 3 August, 2009, 11:04 PM
> Em Mon, 03 Aug 2009 19:57:12 -0300,
> neo anderson <ja...@yahoo.co.uk>
> escreveu:
> 
> > Sorry I do not understand very well. What class I need
> to bind with
> > RdbmsLogin?
> 
> Shouldn't you inject LoginModule instead of RdbmsLogin?
> 
> --Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 03 Aug 2009 19:57:12 -0300, neo anderson  
<ja...@yahoo.co.uk> escreveu:

> Sorry I do not understand very well. What class I need to bind with
> RdbmsLogin?

Shouldn't you inject LoginModule instead of RdbmsLogin?

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by neo anderson <ja...@yahoo.co.uk>.

Sorry I do not understand very well. What class I need to bind with
RdbmsLogin? 

RdbmsLogin is an impl class that implements JAAS LoginModule. So there also
have other classes needed, including CallbackHandler, Principal, etc. 

Should I bind RdbmsLogin with LoginModule? I try to bind them together, e.g. 

public class AppModule {
	public static void bind(ServiceBinder binder) {
		binder.bind(IAuthService.class, AuthService.class);
		binder.bind(IAccount.class, Account.class);
		binder.bind(LoginModule.class, RdbmsLogin.class);
	}
	...
}

but the log shows that accountDAO is null (as below). 

java.lang.NullPointerException
	at org.example.services.security.RdbmsLogin.validate(RdbmsLogin.java:133)

If I do not bind them together, the accountDAO is still null and throws
NullPointerException too.

Or what is the right way if I need to bind RdbmsLogin as well?

Many thanks.


Juan E. Maya wrote:
> 
> are u binding RdbmsLogin.java too?
> 
> On Mon, Aug 3, 2009 at 11:20 PM, Neo
> Anderson<ja...@yahoo.co.uk> wrote:
>>
>> Yes I do see the log (catalina.out) shows
>>
>>                                 IAccount: DEFINED
>>                              IAuthService: DEFINED
>>
>> And what makes me confused is that the log also shows that the IAccount
>> is created when invoking AuthService.java
>>
>> [DEBUG] AppModule.IAccount Creating service 'IAccount'.
>> [AuthService.java] accountDAO is null?<Proxy for
>> Account(org.example.domain.IAccount)> //printed by System.out.println
>>
>> But when it comes to execute RdbmsLogin.java, the '@private IAccount
>> accountDAO' in RdbmsLogin becomes null because I use System.out.println()
>> to print the object accountDAO (accountDAO.findUserByAccount(new
>> User("-1", account, "", password));) and the result is as follow:
>>
>> [RdbmsLogin.java] accountDAO is null? null
>>
>> The flow of execution is
>>
>> Login.java -> IAuthService.java/ AuthService.java -> RdbmsLogin.java
>>
>> in AuthService and Rdbmslogin both contain '@Inject private IAccount
>> accountDAO' annotation; but the accountDAO in AuthService is not null and
>> I can execute the function e.g. findUserByAccount without a problem.
>> Unfortunately, when it execute accountDAO in RdbmsLogin, then the
>> accountDAO is null. (This is just for comparison so I put two Inject
>> annotation in AuthService and RdbmsLogin classes)
>>
>> Also, if I remove IAuthService/ AuthService, directly calling
>> RdbmsLogin.java from Login.java shows the accountDAO ('@Inject private
>> IAccount accountDAO') in RdbmsLogin.java is still null.  (This execution
>> flow should be Login.java -> RdbmsLogin.java )
>>
>> The AppModule.java contains the binding clauses
>>
>> public class AppModule {
>>        public static void bind(ServiceBinder binder) {
>>                binder.bind(IAuthService.class, AuthService.class);
>>                binder.bind(IAccount.class, Account.class);
>>        }
>> ...
>> }
>>
>> I think I may do something wrong, but I completely am not aware of it. Is
>> there anything I miss or misconfigure?
>>
>> Thanks in advice.
>>
>> --- On Mon, 3/8/09, Juan E. Maya <ma...@gmail.com> wrote:
>>
>>> From: Juan E. Maya <ma...@gmail.com>
>>> Subject: Re: Tapestry 5 IoC binding interface with impl problem
>>> To: "Tapestry users" <us...@tapestry.apache.org>
>>> Date: Monday, 3 August, 2009, 7:44 PM
>>> Do u see the DAO being created when
>>> the application goes up? Tapestry
>>> does a very good job informing all the services that are
>>> configured.
>>> If it's not in the log then u r not binding the service.
>>>
>>> There r 2 ways to bind services in a module:
>>> public static void bind(ServiceBinder binder) {
>>>    binder.bind(Interface.class,
>>> Impl.class);
>>> }
>>>
>>> or
>>>  public static Interface buildServiceName()
>>>   {
>>>      return new InteraceImpl();
>>>   }
>>>
>>>
>>> I really didn't get what u were trying to do in the first
>>> email.
>>> ApplicationStateCreator<IAccount> account =
>>>
>>>        new
>>> ApplicationStateCreator<IAccount>(){
>>>
>>>
>>>    public IAccount create() {
>>>
>>>
>>>        return new AccountDAO();
>>>
>>>
>>>    }
>>>
>>>        };
>>>
>>>
>>>    configuration.add(IAccount.class, new
>>> ApplicationStateContribution("session", account));
>>>
>>>
>>> in what method of ur App module is that code?
>>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tapestry-5-IoC-binding-interface-with-impl-problem-tp24793396p24799569.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by "Juan E. Maya" <ma...@gmail.com>.
are u binding RdbmsLogin.java too?

On Mon, Aug 3, 2009 at 11:20 PM, Neo
Anderson<ja...@yahoo.co.uk> wrote:
>
> Yes I do see the log (catalina.out) shows
>
>                                 IAccount: DEFINED
>                              IAuthService: DEFINED
>
> And what makes me confused is that the log also shows that the IAccount is created when invoking AuthService.java
>
> [DEBUG] AppModule.IAccount Creating service 'IAccount'.
> [AuthService.java] accountDAO is null?<Proxy for Account(org.example.domain.IAccount)> //printed by System.out.println
>
> But when it comes to execute RdbmsLogin.java, the '@private IAccount accountDAO' in RdbmsLogin becomes null because I use System.out.println() to print the object accountDAO (accountDAO.findUserByAccount(new User("-1", account, "", password));) and the result is as follow:
>
> [RdbmsLogin.java] accountDAO is null? null
>
> The flow of execution is
>
> Login.java -> IAuthService.java/ AuthService.java -> RdbmsLogin.java
>
> in AuthService and Rdbmslogin both contain '@Inject private IAccount accountDAO' annotation; but the accountDAO in AuthService is not null and I can execute the function e.g. findUserByAccount without a problem. Unfortunately, when it execute accountDAO in RdbmsLogin, then the accountDAO is null. (This is just for comparison so I put two Inject annotation in AuthService and RdbmsLogin classes)
>
> Also, if I remove IAuthService/ AuthService, directly calling RdbmsLogin.java from Login.java shows the accountDAO ('@Inject private IAccount accountDAO') in RdbmsLogin.java is still null.  (This execution flow should be Login.java -> RdbmsLogin.java )
>
> The AppModule.java contains the binding clauses
>
> public class AppModule {
>        public static void bind(ServiceBinder binder) {
>                binder.bind(IAuthService.class, AuthService.class);
>                binder.bind(IAccount.class, Account.class);
>        }
> ...
> }
>
> I think I may do something wrong, but I completely am not aware of it. Is there anything I miss or misconfigure?
>
> Thanks in advice.
>
> --- On Mon, 3/8/09, Juan E. Maya <ma...@gmail.com> wrote:
>
>> From: Juan E. Maya <ma...@gmail.com>
>> Subject: Re: Tapestry 5 IoC binding interface with impl problem
>> To: "Tapestry users" <us...@tapestry.apache.org>
>> Date: Monday, 3 August, 2009, 7:44 PM
>> Do u see the DAO being created when
>> the application goes up? Tapestry
>> does a very good job informing all the services that are
>> configured.
>> If it's not in the log then u r not binding the service.
>>
>> There r 2 ways to bind services in a module:
>> public static void bind(ServiceBinder binder) {
>>    binder.bind(Interface.class,
>> Impl.class);
>> }
>>
>> or
>>  public static Interface buildServiceName()
>>   {
>>      return new InteraceImpl();
>>   }
>>
>>
>> I really didn't get what u were trying to do in the first
>> email.
>> ApplicationStateCreator<IAccount> account =
>>
>>        new
>> ApplicationStateCreator<IAccount>(){
>>
>>
>>    public IAccount create() {
>>
>>
>>        return new AccountDAO();
>>
>>
>>    }
>>
>>        };
>>
>>
>>    configuration.add(IAccount.class, new
>> ApplicationStateContribution("session", account));
>>
>>
>> in what method of ur App module is that code?
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by Neo Anderson <ja...@yahoo.co.uk>.
Yes I do see the log (catalina.out) shows 

                                 IAccount: DEFINED
                              IAuthService: DEFINED

And what makes me confused is that the log also shows that the IAccount is created when invoking AuthService.java

[DEBUG] AppModule.IAccount Creating service 'IAccount'.
[AuthService.java] accountDAO is null?<Proxy for Account(org.example.domain.IAccount)> //printed by System.out.println

But when it comes to execute RdbmsLogin.java, the '@private IAccount accountDAO' in RdbmsLogin becomes null because I use System.out.println() to print the object accountDAO (accountDAO.findUserByAccount(new User("-1", account, "", password));) and the result is as follow:

[RdbmsLogin.java] accountDAO is null? null

The flow of execution is

Login.java -> IAuthService.java/ AuthService.java -> RdbmsLogin.java 

in AuthService and Rdbmslogin both contain '@Inject private IAccount accountDAO' annotation; but the accountDAO in AuthService is not null and I can execute the function e.g. findUserByAccount without a problem. Unfortunately, when it execute accountDAO in RdbmsLogin, then the accountDAO is null. (This is just for comparison so I put two Inject annotation in AuthService and RdbmsLogin classes)

Also, if I remove IAuthService/ AuthService, directly calling RdbmsLogin.java from Login.java shows the accountDAO ('@Inject private IAccount accountDAO') in RdbmsLogin.java is still null.  (This execution flow should be Login.java -> RdbmsLogin.java )

The AppModule.java contains the binding clauses 

public class AppModule {
	public static void bind(ServiceBinder binder) {
		binder.bind(IAuthService.class, AuthService.class);
		binder.bind(IAccount.class, Account.class);
	}
...
}    

I think I may do something wrong, but I completely am not aware of it. Is there anything I miss or misconfigure?

Thanks in advice.

--- On Mon, 3/8/09, Juan E. Maya <ma...@gmail.com> wrote:

> From: Juan E. Maya <ma...@gmail.com>
> Subject: Re: Tapestry 5 IoC binding interface with impl problem
> To: "Tapestry users" <us...@tapestry.apache.org>
> Date: Monday, 3 August, 2009, 7:44 PM
> Do u see the DAO being created when
> the application goes up? Tapestry
> does a very good job informing all the services that are
> configured.
> If it's not in the log then u r not binding the service.
> 
> There r 2 ways to bind services in a module:
> public static void bind(ServiceBinder binder) {
>    binder.bind(Interface.class,
> Impl.class);
> }
> 
> or
>  public static Interface buildServiceName()
>   {
>      return new InteraceImpl();
>   }
> 
> 
> I really didn't get what u were trying to do in the first
> email.
> ApplicationStateCreator<IAccount> account =
>                
>        new
> ApplicationStateCreator<IAccount>(){
>                
>            
>    public IAccount create() {
>                
>                
>        return new AccountDAO();
>                
>            
>    }
>                
>        };
> 
>            
>    configuration.add(IAccount.class, new
> ApplicationStateContribution("session", account));
> 
> 
> in what method of ur App module is that code?
> 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by "Juan E. Maya" <ma...@gmail.com>.
Do u see the DAO being created when the application goes up? Tapestry
does a very good job informing all the services that are configured.
If it's not in the log then u r not binding the service.

There r 2 ways to bind services in a module:
public static void bind(ServiceBinder binder) {
   binder.bind(Interface.class, Impl.class);
}

or
 public static Interface buildServiceName()
  {
     return new InteraceImpl();
  }


I really didn't get what u were trying to do in the first email.
ApplicationStateCreator<IAccount> account =
                       new ApplicationStateCreator<IAccount>(){
                               public IAccount create() {
                                       return new AccountDAO();
                               }
                       };

               configuration.add(IAccount.class, new
ApplicationStateContribution("session", account));


in what method of ur App module is that code?

On Mon, Aug 3, 2009 at 9:35 PM, neo
anderson<ja...@yahoo.co.uk> wrote:
>
> Thanks for reply.
>
> I am a bit confused now. Would you please give a bit more explain on how to
> add make AccountDAO a service?
>
> Why I am confused is because I discover when I switch back using the old
> testing code, it works correctly. The way how I obtain the AccountDAO is
>
> in Login.java
>
>        @Inject
>        private IAuthService auth;
>
>        Object onSubmitFromLogin(){
>               ...
>                user = auth.authenticate(new User("-1", this.account, "", this.password));
>                ...
>        }
>
> in AppModule.java
>
>        public static void bind(ServiceBinder binder) {
>                binder.bind(IAuthService.class, AuthService.class);
>                binder.bind(IAccount.class, Account.class);
>        }
>
> in AuthService.java
>
>        @Inject
>        private IAccount accountDAO;
>
>        public User authenticate(User user){
>                ...
>                User u = accountDAO.findUserByAccount(account);
>                ...
>        }
>
> Then when accessing the login page from web, everything works fine (the
> accountDAO is not null).
>
> But when switching using one that integrates JAAS then the accountDAO
> becomes null. For instance, in AuthService.java the code switch to use
> RdbmsLogin.java where injecting accountDAO (@Inject private IAccountDAO)
>
> in AutheService.java
>
> public User authenticate(User user){
> ...
>                RdbmsCallbackHandler handler =
>                        new RdbmsCallbackHandler(account, password);
>                try{
>                        LoginContext context =
>                                new LoginContext(JAAS_REALM, handler);
>                        context.login();
>                }catch(LoginException le){
>                        le.printStackTrace();
>                }
> ...
> }
>
> in RdbmsLogin.java
>
> public class RdbmsLogin implements LoginModule{
>        public boolean login() throws LoginException {
>                ...
>                flag = validate(account, password);
>                ...
>        }
>        private boolean validate(String account, String password){
>                ...
>                // the accountDAO is always null here, but the accountDAO injected inside
> the AuthService is not null.
>                User user = accountDAO.findUserByAccount(new User("-1", account, "",
> password));
>                ...
>        }
>
> Or if I simply replace AuthService with RdbmsLogin, the AccountDAO injected
> inside RdbmsLogin is still null.
>
> What additional setting I need to configure?
>
> Thanks for patiently answering my questions.
>
> I appreciate it.
>
>
> Thiago H. de Paula Figueiredo wrote:
>>
>> Em Mon, 03 Aug 2009 13:03:51 -0300, Neo Anderson
>> <ja...@yahoo.co.uk> escreveu:
>>
>>> The problem is that it looks like accountDAO is always null. It seems to
>>> me that the IAccount does not successfully bind with AccountDAO class;
>>
>> It wasn't, unless you add make AccountDAO a service. Just instantiating it
>> and using as part of the configuration of another service doesn't make it
>> a service.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Tapestry-5-IoC-binding-interface-with-impl-problem-tp24793396p24796853.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by neo anderson <ja...@yahoo.co.uk>.
Thanks for reply. 

I am a bit confused now. Would you please give a bit more explain on how to 
add make AccountDAO a service?

Why I am confused is because I discover when I switch back using the old
testing code, it works correctly. The way how I obtain the AccountDAO is 

in Login.java 

	@Inject
	private IAuthService auth;

	Object onSubmitFromLogin(){
               ...  
		user = auth.authenticate(new User("-1", this.account, "", this.password));
                ...
        }

in AppModule.java

	public static void bind(ServiceBinder binder) {
		binder.bind(IAuthService.class, AuthService.class);
		binder.bind(IAccount.class, Account.class);
	}

in AuthService.java 

	@Inject 
	private IAccount accountDAO;

	public User authenticate(User user){
                ...
		User u = accountDAO.findUserByAccount(account);
                ...
        }

Then when accessing the login page from web, everything works fine (the
accountDAO is not null).

But when switching using one that integrates JAAS then the accountDAO
becomes null. For instance, in AuthService.java the code switch to use
RdbmsLogin.java where injecting accountDAO (@Inject private IAccountDAO) 

in AutheService.java 

public User authenticate(User user){
...
		RdbmsCallbackHandler handler = 
			new RdbmsCallbackHandler(account, password);
		try{
			LoginContext context = 
				new LoginContext(JAAS_REALM, handler);
			context.login();
		}catch(LoginException le){
			le.printStackTrace();
		}
...
}

in RdbmsLogin.java

public class RdbmsLogin implements LoginModule{
	public boolean login() throws LoginException {	
		... 
		flag = validate(account, password);
		...
	}
	private boolean validate(String account, String password){
		...
		// the accountDAO is always null here, but the accountDAO injected inside
the AuthService is not null. 
		User user = accountDAO.findUserByAccount(new User("-1", account, "",
password));
		...
	}

Or if I simply replace AuthService with RdbmsLogin, the AccountDAO injected
inside RdbmsLogin is still null. 

What additional setting I need to configure?

Thanks for patiently answering my questions. 

I appreciate it.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Mon, 03 Aug 2009 13:03:51 -0300, Neo Anderson  
> <ja...@yahoo.co.uk> escreveu:
> 
>> The problem is that it looks like accountDAO is always null. It seems to  
>> me that the IAccount does not successfully bind with AccountDAO class;
> 
> It wasn't, unless you add make AccountDAO a service. Just instantiating it  
> and using as part of the configuration of another service doesn't make it  
> a service.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tapestry-5-IoC-binding-interface-with-impl-problem-tp24793396p24796853.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5 IoC binding interface with impl problem

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 03 Aug 2009 13:03:51 -0300, Neo Anderson  
<ja...@yahoo.co.uk> escreveu:

> The problem is that it looks like accountDAO is always null. It seems to  
> me that the IAccount does not successfully bind with AccountDAO class;

It wasn't, unless you add make AccountDAO a service. Just instantiating it  
and using as part of the configuration of another service doesn't make it  
a service.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org