[RESOLVIDO]Implantação sistema JSF+Wildfly+Hibernate

27 respostas
jsfservidortomcatlinuxmysql
M

Não soube qual tóṕico usar, qualquer coisa é só mover.

Tenho uma aplicacão para ser hospedada na digitalocean, porém estou tendo algumas dificuldades. Ao tentar implantar usando o Wildfly a mesma não funciona porém quando pego o mesmo .war e coloco no Apache Tomcat funciona perfeitamente.

A Dúvida é a seguinte, existe alguma configuração adicional que preciso fazer para que uma mesma aplicação funcione no Wildfly 9.0.0.Final, sendo que ela está funcionando corretamente no Tomcat 8.5.11??

27 Respostas

D

Depende, podem existir inúmeras como pode não precisar de nenhuma.
Quando você tenta realizar o deploy do war no wildfly, qual ou quais são os erros?

M

Apesar de não ser especialista na área de implantação pelo log percebo que é um problema de estouro de memória.

Não sei se o fato de ele não encontrar o hibernate.cfg.xml cause isso. Mas seria possível o tomcat encontrar o hibernate.cfg.xml e o wildfly não?

D

Como eu te disse, depende.
Se estoura a memória, pode ser a configuração do wildfly que esteja com algum problema.
Sem ver o log, não tem como dizer mais nada.

M

Aí o log de erro dele
identar texto pre-formatado em 4 espaços

JBoss Bootstrap Environment

JBOSS_HOME: /opt/wildfly

JAVA: java

JAVA_OPTS: -server -XX:+UseCompressedOops -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

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

18:38:12,453 INFO  [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final

18:38:13,196 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final

18:38:13,358 INFO  [<a href="http://org.jboss.as">org.jboss.as</a>] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 9.0.0.Final (WildFly Core 1.0.0.Final) starting

18:38:16,940 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool  3) WFLYCTL0028: Attribute job-repository-type in the resource at address /subsystem=batch is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.

18:38:16,958 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool  19) WFLYCTL0028: Attribute enabled in the resource at address /subsystem=datasources/data-source=ExampleDS is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.

18:38:17,593 INFO  [org.jboss.as.repository] (ServerService Thread Pool  16) WFLYDR0001: Content added at location /opt/wildfly/standalone/data/content/9f/a970734ad8b67cfbaeb275d7389d9015951ad7/content

18:38:17,674 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)

18:38:17,779 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.3.1.Final

18:38:17,821 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.3.1.Final

18:38:18,000 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool  38) WFLYCLINF0001: Activating Infinispan subsystem.

18:38:18,018 INFO  [org.jboss.as.jsf] (ServerService Thread Pool  44) WFLYJSF0007: Activated the following JSF Implementations: [main]

18:38:18,060 INFO  [<a href="http://org.wildfly.extension.io">org.wildfly.extension.io</a>] (ServerService Thread Pool  37) WFLYIO001: Worker default has auto-configured to 2 core threads with 16 task threads based on your 1 available processors

