jax rs activator in web cdi app is ignored
miguelius Feb 7, 2013 9:01 AMHi!
Me again!
I'm deploying a war with couple of web services, some of them jax rs, other jax ws.
My configuration is JBOSS AS 7.1.1.Final, Sun JDK 1.7.0_13. I'm using the standalone.xml configuration. I've tried with server's default Resteasy release, with 2.3.4.Final and with 2.3.5.Final. Same result.
The web project has the corresponding web.xml file. It's content:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"/>
Threre's a beans.xml, too, and it looks like:
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
We have an Activator class
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath(value="/")
public class SeraPosibleActivator extends Application {
}
And a couple of classes which exposes the services, which also include some:
@Path("/elServicio")
public class QueServicio {
@Inject
private ElNegocio elNegocio;
@GET
@Path("/queHoraEs")
public Date queHoraEs() {
return elNegocio.queHoraEs();
}
}
When I deployed it:
10:52:14,367 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
10:52:14,513 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:52:14,552 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
10:52:15,119 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
10:52:15,120 INFO [org.xnio] XNIO Version 3.0.3.GA
10:52:15,128 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
10:52:15,134 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
10:52:15,143 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
10:52:15,146 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
10:52:15,148 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
10:52:15,162 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
10:52:15,163 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
10:52:15,178 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
10:52:15,183 INFO [org.jboss.as.connector] (MSC service thread 1-10) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
10:52:15,184 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
10:52:15,187 INFO [org.jboss.as.security] (MSC service thread 1-7) JBAS013100: Current PicketBox version=4.0.7.Final
10:52:15,205 INFO [org.jboss.as.naming] (MSC service thread 1-9) JBAS011802: Starting Naming Service
10:52:15,225 INFO [org.jboss.as.mail.extension] (MSC service thread 1-13) JBAS015400: Bound mail session [java:jboss/mail/Default]
10:52:15,249 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
10:52:15,263 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
10:52:15,331 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-12) JBoss Web Services - Stack CXF Server 4.0.2.GA
10:52:15,363 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-14) Arrancando Coyote HTTP/1.1 en puerto http--0.0.0.0-8081
10:52:15,566 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-14) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
10:52:15,567 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:jboss/datasources/ChangosDS]
10:52:15,651 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-14) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.1.Final/standalone/deployments
10:52:15,652 INFO [org.jboss.as.remoting] (MSC service thread 1-13) JBAS017100: Listening on /127.0.0.1:9999
10:52:15,652 INFO [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on /0.0.0.0:4447
10:52:15,656 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found changos-ws.war in deployment directory. To trigger deployment create a file called changos-ws.war.dodeploy
10:52:15,717 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "changos-ws.war"
10:52:15,980 INFO [org.jboss.as.jpa] (MSC service thread 1-11) JBAS011401: Read persistence.xml for baseCHANGOS
10:52:16,036 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016002: Processing weld deployment changos-ws.war
10:52:16,083 INFO [org.jboss.weld.deployer] (MSC service thread 1-10) JBAS016005: Starting Services for CDI deployment: changos-ws.war
10:52:16,255 INFO [org.jboss.weld.Version] (MSC service thread 1-10) WELD-000900 1.1.5 (AS71)
10:52:16,274 INFO [org.jboss.as.jpa] (MSC service thread 1-6) JBAS011402: Starting Persistence Unit Service 'changos-ws.war#baseCHANGOS'
10:52:16,337 INFO [org.hibernate.annotations.common.Version] (MSC service thread 1-6) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
10:52:16,340 INFO [org.hibernate.Version] (MSC service thread 1-6) HHH000412: Hibernate Core {4.0.1.Final}
10:52:16,341 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-6) HHH000206: hibernate.properties not found
10:52:16,342 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-6) HHH000021: Bytecode provider name : javassist
10:52:16,353 INFO [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-6) HHH000204: Processing PersistenceUnitInfo [
name: baseCHANGOS
...]
10:52:16,394 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-6) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
10:52:16,575 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-6) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
10:52:16,586 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-6) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
10:52:16,588 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-6) HHH000397: Using ASTQueryTranslatorFactory
10:52:16,662 INFO [org.hibernate.tool.hbm2ddl.SchemaValidator] (MSC service thread 1-6) HHH000229: Running schema validator
10:52:16,662 INFO [org.hibernate.tool.hbm2ddl.SchemaValidator] (MSC service thread 1-6) HHH000102: Fetching database metadata
10:52:16,677 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment changos-ws.war
10:52:16,900 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Inicializando Mojarra 2.1.7-jbossorg-1 (20120227-1401) para el contexto '/changos-ws'
10:52:17,404 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-4) Hibernate Validator 4.2.0.Final
10:52:17,540 INFO [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /changos-ws
10:52:17,546 INFO [org.jboss.as] (MSC service thread 1-16) JBAS015951: Admin console listening on http://127.0.0.1:9990
10:52:17,546 INFO [org.jboss.as] (MSC service thread 1-16) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 3373ms - Started 193 of 271 services (76 services are passive or on-demand)
10:52:17,635 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "changos-ws.war"
Couple of weird things:
- No log about jax rs, nor scanning
- No log about CDI beans initialization, either. There used to be some of it.
- No log about the hibernate's validation of the database schema...
The weirdest thing is that it was working. I have tried with different configurations according resteasy's installation and configuration chapter. Sometimes it works section 3.1, and then I redeploy it and it stops working. Then I move to the way section 3.7 says, it works for a while and boom, back to the bottom.
Any help? Am I missing some configuration tweak?
Thank you very much in advance. Kind regards!
Miguel