我正在使用Worklight 6,当我尝试在预览模式或Android模拟器中运行应用程序时,我有以下Uncaught TypeErrors:
02-28 00:13:19.727: D/CordovaLog(562): Uncaught TypeError: Cannot read property 'UNSUPPORTED_BROWSER' of undefined
02-28 00:13:19.727: E/Web Console(562): Uncaught TypeError: Cannot read property 'UNSUPPORTED_BROWSER' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/wlclient.js:142
02-28 00:13:20.107: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined
02-28 00:13:20.107: E/Web Console(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/encryptedcache.js:24
02-28 00:13:20.247: D/CordovaLog(562): Uncaught TypeError: Cannot read property 'ANDROID' of undefined
02-28 00:13:20.247: E/Web Console(562): Uncaught TypeError: Cannot read property 'ANDROID' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/analytics/analytics.js:43
02-28 00:13:20.347: D/CordovaLog(562): Uncaught TypeError: Cannot set property 'startAcquisition' of undefined
02-28 00:13:20.347: E/Web Console(562): Uncaught TypeError: Cannot set property 'startAcquisition' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/deviceSensors/acquisition.js:50
02-28 00:13:20.417: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined
02-28 00:13:20.417: E/Web Console(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/deviceSensors/geo.js:22
02-28 00:13:20.457: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined
02-28 00:13:20.457: E/Web Console(562): Uncaught TypeError: Cannot call method 'getEnvironment' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/deviceSensors/wifi.js:399
02-28 00:13:20.527: D/CordovaLog(562): Uncaught TypeError: Cannot set property 'transmitEvent' of undefined
02-28 00:13:20.527: E/Web Console(562): Uncaught TypeError: Cannot set property 'transmitEvent' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/events/eventTransmitter.js:320
02-28 00:13:20.547: D/CordovaLog(562): Uncaught TypeError: Cannot set property 'setKeepAliveInBackground' of undefined
02-28 00:13:20.547: E/Web Console(562): Uncaught TypeError: Cannot set property 'setKeepAliveInBackground' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/deviceSensors/bind.js:21
02-28 00:13:20.627: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined
02-28 00:13:20.627: E/Web Console(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/challengeHandlers/antiXSRFChallengeHandler.js:12
02-28 00:13:20.647: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined
02-28 00:13:20.647: E/Web Console(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/challengeHandlers/authenticityChallengeHandler.js:12
02-28 00:13:20.667: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'createProvisioningChallengeHandler' of undefined
02-28 00:13:20.667: E/Web Console(562): Uncaught TypeError: Cannot call method 'createProvisioningChallengeHandler' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/challengeHandlers/deviceAuthAutoProvisioningChallengeHandler.js:11
02-28 00:13:20.677: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'createDeviceAuthChallengeHandler' of undefined
02-28 00:13:20.687: E/Web Console(562): Uncaught TypeError: Cannot call method 'createDeviceAuthChallengeHandler' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/challengeHandlers/deviceAuthNoProvisioningChallengeHandler.js:10
02-28 00:13:20.698: D/CordovaLog(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined
02-28 00:13:20.698: E/Web Console(562): Uncaught TypeError: Cannot call method 'createWLChallengeHandler' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/challengeHandlers/remoteDisableChallengeHandler.js:11
02-28 00:13:20.757: D/CordovaLog(562): Uncaught TypeError: Cannot set property 'extendedGeolocation' of undefined
02-28 00:13:20.757: E/Web Console(562): Uncaught TypeError: Cannot set property 'extendedGeolocation' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/deviceSensors/ExtendedGeolocation.js:237
02-28 00:13:20.837: D/CordovaLog(562): Uncaught TypeError: Cannot set property 'openURL' of undefined
02-28 00:13:20.837: E/Web Console(562): Uncaught TypeError: Cannot set property 'openURL' of undefined at file:///data/data/com.hBC/files/www/default/wlclient/js/wlgap.android.js:33
*(hBC是项目的名称)
当我尝试在移动模拟器中运行项目时,我收到以下错误:
[ERROR] SRVE0777E: Exception thrown by application class 'org.apache.commons.io.FileUtils.openInputStream:190'
java.io.IOException: File 'C:\Users\ADMIN\lastWS_Worklight_h\WorklightServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\72\data\temp\default_node\SMF_WebContainer\hBC\hBC\widget-resources\hBC-android-1.0-67e5a1b0bfe38851fb5006a11b77200e930e4636\preview\default' exists but is a directory
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:190)
at [internal classes]
at com.worklight.gadgets.serving.WebServingServletBase.writeResponse(WebServingServletBase.java:131)
at com.worklight.gadgets.serving.WebServingServletBase.sendResourceResponse(WebServingServletBase.java:78)
at com.worklight.gadgets.serving.PreviewServlet.respondToRequest(PreviewServlet.java:71)
at com.worklight.gadgets.serving.WebServingServletBase.doGetOrPost(WebServingServletBase.java:60)
at com.worklight.gadgets.serving.WebServingServletBase.doGet(WebServingServletBase.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
at [internal classes]
at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:199)
at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:203)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
[ERROR ] FWLSE0048E: Unhandled exception caught: java.io.IOException: File 'C:\Users\ADMIN\lastWS_Worklight_h\WorklightServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\72\data\temp\default_node\SMF_WebContainer\hBC\hBC\widget-resources\hBC-android-1.0-67e5a1b0bfe38851fb5006a11b77200e930e4636\preview\default' exists but is a directory [project hBC]
java.io.IOException: File 'C:\Users\ADMIN\lastWS_Worklight_h\WorklightServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\72\data\temp\default_node\SMF_WebContainer\hBC\hBC\widget-resources\hBC-android-1.0-67e5a1b0bfe38851fb5006a11b77200e930e4636\preview\default' exists but is a directory
[ERROR ] Error Page Exception:
hBC
/hBC
Error Page Exception
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: java.io.IOException: Stream is closed
at com.ibm.wsspi.http.HttpOutputStream.validate(HttpOutputStream.java:187)
at [internal classes]
Caused by: java.io.IOException: Stream is closed
... 3 more
[WARNING ] WARNING: Cannot set status. Response already committed.
[WARNING ] SRVE8094W: WARNING: Cannot set header. Response already committed.
我尝试在eclipse中为ADT和Worklight重新安装,但不是一个好主意。 我安装了最新版本的Worklight,并且存在相同的错误。
在一个干净的项目之后仍然没有。我必须提到我没有在构建路径中标记任何缺少的库。
我非常感谢任何帮助。
答案 0 :(得分:0)