[Resolvido] Hibernate - Persistence com Oracle E MySQL: Erro na geração de ID sequences

Caros,

tenho um sistema que utiliza persistência via Hibernate no Oracle e recentemente precisei incluir uma consulta a um banco MySQL.
Primeiro utilizei uma maneira pré-histórica (JDBC) e a consulta funcionou, então tentei usar JPA.
Mapeei os elementos, acrescentei a conexão ao datasourse e ao persistence.xml, retirei os vestígios do método JDBC e subi o JBoss.
Enquanto ele subia, soltou uma pilha de erros, da qual destaco as seguintes linhas:

Caused by: org.hibernate.MappingException: Could not instantiate id generator [entity-name=xxx.model.Usuario]
	at org.hibernate.id.factory.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:118) [:3.6.6.Final]
	at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:193) [:3.6.6.Final]
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:248) [:3.6.6.Final]
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) [:3.6.6.Final]
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906) [:3.6.6.Final]
	... 79 more
Caused by: org.hibernate.MappingException: org.hibernate.dialect.MySQLDialect does not support sequences
	at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:601) [:3.6.6.Final]
	at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:101) [:3.6.6.Final]
	at org.hibernate.id.SequenceHiLoGenerator.configure(SequenceHiLoGenerator.java:60) [:3.6.6.Final]
	at org.hibernate.id.factory.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:111) [:3.6.6.Final]
	... 83 more

A classe citada (xxx.model.Usuario) é da persistência Oracle. Ela contém a anotação @GeneratedValue(strategy = GenerationType.SEQUENCE […]) no atributo ID da entidade.
Rapidamente percebi meu problema: O JBoss não sabe diferenciar o que é Oracle e o que é MySQL.

Agora vem a pergunta, como esclarecer isso para ele?

O que já tentei:

  • Trocar a anotation para @GeneratedValue(strategy = GenerationType.IDENTITY […]);
  • Trocar a anotation para @GeneratedValue(strategy = GenerationType.AUTO […]). Parece que sobe normal, mas perto do fim, avisa que teve coisa com erro;
  • Anotar os EntityManager de cada DAO com seu respectivo @PersistenceContext(pu-oracle/pu-mysql);
  • Anotar cada classe com seu respectivo @PersistenceContext(pu-oracle/pu-mysql);
  • Trocar o dialect no persistence.xml para Oracle10gDialect.

Qualquer dica seria muito bem vinda.

OBS.: Seguem a baixo os trechos relevantes do persistence e do datasource:

Persistence.xml:

	<persistence-unit name="pu-oracle">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<jta-data-source>java:/oracle-data-source</jta-data-source>
		<properties>
			<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
			<property name="hibernate.hbm2ddl.auto" value="none" />
			<property name="hibernate.show_sql" value="false" />
		</properties>
	</persistence-unit>

	<persistence-unit name="pu-mysql">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<jta-data-source>java:/mysql-data-source</jta-data-source>
		<properties>
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
			<property name="hibernate.hbm2ddl.auto" value="none" />
			<property name="hibernate.show_sql" value="false" />
		</properties>
	</persistence-unit>

Datasource:

	<local-tx-datasource>
		<jndi-name>oracle-data-source</jndi-name>
		<use-java-context>true</use-java-context>
		<connection-url>jdbc:oracle:thin:@192.168.10.215:1521:bd</connection-url>
		<driver-class>oracle.jdbc.OracleDriver</driver-class>
		<user-name>admin</user-name>
		<password>admin</password>
		<min-pool-size>2</min-pool-size>
		<max-pool-size>5</max-pool-size>
	</local-tx-datasource>

	<local-tx-datasource>
		<jndi-name>jdbc/mysql-data-source</jndi-name>
		<use-java-context>true</use-java-context>
		<connection-url>jdbc:mysql://192.168.10.12:3306/web?autoReconnect=true</connection-url>
		<driver-class>com.jdbc.mysql.Driver</driver-class>
		<user-name>conmysql</user-name>
		<password>conmysql</password>
		<min-pool-size>2</min-pool-size>
		<max-pool-size>5</max-pool-size>
	</local-tx-datasource>

Como assim o jboss não consegue diferenciar quem é oracle ou mysql?

Você é que tem que especificar qual classe pertence a qual persistence unit no persistence.xml.

A implementação do JPA do JBoss nada mais faz do que seguir o que você determinou, todas as classes pertencem aos dois persistence units.

