Galera,
estou com um erro muito estranho em uma aplicação EJB.
Tenho uma aplicação corporativa (EAR) com um módulo Web e dois módulos EJB. Um desses módulos EJB possui um Enterprise Bean (Module001ScheduleService) do tipo @Singleton.
Quando publico a aplicação, tenho o seguinte erro:
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss-injector:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT" is missing the following dependencies:
Dependency "<UNKNOWN jboss-injector:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT' **")
Deployment "jboss-switchboard:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT" is missing the following dependencies:
Dependency "java:global/cdi/AppServer/AppServer-web-0.0.1-SNAPSHOT/BeanManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'java:global/cdi/AppServer/AppServer-web-0.0.1-SNAPSHOT/BeanManager' **")
Deployment "jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3' **")
Deployment "jboss.web.deployment:war=/AppServer" is missing the following dependencies:
Dependency "jboss-injector:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT" (should be in state "Create", but is actually in state "Configured")
Deployment "vfs:///E:/Servidores/jboss-6.1.0.Final/server/default/deploy/AppServer.ear_WeldBootstrapBean" is missing the following dependencies:
Dependency "jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3" (should be in state "PreInstall", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3' **")
DEPLOYMENTS IN ERROR:
Deployment "java:global/cdi/AppServer/AppServer-web-0.0.1-SNAPSHOT/BeanManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'java:global/cdi/AppServer/AppServer-web-0.0.1-SNAPSHOT/BeanManager' **
Deployment "<UNKNOWN jboss-injector:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=AppServer,module=AppServer-web-0.0.1-SNAPSHOT' **
Deployment "jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=AppServer.ear,jar=AppModule-0.0.1-SNAPSHOT.jar,name=Module001ScheduleService,service=EJB3' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905)
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87)
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107)
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135)
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56)
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827)
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417)
at java.lang.Thread.run(Thread.java:722)
Bom, quebrei a cabeça e não consegui compreender qual a dependência que ele acusa estar faltando.
Por um momento eu troquei o tipo do Enterprise Bean Module001ScheduleService, de Singleton para Stateless e o erro desapareceu, e o EJB foi publicado com sucesso.
Agora minha pergunta: o que tem a ver o tipo do EJB neste caso. Pra mim este erro não faz o menor sentido.
Estou usando o JBoss 6.1 como AS.
Alguma sugestão?