【问题标题】:UnableToAdaptException for new web app in Websphere Liberty + Vaadin + IntelliJWebsphere Liberty + Vaadin + IntelliJ 中的新 Web 应用程序出现 UnableToAdaptException
【发布时间】:2014-10-13 11:23:59
【问题描述】:

更新:为了测试 Vaadin 7 教程,我必须检查另一个应用程序服务器 (tomcat 8) 才能启动并运行它。根据用户 Gas 提示,我尝试更改为 web 应用程序 3.0,这似乎破坏了对 Vaadin 7 的引用。

更新2:使用IDEA生成代码库时,选择Web Applicin的版本选项只包含我安装的3.1版本。我仍然是 IDEA 的新手,以及需要修改哪些设置才能在 3.0 及以下版本中修复此问题,但在新的 schemaLocation 解决问题时使用 Gas 的响应。


我刚刚安装:

  • IntelliJ Ultimate Ed IDEA
  • JDK8 Websphere
  • Liberty 配置文件 (wlp-developers-runtime-8.5.5.3)
  • Vaadin 7 完整的 zip 框架

我正在按照 Vaadin 书中的教程设置默认项目,然后创建项目指南顺利完成。但是,当我尝试启动服务器时,我在运行和调试模式下都会收到此错误消息。

Connected to server
[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0,026 seconds.
[ERROR   ] CWWKZ0106E: Could not start web application VaadinDemo_war_exploded.
[ERROR   ] CWWKZ0002E: An exception occurred while starting the application VaadinDemo_war_exploded. The exception message was: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2262E: The version 3.1 does not match the namespace http://xmlns.jcp.org/xml/ns/javaee in the /WEB-INF/web.xml deployment descriptor.
[AUDIT   ] CWWKF0011I: The server liberty-oscar is ready to run a smarter planet.

这就是 web.xml 包含的内容

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <servlet>
        <servlet-name>VaadinApplicationServlet</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <init-param>
            <param-name>UI</param-name>
            <param-value>com.MyVaadinApplication</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>VaadinApplicationServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

由于这些都是全新安装,我是否缺少某些内容,还是应该配置其他内容?对于我列出的安装,所有设置都是“默认”的。

【问题讨论】:

    标签: java websphere vaadin


    【解决方案1】:

    WebSphere Liberty 8.5.5.3 还不支持 Servlet 3.1。尝试将您的部署描述符更改为:

    <web-app xmlns="http://java.sun.com/xml/ns/javaee" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  
       http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
    

    更新

    这个servlet 标签在 Liberty 中完美运行。所以你的设置有问题。

    <servlet>
        <description>
            This is the description for the sample servlet
        </description>
        <display-name>Test</display-name>
        <servlet-name>Test</servlet-name>
        <servlet-class>servlet.Test</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Test</servlet-name>
        <url-pattern>/Test</url-pattern>
    </servlet-mapping>
    

    【讨论】:

    • 所以我试过了,似乎 标签在 3.0 及以下版本中不受支持。我不得不下载tomcat(8),一切正常。我这样做是为了学习如何使用 Vaadin,所以我想没关系。但是我在这里的目标是专门使用 Liberty,所​​以我想如果我不想在那里取得一些进展,我将不得不去看看 Vaadin (6)。无论如何感谢您的意见!
    • @oalmgren &lt;servlet&gt; tags aren't supported in 3.0 and below - 你在哪里找到这些信息,它完全错误,他们支持很久了。
    • @oalmgren 查看此页面:vaadin.com/download/release/7.3/7.3.2/release-notes.htmlvaadin7 需要 servlet 2.4,并且在 WAS 8 中受支持。但如果您正在运行 8,我建议切换到 Java v7(不知道JDK8 WebSphere 是什么意思)
    • 错字:JDK8 Websphere -> 使用 JDK8,
      Websphere Liberty Profile 好的,我会试试 JDK7 看看效果如何。此外, 的东西似乎是对源的不匹配阅读。毫无根据的说法。
    猜你喜欢
    • 2016-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多