18:38:18,063 WARN  [org.jboss.as.txn] (ServerService Thread Pool  54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.

18:38:18,063 INFO  [org.jboss.as.security] (ServerService Thread Pool  53) WFLYSEC0002: Activating Security Subsystem

18:38:18,177 INFO  [org.jboss.as.naming] (ServerService Thread Pool  46) WFLYNAM0001: Activating Naming Subsystem

18:38:18,210 INFO  [org.jboss.as.webservices] (ServerService Thread Pool  56) WFLYWS0002: Activating WebServices Extension

18:38:18,192 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.9.Final

18:38:18,430 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0003: Undertow 1.2.8.Final starting

18:38:18,571 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=4.9.2.Final

18:38:18,609 INFO  [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0009: Starting JCA Subsystem (IronJacamar 1.2.4.Final)

18:38:18,905 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool  33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

18:38:18,886 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.2.8.Final starting

18:38:19,026 INFO  [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service

18:38:19,166 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2

18:38:19,181 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]

18:38:19,484 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0014: Creating file handler for path /opt/wildfly/welcome-content

18:38:19,851 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.

18:38:19,980 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting

18:38:20,697 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on /0.0.0.0:8080

18:38:21,301 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]

18:38:21,751 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/standalone/deployments

18:38:21,832 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of testehibernate.war (runtime-name: testehibernate.war)

18:38:22,429 INFO  [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.0.0.Final

18:38:26,583 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0003: Processing weld deployment testehibernate.war

18:38:26,966 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.1.3.Final

18:38:28,022 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

18:38:28,027 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)

18:38:28,038 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0006: Starting Services for CDI deployment: testehibernate.war

18:38:28,149 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.2.14 (Final)

18:38:28,295 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = testehibernate.war_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1

18:38:28,303 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = testehibernate.war_com.mysql.jdbc.Driver_5_1

18:38:28,333 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0009: Starting weld service for deployment testehibernate.war

18:38:32,193 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool  67) Initializing Mojarra 2.2.11-jbossorg-1 20150505-1501 for context /testehibernate

*** JBossAS process (2602) received KILL signal ***

2602

identar texto pre-formatado em 4 espaços
D

Esse log não faz sentido, não encontro nada que indique o que está acontecendo.

O Jboss está executando sem o war?

M

Sim… Funciona perfeitamente, inclusive coloquei um helloWorld e ele funcionou sem problemas.

D

Só tem isso no log?

Qual erro você está tendo? Até o momento não vejo nada anormal.

M

Quando acesso a URL o browser informa que está inacessível!

A

O level do log está para INFO, precisa mudar para um TRACE ou DEBUG, outro detalhe é que se você sobe em um sevlet container provável que tenha utilizado uma dependência do WELD que no wildfly não precisa.

M

Essa é a primeira vez que tento fazer deploy em uma aplicação!
Segue o log do wildfly.

JBoss Bootstrap Environment

JBOSS_HOME: /opt/wildfly

JAVA: /usr/lib/jvm/java-8-oracle/bin/java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

23:20:02,736 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final

23:20:03,362 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final

23:20:03,502 INFO  [<a href="http://org.jboss.as">org.jboss.as</a>] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting

23:20:07,997 INFO  [org.jboss.as.repository] (ServerService Thread Pool  20) WFLYDR0001: Content added at location /opt/wildfly/standalone/data/content/bb/5838d40384bfc7499ffecda0d9a8d134ab8524/content

23:20:08,058 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)

23:20:08,136 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.3.4.Final

23:20:08,170 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.3.4.Final

23:20:08,361 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool  38) WFLYCLINF0001: Activating Infinispan subsystem.

23:20:08,442 INFO  [org.jboss.as.naming] (ServerService Thread Pool  46) WFLYNAM0001: Activating Naming Subsystem

23:20:08,457 INFO  [<a href="http://org.wildfly.extension.io">org.wildfly.extension.io</a>] (ServerService Thread Pool  37) WFLYIO001: Worker default has auto-configured to 2 core threads with 16 task threads based on your 1 available processors

23:20:08,514 INFO  [org.jboss.as.webservices] (ServerService Thread Pool  56) WFLYWS0002: Activating WebServices Extension

23:20:08,443 INFO  [org.jboss.as.jsf] (ServerService Thread Pool  44) WFLYJSF0007: Activated the following JSF Implementations: [main]

23:20:08,497 WARN  [org.jboss.as.txn] (ServerService Thread Pool  54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.

23:20:08,567 INFO  [org.jboss.as.security] (ServerService Thread Pool  53) WFLYSEC0002: Activating Security Subsystem

23:20:08,673 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool  33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

23:20:08,708 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0003: Undertow 1.3.15.Final starting

23:20:08,743 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=4.9.4.Final

23:20:08,820 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.18.Final

23:20:08,835 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.3.15.Final starting

23:20:08,917 INFO  [org.jboss.as.connector] (MSC service thread 1-2) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.2.Final)

23:20:09,194 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2

23:20:09,329 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]

23:20:09,347 INFO  [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service

23:20:09,486 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0014: Creating file handler for path /opt/wildfly/welcome-content with options [directory-listing: ‘false’, follow-symlink: ‘false’, case-sensitive: ‘true’, safe-symlink-paths: ‘[]’]

23:20:09,884 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.

23:20:10,063 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 4 (per class), which is derived from the number of CPUs on this host.

23:20:10,065 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 16 (per class), which is derived from thread worker pool sizing.

23:20:10,066 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting

23:20:10,723 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:28080

23:20:11,445 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]

23:20:12,414 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan Mahou 8.1.0.Final

23:20:12,507 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)

23:20:12,598 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/standalone/deployments

23:20:12,632 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of testehibernate.war (runtime-name: testehibernate.war)

23:20:17,686 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment testehibernate.war

23:20:17,892 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.2.3.Final

23:20:18,700 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

23:20:18,703 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)

23:20:18,713 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0006: Starting Services for CDI deployment: testehibernate.war

23:20:18,807 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.3.2 (Final)

23:20:18,914 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = testehibernate.war_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1

23:20:18,915 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = testehibernate.war_com.mysql.jdbc.Driver_5_1

23:20:18,933 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0009: Starting weld service for deployment testehibernate.war

23:20:22,311 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool  69) Initializing Mojarra 2.2.12-jbossorg-2 20150729-1131 for context /testehibernate

*** JBossAS process (1838) received KILL signal ***

1838
M

Outra dúvida, existe alguma particularidade no deploy com o Wildfly?

Fiz uma aplicação simples para teste e a mesma funciona perfeitamente no Tomcat (estou gerando o .war pelo eclipse export>war file). Porém ao pegar o mesmo .war e colocar no wildfly ele não funciona.

O Servidor do Wildfly está funcional pois testei um HelloWorld nele!
Agradeço qualquer tipo de ajuda.

A

precisa alterar o level do log, ou coloca o pom.xml aqui, olhou o weld?

M

Então eu não estou usando injenção de dependências não, fiz um projeto básico só p testar pois não estava conseguindo subir o meu “principal”.

<build>
	<finalName>testehibernate</finalName>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.3</version>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>
		<plugin>
			<artifactId>maven-resources-plugin</artifactId>
			<version>2.7</version>
			<configuration>
				<encoding>UTF-8</encoding>
			</configuration>
		</plugin>
	</plugins>
</build>
<properties>

</properties>
<repositories>
	<repository>
		<id>jvnet-nexus-releases</id>
		<name>jvnet-nexus-releases</name>
		<url>https://maven.java.net/content/repositories/releases/</url>
	</repository>
</repositories>

<dependencies>
	<!--Java Server Faces  -->
	<dependency>
		<groupId>javax</groupId>
		<artifactId>javaee-api</artifactId>
		<version>7.0</version>
	</dependency>
	<!-- Hibernate -->
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-core</artifactId>
		<version>4.3.4.Final</version>
	</dependency>
	<!-- MySQL -->
	<dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
		<version>5.1.30</version>
		<scope>provided</scope>
	</dependency>
</dependencies>
A

Entendo, então faz um favor, la no standloane.xml muda o level do log para debug ou trace,
Algum motivo especial para usar o repositorio do nexus?
Sua app não faz conexão com o database?
Porque você usa o jar do mysql como provided e o JavaEE que deveria ser não ? algumo motivo especial?

M

Vou buscar aqui como mudar o level do log.
O repositório do nexus eu uso pois peguei de tutoriais pela net a fora.
Faço conexão com um DataSource e já configurei. Coloquei o mysql como provided pois vi que deveria colocar assim em um tutorial, já que ao criar o Datasource precisamos copiar o conector para a pasta do wildfly.

A

