Skip to Content

Error while deploying servlet for Document for the Document Service

Hello SCN,

I want to access the Document Service in an external Application and i'm following this Tutorial SAP HANA Cloud Platform.

I built the servlet, which should expose the document service to an external app following the exact steps.

I end up with this servlet file


import com.sap.ecm.api.AbstractCmisProxyServlet;
public class CMISProxyServlet extends AbstractCmisProxyServlet { 
   @Override 
   protected String getRepositoryUniqueName() { 
       return "demo.repository.com"; 
   } 
   @Override 
   //For productive applications, use a secure location to store the secret key. 
   protected String getRepositoryKey() { 
       return "********************"; 
   } 
}

When i use eclipse to deploy the servlet on my trial instance i get the following error.

2016 09 05 09:30:26#+00#ERROR#org.eclipse.virgo.web.enterprise.openejb.deployer.VirgoDeployerEjb##anonymous#fs-watcher#na#p1942007883trial#repositoryse#web##Error while deploying application 
with real path '/usr/sap/ljs/webapps/Repository_Servlet' and web context path '/Repository_Servlet'org.apache.openejb.OpenEJBException: Unable to load servlet class: com.sap.sapfiledepot.CMISProxyServlet: com.sap.sapfiledepot.CMISProxyServlet

Does anyone have a clue what could haven gone wrong here?

Greetings

Oliver

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 05, 2016 at 11:52 AM

    Looks like your servlet class is not packaged in your war file or its name (including packages) does not match the name specified in your web.xml.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 05, 2016 at 12:43 PM

    Hi Vladimir,

    thanks for the idea where the error could come from.

    Since I'm a beginner with servlets i didn't correctly map the servlet class in the web.xml.

    The code in the tutorial is:

    <servlet>
      <servlet-name>cmisproxy</servlet-name>
      <servlet-class>my.app.CMISProxyServlet</servlet-class> 
    </servlet> 
    
    <servlet-mapping>
      <servlet-name>cmisproxy</servlet-name>
      <url-pattern>/cmis/*</url-pattern> 
    </servlet-mapping>
    

    Since i just added a servlet with out a package line 03 should be:

      <servlet-class>CMISProxyServlet</servlet-class> 
    

    It works now.

    Thanks everyone and happy coding.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.