Tye Mismatch Error Closing a Collection - vb6-migration

I receive a "Type Mismatch" error on the following line of code.
Set colClaims = Nothing
Earlier pertinent code is as follows:
Public colClaims As New Collection
....
Dim oClaimRecord As IClaimRecord
...
Set UB01 = oClaimRecord.ParseInput(psInputRecord)
...
colClaims.Add UB01, sIndex, psBefore
...
I am very confused as to how there can be a type mismatch error when closing a collection. Can anyone offer any direction? Thank you

Related

changeset begin/end methods in DPC_EXT but GCS_METHODS-CHANGESET_BEGIN unknown

My SAPui5 web app throws this error in Chrome's console:
The following problem occurred: HTTP request failed500,Internal Server Error,{"error":{
"code":"/IWBEP/CM_MGW_RT/053","message":{"lang":"en","value":"Default changeset impleme
ntation allows only one operation"},"innererror":{"application":{"component_id":"CA","s
ervice_namespace":"/SAP/","service_id":"YFLEXUI_LEAVE_REQUEST_SRV","service_version":"0
001"},"transactionid":"something","timestamp":"something","Error_Resolution":{"SAP_Tran
saction":"For backend administrators: run transaction /IWFND/ERROR_LOG on SAP Gateway h
ub system and search for entries with the timestamp above for more details","SAP_Note":
"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/179
7736)"},"errordetails":[{"code":"/IWBEP/CX_MGW_TECH_EXCEPTION","message":"Default chang
eset implementation allows only one operation","propertyref":"","severity":"error","tar
get":""}]}}} -
According to some posts on the internet, the problem is caused by the conflict between these methods:
/iwbep/if_mgw_appl_srv_runtime~changeset_begin
/iwbep/if_mgw_appl_srv_runtime~changeset_end
and
/iwbep/if_mgw_core_srv_runtime~changeset_begin
/iwbep/if_mgw_core_srv_runtime~changeset_end
Most people advice to redefine the methods /iwbep/if_mgw_appl_srv_runtime~changeset_begin and /iwbep/if_mgw_appl_srv_runtime~changeset_end.
This is my /iwbep/if_mgw_appl_srv_runtime~changeset_begin method:
METHOD /iwbep/if_mgw_appl_srv_runtime~changeset_begin.
* Default Implementation:
* - Local Update Task
* - Only one operation in each changeset
* - No deferred processing: Immediate process changset operation
SET UPDATE TASK LOCAL.
IF lines( it_operation_info ) > 1.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception
EXPORTING
textid = /iwbep/cx_mgw_tech_exception=>changeset_default_violation
method = gcs_methods-changeset_begin.
ENDIF.
CLEAR cv_defer_mode.
ENDMETHOD.
The problem is, in SE80, after the redefinition of /iwbep/if_mgw_appl_srv_runtime~changeset_begin when I try to check that method and activate it, SAP throws this error:
Field GCS_METHODS-CHANGESET_BEGIN is unknown
Can you tell me how can /iwbep/if_mgw_appl_srv_runtime~changeset_begin's redefinition cause such error?
FYI. gcs_methods is a private constant. It might be causing the problem.
A subclass cannot use a private member of its superclass (unless the superclass said the subclass is its friend).
As the superclass is generated, you have to duplicate the constant in your own program.
We had the same issue recently and redefined the method like this:
METHOD /iwbep/if_mgw_core_srv_runtime~changeset_begin.
IF line_exists( it_operation_info[ entity_type = 'ENTITY_TYPE' ] ).
cv_defer_mode = abap_true.
ENDIF.
ENDMETHOD
I'm no expert on this topic, but this implementation fixed our problem.
What the issue with your private constant is, however, I cannot tell.
The error is the inactive methods on the class interface. A simple code check tells all the erros of this implementation.
BR,

The method fromQuery(String) gives an error in an eclipse dataflow project. How should I solve it?

The error below is generated:
The method fromQuery(String) is undefined for the type
BigQueryIO.Read.
And, it occurs in the following line :
PCollection<TableRow> somename = p.apply(BigQueryIO.Read.fromQuery("Select * from abc:def.ghi"));
I looks like fromQuery(String) belongs to BigQuery.Read.Bound. You're missing the .Bound.
Try:
PCollection<TableRow> somename = p.apply(BigQueryIO.Read.Bound.fromQuery("Select * from abc:def.ghi"));
Check out the documentation here.

Can't get media image URL from Umbraco after upgrade

I have recently upgraded to 7.6.3 and I am having an issue retrieving media image URLs in my views. For testing purpposes, I added a new MediaPicker2 property for one of the nodes, set up a value for it and tried to get its value in my razor view:
var icon2 = Model.Content.GetProperty("icon2");
The object then looks like this:
Executing Model.Content.GetPropertyValue("icon2") throws the following error:
An exception of type 'System.Exception' occurred in Umbraco.Core.dll but was not handled in user code
Additional information: Exception while creating a value.
InnerException: "Object reference not set to an instance of an object."
Model.Content.GetPropertyValue<IPublishedContent>("icon2") throws the same error.
What am I doing wrong?
According to this answer, what you're doing is correct. However, I'm not sure why it's not working.
However, I have answered a similar question to this before, and I found a roundabout way of getting the node for a Udi:
You can get an IPublishedContent from your image string using this code:
// Your string.
var imageString = Model.Content.GetPropertyValue<string>("icon2");
// Get the guid from this string.
var imageGuidUdi = GuidUdi.Parse(imageString);
// Get the ID of the node!
var imageNodeId = ApplicationContext.Current.Services.EntityService.GetIdForKey(guidUdi.Guid, (UmbracoObjectTypes)Enum.Parse(typeof(UmbracoObjectTypes), guidUdi.EntityType, true));
// Finally, get the node.
var imageNode = Umbraco.TypedMedia(imageNodeId.Result);

Grail: Error handling in #BindUsing

I have tried to use #BindUsing for a property (amt100) of a domain class (TcTransaction). The purpose is to convert a display format to a database format. Out of a dozen variants, here is one:
#BindUsing({tcTransaction, source ->
def result = tcTransaction.amt100
def amt = Amount100.of(source['amt100']) //parse and convert input
if (amt) {
result = amt.cents
} else {
tcTransaction.errors.rejectValue('amt100', 'tcTransaction.invalid.amount')
}
return result
})
Integer amt100
It works beautifully in the absence of errors. The problem is error management. This particular version returns the original value if the new value is invalid. It also adds an error to the domain object.
It seems adding to errors has no effect. The user is not warned.
I also tried to throw an exception. It seems whatever exception you throw you end up with a standard error code saying that the property must not be left empty. A previous post indicated this behaviour. (It has gone unanswered for two years.) I'm on Grails 3.2.8.
So, is there any theory of error management in #BindUsing? It's such a nifty mechanism.

Irony AST generation throws nullreference excepttion

I'm getting started with Irony (version Irony_2012_03_15) but I pretty quickly got stuck when trying to generate an AST. Below is a completely strpped language that throws the exception:
[Language("myLang", "0.1", "Bla Bla")]
public class MyLang: Grammar {
public NModel()
: base(false) {
var number = TerminalFactory.CreateCSharpNumber("number");
var binExpr = new NonTerminal("binExpr", typeof(BinaryOperationNode));
var binOp = new NonTerminal("BinOp");
binExpr.Rule = number + binOp + number;
binOp.Rule = ToTerm("+");
RegisterOperators(1, "+");
//MarkTransient(binOp);
this.Root = binExpr;
this.LanguageFlags = Parsing.LanguageFlags.CreateAst; // if I uncomment this line it throws the error
}
}
As soon as I uncomment the last line it throws a NullReferenceException in the grammar explorer or when i want to parse a test. The error is on AstBuilder.cs line 96:
parseNode.AstNode = config.DefaultNodeCreator();
DefaultNodeCreator is a delegate that has not been set.
I've tried setting things with MarkTransient etc but no dice.
Can someone help me afloat here? I'm proably missing something obvious. Looked for AST tutorials all over the webs but I can't seem to find an explanation on how that works.
Thanks in advance,
Gert-Jan
Once you set the LanguageFlags.CreateAst flag on the grammar, you must provide additional information about how to create the AST.
You're supposed to be able to set AstContext.Default*Type for the whole language, but that is currently bugged.
Set TermFlags.NoAstNode. Irony will ignore this node and its children.
Set AstConfig.NodeCreator. This is a delegate that can do the right thing.
Set AstConfig.NodeType to the type of the AstNode. This type should be accessible, implement IAstInit, and have a public, no-parameters constructor. Accessible in this case means either public or internal with the InternalsVisibleTo attribute.
To be honest, I was facing the same problem and did not understand Jay Bazuzi answer, though it looks like valid one(maybe it's outdated).
If there's anyone like me;
I just inherited my Grammar from Irony.Interpreter.InterpretedLanguageGrammar class, and it works. Also, anyone trying to get AST working, make sure your nodes are "public" :- )
On top of Jay's and Erti-Chris's responses, this thread is also useful:
https://irony.codeplex.com/discussions/361018
The creator of Irony points out the relevant configuration code in InterpretedLanguageGrammar.BuildAst.
HTH

Resources