我试图使用Junit5为特定的服务类创建单元/集成测试,以避免整个项目超载。
因此,这里我尝试运行EmailService,其中包含它的依赖类,但是我得到了java.lang.IllegalStateException: Failed to load ApplicationContext. Error creating bean with name 'emailSenderService. No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: ex
我正在从数据库读取/加载环境变量。因此,我没有application.properties。 我收到以下错误消息 APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in com.MyNotificationService required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.
- B
当我运行这个应用程序时,我有这个类运行得很好。
@Service("bookManager")
public class BookManagerImpl implements BookManager {
private MailClient mailClient;
..
}
@Service
public class MailClient {
protected static final Logger looger = LoggerFactory.getLogger(MailClient.class);
@Autowired
p
我正在使用spring boot 2.0.7 Release和spring-boot-starter-mail-2.0.7.Release.
我在类中自动安装javaMailsender,在windows上工作正常,同时尝试在Unix上进行部署。
APPLICATION FAILED TO START
***************************
Description:
Field javaMailSender in com.fti.di.capstock.tran.pub.email.SendEmail required a bean of type 'org.sp
我正在创建一个批处理应用程序,将来自web服务的一些数据放到数据库中。为此,我需要在可利用类上转换web服务接收的DTO。这可以使用在其他模块中定义的映射器。
当我尝试使用@Autowired (地图绘制者)时,我有一个例外,我没有找到如何晕倒的方法。
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobConfiguration': Injection of autowired
集成测试使用Swagger最新版本2.9.2 & HATEOS开始失败后Spring 2.2.0升级
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'linkDiscoverers'
defined in class path resource [org/springf
我想为使用Spring4.1.1和Hibernate 4.3.6的MySQL数据库开发基本的创建、读取、更新和删除功能。我试图使用来实现这个目的,但是在完成的每一步之后,我会在Tomcat启动时遇到这些错误。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dmsController': Injection of resource dependencies failed; nested exception is org.springframework.
这个bean是在这个类中定义的,我在springSecurityConfig.java类中使用了相同的dataSource,但它给出了错误:No qualifying bean of type 'javax.sql.DataSource' available
ShoppingServletConfig.java
@Configuration
@EnableWebMvc
@EnableTransactionManagement
@ComponentScan(basePackages = "com.project.shopping")
public class Sh
我在这里发现了很多关于我的问题的东西,但都没有用。让我解释一下,我试着做一个视图,它可以检索像电子邮件、主题、文本之类的数据,并发送到我的电子邮件中,比如在一些webPages上“联系我们”。
使用@Authowired to public JavaMailSender mailSender;我收到“没有符合条件的JavaMailSender类型的bean”,这意味着我应该添加@Config和一些@Bean,但是在删除注释: NullPointerException之后,设置上下文:component-扫描基本包的applicationMailSender.xml怎么办?
在我创建方法将所有数
我有3颗javax.persistence.EntityManagerFactory的豆子。
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
//Make this the default bean
}
这是我得到的异常。
No qualifying bean of type 'javax.persistence.EntityManagerFactory' available: expected single matching bean
我有一个spring启动应用程序,其中我已经启用了mongo审计。应用程序启动正常,并存储包含所有审计字段(createdDate、updatedDate等)的mongo文档。然而,在运行单元测试时,我得到了以下异常:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoAuditingHandler
我正在学习春靴,但是我遇到了一个问题,我找不到解决办法。当我尝试运行测试时,我会得到以下异常。
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookServiceImplementation' defined in file []: Unsatisfied dependency
我想声明ApplicationContext并使用getBean取出Bean。
但我犯了个错误。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inactiveMemberJobConfig': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.
我试图发送电子邮件给一个用户,一旦他们的帐户注册,我可以让我的代码工作在一个单独的项目(简单的表单输入等),但当我试图添加相同的代码到我的应用程序,它会给我以下错误
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException error
Could not autowire method: public void com.finalProject.school.controller.AppController.setMailSender(org.springfram
在我的Spring项目中,所有MVC配置都是使用XML完成的。
现在,我正在尝试集成security,并添加基于注释的基于的安全配置(@EnableWebScurity & @Configuration)扩展WebSecurityConfigurerAdapter。
有可能吗?
我的问题是:
每当我尝试在我的@EnableWebMvc类中使用任何自动处理依赖项时,NoSuchBeanDefinitionException: No qualifying bean of type [com.crud.servicesimpl.UserServiceImpl]
代码片段:
SecurityC
我创建了这个类:
public class ActivitiWorkflowService {
private final TaskService taskService;
..
}
但是我在这个项目中遇到了这个问题:
No qualifying bean of
type 'org.activiti.engine.TaskService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
我有以下Spring @配置:
@Bean
@Qualifier("mongo")
public MongoFacade mongo(Environment env){
final String host = env.getProperty("database.host");
final MongoClient mongoClient = new MongoClient(host);
return new MongoFacade(mongoClient, "test-db");
}
@Bean
public Messag
我正试图将一个基于Spring + Spring的项目升级到Brixton.M4,因为zuul在与SC的Brixton.M3打包的版本中缺乏对修补程序()的支持。我启用了弹簧启动启动器和弹簧云启动器-zuul,但是现在容器无法从以下错误开始:
No qualifying bean of type [org.springframework.boot.actuate.metrics.CounterService] is defined:
expected single matching bean but found 2: dropwizardMetricServices,servoMetricSe
我想创建两个实现相同接口的bean。Bean有名称,但是当我使用@Qualifier注解时
得到如下错误:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cdPlayer' defined in soundsystem.CDPlayerConfig: Unsatisfied dependency expressed through method 'cdPlayer' parameter 0: N
我有这样的代码:
package beans;
public interface Pet {
public String speak();
}
package beans;
public class Cat implements Pet {
private int age;
public Cat(int age) {
this.age = age;
}
@Override
public String speak() {
return "meaow";
}
public
我正在尝试运行这个示例:,我使用Maven作为构建工具。我得到的错误如下:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli) on project gs-accessing-data-neo4j: An exception occurred while running. null: InvocationTargetException: Error creating bean with name 'demo'
我使用的是spring boot 1.4.0.RELEASE。我正在为我的控制器类编写测试。我得到了以下异常。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.concur.cognos.authentication.service.ServiceControllerITTest': Unsatisfied dependency expressed through field 'restTemplate': N
我有一个bean Item<T>,它需要在@Configuration类中自动处理。
@Configuration
public class AppConfig {
@Bean
public Item<String> stringItem() {
return new StringItem();
}
@Bean
public Item<Integer> integerItem() {
return new IntegerItem();
}
}
但是,当我尝试@Autowir
尝试使用config类中的prototype作用域创建映射bean
@Configuration
public class SpringConfig {
public SpringConfig() {
}
@Bean
@Scope("prototype")
public Map<String, Composite> getCompositesMap() {
return new LinkedHashMap<String, Composite>();
}
}
但是春天抱怨说
org.springfram
我在不同的包中有两个bean,其中一个是库,因此无法编辑,并且执行会给出 org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type '' available: 就目前的目的而言,我希望库中的bean成为主要bean,有没有办法避免使用我可以编辑的第二个bean,而无需删除该bean? 到目前为止,我只看到了@Primary注解
我定义了几个相同类的bean:
@Bean
public FieldDescriptor fullSpotField() {
FieldDescriptor ans = new FieldDescriptor("full_spot", String.class);
return ans;
}
@Bean
public FieldDescriptor annotationIdField() {
FieldDescriptor ans = new FieldDescriptor("annotationID", In