Vamos por partes, não precisa aquele repósitorio do nexus explicito ali (a menos que me de um bom motivo), se você configurou o módulo com o connector do banco de dados no wildfly e criar uma DS não é necessário ter o jar no pom.xml, afinal fica a cargo do container gerenciar as conexões (POOL e DS) , sinceramente acho que você está meio perdido, eu sugiro você usar algum archtype do mavem com o materials(BOM) do wildfly para começar e entender a criação de um projeto, em aplication server é um pouco diferente de quando programamos em servlet containers.

M

@aix Muito obrigado pela sua atenção! Vou seguir o seu conselho e retrocedor um pouco. Realmente estou a ter algumas dificuldades.

Vou te mandar o log com o level DEBUG
2017-03-08 01:53:27,335 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
2017-03-08 01:53:27,893 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
2017-03-08 01:53:28,022 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
2017-03-08 01:53:28,025 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties:
[Standalone] =
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.headless = true
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = /opt/wildfly/jboss-modules.jar
java.class.version = 52.0
java.endorsed.dirs = /usr/lib/jvm/java-8-oracle/jre/lib/endorsed
java.ext.dirs = /usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext
java.home = /usr/lib/jvm/java-8-oracle/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.net.preferIPv4Stack = true
java.runtime.name = Java™ SE Runtime Environment
java.runtime.version = 1.8.0_121-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.util.logging.manager = org.jboss.logmanager.LogManager
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_121
java.vm.info = mixed mode
java.vm.name = Java HotSpot™ 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.121-b13
javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory
javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory
javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory
javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory
javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory
javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory
javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory
javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory
javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory
jboss.home.dir = /opt/wildfly
jboss.host.name = testewildfly
jboss.modules.dir = /opt/wildfly/modules
jboss.modules.system.pkgs = org.jboss.byteman
jboss.node.name = testewildfly
jboss.qualified.host.name = testewildfly.localdomain
jboss.server.base.dir = /opt/wildfly/standalone
jboss.server.config.dir = /opt/wildfly/standalone/configuration
jboss.server.data.dir = /opt/wildfly/standalone/data
jboss.server.deploy.dir = /opt/wildfly/standalone/data/content
jboss.server.log.dir = /opt/wildfly/standalone/log
jboss.server.name = testewildfly
jboss.server.persist.config = true
jboss.server.temp.dir = /opt/wildfly/standalone/tmp
line.separator =

logging.configuration = file:/opt/wildfly/standalone/configuration/logging.properties
module.path = /opt/wildfly/modules
org.jboss.boot.log.file = /opt/wildfly/standalone/log/server.log
org.jboss.resolver.warning = true
org.xml.sax.driver = __redirected.__XMLReaderFactory
os.arch = amd64
os.name = Linux
os.version = 4.4.0-64-generic
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/classes
sun.boot.library.path = /usr/lib/jvm/java-8-oracle/jre/lib/amd64
sun.cpu.endian = little
sun.cpu.isalist = 
sun.io.unicode.encoding = UnicodeLittle
sun.java.command = /opt/wildfly/jboss-modules.jar -mp /opt/wildfly/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly -Djboss.server.base.dir=/opt/wildfly/standalone -c standalone.xml
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = unknown
user.country = US
user.dir = /opt/wildfly-10.0.0.Final
user.home = /home/wildfly
user.language = en
user.name = wildfly
user.timezone = Etc/UTC
2017-03-08 01:53:28,026 DEBUG [org.jboss.as.config] (MSC service thread 1-2) VM Arguments: -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly/standalone/configuration/logging.properties

2017-03-08 01:53:32,383 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)

2017-03-08 01:53:32,466 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.3.4.Final

2017-03-08 01:53:32,506 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.3.4.Final

2017-03-08 01:53:32,654 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool  38) WFLYCLINF0001: Activating Infinispan subsystem.

2017-03-08 01:53:32,721 INFO  [org.jboss.as.naming] (ServerService Thread Pool  46) WFLYNAM0001: Activating Naming Subsystem

