Micronaut

Getting error while connecting to jpa using micronaut-data-hibernate-jpa library

你说的曾经没有我的故事 提交于 2019-12-22 08:53:08
问题 I want to use JPA for micronaut. For that I am using io.micronaut.data:micronaut-data-hibernate-jpa:1.0.0.M1 library. Whenever I run my application and hit the endpoint to get the data, I get the following error: { message: "Internal Server Error: No backing RepositoryOperations configured for repository. Check your configuration and try again" } I tried looking up for errors but I couldn't find one. Attaching my files here. Please help. build.gradle plugins { id "net.ltgt.apt-eclipse"

Micronaut CLI behind a HTTP proxy

梦想的初衷 提交于 2019-12-14 02:04:33
问题 I'm new to Micronaut, and Gradle for that matter, and I was able to get it to work on my personal laptop. But I wanted to get a POC working for work which is behind a HTTP proxy. I've been looking for some examples on how to configure Micronaut to be able to work properly behind it. Can anybody point me to some docs or examples to show how this is done? P.S. I've been trying to get some Gradle examples into an init.d directory in Micronaut hoping it would pick it up but I haven't gotten it to

Micronaut bean conditionals using env

纵然是瞬间 提交于 2019-12-13 04:27:29
问题 I'm working on an micronaut app and I'm using conditional beans using the @Requires(env="test") , @Requires(env="development") and @Requires(env="prod") but when I try to run my application I keep getting the: Caused by: io.micronaut.context.exceptions.NonUniqueBeanException: Multiple possible bean candidates found: does conditional bean suppport env for it ? 来源: https://stackoverflow.com/questions/56908228/micronaut-bean-conditionals-using-env

Micronaut server and httpclient behind corporate proxy

拜拜、爱过 提交于 2019-12-13 04:11:35
问题 I'm running a micronaut microservice on a Win 7. My GET Request looks like : http://localhost:8080/maps/myreq . The controller use a httpclient to send request to an external webseite : image.maps.api.here.com When running without proxy, all went fine and the response is ok (an image). But when running behind the proxy, connection timed out. Proxy works fine for any other applications or browser. How to set micronaut server behind proxy to properly root requests? edit : when sending a request

Micronaut set up EmbeddedServer for Pact test

☆樱花仙子☆ 提交于 2019-12-13 02:56:53
问题 I have this SpringBoot and Pact test example from Writing Contract Tests with Pact in Spring Boot @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = "user-service.base-url:http://localhost:8080", classes = UserServiceClient.class) public class UserServiceContractTest { @Rule public PactProviderRuleMk2 provider = new PactProviderRuleMk2("user-service", null, 8080, this); @Autowired private UserServiceClient userServiceClient; @Pact

Is there with micronaut a way to have the “Spring Data JPA” repository autogenerated from an interface like in spring?

安稳与你 提交于 2019-12-12 16:28:56
问题 Im setting up a new micro service with micronaut and want it to access a database over jpa/hibernate. Is there an easy way to have the "Spring Data JPA" repositories implementation to be autogenerated from the interface like with spring? interface ExampleRepository { fun FindById(id: String): Example } Ideally i would the be able to import an ExampleRepository over DI into my service. EDIT: Micronaut Data is in the process of being released: https://github.com/micronaut-projects/micronaut

Micronaut token propagation throwing Unauthrized error

浪子不回头ぞ 提交于 2019-12-11 19:10:17
问题 As part of my project requirement, I am trying to call two server APIs from my parent service. All my endpoints are secured, so token has to be passed through every request. To pass token to endpoints calling from my parent controller, I have used token propagation concept of micronaut. But still I am seeing 'unauthrozed' error with child request. Note I am receiving token at parent controller method (logged and verified). Below is my code. Parent Controller - ClientUserController package io

Micronaut view rendering without template engine

∥☆過路亽.° 提交于 2019-12-11 05:25:48
问题 Can micronaut render static files? I added compile 'io.micronaut:micronaut-views' into build.gradle The Controller: @Controller("/main") public class MainController { @View("index.html") @Get("/") public HttpResponse index() { return HttpResponse.ok(); } } The index.html file is under /src/main/resources/views/index.html A requesting localhost:8080/main does not render the view. 回答1: This is behaving as designed. There is no point in applying view model logic when there is no way to apply the

Ignore property for type conversion of declarative client URI argument

ⅰ亾dé卋堺 提交于 2019-12-11 04:31:38
问题 I am implementing a declarative client in Micronaut that looks like this: @Get("/dostuff{?requestObject*}") fun getStuff(requestObject: MyRequestObject): String My MyRequestObject is validated with Javax.Validation and looks like this: data class MyRequestObject(val anything: String) { @AssertTrue fun isValid() = true } When I now send a request via the client the value from requestObject generates the following query /?anything=helloworld&valid=true . I need to exclude the value from the

IntelliJ - Gradle - Kotlin - Micronaut - Changing files does not re-generate classes on “run”

一个人想着一个人 提交于 2019-12-11 00:40:04
问题 I have a Kotlin-Micronaut v.1.0.2 project in IntelliJ and with Gradle v5.3. My running application has for example the following controller: @Controller("/api/test") class TestController { @Get fun helloWorld() = "Hello World" } In case I change any of this code, for example change the return value or add another REST method (e.g. POST), the necessary code will only be generated on a ./gradlew clean build . Hitting "Run" in IntelliJ will not generate the necessary endpoints for me (e.g. on