Caused by: com.haulmont.cuba.core.global.RemoteException: ApplicationContext is not initialized
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:96) ~[cuba-core-7.2.13.jar:7.2.13]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_281]
Error creating bean with name ‘wechatMysql’: Invocation of init method failed; nested exception is com.haulmont.cuba.core.global.RemoteException:
dataManager.load(User.class)
.query("select s.name from planner_User s where " +
“s.name = :name”)
.parameter(“name”, “zhangsan”)
.one();------------>ERRROR指向这一行
@Table(name = “PLANNER_USER”)
@Entity(name = “planner_User”)
@NamePattern("%s|name")
public class User extends StandardEntity {
private static final long serialVersionUID = -4301424143969004325L;
@Column(name = "AGE", length = 32)
private String age;
@Column(name = "NAME", length = 32)
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}
@Component
public class WechatMysql {
private final static Logger logger = LoggerFactory.getLogger(WechatMysql.class);
@Inject
WeChatService weChatService;
@PostConstruct
public void test(){
weChatService.test();
}
}