0

I have a class named "NodeUtil" and that class have a three services injected in the bootstrap phase but once i trying to Log the service.toString() the value that printed is proxy$.toString() .

I'm trying to initialize the services in the NodeUtil bean rather than initialize them using

Repository.getServiceRegistry(FacesContext ...).getSearchService()

I use the same thing in the file action-services-context.xml.

  • I create a class.
  • I set setter methods.
  • I write a snipe of xml tag for NodeUtil Bean.

Can anyone tell me why this initiate an error and what the correct way.

Thanks

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
Mohammed Amr
  • 307
  • 5
  • 15
  • So what is the error? What were you expecting? – Artefacto Sep 15 '11 at 12:05
  • Artefacto, i think that i get it, where once the alfresco bootstrapping there is no Faces Context, so i will relay on the spring framework to inject the services proxies. Thanks – Mohammed Amr Sep 19 '11 at 09:56

1 Answers1

1

As @Artefacto said, there's no issue here. When using Spring, you get a reference to a Proxy class that wraps what you asked it to initialize. This has a number of (beneficial) effects, but definitely it's not an error.

You can see that proxy$.toString() as a proof that you really have a handle to an initialized instance of the class you need. I strongly suggest you to read more about how Spring IoC works.

Community
  • 1
  • 1
skuro
  • 13,414
  • 1
  • 48
  • 67