Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Erro ao acessar o http://localhost:8080/bitcoins

The stacktrace below has been reversed to show the root cause first. Click Here to see the original stacktrace

java.lang.IllegalArgumentException: Unable to determine the proper baseUrl/baseUri. Consider registering using @RegisterRestClient(baseUri="someuri"), @RegisterRestClient(configKey="orkey"), or by adding 'quarkus.rest-client."br.alura.service.BitcoinService".url' or 'quarkus.rest-client."br.alura.service.BitcoinService".uri' to your Quarkus configuration at io.quarkus.restclient.runtime.RestClientBase.configureBaseUrl(RestClientBase.java:294) at io.quarkus.restclient.runtime.RestClientBase.create(RestClientBase.java:58) at br.alura.service.BitcoinService_1574a6c832e36b378f338e4ec5b4375707ad60bd_Synthetic_Bean.create(Unknown Source) at br.alura.service.BitcoinService_1574a6c832e36b378f338e4ec5b4375707ad60bd_Synthetic_Bean.get(Unknown Source) at br.alura.service.BitcoinService_1574a6c832e36b378f338e4ec5b4375707ad60bd_Synthetic_Bean.get(Unknown Source) at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:52) at br.alura.resource.BitcoinResource_Bean.create(Unknown Source) at br.alura.resource.BitcoinResource_Bean.create(Unknown Source) at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26) at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26) at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69) at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26) at br.alura.resource.BitcoinResource_Bean.get(Unknown Source) at br.alura.resource.BitcoinResource_Bean.get(Unknown Source) at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:440) at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:453) at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:277) at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:274) at io.quarkus.resteasy.common.runtime.QuarkusConstructorInjector.construct(QuarkusConstructorInjector.java:46) at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.createResource(POJOResourceFactory.java:71) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:401) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492) at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261) at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161) at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)

`package br.alura.model;

import java.time.LocalDate;

public class Bitcoin {

private Long id;

private Double preco;

private String tipo;

private LocalDate data;

public Long getId() {
    return id;
}

public void setId(Long id) {
    this.id = id;
}

public Double getPreco() {
    return preco;
}

public void setPreco(Double preco) {
    this.preco = preco;
}

public String getTipo() {
    return tipo;
}

public void setTipo(String tipo) {
    this.tipo = tipo;
}

public LocalDate getData() {
    return data;
}

public void setData(LocalDate data) {
    this.data = data;
}

} `

package br.alura.resource;

import java.util.List;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.eclipse.microprofile.rest.client.inject.RestClient;

import br.alura.model.Bitcoin;
import br.alura.service.BitcoinService;

@Path("/bitcoins")
public class BitcoinResource {

    @Inject
    @RestClient
    BitcoinService bitcoinService;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<Bitcoin> listar() {
        return bitcoinService.listar();
    }
}
package br.alura.service;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import br.alura.model.Bitcoin;

@Path("/bitcoins")
@RegisterRestClient
public interface BitcoinService {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<Bitcoin> listar();

}

br.com.alura.service.BitcoinService/mp-rest/url=https://alura-bitcoin.herokuapp.com/

4 respostas

A mensagem de erro é somente essa que vc informou?

no terminal Insira aqui a descrição dessa imagem para ajudar na acessibilidade

na url Insira aqui a descrição dessa imagem para ajudar na acessibilidade

solução!

Nossa, o erro era só um .com:

Arrumei e funcionou kkkk xD