2017-03-08 01:53:32,797 INFO  [org.jboss.as.security] (ServerService Thread Pool  53) WFLYSEC0002: Activating Security Subsystem

2017-03-08 01:53:32,690 INFO  [org.jboss.as.jsf] (ServerService Thread Pool  44) WFLYJSF0007: Activated the following JSF Implementations: [main]

2017-03-08 01:53:32,765 WARN  [org.jboss.as.txn] (ServerService Thread Pool  54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.

2017-03-08 01:53:32,857 INFO  [org.jboss.as.webservices] (ServerService Thread Pool  56) WFLYWS0002: Activating WebServices Extension

2017-03-08 01:53:32,958 INFO  [<a href="http://org.wildfly.extension.io">org.wildfly.extension.io</a>] (ServerService Thread Pool  37) WFLYIO001: Worker default has auto-configured to 2 core threads with 16 task threads based on your 1 available processors

2017-03-08 01:53:33,081 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=4.9.4.Final

2017-03-08 01:53:33,122 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0003: Undertow 1.3.15.Final starting

2017-03-08 01:53:33,125 INFO  [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.2.Final)

2017-03-08 01:53:33,126 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool  33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

2017-03-08 01:53:33,333 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool  33) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

2017-03-08 01:53:33,348 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.18.Final

2017-03-08 01:53:33,421 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.3.15.Final starting

2017-03-08 01:53:33,583 INFO  [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service

2017-03-08 01:53:33,623 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]

2017-03-08 01:53:33,651 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2

2017-03-08 01:53:33,664 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = mysql

2017-03-08 01:53:33,666 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  55) WFLYUT0014: Creating file handler for path /opt/wildfly/welcome-content with options [directory-listing: ‘false’, follow-symlink: ‘false’, case-sensitive: ‘true’, safe-symlink-paths: ‘[]’]

2017-03-08 01:53:34,144 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 4 (per class), which is derived from the number of CPUs on this host.

2017-03-08 01:53:34,151 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 16 (per class), which is derived from thread worker pool sizing.

2017-03-08 01:53:34,203 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.

2017-03-08 01:53:34,221 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting

2017-03-08 01:53:34,515 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:28080

2017-03-08 01:53:35,006 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/WizardDB]

2017-03-08 01:53:35,027 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]

2017-03-08 01:53:35,919 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)

2017-03-08 01:53:35,971 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan Mahou 8.1.0.Final

2017-03-08 01:53:36,042 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/standalone/deployments

2017-03-08 01:53:36,049 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of testehibernate.war (runtime-name: testehibernate.war)

2017-03-08 01:53:40,008 WARN  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0013: Deployment deployment testehibernate.war contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)

2017-03-08 01:53:40,659 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool  62) Initializing Mojarra 2.2.12-jbossorg-2 20150729-1131 for context '/testehibernate

2017-03-08 01:53:42,699 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool  62) Monitoring file:/opt/wildfly-10.0.0.Final/standalone/tmp/vfs/temp/tempf7e3a05462b814f0/content-2c70965032d37c84/WEB-INF/faces-config.xml for modifications

2017-03-08 01:53:42,848 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool  62) WFLYUT0021: Registered web context: /testehibernate

2017-03-08 01:53:42,946 INFO  [org.jboss.as.server] (ServerService Thread Pool  34) WFLYSRV0010: Deployed testehibernate.war (runtime-name : testehibernate.war)

2017-03-08 01:53:43,438 INFO  [<a href="http://org.jboss.as">org.jboss.as</a>] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on <a href="http://127.0.0.1:9990/management">http://127.0.0.1:9990/management</a>

2017-03-08 01:53:43,439 INFO  [<a href="http://org.jboss.as">org.jboss.as</a>] (Controller Boot Thread) WFLYSRV0051: Admin console listening on <a href="http://127.0.0.1:9990">http://127.0.0.1:9990</a>

