Skip to Content

Error when deploying EAR file (restful)

Hi experts,

I am getting the following error when deploying an EAR file: "CSN component of deployment item is not available".

That is all the message.

The application is about restful service.

I am doing the exact tutorial from this link: Put SOAP to REST using CE

I have no idea what is missing.

Maybe an reference target in the application-j2ee-engine.xml ?

Can someone help?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 29, 2018 at 11:23 AM

    It finally works!!!!

    I also added cxf-core-3.2.1.jar file in EAR project as Deployment Assembly.

    Thanks Richard for your precious help. You put me on the way.

    So I would like to sum up.

    1) Create a class in a package.

    2) Configure web.xml as Richard wrote.

    3) Add the cxf-core-3.2.1.jar (and all the jars that we mentioned in this page).

    Best Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 29, 2018 at 06:22 AM

    Hello, David, I would like to know that whether this message is just a warning message or not?

    Add comment
    10|10000 characters needed characters exceeded

    • Hopefully there is an improvement.

      I do not get the CSN message error anymore.

      The thing is to put the class in a package. Without package, you get the CSN error message.

      So now, my web.xml looks like this.


      The class looks like this.

      package com.test;
      public class Hello2 {
      	  public String sayPlainTextHello() {
      	    return "Hello Jersey";
      	 // This method is called if XML is request
      	  public String sayXMLHello() {
      	    return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>";
      	// This method is called if HTML is request
      	  public String sayHtmlHello() {
      	    return "<html> " + "<title>" + "Hello Jersey" + "</title>"
      	        + "<body><h1>" + "Hello Jersey" + "</body></h1>" + "</html> ";

      I created a new class named Hello2.

      Now everything is deployed without warning but still cannot call the restful class via http://server/KM30_WEB/rest/hello2.

      In log file, I have new error which is tje following.

      java.lang.NoSuchMethodError: org.apache.cxf.common.util.UrlUtils.urlEncode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      	at org.apache.cxf.jaxrs.utils.HttpUtils.urlEncode(
      	at org.apache.cxf.jaxrs.utils.HttpUtils.urlEncode(
      	at org.apache.cxf.jaxrs.utils.HttpUtils.componentEncode(
      	at org.apache.cxf.jaxrs.utils.HttpUtils.pathEncode(
      	at org.apache.cxf.jaxrs.utils.HttpUtils.encodePartiallyEncoded(
      	at org.apache.cxf.jaxrs.model.URITemplate.<init>(
      	at org.apache.cxf.jaxrs.model.URITemplate.createExactTemplate(
      	at org.apache.cxf.jaxrs.impl.UriBuilderImpl.buildPath(
      	at org.apache.cxf.jaxrs.impl.UriBuilderImpl.doBuildUriParts(
      	at org.apache.cxf.jaxrs.impl.UriBuilderImpl.doBuild(
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(
      	at javax.servlet.http.HttpServlet.service(

      I hope I did not make too much mess here. I try to keep things clear.

      Thanks again.