1

I am trying to create a RESTful Web Service using Jersey (I am new to Java). When I add the jersey dependencies in pom.xml, it worked fine. But when I am trying to add SDL Web 8.5 CIL maven dependency

<dependency>
    <groupId>com.sdl.web</groupId>
    <artifactId>cil</artifactId>
    <version>8.5.0-1011</version>
    <type>pom</type>
</dependency>

It is throwing following error

java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:669) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

When I removed / uncommented the CIL dependency, it worked again. Here is the pom.xml which I used:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>RestSample</groupId>
<artifactId>RestSample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.19</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-servlet</artifactId>
            <version>1.19</version>
        </dependency>
        <dependency>
            <groupId>com.sdl.web</groupId>
            <artifactId>cil</artifactId>
            <version>8.5.0-1011</version>
            <type>pom</type>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                <source>1.8</source>
                <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                <warSourceDirectory>WebContent</warSourceDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Please let me know if I am missing anything or not doing anything right.

  • can you please post the xml in the readability format which will help others to take look quickly – k951 Feb 12 at 6:29
  • Yes, just did that – GVK Feb 12 at 6:30
  • take look shahideqamuddin.blogspot.com/2017/11/… may help you out – k951 Feb 12 at 6:34
  • Hi @k951, I used the same reference and created a console application. It worked well, but when I am trying to do the same with Jersey RESTFul based Web Service. I am getting the issue. – GVK Feb 12 at 6:38
  • Looks like a version conflict. Perhaps your application requires a different version of one of the jars in the CIL. Have you checked where the class javax.ws.rs.core.UriBuilder comes from? – Quirijn Feb 12 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.