2017-03-08 01:53:43,439 INFO  [<a href="http://org.jboss.as">org.jboss.as</a>] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 17071ms - Started 355 of 646 services (383 services are lazy, passive or on-demand)
A

continua tentando, é assim que apredemos, olha só não há nada de errado aparentemente, a app startou /testehibernate
provável que você acesse assim no browser http://localhost:8080/testehibernate, isso se você tem uma página para exibir, se jsf um .xhtml, lembrando que mesmo para o faces precisa algumas configs no web.xml.
Quanto ao CDI só tem um warn e warn não é erro, acredito que sua app esteja funcionando.

M

Uma última dúvida… É normal uma aplicação funcionar normalmente local e quando subir ela para um servidor começar a haver problemas?

A

O que acontece é que quando você desenvolve no seu computador local e depois migra para um datacenter, cloud etc… é que os ambientes não são os mesmos, um exemplo é quando você desenvolve no seu computador e depois publica na amazon, gae, openshift … geralmente para rodar nesses ambientes requer obedecer algumas regras do próprio ambiente para poder publicar, mas claro, tudo tem nas docs de cada serviço. mas você pode se prevenir de surpresas, desenvolvendo um sistema com uma boa cobertura de testes, seguir a especificação JavaEE, quando falo em testes digo não só os de unidade mas testes de integração como por exemplo arquillian, onde você constói uma suite de testes e sobe um container em tempo de build.

Olha sendo sincero, eu já subi aplicações em todos esses ambientes e outros e nunca tive problemas que me impedissem o deploy, mas claro, baseado em tudo que falei acima cada ambiente tem suas particularidades.

O que aconteceu neste seu caso eu penso que é mais voltado ao conhecimento das ferramentas, se você se aprimorar um pouco mais tudo fica mais fácil, mas uma coisa se sempre pego bastante com meu time é sobre as dependências do projeto, eu não suporto ver um jar lá que não é utilizado, eu estudo as dependências do container e sempre dou preferência em deixar essa parte de infraestrutura para ele controlar, hoje quando alguém me pergunta: sua aplicação sobe no container X eu respondo que: sobe em qualquer container que implemente a especificação Javaee7 por exemplo.

M

Acho que errrei nesse aspecto. Devia ter buscado mais informações sobre o Wildfly antes de usá-lo. Porque ela funciona localmente e ao subir está dando esses problemas.

Obrigado novamente… Valeu

D

Seu servidor está rodando nessa porta

28080 e não 8080

A

verdade @DarkElf , não tinha ligado que ele havia trocado a porta default, vamos ver se ele testa e consegue subir a app dele.

M

OPA, isso eu realmente mudei a porta.
Conseguir implantar, porém mudei o servidor wildfly pelo servlet container apache tomcat. O plano B funcionou.

Porém estou com outro problema. A aplicação sobe corretamente e funciona como esperado porém após determinado tempo o apache tomcat cai e preciso reiniciá-lo. Existe alguma configuração extra que preciso fazer nele para que isso não ocorra??

Obrigado novamente pela atenção de vocês…Terei q cita-los no trabalho kkkkkkkk @aix @DarkElf

L

Quando tiver tempo, dá uma olhada no Docker, acho que você vai gostar (se já não tiver visto). Dentre as centenas de benefícios, você pode configurar um ambiente (ou uma imagem, em termos do Docker) e migrar entre máquinas da forma mais fácil do mundo.

A

heheheheh, não precisa nos citar :slight_smile: , isso deixamos entre nós programadores, olha manu, quanto ao tomcat estar caindo pode ser muitas coisas, chegou a ver se nos logs tem alguma informação? abraços.

M

Obrigado galera, conseguir resolver todos os problemas!
Valeu mesmo pela ajuda, principalmente o @aix… Obrigado mesmo pela atenção.

Resolvido!

Criado 6 de março de 2017
Ultima resposta 16 de mar. de 2017
Respostas 27
Participantes 5