我是个新手,正在尝试创建Tomcat /Hibernate5Web应用程序,但是当我启动Spring5时,我得到了以下错误:
最初的问题是与事务管理器有关,在添加事务管理器bean定义之前,应用程序启动正常,但失败了,并显示错误消息,表明无法创建事务线程。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerController' defined in ServletContext resource [/WEB-INF/spring/sto
我需要从env变量初始化admin,但是@BeforeExecution方法没有启动,直接在initAdmin方法中开始执行。有什么建议吗?
@ChangeUnit(id = "init", order = "001", author = "me")
@RequiredArgsConstructor
@Component
public class InitChangeLog {
private final MyService service;
private final MongoTemplate template;
private
在Spring3.2项目中,我在启动应用程序时遇到了问题。有些bean似乎不被系统所识别。
我知道这个错误:
27-May-2014 12:41:05.879 SEVERE [http-nio-8084-exec-5] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
or
我正在使用Spring和JAX编写一个web服务,我有点困惑于以下内容
这是我的服务
@Path("/users")
public class UserService {
@GET
@Path("{id}")
@Produces("application/xml")
public User getById(@PathParam("id") int id) {
ApplicationContext context = new ClassPathXmlApplicationContex
我有以下配置类:
@Configuration
public class StartupConfig {
private final Logger log = LoggerFactory.getLogger(this.getClass().getSimpleName());
@PostConstruct
public void init() {
log.debug("Start up config initialized.");
}
@Bean
public SchedulerService schedule
在使用Spring之前,我有这样一个工作代码:
@Controller
public class UserChoiceController {
@Autowired
private CityPropertyEditor cityPropertyEditor;
//...
}
哪里
@Component("cityPropertyEditor")
public class CityPropertyEditor extends java.beans.PropertyEditorSupport {
//...
}
哪里
@Component
public class
使用Mongock https://github.com/cloudyrock/mongock进行数据迁移spring boot 2.3.1版本,之前使用Mongobee,但由于这个错误org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean with name 'mongoTemplate'和每个人的建议切换到Mongock An attempt was made to call a method that does not exist, mongo-java-d
我无法通过模拟UserService.save()方法来返回虚拟用户对象来测试我的控制器类。
继续获得以下异常
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springf
我试图将一个属性类注入到一个基于Groovy的类中,但注入的类为空。我确实有另一个属性类,它被注入到从Tomcat的Filter接口实现的类中,并且工作得很好。
下面是我在启动Spring Boot应用程序时的堆栈跟踪:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stormpathAccountService' defined in file [/Users/jfitz
我正在尝试写一个基本的spring项目。然而,我有一个很大的问题,那就是通过服务使用`@Autowired。我没有发现问题,得到的错误如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testeRS': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
我正在尝试使用@Configuration和@Bean注释在运行时创建Bean。这样做的原因是我试图让Spring知道创建的bean,这样它就可以处理我正在创建的应用程序的调度。我像这样定义了带注释的类:
@Configuration
public class GathererConfigBean {
@Bean(name = "FactoryBean")
public MethodInvokingJobDetailFactoryBean createMethodInvokingJobDetail(String service, Object obj, St
看看下面的代码:
@Controller
public class HomeController
{
@Autowired
private FacadeRemote fr;
// code omitted
}
|
@Component("user-details")
public class CustomUserServiceDetails implements UserDetailsService
{
@Autowired
private FacadeRemote fr;
@Override
public Us
我正在尝试实现一个自定义的java Spring JPA存储库,如中所述。似乎我的spring配置坚持以标准的方式创建存储库,而不是使用给定的MyRepositoryFactoryBean,这给了我
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.myapp.repository.impl.DocumentRepositoryImpl]: No default constructor found; nested exception is
我使用的代理bean与属性可选择的传输协议。我的问题是bean属性不能转换,但我真的不知道为什么。情况是这样的:
我的财产: service.protocol=rmi
<!-- This is the 'multiplexing' factory bean (using this because properties
cannot be used in bean names and aliases -->
<bean name="dbFormGenWindowComponent"
class="org.springfram
,我在给DepartmentService注射DepartmentDAO。这是在我添加了@Transactional注释之后出现的。这是我的DepartmentService:
@Service
@Transactional
public class DepartmentService extends AbstractCRUDService<DepartmentDTO> {
private DepartmentDAO departmentDAO;
public DepartmentService() {
super();
this
来自DotNet并使用"Unity“进行依赖注入和依赖解决,我将有如下内容:
public interface ILog
{
void LogSomething(string msg);
}
public class MyLogger() : ILog
{
public void LogSomething(string msg)
{
/* do something real here */
Console.Writeline("I'm logging something: " + msg);
}
我试图使用@Autowire为测试类自动绑定一个bean,但是这个bean没有被连接,我得到了这个异常:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [com.abc.MyDaoHibernateImpl] found for dependency:
expected at least 1 bean which qualifies as autowire candidate for this
dependen
我已经将我的spring引导应用程序从1.x更新到2.x,因为升级调度程序没有按预期工作。获取以下异常。
org.quartz.SchedulerException: Job instantiation failed
at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:47)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org