Se a classe deve pertencer ao PU de oracle, mapeie-a lá.
Se a classe deve pertencer aos DOIS PUs você pode:

  1. deixar como AUTO e ela irá escolher o que fazer. Nesse caso a coluna no mysql deve estar como auto incremento e uma sequence criada para o JPA usar (Nome padrão).
  2. sobrescrever o ID de cada uma no arquivo persistence.xml

Logo essa parte que era importante você não especificou :slight_smile:

O que é a tal “coisa com erro” ?

É simples, você precisa entender que Oracle trabalha com sequence e, o MySQL, com auto_increment.
Precisa determinar isso nas configurações dos teus entities.

[quote=Hebert Coelho]Como assim o jboss não consegue diferenciar quem é oracle ou mysql?

Você é que tem que especificar qual classe pertence a qual persistence unit no persistence.xml.

A implementação do JPA do JBoss nada mais faz do que seguir o que você determinou, todas as classes pertencem aos dois persistence units.

Se a classe deve pertencer ao PU de oracle, mapeie-a lá.
Se a classe deve pertencer aos DOIS PUs você pode:

  1. deixar como AUTO e ela irá escolher o que fazer. Nesse caso a coluna no mysql deve estar como auto incremento e uma sequence criada para o JPA usar (Nome padrão).
  2. sobrescrever o ID de cada uma no arquivo persistence.xml[/quote]

Mapeei as classes nos respectivos Persistence Unit, agora tenho o mesmo erro que o Rodrigo perguntou: Missing Dependecies, que pra mim é erro genérico.

[ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "jboss-injector:appName=apporacle,module=apporacle" is missing the following dependencies:
    Dependency "<UNKNOWN jboss-injector:appName=apporacle,module=apporacle>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=apporacle,module=apporacle' **")
.
.
.

[quote=bruno_7317]

[quote=Hebert Coelho]Como assim o jboss não consegue diferenciar quem é oracle ou mysql?

Você é que tem que especificar qual classe pertence a qual persistence unit no persistence.xml.

A implementação do JPA do JBoss nada mais faz do que seguir o que você determinou, todas as classes pertencem aos dois persistence units.

Se a classe deve pertencer ao PU de oracle, mapeie-a lá.
Se a classe deve pertencer aos DOIS PUs você pode:

  1. deixar como AUTO e ela irá escolher o que fazer. Nesse caso a coluna no mysql deve estar como auto incremento e uma sequence criada para o JPA usar (Nome padrão).
  2. sobrescrever o ID de cada uma no arquivo persistence.xml[/quote]

Mapeei as classes nos respectivos Persistence Unit, agora tenho o mesmo erro que o Rodrigo perguntou: Missing Dependecies, que pra mim é erro genérico.

