cancel
Showing results for 
Search instead for 
Did you mean: 

Error while deploying servlet for Document for the Document Service

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

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.

Answers (1)

Answers (1)

0 Kudos

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.

Vlado
Advisor
Advisor
0 Kudos

Glad to hear!

Just as a tip: Creating classes in the default (unnamed) package in Java is generally not recommended, it can lead to all kinds of weird issues.