Servlet pluggin error - LinkageError

Certified Senior Developer

Hi,

Have created a servlet pluggin to download document from rest API.

Using this pluggin as safeuri.

Getting the following error on clicking the link.

Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) 
previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"

Please suggest if anyone has encountered the same issue and how to resolve it.

Thanks in advance.

 

  Discussion posts and replies are publicly visible

Parents
  • Hi Vikrant,

    Please share few more details.

    1) Did you add any jars along with plugin if yes can you mention what are they?
    2) Did you see any error while deploying the plugin?
    3) What is the code code snippet including imports if possible?

    Where are you using (In Appian itself or external application) this Servlet plugin link? If it is external then did you try to use the Appian Web API directly in the external application?
  • 0
    Certified Senior Developer
    in reply to Shanmukha
    Hi Raghvendra,

    Thanks for your response.

    Please find the details below:

    1. List of Jars included in lib
    -> activation-1.1.1.jar
    -> commons-codec-1.9.jar
    -> commons-io-2.4.jar
    -> commons-lang3-3.2.1.jar
    -> javax.servlet-api-3.1.0.jar
    -> json-rpc-1.0-appian-1.0.jar
    -> log4j-1.2.17.jar

    2. No error in deploying.

    3. We are using the pluggin in Appian SAIL interface.

    4. List of imports

    import java.io.BufferedReader;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.io.UnsupportedEncodingException;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.HashMap;
    import java.util.Map;

    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import org.apache.commons.io.IOUtils;
    import org.apache.commons.codec.binary.Base64;
    import org.apache.log4j.Logger;
    import org.json.JSONObject;

    import com.appiancorp.services.ServiceContext;
    import com.appiancorp.services.WebServiceContextFactory;
    //import com.appiancorp.suiteapi.common.ServiceLocator;
    import com.appiancorp.suiteapi.process.ProcessDesignService;
    import com.appiancorp.suiteapi.type.TypedValue;
    import com.appiancorp.suiteapi.servlet.AppianServlet;

    Thanks.
  • 0
    A Score Level 1
    in reply to vbhardwaj
    Hi Vikrant,

    Please remove Servlet related jar files from lib when you bundle the plugin jar. This may be because of the Servlet jar your using must be version mismatch with the current Appian version.

    Please let me know the results. Hope this may work.
  • 0
    Certified Senior Developer
    in reply to Shanmukha
    Hi Raghavendra,

    Should i remove any other jars also apart from javax.servlet-api-3.1.0.jar ?

    Thanks
  • 0
    A Score Level 1
    in reply to vbhardwaj
    Please remove Servlet one and see if it works. I see that is the suspected one. You can check the other jars from we-inf/lib folder. If others are available then you don't need to bundle them with jar.
Reply Children
No Data