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

Session beans não estão sendo registrados

Prezados, boa noite.

Estou realizando o curso de EJB e conforme um dos exercícios, é pedido para configurar alguns EJBs, porém o endereço dos Session Beans não estão sendo registrados no JNDI. Estou utilizando o wildfly, abaixo segue as informações do meu console, quando subo o wildfly.

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

WFLYUT0003: Undertow 1.4.0.Final starting
20:29:27,019 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path '/home/junior/Desktop/projetos-alura/wildfly-10.1.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
20:29:27,024 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
20:29:27,026 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0018: Host default-host starting
20:29:27,068 INFO  [org.jboss.as.ejb3] (MSC service thread 1-3) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
20:29:27,068 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
20:29:27,166 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8081
20:29:27,293 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
20:29:27,431 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-8) WFLYDM0111: Keystore /home/junior/Desktop/projetos-alura/wildfly-10.1.0.Final/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 64) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
20:29:27,789 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 64) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
20:29:27,941 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
20:29:28,079 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6) 
20:29:28,719 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment livraria.war
20:29:28,782 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.2.4.Final
20:29:29,075 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.3.5 (Final)
20:29:30,075 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 60) Initializing Mojarra 2.2.13.SP1 20160303-1204 for context '/livraria'
20:29:31,075 INFO  [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 60) Running on PrimeFaces 4.0
20:29:31,096 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 60) WFLYUT0021: Registered web context: /livraria
20:29:31,120 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
20:29:31,226 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
20:29:31,227 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
20:29:31,227 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 6679ms - Started 430 of 678 services (404 services are lazy, passive or on-demand)

Desde já muito obrigado pela ajuda.

3 respostas

Boa noite Antonio, poderia me disponibilizar o código?

Guilherme boa noite. Segue um dos beans que não estão sendo registrados.

package br.com.caelum.livraria.dao;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.Stateless;

import br.com.caelum.livraria.modelo.Autor;

@Stateless
public class AutorDao {

    private Banco banco = new Banco();

    @PostConstruct
    void aposCriacao(){
        System.out.println("Autor dao foi criado");
    }

    public void salva(Autor autor) {
        banco.save(autor);
    }

    public List<Autor> todosAutores() {
        return banco.listaAutores();
    }

    public Autor buscaPelaId(Integer autorId) {
        Autor autor = this.banco.buscaPelaId(autorId);
        return autor;
    }

}
solução!

Guilherme, por algum motivo, que não sei qual, agora começou a aparecer no console os meus beans.

Obrigado