Unable to find a supported adapter

Comments

Copy link Quote reply

PlanetDyna commented May 1, 2018

I haven’t used Ruby on Rails until now and want to clone an existing project from a web server. When I execute the command "bundler exec rails server", I get the following error message:

I’m new to frameworks (just passed the class) and this is my first time using Spring Boot.

I’m trying to run a simple Junit test to see if my CrudRepositories are indeed working.

The error I keep getting is:

Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest( >

Doesn’t Spring Boot configure itself?

My Spring Boot application starter:

10 Answers 10

Indeed, Spring Boot does set itself up for the most part. You can probably already get rid of a lot of the code you posted, especially in Application .

I wish you had included the package names of all your classes, or at least the ones for Application and JpaTest . The thing about @DataJpaTest and a few other annotations is that they look for a @SpringBootConfiguration annotation in the current package, and if they cannot find it there, they traverse the package hierarchy until they find it.

For example, if the fully qualified name for your test class was com.example.test.JpaTest and the one for your application was com.example.Application , then your test class would be able to find the @SpringBootApplication (and therein, the @SpringBootConfiguration ).

If the application resided in a different branch of the package hierarchy, however, like com.example.application.Application , it would not find it.

Example

Consider the following Maven project:

And then the following content in Application.java :

Читайте также:  5D624f94 8850 40c3 a3fa a4fd2080baf3 vwifimp wfd

Followed by the contents of JpaTest.java :

Everything should be working. If you create a new folder inside src/main/com/example called app , and then put your Application.java inside it (and update the package declaration inside the file), running the test will give you the following error:

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest( >

Configuration is attached to the application class, so the following will set up everything correctly:

Example from the JHipster project here.

It is worth to check if you have refactored package name of your main class annotated with @SpringBootApplication . In that case the testcase should be in an appropriate package otherwise it will be looking for it in the older package . this was the case for me.

In addition to what Thomas Kåsene said, you can also add

to the test annotation to specify where it should look for the other class if you didn’t want to refactor your file hierarchy. This is what the error message hints at by saying:

In my case the packages were different between the Application and Test classes

After making them agree the tests ran correctly.

the package name of the above test class is changed to the same as the package name of the normal class.

The test slice provided in Spring Boot 1.4 brought feature oriented test capabilities.

@JsonTest provides a simple Jackson environment to test the json serialization and deserialization.

@WebMvcTest provides a mock web environment, it can specify the controller class for test and inject the MockMvc in the test.

Читайте также:  Gembird usb link cable драйвер windows 10

@DataJpaTest will prepare an embedded database and provides basic JPA environment for the test.

@RestClientTest provides REST client environment for the test, esp the RestTemplateBuilder etc.

These annotations are not composed with SpringBootTest, they are combined with a series of AutoconfigureXXX and a @TypeExcludesFilter annotations.

Have a look at @DataJpaTest .

You can add your @AutoconfigureXXX annotation to override the default config.

I applied SP 20 in XI 3.0 (from SP9), but when I test the File to File scenario I am getting an Error : *no_adapter_engine_found: Unable to find Adapter Engine* in SXMB_MONI.

Here it the complete Error log

no_adapter_engine_found: Unable to find Adapter Engine

Error when reading the access data (URL, user, password) for the Adapter Engine

Can any one help me, so I can resolve this ASAP?

Add comment

Related questions

3 Ответов

Please try to refer SAP Note : 764176

Hope it helps you.

Reward points if useful ��

Alert Moderator

You already have an active moderator alert for this content.

  • Закрыть
Add comment

I got the same error in my scenario and i solved the same.Actually i ma not pretty surte this will solve your problem.

In my case proxy generation settings was mis configured in the sender system. so its caused the problem

I made an entry in the SPROXSET table and i did other activities like RFC and application system also.

Then its worked for me. Its not matching with your case please do ignore this one

Rate this post
Читайте также:  Xerox workcentre 3550 цена

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *