getting Developer Notifications about OGNL exceptions after upgrading to struts 2.3.14.2 from 2.3.1.2 - struts

I have my web application built using struts 2.3.1.2. I have following pages/actions where I don't get any OGNL exception as a warning/notification.
JSP page - containing 3 text fields name, address, phone
struts.xml file - devMode = true and corresponding action entry using default interceptor stack
action class where I have properties only for two request parameters i.e. for name and address
Above is running fine and I don't get any warning/notification exception.
Now, recently I have upgraded to struts 2.3.14.2 And I have started to get below warning/notification exception on log file:
Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'start' on 'class com.xyz.DetailsActionSupport:
Error setting expression 'start' with value ['0', ] - Error setting expression 'start' with value ['0', ] - [unknown location] at
com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:201) at
com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:178) at
com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152) at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:329) at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:241) at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) and more ...
By google search, found two answers:
to add the exclude parameters in struts.xml for Param interceptor
disable the development mode defined in struts.xml
I can do that, but, don't understand what has changed in struts version so it has started to print the exceptions as notifications/warnings?
Below link will tells us how it shows warning exception:
http://struts.apache.org/release/2.3.x/docs/parameters-interceptor.html
Refer the section Warning on missing parameters from above link

Related

Why does navigating to a route work, but when i put that URL into the address bar (Or reload page after navigating to it) express server returns error

