2
respostas

Boa tardee! Não está fazendo conexão com o servidor! até quando eu executo como JAva Aplication, o código me retorna uma exceção do tipo" IOException thrown when trying to start grizzly server"

package br.com.alura.lojinha;

import java.io.IOException;
import java.net.URI;

import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;



public class Servidor {
        public static void main(String[] args) throws IOException{
            ResourceConfig config = new ResourceConfig().packages("br.com.alura.lojinha");
            URI uri = URI.create("http://localhost:8080/");
            HttpServer server = GrizzlyHttpServerFactory.createHttpServer(uri, config);
            System.out.println("Servidor rodando");
            System.in.read();//espera dar enter para sair do servidor
            server.stop();
        }
}
2 respostas

Mateus, pode postar a stacktrace completa da exception?

Deu certo aqui, é pq estava dando conflito com apache.

Obrigadoo!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software