首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >原因: org.apache.chemistry.opencmis.server.shared.AbstractCmisHttpServlet :java.lang.ClassNotFoundException

原因: org.apache.chemistry.opencmis.server.shared.AbstractCmisHttpServlet :java.lang.ClassNotFoundException
EN

Stack Overflow用户
提问于 2018-07-30 09:40:52
回答 1查看 449关注 0票数 0

我正在做一个现成的cmis项目,使用开放管理信息系统。我成功地构建了maven,但是当我尝试在本地运行这个springboot应用程序时,我得到了上面的类-抽象class,但是我可以在我的IDE/m2存储库中看到这个文件。在Applicattion主文件中,当我尝试初始化这个对象时,dispatcherServletRegistration()方法中出现了错误--新的CustomCmisBrowserBindingServlet() --该类扩展了AbstractCmisHttpServlet。在这上面写着全班没找到。

,这是我的的详细信息

代码语言:javascript
复制
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <overlays>
            <overlay />
            <overlay>
                <groupId>org.apache.chemistry.opencmis</groupId>
                <artifactId>chemistry-opencmis-server-bindings-war</artifactId>
                <excludes>
                    <!-- exclude everything you don't need -->
                    <exclude>index.html</exclude> <!-- default index page -->
                    <exclude>css/**</exclude> <!-- CSS for the default index page -->
                    <exclude>images/**</exclude>
                    <exclude>web/**</exclude> <!-- sample JavaScript application -->
                    <exclude>WEB-INF/classes/sample-repository.properties</exclude>
                </excludes>
            </overlay>
        </overlays>
    </configuration>
</plugin>


<dependency>
    <groupId>org.apache.chemistry.opencmis</groupId>
    <artifactId>chemistry-opencmis-server-bindings-war</artifactId>
    <version>${opencmis.version}</version>
    <type>war</type>
</dependency>
<dependency>
    <groupId>org.apache.chemistry.opencmis</groupId>
    <artifactId>chemistry-opencmis-server-support</artifactId>
    <version>${opencmis.version}</version>
</dependency>
<dependency><!-- for development only -->
    <groupId>org.apache.chemistry.opencmis</groupId>
    <artifactId>chemistry-opencmis-server-bindings</artifactId>
    <version>${opencmis.version}</version>
    <scope>provided</scope>
</dependency>

这是我的主要应用程序java文件

代码语言:javascript
复制
 public static void main(String[] args) {
        //System.setProperty("spring.profiles.active", "local");
        SpringApplication.run(CMISApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(CMISApplication.class, WebConfigurerAdapter.class);
    }

    @Bean
    public ServletRegistrationBean dispatcherServletRegistration() {
        ServletRegistrationBean registration = new ServletRegistrationBean(new
                CustomCmisBrowserBindingServlet(),
                "/api/cmis/browser/*");
        Map<String, String> params = new HashMap<String, String>();
        params.put("callContextHandler",
                "com.sbs.digimags.browser.BearerAuthCallContextHandler");
        registration.setInitParameters(params);
        return registration;
    }



    @Override
    public void onStartup(ServletContext servletContext) throws ServletException
    {
        // Added code to delete the cached files in the server during server start 
        File folder = new File(cacheFolder+key);
        LOG.info("Deleting cache files from"+ cacheFolder+key);
        File[] listOfFiles = folder.listFiles();
        if(listOfFiles!=null ){
            for (int fileNumber = 0; fileNumber < listOfFiles.length; fileNumber++) {
                if (listOfFiles[fileNumber].isFile()) {

                    boolean deletionSuccess =listOfFiles[fileNumber].delete();
                    if(!deletionSuccess)
                        throw new CmisStorageException("Unable to delete the file");
                }
            }
        }
        servletContext.addListener(new CustomCmisRepositoryContextListener(env));
    }

    @Override
    public void contextInitialized(ServletContextEvent sce) {

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
EN

回答 1

Stack Overflow用户

发布于 2018-08-03 11:25:27

<scope>provided</scope>依赖项中删除chemistry-opencmis-server-bindings。在你的设置中,你需要这个罐子。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51591102

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档