Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1211

zk 6.0.1 device-class not set by default; upgrade causes org.zkoss.zk.device.DeviceNotFoundException: ajax not found exception

XMLWordPrintable

      When upgrading from ZK 6.0.0 to 6.0.1, I started getting the following exception:

      Jun 23, 2012 11:29:45 AM org.apache.catalina.core.AprLifecycleListener init
      INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_05\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0_05\jre\bin;C:/Progra~1/Java/jdk1.7.0_03//bin/../jre/bin/server;C:/Progra~1/Java/jdk1.7.0_03//bin/../jre/bin;C:/Progra~1/Java/jdk1.7.0_03//bin/../jre/lib/amd64;C:\Program Files (x86)\Informatica\UMQ_5.3\Win2k-i386\bin;C:\Program Files\Informatica\UMQ_5.3\Win2k-x86_64\bin;C:\Program Files (x86)\PC Connectivity Solution\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Progra~1\Java\jdk1.7.0_03\\bin;D:\MinGW\bin;D:\MinGW\msys\1.0\bin;C:\Progra~1\PostgreSQL\9.1\bin;D:\work\pontus\tech\thirdparty\apache-maven-3.0.4\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Calibre2\;D:\work\pontus\tech\thirdparty\apache-ant-1.8.3\bin;D:\work\thirdparty\eclipse;;.
      Jun 23, 2012 11:29:45 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
      WARNING: [SetPropertiesRule]

      {Server/Service/Engine/Host/Context}

      Setting property 'source' to 'org.eclipse.jst.jee.server:vision' did not find a matching property.
      Jun 23, 2012 11:29:45 AM org.apache.coyote.AbstractProtocolHandler init
      INFO: Initializing ProtocolHandler ["http-bio-8080"]
      Jun 23, 2012 11:29:45 AM org.apache.coyote.AbstractProtocolHandler init
      INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
      Jun 23, 2012 11:29:45 AM org.apache.catalina.startup.Catalina load
      INFO: Initialization processed in 799 ms
      Jun 23, 2012 11:29:45 AM org.apache.catalina.core.StandardService startInternal
      INFO: Starting service Catalina
      Jun 23, 2012 11:29:45 AM org.apache.catalina.core.StandardEngine startInternal
      INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
      Jun 23, 2012 11:29:49 AM org.zkoss.zk.ui.http.WebManager <init>:115
      INFO: Starting ZK 6.0.1 CE (build: 2012050214)
      Jun 23, 2012 11:29:49 AM org.zkoss.zk.ui.sys.ConfigParser parseConfigXml:160
      INFO: Loading system default
      Jun 23, 2012 11:29:49 AM org.zkoss.util.resource.ClassLocator getDependentXMLResources:80
      WARNING: Replicate resource: zk
      Overwrite jar:file:/C:/Users/leo/.m2/repository/org/zkoss/zk/zk/6.0.1/zk-6.0.1.jar!/metainfo/zk/config.xml
      with jar:file:/D:/work/pontus/tech/inhouse/gui/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vision/WEB-INF/lib/zk.jar!/metainfo/zk/config.xml
      Jun 23, 2012 11:29:49 AM org.zkoss.util.resource.ClassLocator getDependentXMLResources:80
      WARNING: Replicate resource: zkbind
      Overwrite jar:file:/C:/Users/leo/.m2/repository/org/zkoss/zk/zkbind/6.0.1/zkbind-6.0.1.jar!/metainfo/zk/config.xml
      with jar:file:/D:/work/pontus/tech/inhouse/gui/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vision/WEB-INF/lib/zkbind.jar!/metainfo/zk/config.xml
      Jun 23, 2012 11:29:49 AM org.zkoss.zk.ui.sys.ConfigParser checkVersion:126
      INFO: Ignore jar:file:/D:/work/pontus/tech/inhouse/gui/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vision/WEB-INF/lib/zk.jar!/metainfo/zk/config.xml
      Cause: version not matched; expected=6.0.1, xml=6.0.0
      Jun 23, 2012 11:29:49 AM org.zkoss.zk.ui.sys.ConfigParser checkVersion:126
      INFO: Ignore jar:file:/D:/work/pontus/tech/inhouse/gui/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vision/WEB-INF/lib/zkbind.jar!/metainfo/zk/config.xml
      Cause: version not matched; expected=6.0.1, xml=6.0.0
      Jun 23, 2012 11:29:49 AM org.zkoss.zk.ui.sys.ConfigParser parse:267
      INFO: Parsing jndi:/localhost/vision/WEB-INF/zk.xml
      Jun 23, 2012 11:29:52 AM org.zkoss.util.resource.impl.LabelLoader loadLabels:232
      INFO: Loading labels for en_US
      Jun 23, 2012 11:29:52 AM org.zkoss.util.resource.impl.LabelLoader loadLabels:232
      INFO: Loading labels for en
      Jun 23, 2012 11:29:52 AM org.zkoss.zk.ui.metainfo.DefinitionLoaders load0:179
      SEVERE: Failed to load jar:file:/C:/Users/leo/.m2/repository/org/zkoss/zk/zul/6.0.1/zul-6.0.1.jar!/metainfo/zk/lang.xml
      org.zkoss.zk.device.DeviceNotFoundException: ajax not found.
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.<init>(LanguageDefinition.java:344)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.parseLang(DefinitionLoaders.java:275)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.load0(DefinitionLoaders.java:177)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.load(DefinitionLoaders.java:153)
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.init(LanguageDefinition.java:315)
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.getAll(LanguageDefinition.java:294)
      at org.zkoss.zk.ui.http.WebManager.getCWRURLPrefix(WebManager.java:268)
      at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:225)
      at org.zkoss.zk.ui.http.HttpSessionListener23.contextInitialized(HttpSessionListener23.java:140)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)

      Jun 23, 2012 11:29:52 AM org.apache.catalina.core.StandardContext listenerStart
      SEVERE: Exception sending context initialized event to listener instance of class org.zkoss.zk.ui.http.HttpSessionListener
      org.zkoss.zk.device.DeviceNotFoundException: ajax not found.
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.<init>(LanguageDefinition.java:344)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.parseLang(DefinitionLoaders.java:275)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.load0(DefinitionLoaders.java:177)
      at org.zkoss.zk.ui.metainfo.DefinitionLoaders.load(DefinitionLoaders.java:153)
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.init(LanguageDefinition.java:315)
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.getAll(LanguageDefinition.java:294)
      at org.zkoss.zk.ui.http.WebManager.getCWRURLPrefix(WebManager.java:268)
      at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:225)
      at org.zkoss.zk.ui.http.HttpSessionListener23.contextInitialized(HttpSessionListener23.java:140)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)

      Jun 23, 2012 11:29:52 AM org.apache.catalina.core.StandardContext startInternal
      SEVERE: Error listenerStart
      Jun 23, 2012 11:29:52 AM org.apache.catalina.core.StandardContext startInternal
      SEVERE: Context [/vision] startup failed due to previous errors
      Jun 23, 2012 11:29:52 AM org.apache.coyote.AbstractProtocolHandler start
      INFO: Starting ProtocolHandler ["http-bio-8080"]
      Jun 23, 2012 11:29:52 AM org.apache.coyote.AbstractProtocolHandler start
      INFO: Starting ProtocolHandler ["ajp-bio-8009"]
      Jun 23, 2012 11:29:52 AM org.apache.catalina.startup.Catalina start
      INFO: Server startup in 7453 ms

      I narrowed it down to the ajax class definition in the zk.xml file not having a default class type:

      In the 6.0.0 version, the following worked without setting a device-class:

      <zk>
      <device-config>
      <device-type>ajax</device-type>
      <server-push-class>org.zkoss.zk.ui.impl.PollingServerPush
      </server-push-class>
      <timeout-uri>/timeout.zul</timeout-uri><!-- An empty URL can cause the
      browser to reload the same URL -->
      </device-config>
      ....
      </zk>

      In 6.0.1, I had to add teh device-class explicitly (even though the doc seems to mention that this is an optional field:

      <zk>
      <device-config>
      <device-type>ajax</device-type>
      <device-class>org.zkoss.zk.device.AjaxDevice</device-class>
      <server-push-class>org.zkoss.zk.ui.impl.PollingServerPush
      </server-push-class>
      <timeout-uri>/timeout.zul</timeout-uri><!-- An empty URL can cause the
      browser to reload the same URL -->
      </device-config>
      ....
      </zk>

            Unassigned Unassigned
            odranoel75 odranoel75
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: