Thursday, February 19, 2009

Deploying Jersey to JBOSS

7 comments:

  1. Hi
    I used the same code and it is not able to find the ServletContainer class. I am using JBoss 5.X and I do not think it comes with this container.

    Error is :--
    com.sun.jersey.spi.service.ServiceConfigurationError: com.sun.jersey.spi.HeaderDelegateProvider: The class com.sun.jersey.core.impl.provider.header.LocaleProvider implementing provider interface com.sun.jersey.spi.HeaderDelegateProvider could not be instantiated: null

    ReplyDelete
  2. Dear Chase,

    these seem to be the same steps as writing a RESTful web service in Glassfish. The big difference is that Glassfish comes with all Jersey JARs installed.

    My question is, which JARs did you deploy into which JBoss directory?

    ReplyDelete
  3. Typically, you would either put JARs into jboss/servers/XXX/lib, where XXX is your server name, or you would have them packaged in your JARs.

    Which JARs you need will likely be different depending on your configuration. I would start by including jersey.jar itself, the trouble-shooting via the JBOSS logs.

    ReplyDelete
  4. Hi Chase,
    your jersey example is running well on JBoss 4.2.3, but on JBoss 5.1.0 I get this:
    java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xml.bind.JAXBContext

    Any idea, what can I do?

    ReplyDelete
  5. I deployed jersey on jboss 5.1 following the tutorial. The libraries I add were

    activation-1.1.jar
    asm-3.1.jar
    jersey-bundle-1.8.jar
    stax-api-1.0-2.jar

    I had a similar problem to Snooker and took out the jaxb jars that come from jersey from my project lib as I am running under JRE 6. JAXB is included with Java 6 so did not need to add it to the project.

    ReplyDelete
  6. hi, i can confirm with these libraries it works under jboss5.1

    activation-1.1.jar
    asm-3.1.jar
    jaxb-api-2.1.jar
    jaxb-impl-2.1.jar
    jersey-bundle-1.5.jar
    jersey-core-1.5.jar
    jersey-server-1.5.jar
    jsr311-api-1.0.jar
    stax-api-1.0-2.jar

    ReplyDelete
  7. thanks for this simple but very helpful tutorial.. helped me very much !

    ReplyDelete