Setting coordinator names in Oozie bundle from bundle.properties - bundle

I'm using an Oozie bundle to manage two coordinators (for now). They are the same process, but for two different clients. I have the client names defined in the bundle.properties file that I call when I launch the bundle.xml. I'm trying to use the client name to name each of the coordinators, but I keep seeing variations of the following error:
Error: E0701 : E0701: XML schema error, cvc-pattern-valid: Value
'Daily_job_#{client1}' is not facet-valid with respect to pattern
'(a-zA-Z*){1,39}' for type 'IDENTIFIER'
I have been playing around with using ${} to access the variable name vs #{} based on this post here: Renaming Oozie coordinator dynamically. I seem to be able to access the variables as properties just fine from the bundle.properties just not in the name.
Here is what I've tried in the bundle.xml:
<coordinator name='Daily_job_#{client1}' >
...
<property>
<name>client</name>
<value>${client1}</value>
</property>
</coordinator>
and
<coordinator name='Daily_job_${client1}' >
...
</coordinator>
In the bundle.properties:
client1=firstclientname
client2=secondclientname
I'm able to access the value of client within the property in the coordinator and workflow but I can't seem to name the coordinator based on the property. Can anyone help me? Thank you!

Seeing as you're getting that particular error seems to indicate the name which happens to be a bundle:IDENTIFIER type does not conform to the schema that was defined by the Oozie developers.
What this means is that your XML is being validated for well-formedness against a schema and the bundle:IDENTIFIER is checked against a regular expression that only allows alphanumerics, dashes and underscores in the name with a minimum of 1 character up to 40 characters.
<xs:simpleType name="IDENTIFIER">
<xs:restriction base="xs:string">
<xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39})"/>
</xs:restriction>
</xs:simpleType>
Well-formedness is a XML pre-processing step and is probably restricting your substitution characters as $ # { } are not included in the regular expression.
https://github.com/apache/oozie/blob/master/client/src/main/resources/oozie-bundle-0.2.xsd

I was using Oozie bundle schema 0.1: xmlns='uri:oozie:bundle:0.1', and by changing it to 0.2:xmlns='uri:oozie:bundle:0.2' it works now. I am also using the second variation with ${}, so in the bundle.xml:
<coordinator name='Daily_job_${client1}' >
...
</coordinator>
Is the one to use.

Related

Tomcat Startup exception: Failed to read schema document

This is idp.war deployment on tomcat 7(.69)
Failed to read schema document 'class path:/schema/shibboleth-2.0-services.xsd'
in the trace it suggests some things:
1) could not find the document.
2) the document could not be read.
3) the root element of the document is not <xsd:schema>
I can go into the deployment: idp/WEB-INF/lib/shibboleth-common-1.2.1.jar/schema/ and see all the shibboleth-2.0- .xsd files that the Service.xml file is declaring as schemaLocations
this folder was created by tomcat deployment for tomcat so I don't know why it can't be read, I'm guessing permissions issues wouldn't apply here.
and the root element of the .xsd document is
<schema ... >
so that qualifies as
<xsd:schema>
correct or no?
Two points:
(1) Whether a start-tag with the element-type name schema is effectively the same as one with the element-type name xsd:schema depends on the namespace bindings, which are omitted here. (The start-tag <xsd:schema> cannot occur as the first tag in a namespace-well-formed XML document, so I'm assuming you're paraphrasing, not quoting.)
If the unprefixed schema start-tag makes "http://www.w3.org/2001/XMLSchema" the default namespace, then that is not likely to be your problem. (Hint for the next time you ask a question, though: omitting salient information like namespace bindings makes your question less clear and less likely to get useful responses.)
(2) The error message you quote puts a blank between the strings 'class' and 'path' -- if your reference to the schema document actually does begin "class path:", then that is your problem: Shibboleth's documentation says:
Shibboleth defines a special URL scheme, classpath, which ensures that the schema files are resolved from the classpath.
As a matter of URI syntax, blanks are not allowed in the middle of a scheme name. You will need to start any URI you want to identify in this way with "classpath:/", not "class path:/".

How To invoke a model's template from another model in xpand for AUTOSAR

I've been trying to develop an AUTOSAR 4.2.1 module to generate code using Xpand/Xtend. I'm using artext demonstrator 1.6.0. But my query is that the concept of defining a variation point is not found in the PDF(ECUConfigurationParameters.arxml) when I create a new Ecu platform project in the demonstrator (or maybe I'm not familiar with finding out how).
By default I'm able to fetch parameter values from an arxml. But when there is more than one value for a parameter which is defined in a different post build variant condition, I'm getting only the first value.
For example, if the arxml contains this
<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>1</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>1</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>
<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>2</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>0</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>
it gives me value as 'true' in Xpand if I do Com.ComConfig.ComIpdus.ComIPduCancellationSupport. I’m unable to access the second value ‘false’.
How may I proceed to fetch the parameter values based on the post-build variant conditions?
I'm trying to do the following:
«DEFINE Gen1 FOR varianthandling::VariationPoint»
«EXPAND Gen1::GetThings»
«ENDDEFINE»
«DEFINE GenMain FOR AUTOSAR::EcucDefs::Com»
«EXPAND Gen1 FOR varianthandling::VariationPoint»
«ENDDEFINE»
This gives me an error as 'Couldn't find definition ComOtherVarGen for type xpand2::Type'. How do I achieve the above?
Please note that I am not trying to add/modify any functionality to the template of 'MainObj' so 'AROUND' is not what I'm looking for.
Any help is greatly appreciated.
The tool which you are using to create the model (which is created from the PDF file + EcuC Values file) must be able to build a model which is post-build compatible.
If you are sure, this being done- Then try the below method
Com.ComConfig.ComIpdus.ComIPduCancellationSupport changes to
<FOREACH Com.ComConfig.ComIpdus.ComIPduCancellationSupport AS ele>
<ele>
<ENDFOREACH>
or
Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(0)
Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(1)

Accessing property values within filename-generator-expression

We have the following snippet in one of our Spring Batch XML files:
<int-file:outbound-channel-adapter
id="out" directory="c:\test"
filename-generator-expression="headers['msg.number']+'.xml'"
channel="in"/>
We would like to add access a value stored in a property file from within filename-generator-expression
The property can be accessed elsewhere in the XML as follows: attribute="${property.name}"
Th question is, how to access it from within filename-generator-expression.
This is obviously wrong:
filename-generator-expression="${property.name} + headers['msg.number']+'.xml'"
What is the correct solution?
Thanks very much

Websphere JYTHON Scripting - Get Active Spec ID

Problem:
Attempting to use the JYTHON command below and I cannot retrieve the id of my active specification defined at a node-server level in Websphere. I believe its a syntax issue but I'm not sure what.
Code:
AdminConfig.getid('/Cell:mycell/Node:mynode/Server:myserver/J2CActivationSpec:myActiveSpecName/')
Problem Notes:
I do not get a invalid object error so I believe I have the syntax right but it just cannot find the resource even though it exists.
I am using the AdminConfig.getid() as a way to check if the resource already exists in order to do a modify or a create.
If I use the following code: AdminConfig.getid('/J2CActivationSpec:myActiveSpecName/') it will find it but not if I use a more specific path listed above.
Reference Material:
IBM Documentation
Containment paths are always a little tricky. In my (limited) experience, even if you can trace the path by AdminConfig.parents, you may not always be able to use getid.
Are you restricted to using getid? If not, here are some alternatives that will get you an ActivationSpec at the /Cell/Node/Server level:
Querying using AdminConfig.list
This approach will list the Activation Specifications at the specified scope (in our case, the server), and grab the one that has it's name attribute equal to 'myActiveSpecName'.
server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:myserver')
activationSpec = ''
for as in AdminConfig.list('J2CActivationSpec', server).splitlines():
if AdminConfig.showAttribute(as, 'name') == 'myActiveSpecName'
activationSpec = as
print 'found it :)'
Using Wildcards
This approah uses AdminConfig.list as well, but with a pattern to narrow down your list. If you know your activation spec's configuration begins with myActiveSpecName, then you can do the following:
activationSpec = AdminConfig.list('J2CActivationSpec', 'myActiveSpecName*')

SOAP faultcode list

I'm developing a magento script to import products from a XML file using the API and a SOAP wsdl connection.
I would like to know the faultcode list, I've been searching it for several days without luck, anyone know if there is one at all and where I can find it?
I need to handle the error codes to avoid the code to stop instead of just skipping the errors and continue importing what is correct.
At the moment I just discovered that the faultcode 101 is "Product not exists.".
Here's how to grab the list for your version of Magento. (I can't imagine this would be radically different between versions, but one never knows what's been done to a system)
Find all your api.xml files.
$ find app/code/core -name 'api.xml'
app/code/core/Mage/Api/etc/api.xml
app/code/core/Mage/Catalog/etc/api.xml
app/code/core/Mage/CatalogInventory/etc/api.xml
app/code/core/Mage/Checkout/etc/api.xml
app/code/core/Mage/Core/etc/api.xml
app/code/core/Mage/Customer/etc/api.xml
app/code/core/Mage/Directory/etc/api.xml
app/code/core/Mage/Downloadable/etc/api.xml
app/code/core/Mage/GiftMessage/etc/api.xml
app/code/core/Mage/Sales/etc/api.xml
app/code/core/Mage/Tag/etc/api.xml
Each file will have one or many <faults/> nodes which will contain the code and message.
<!-- File: app/code/core/Mage/CatalogInventory/etc/api.xml -->
<faults module="cataloginventory">
<not_exists>
<code>101</code>
<message>Product not exists.</message>
</not_exists>
<not_updated>
<code>102</code>
<message>Product inventory not updated. Details in error message.</message>
</not_updated>
</faults>
It's probably worth mentioning that the numeric codes aren't unique. Each "soap object" (unsure what to call these) defines its own.
<!-- File: app/code/core/Mage/Sales/etc/api.xml -->
<faults module="sales">
<not_exists>
<code>100</code>
<message>Requested order not exists.</message>
</not_exists>
<filters_invalid>
<code>101</code>
<message>Invalid filters given. Details in error message.</message>
</filters_invalid>
Good luck!

Resources