【问题标题】:Play2War - could not create Vfs.Dir from urlPlay2War - 无法从 url 创建 Vfs.Dir
【发布时间】:2016-03-21 15:49:20
【问题描述】:

我正在尝试使用 Play2War 将 Play 2.1.1 应用程序部署到 Websphere 8.5.5。该应用程序在使用 play ~run 启动时运行良好,但是当我将战争部署到 Websphere 时,我收到以下错误消息:

org.reflections.ReflectionsException:
    could not create Vfs.Dir from url, no matching UrlType was found
    [wsjar:file:/C:/apps/websphere/wlp/usr/servers/server_kev/workarea/org.eclipse.osgi/bundles/45/data/cache/com.ibm.ws.app.manager_gen_0fdbabb2-5ae7-4075-bda1-136e52319906/.cache/WEB-INF/lib/playbackend.jar!/]

其他人看到过这个问题吗?

【问题讨论】:

    标签: playframework-2.0 ebean websphere-8 reflections


    【解决方案1】:

    如果您当前的 Reflections 库还没有开箱即用,只需添加一个 Vfs UrlType:

    Vfs.addDefaultURLTypes(
        new Vfs.UrlType() {
            public boolean matches(URL url) {
               return url.getProtocol().equals("vfs");
            }
    
            public Vfs.Dir createDir(URL url) {
                return DefaultUrlTypes.jarUrl.createDir(url);
            }
    

    查看latest sources

    【讨论】:

      【解决方案2】:

      如果您使用Subcontext Deployment,请确保在conf/application.conf 中添加:

      application.context=/KevSheedyApp/
      

      你可以将你的战争命名为KevSheedyApp.war

      您应该可以通过http://host:port/KevSheedyApp/bla/bla访问您的应用程序

      【讨论】:

        【解决方案3】:

        即使使用最新版本的 Reflections 库,我也会得到这个。我最终发现这是我构建我的(胖)罐子(或者在你的情况下是战争)的方式。我有一个 ant 脚本(最初由 Eclipse 生成)将库按原样复制到 jar 中并使用某种加载器。相反,我告诉它将库解压缩到我的 jar 中,这解决了这个问题。不知道为什么当它们按原样打包到罐子/战争中时会发生这种情况。我希望这对某人有所帮助。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2017-01-09
          • 1970-01-01
          • 2021-08-08
          • 1970-01-01
          • 1970-01-01
          • 2016-05-15
          • 2018-04-14
          • 1970-01-01
          相关资源
          最近更新 更多