[code]
[ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment “jboss-injector:appName=cabal-beneficios,module=cabal-beneficios” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:appName=apporacle,module=apporacle>” (should be in state “Installed”, but is actually in state “** UNRESOLVED Demands ‘jboss-switchboard:appName=cabal-beneficios,module=cabal-beneficios’ **”)
.
.
.
[/code][/quote] Coloca o log todo, por favor.

Segue:

[code]DEPLOYMENTS MISSING DEPENDENCIES:
Deployment “jboss-injector:appName=apporacle,module=apporacle” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:appName=apporacle,module=apporacle>” (should be in state “Installed”, but is actually in state “** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle,module=apporacle’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=arquivoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=arquivoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=arquivoService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=chamadoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=chamadoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=chamadoService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=comercioService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=comercioService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=comercioService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=contratoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=contratoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=contratoService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=emailService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=emailService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=emailService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=empresaService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=empresaService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=empresaService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=enderecoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=enderecoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=enderecoService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=loteService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=loteService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=loteService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=pedidoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=pedidoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=pedidoService’ ")
Deployment “jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=ramoService” is missing the following dependencies:
Dependency “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=ramoService>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=ramoService’ ")
Deployment “jboss-switchboard:appName=apporacle,module=apporacle” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=arquivoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=chamadoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=comercioService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=contratoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=emailService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=empresaService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=enderecoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=loteService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=pedidoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=ramoService” is missing the following dependencies:
Dependency “mysql-data-source” (should be in state “Installed”, but is actually in state "
NOT FOUND Depends on ‘mysql-data-source’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=arquivoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=arquivoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=arquivoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=arquivoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=arquivoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=chamadoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=chamadoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=chamadoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=chamadoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=chamadoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=comercioService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=comercioService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=comercioService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=comercioService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=comercioService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=contratoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=contratoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=contratoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=contratoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=contratoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=emailService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=emailService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=emailService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=emailService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=emailService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=empresaService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=empresaService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=empresaService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=empresaService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=empresaService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=enderecoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=enderecoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=enderecoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=enderecoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=enderecoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=loteService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=loteService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=loteService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=loteService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=loteService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=pedidoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=pedidoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=pedidoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ ")
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=pedidoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=pedidoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=ramoService,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=ramoService,service=EJB3>” (should be in state “Installed”, but is actually in state "
UNRESOLVED Demands ‘jboss-injector:bean=ramoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **”)
Deployment “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=ramoService,service=EJB3_endpoint” is missing the following dependencies:
Dependency “jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=ramoService,service=EJB3” (should be in state “Installed”, but is actually in state “PreInstall”)
Deployment “jboss.web.deployment:war=/sinet” is missing the following dependencies:
Dependency “jboss-injector:appName=apporacle,module=apporacle” (should be in state “Create”, but is actually in state “Configured”)

DEPLOYMENTS IN ERROR:
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=ramoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=ramoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=contratoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=contratoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=pedidoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=pedidoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “mysql-data-source” is in error due to the following reason(s): ** NOT FOUND Depends on ‘mysql-data-source’ **
Deployment “<UNKNOWN jboss-injector:appName=apporacle,module=apporacle>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle,module=apporacle’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=arquivoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=arquivoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=comercioService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=comercioService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=chamadoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=chamadoService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=enderecoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=enderecoService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=loteService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=loteService’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=emailService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=emailService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=chamadoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=chamadoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=ramoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=ramoService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=emailService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=emailService’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=empresaService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=empresaService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=comercioService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=comercioService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=contratoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=contratoService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=pedidoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=pedidoService’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=enderecoService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=enderecoService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=empresaService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=empresaService’ **
Deployment “<UNKNOWN jboss-injector:topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,bean=arquivoService>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-switchboard:appName=apporacle-srv-ear,module=apporacle-srv-ejb-1.0.0-SNAPSHOT,name=arquivoService’ **
Deployment “<UNKNOWN jboss.j2ee:ear=apporacle-srv-ear.ear,jar=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar,name=loteService,service=EJB3>” is in error due to the following reason(s): ** UNRESOLVED Demands ‘jboss-injector:bean=loteService,topLevelUnit=apporacle-srv-ear.ear,unit=apporacle-srv-ejb-1.0.0-SNAPSHOT.jar’ **

at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_35]

[/code]

É cara, ainda acho que tá faltando coisa aí…

mas tudo bem.

Como está seu persistence.xml?

Sim, não coloquei o resto porque não deu erro, subiu normal.

Segue o persistence:

[code]
org.hibernate.ejb.HibernatePersistence
java:/oracle-data-source

	<class>com.modelo.Contrato</class>
	<class>com.modelo.Email</class>
	<class>com.modelo.Usuario</class>
	<exclude-unlisted-classes>true</exclude-unlisted-classes>

	<properties>
		<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
		<property name="hibernate.hbm2ddl.auto" value="none" />
		<property name="hibernate.show_sql" value="false" />
	</properties>
</persistence-unit>

<persistence-unit name="pu-mysql">
	<provider>org.hibernate.ejb.HibernatePersistence</provider>
	<jta-data-source>java:/mysql-data-source</jta-data-source>

	<class>com.modelo.EntidadeSQL</class>
	<exclude-unlisted-classes>true</exclude-unlisted-classes>

	<properties>
		<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
		<property name="hibernate.hbm2ddl.auto" value="none" />
		<property name="hibernate.show_sql" value="false" />
	</properties>
</persistence-unit>

[/code]

Não subiu certinho pq deu erro. Esse erro aí fala que falta um módulo deve ter dado erro por isso ñ subiu.

Só com isso aí não tem como analisar.

Exato, só que NÃO HÁ erros no log, nenhuma pilha sequer. Li linha por linha do deploy e não há nenhuma pista do que possa estar acontecendo.
Vou tentar limpar os caches e subir de novo, não é possível.

EDIT:
Comparei meu log de deploy com o de uma colega e novamente não há pistas, com exceção que o JBoss dela sobe, e o meu não.

Para futuro esclarecimento:
O problema era uma classe (GenericService) que tinha as linhas abaixo:

@Resource(mappedName = "jdbc/mysql-data-source")
private DataSource dataSourceMySql;

Como o atributo estava setado true no datasource, foi necessário reescrever a linha para

@Resource(mappedName = "java:/jdbc/mysql-data-source")
private DataSource dataSourceMySql;

Com isso o problema foi resolvido.

Abraços