I'm using an Express server, and everything seem to be working fine. I run my Angular application on it and it runs as it should Navigating between the different routes works like a charm.
But if I navigate to a route, and reload the page in browser, the server returns "Internal Server Error" and the following appears in my server log:
Error
at XMLHttpRequest3.send (/Users/<path-to>/server/main.js:1:4025798)
at Observable._subscribe (/Users/<path-to>/server/main.js:1:4264955)
at Observable._trySubscribe (/Users/<path-to>/server/main.js:1:3520438)
at Observable.subscribe (/Users/<path-to>/server/main.js:1:3520220)
at DoOperator.call (/Users/<path-to>/server/main.js:1:3583421)
at Observable.subscribe (/Users/<path-to>/server/main.js:1:3520074)
at CatchOperator.call (/Users/<path-to>/server/main.js:1:3562760)
at Observable.subscribe (/Users/<path-to>/server/main.js:1:3520074)
at scheduleTask (/Users/<path-to>/main.js:1:640743)
at Observable._subscribe (/Users/<path-to>/server/main.js:1:641346)
Unhandled Promise rejection: req.next is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: req.next is not a function
at done (/Users/<path-to>/server/main.js:1:2200666)
at _ZoneDelegate2.invoke (/Users/<path-to>/server/main.js:1:4048589)
at Zone3.run (/Users/<path-to>/server/main.js:1:4040924)
at /Users/<path-to>/server/main.js:1:4068136
at _ZoneDelegate2.invokeTask (/Users/<path-to>/server/main.js:1:4049527)
at Zone3.runTask (/Users/<path-to>/main.js:1:4042009)
at drainMicroTaskQueue (/Users/<path-to>/server/main.js:1:4053298) TypeError: req.next is not a function
at done (/Users/<path-to>/server/main.js:1:2200666)
at _ZoneDelegate2.invoke (/Users/<path-to>/server/main.js:1:4048589)
at Zone3.run (/Users/<path-to>/server/main.js:1:4040924)
at /Users/<path-to>/server/main.js:1:4068136
at _ZoneDelegate2.invokeTask (/Users/<path-to>/server/main.js:1:4049527)
at Zone3.runTask (/Users/<path-to>/server/main.js:1:4042009)
at drainMicroTaskQueue (/Users/<path-to>/server/main.js:1:4053298)
Edit: The server crashes with the error below when i do a second reload.
/Users/<path-to>/server/main.js:1
var __defProp=Object.defineProperty,__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});(()=>{var __webpack_modules__={12560:(module2,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{AppServerModule:()=>AppServerModule,app:()=>app,renderModule:()=>renderModule,renderModuleFactory:()=>renderModuleFactory});var transports_namespaceObject={};__webpack_require__2.r(transports_namespaceObject),__webpack_require__2.d(transports_namespaceObject,{BaseTransport:()=>BaseTransport,HTTPSTransport:()=>HTTPSTransport,HTTPTransport:()=>HTTPTransport,makeNodeTransport:()=>makeNodeTransport});var integrations_namespaceObject={};__webpack_require__2.r(integrations_namespaceObject),__webpack_require__2.d(integrations_namespaceObject,{Console:()=>Console,ContextLines:()=>ContextLines,Http:()=>Http,LinkedErrors:()=>LinkedErrors,Modules:()=>Modules,OnUncaughtException:()=>OnUncaughtException,OnUnhandledRejection:()=>OnUnhandledRejection});var esm_integrations_namespaceObject={};__webpack_require__2.r(esm_integrations_namespaceObject),__webpack_require__2.d(esm_integrations_namespaceObject,{FunctionToString:()=>FunctionToString,InboundFilters:()=>InboundFilters});var handlers_namespaceObject={};__webpack_require__2.r(handlers_namespaceObject),__webpack_require__2.d(handlers_namespaceObject,{errorHandler:()=>errorHandler,extractRequestData:()=>extractRequestData,parseRequest:()=>parseRequest,requestHandler:()=>requestHandler,tracingHandler:()=>tracingHandler});var node_esm_namespaceObject={};__webpack_require__2.r(node_esm_namespaceObject),__webpack_require__2.d(node_esm_namespaceObject,{Handlers:()=>handlers_namespaceObject,Hub:()=>Hub,Integrations:()=>INTEGRATIONS,NodeBackend:()=>NodeBackend,NodeClient:()=>NodeClient,SDK_NAME:()=>SDK_NAME,SDK_VERSION:()=>SDK_VERSION,Scope:()=>scope_Scope,Session:()=>Session,Severity:()=>Severity,Transports:()=>transports_namespaceObject,addBreadcrumb:()=>addBreadcrumb,addGlobalEventProcessor:()=>addGlobalEventProcessor,captureEvent:()=>captureEvent,captureException:()=>captureException,captureMessage:()=>captureMessage,close:()=>sdk_close,configureScope:()=>configureScope,deepReadDirSync:()=>deepReadDirSync,defaultIntegrations:()=>defaultIntegrations,flush:()=>flush,getCurrentHub:()=>getCurrentHub,getHubFromCarrier:()=>getHubFromCarrier,getSentryRelease:()=>getSentryRelease,init:()=>init,lastEventId:()=>lastEventId,makeMain:()=>makeMain,setContext:()=>setContext,setExtra:()=>setExtra,setExtras:()=>setExtras,setTag:()=>setTag,setTags:()=>setTags,setUser:()=>setUser,startTransaction:()=>startTransaction,withScope:()=>withScope});var integrations_namespaceObject_0={};__webpack_require__2.r(integrations_namespaceObject_0),__webpack_require__2.d(integrations_namespaceObject_0,{FunctionToString:()=>functiontostring_FunctionToString,InboundFilters:()=>inboundfilters_InboundFilters});var browser_esm_integrations_namespaceObject={};__webpack_require__2.r(browser_esm_integrations_namespaceObject),__webpack_require__2.d(browser_esm_integrations_namespaceObject,{Breadcrumbs:()=>Breadcrumbs,Dedupe:()=>Dedupe,GlobalHandlers:()=>GlobalHandlers,LinkedErrors:()=>linkederrors_LinkedErrors,TryCatch:()=>TryCatch,UserAgent:()=>UserAgent});var esm_transports_namespaceObject={};__webpack_require__2.r(esm_transports_namespaceObject),__webpack_require__2.d(esm_transports_namespaceObject,{BaseTransport:()=>base_BaseTransport,FetchTransport:()=>FetchTransport,XHRTransport:()=>XHRTransport,makeNewFetchTransport:()=>makeNewFetchTransport,makeNewXHRTransport:()=>makeNewXHRTransport});var browser_esm_namespaceObject={};__webpack_require__2.r(browser_esm_namespaceObject),__webpack_require__2.d(browser_esm_namespaceObject,{BrowserClient:()=>BrowserClient,Hub:()=>hub_Hub,Integrations:()=>esm_INTEGRATIONS,SDK_NAME:()=>version_SDK_NAME,SDK_VERSION:()=>version_SDK_VERSION,Scope:()=>scope_Scope_0,Session:()=>session_Session,Severity:()=>severity_Severity,Transports:()=>esm_transports_namespaceObject,addBreadcrumb:()=>minimal_addBreadcrumb,addGlobalEventProcessor:()=>scope_addGlobalEventProcessor,captureEvent:()=>minimal_captureEvent,captureException:()=>minimal_captureException,captureMessage:()=>minimal_captureMessage,close:()=>esm_sdk_close,configureScope:()=>minimal_configureScope,defaultIntegrations:()=>sdk_defaultIntegrations,eventFromException:()=>eventFromException,eventFromMessage:()=>eventbuilder_eventFromMessage,flush:()=>sdk_flush,forceLoad:()=>forceLoad,getCurrentHub:()=>hub_getCurrentHub,getHubFromCarrier:()=>hub_getHubFromCarrier,init:()=>sdk_init,injectReportDialog:()=>injectReportDialog,lastEventId:()=>sdk_lastEventId,makeMain:()=>hub_makeMain,onLoad:()=>onLoad,setContext:()=>minimal_setContext,setExtra:()=>minimal_setExtra,setExtras:()=>minimal_setExtras,setTag:()=>minimal_setTag,setTags:()=>minimal_setTags,setUser:()=>minimal_setUser,showReportDialog:()=>showReportDialog,startTransaction:()=>minimal_startTransaction,withScope:()=>minimal_withScope,wrap:()=>sdk_wrap});__webpack_require__2(97584);var TagContentType,TagContentType2,tslib_es6=__webpack_require__2(70655);function splitNsName(elementName){if(":"!=elementName[0])return[null,elementName];const colonIndex=elementName.indexOf(":",1);if(-1===colonIndex)throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);return[elementName.slice(1,colonIndex),elementName.slice(colonIndex+1)]}function isNgContainer(tagName){return"ng-container"===splitNsName(tagName)[1]}function isNgContent(tagName){return"ng-content"===splitNsName(tagName)[1]}function isNgTemplate(tagName){return"ng-template"===splitNsName(tagName)[1]}function getNsPrefix(fullName){return null===fullName?null:splitNsName(fullName)[0]}function mergeNsAndName(prefix,localName){return prefix?`:${prefix}:${localName}`:localName}(TagContentType2=TagContentType||(TagContentType={}))[TagContentType2.RAW_TEXT=0]="RAW_TEXT",TagContentType2[TagContentType2.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",TagContentType2[TagContentType2.PARSABLE_DATA=2]="PARSABLE_DATA",__name(splitNsName,"splitNsName"),__name(isNgContainer,"isNgContainer"),__name(isNgContent,"isNgContent"),__name(isNgTemplate,"isNgTemplate"),__name(getNsPrefix,"getNsPrefix"),__name(mergeNsAndName,"mergeNsAndName");class HtmlTagDefinition{constructor({closedByChildren,implicitNamespacePrefix,contentType=TagContentType.PARSABLE_DATA,closedByParent=!1,isVoid=!1,ignoreFirstLf=!1,preventNamespaceInheritance=!1}={}){this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,closedByChildren&&closedByChildren.length>0&&closedByChildren.forEach(tagName=>this.closedByChildren[tagName]=!0),this.isVoid=isVoid,this.closedByParent=closedByParent||isVoid,this.implicitNamespacePrefix=implicitNamespacePrefix||null,this.contentType=contentType,this.ignoreFirstLf=ignoreFirstLf,this.preventNamespaceInheritance=preventNamespaceInheritance}isClosedByChild(name){return this.isVoid||name.toLowerCase()in this.closedByChildren}getContentType(prefix){if("object"==typeof this.contentType){const overrideType=void 0===prefix?void 0:this.contentType[prefix];return null!=overrideType?overrideType:this.contentType.default}return this.contentType}}let _DEFAULT_TAG_DEFINITION,TAG_DEFINITIONS;function getHtmlTagDefinition(tagName){var _a,_b;return TAG_DEFINITIONS||(_DEFAULT_TAG_DEFINITION=new HtmlTagDefinition,TAG_DEFINITIONS={base:new HtmlTagDefinition({isVoid:!0}),meta:new HtmlTagDefinition({isVoid:!0}),area:new HtmlTagDefinition({isVoid:!0}),embed:new HtmlTagDefinition({isVoid:!0}),link:new HtmlTagDefinition({isVoid:!0}),img:new HtmlTagDefinition({isVoid:!0}),input:new HtmlTagDefinition({isVoid:!0}),param:new HtmlTagDefinition({isVoid:!0}),hr:new HtmlTagDefinition({isVoid:!0}),br:new HtmlTagDefinition({isVoid:!0}),source:new HtmlTagDefinition({isVoid:!0}),track:new HtmlTagDefinition({isVoid:!0}),wbr:new HtmlTagDefinition({isVoid:!0}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5"
A server error has occurred.
node exited with 1 code.
I suspect this is a symptom of client side routing, which is typical of Single Page Applications (SPAs). As you navigate through your working application, you see your address bar entries change. But those are not URLs being requested from your Express server. Rather, your Angular framework is intercepting the request and invoking the JavaScript you packaged with your application.
The only "legitimate" URL for your application would be the one that initially loads your application. Everything you see in the address bar afterwards is recognized by your Angular router, but not by your Express server.

How to get Exception source “Activity Description name”

When exceptions occur in a UIPath project I have an email that is sent out with the exception info included. There seems to be an issue though where I can only see where the error occured by looking at the selector information such as:
Cannot find the UI element corresponding to this selector:
<html app='chrome.exe' title='Microsoft Dynamics GP' />
<webctrl aaname='Add' idx='1'
parentid='a00000000000000008549000000030009000000000001000000000000' tag='DIV' />
This info and the stack trace or any other info is not really helpful for quickly finding the source of the problem. I have looked through the UIPath documentation and forum and found only the this question, which seemed to point to using the exception.Source to show the name of the activity where the error occurred. exception.Source only returns “UiPath.Core.Activities” though instead of "Type into Copy Job# 'INPUT'" in the following example:
This obviously causes a big problem with exception handling. How can I easily return the source with each exception?
When your selector fails, you will end up with a new object of type UiPath.Core.SelectorNotFoundException. However, until the team at UiPath decides to add the Display Name into the inner exception, there is little you can do in this particular case.
Take the following example - the first line shows the Inner Exception, and the second one in red is essentially just the exception being rethrown. Note that only the latter one contains the Display Name property.
The Source itself will usually be of type UiPath.Core.Activities, but since this is just the type's name, we don't have any link to the faulting object. Here's what you can do:
Add some details to your exception. You don't want to do this for each activity, but you could have certain blocks of try-catches (example: logging into the system consists of three individual activites, and they reside in one block).
Rethrow the exception. That way the Display Name will end up in the execution log file.

How to fail Velocity template processing with tracable message

Having:
Velocity template or macro
some object
How to validate the object (#if) and fail (stop further processing) in a way that is easily tracable to the place of failure (like throwing exception in Java).
I am looking for something like this:
#if ( ! $context.treasureMap.containsKey('gold'))
#fail('no golden treasure here')
#end
Background
I am writing a maven site page. The velocity context is injected by maven and contains POM information. I want to test existence of some information from effective pom. When the information is not available, I want to fail.
Requirements
fail Velocity processing > fail site generation > fail maven build.
error message should lead to the place of failure so the site should be fixed
preferably no configuration (no extensions, just constructs/tools contained in plain Velocity)
Tried
Strict Reference Mode
Unwanted configuration, do not want to fail on every occasion.
#evaluate('#end') aka syntax error
(Chose #end as most descriptive to my intent) Basically what I want. Fails the processing and maven build but the error message does not lead back to failure location:
ParseException: Encountered "#end" at line 1, column 1..
You need to make a method call which produce exception.See explanation:
The only place where one could run into trouble within Velocity is if there is a call to a method which throws an exception during runtime. For example, this VTL defines a String $foo and then attempts to call its substring() method on it would throw an IndexOutOfBoundsException:
#set ($foo = "bar")
#set ($bar = $foo.substring(0,10))
When the exception is thrown, the parser will stop processing and throw that exception up the stack tree where it can be caught in the method that caused the parser to execute. At that point, the exception can be handled gracefully.

Error with NSURLSessionDataTask in iOS 10

I am having an issue with NSURLSessionDataTask , while trying to upload a JSON object , I am getting the following message in console .
[] __tcp_connection_write_eof_block_invoke Write close callback received
[error: [89] Operation canceled]
How to solve this issue ?
May be it is related to OS_ACTIVITY_MODE settings for Schemes.
disable OS_ACTIVITY_MODE mode by following steps and check:
--- Go in Product ---> Scheme ---> Edit Scheme
--- in Run Section on the left, select Argument Tab and in Environment Variable Change value as below:
Name: OS_ACTIVITY_MODE
Value: disable

WP Windows Phone Invalid XAML

I get exception
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException'
occurred in WP.MyOffice.exe but was not handled in user code
WinRT information: Unable to resolve property '%1' while processing
properties for Uid '%0'. [Line: 79 Position: 27]
1 - line 79 position 27
2 - "Invalid XAML" in Error List window
In Resources.recw has Hub.Header and HubSection1.Header
How found what is wrong?
Check your resources.resw file, you probably have something like Hub.Text, while the "Hub" element doesn't support that attribute (text). Maybe you already used the key Hub for something else
Strategy to fix:
Remove the x:uid properties and worry about localization later, get the Hub working.
If it still doesn't work create a basic hub with no items. Once working add the hub items/sections back until the point of failure.
Once the failure is determined resolve.