autowire resource with service