I have following classes :
Class 1
package com.assets;
@Component
@Scope("request)
public class AssetDetailsImpl implements AssetApi
{
public void function1(){
....
}
public void function2(){
new AssetUtil().test1();
}
}
Class 2
package com.assets;
@Component
public class AssetUtil
{
@Autowired
AssetDetailsImpl impl;
//some functions
public void test1{
impl.function1();// NPE I amm getting
}
here my autowiring not working, its coming null. both the classes in same package. Is it because of the request scope which is there in AssetDetailsImpl? I even tried with @Inject that also was not working Can anyone please help me to resolve this?? Thanks in advance!
Edit : I have tried removing the scope, but then also the same problem.