Error Creating Bean With Name and Singleton Bean Creation Not Allowed

Error creating bean with name and Singleton bean creation not allowed

Go to this thread

I assume that you too have the same issue around there..
It got solved by setting the JAVA_HOME path
And Updating your JDK to version 7 and try restarting your server..(solution)

I think that could solve your issue..

Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not allowed while singletons of this factory are in destruction

You simply need to add the web dependency. I am not clear why with the addition of web dependencies works/solves this issue.

Spring boot with scheduler-BeanCreationNotAllowedException: Error creating bean with name 'entityManagerFactory': Singleton bean creation not allowed

In Spring Boot, when you do a maven build the test cases are run by default. In this scenario the integration test scripts are run which will be trying to connect to your database.
Since you dont have anything to be excecuted as part of integration test in your project.
One possible solution is to declare your class ProvisioningApplicationTests as abstract.
This will restrict the instance creation of ProvisioningApplicationTests class.

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ProvisioningApplication.class)
public abstract class ProvisioningApplicationTests {
@Test
public void contextLoads() {
}
}

The other way to solve this issue is to include the below code in your pom.xml

<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skipTests>true</skipTests>
<includes>
<include>**/*IT.class</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

This will exclude your integration test classes to be executed while building youy project. maven-surefire-plugin is use to run unit tests. maven-failsafe-plugin is use to run integration tests. While using this approach make sure that all your integration class file names ends with 'IT'. E.g. UserTestIT.java



Related Topics



Leave a reply



Submit