no declaration can be found for element 'constructor-arg' - mule

The error when running:
Caused by: org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 30; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'constructor-arg'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
The source:
<spring:bean id="HandlerA_id" name="HandlerA" class="Handler">
<constructor-arg>
<ref bean="BeanA"></ref>
</constructor-arg>
</spring:bean>
The editor recognizes the constructor-arg tag and gives a summary upon roll-over.
In the config file, xsi:schemaLocation value contains (among others):
"...http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd..."
If you examine the xsd at that URL, you can see that the constructor-arg tag is valid for group beanElements which is one of the complex types allowed in 'bean'
Does the runtime not properly validate XML under some conditions?

Include the spring: prefix in the tag. Same for the ref tag.

Related

Error while setting filter on queue in ArtemisMQ

I have a problem trying to configure filter on queue through config for ArtemisMQ (broker.xml):
<address name="foo">
<multicast>
<queue name="filtered_foo">
<durable>true</durable>
<filter string="bar <> 42"/>
</queue>
</multicast>
</address>
Trying start broker I have an error:
[Fatal Error] :207:30: The value of attribute "string" associated with an element type "filter" must not contain the '<' character.
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 207; columnNumber: 30; The value of attribute "string" associated with an element type "filter" must not contain the '<' character.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.apache.activemq.artemis.utils.XMLUtil.readerToElement(XMLUtil.java:90)
at org.apache.activemq.artemis.utils.XMLUtil.stringToElement(XMLUtil.java:55)
at org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:76)
at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:68)
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:82)
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:149)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:97)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49)
If I set selector on consumer with same filter string it works:
auto consumer = session->createConsumer("foo::filtered_foo", "bar <> 42");
According to Artemis documentation syntax for config must be the same as for selectors. What's the problem?
The issue here is that the filter is being defined in XML which has its own rules for what characters are allowed and what characters are not allowed. Simply put, your XML isn't valid. Try using this:
<filter string="bar <> 42"/>
By escaping the < character the XML should parse correctly.

org.testng.TestNGException: org.xml.sax.SAXParseExceptionElement type "listners" must be declared

Getting following error in eclipse"
1.The content of element type "suite" must match "(groups?,(listeners|packages|test|parameter|method-selectors|
suite-files)*)".
2.If run erroneous testng.xml following error is thrown:
org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber:
4; columnNumber: 11; Element type "listners" must be declared.
To call a listener, we need to mention it in the testng.xml with the proper listener tag
Ex:
<listeners>
<listener class-name="TestNgListners.CustmoListner"/>
</listeners>
The custom listner is created under the location "TestNgListners.CustmoListner"

How to find all active employees using NetSuite connector in Mule?

I configured the following component:
<netsuite:search config-ref="Netsuite" searchRecord="EMPLOYEE" bodyFieldsOnly="false" returnSearchColumns="false" pageSize="10" doc:name="Netsuite">
<netsuite:criteria>
<netsuite:criterium key="isInactive">false</netsuite:criterium>
</netsuite:criteria>
</netsuite:search>
I am getting an error:
java.lang.IllegalArgumentException: Property isInactive in class class com.netsuite.webservices.lists.employees_2013_1.EmployeeSearch is not readable
I was able to find a solution for this. At first stage, we create a spring bean containing a search field value. Then use this bean in the NetSuite component. The correct flow is the following:
<spring:beans>
<spring:bean id="SearchBooleanField" name="SearchBooleanField" class="com.netsuite.webservices.platform.core_2013_1.SearchBooleanField" scope="prototype">
<spring:property name="searchValue" value="false"/>
</spring:bean>
</spring:beans>
...
<netsuite:search config-ref="Netsuite" searchRecord="EMPLOYEE_BASIC" bodyFieldsOnly="false" returnSearchColumns="false" pageSize="10" doc:name="Netsuite">
<netsuite:criteria>
<netsuite:criterium key="isInactive">#[app.registry.SearchBooleanField]</netsuite:criterium>
</netsuite:criteria>
</netsuite:search>

Mule 3.3.0 - global property not being resolved from properties file

The global property is not being resolved from properties file, as a result of which mmc deployment fails. Any ides why what could be wrong?
<context:property-placeholder location="airports.properties" />
<global-property name="airportslist" value="${airportslist}" />
Getting the following exception --
com.mulesoft.mmc.agent.v3.dto.DeploymentException: Unexpected exception parsing XML document from URL [file:/arprt/mule-esb-ee/mule-enterprise-standalone-3.3.0/apps/myapp-1.0.0-SNAPSHOT/myapp-config.xml]; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'airportslist' (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
at com.mulesoft.mmc.agent.service.impl.ApplicationServiceImpl.deploy(ApplicationServiceImpl.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
airports.properties contains the above mentioned property:
airportslist={'SFO', 'YYZ', 'DFW'}
You do not need to declare a global-property if the property is defined in a properties file and loaded with the context:property-placeholder.
Just remove:
<global-property name="airportslist" value="${airportslist}" />
and use ${airportslist} anywhere you need it in your config.

tenant-aware datasource in pentaho BI

we have several clients(companies) each of them have separate database i.e companyA has databaseA,CompanyB has databaseB ...etc , so what i want to achieve is, in pentaho user console all of these companies use the same report but with a different datasoruce , for example
CompanyA,CompanyB..etc would have access to a solution-folder called "Reports" this folder has
a list of reports e.g weeklySales_report so i want weeklySales_report to use CompanyA's database when the loged-in user is from companyA and use CompanyB's database when the logged-in user is from companyB,
i tried this but i am getting this error
XmlBeanDefinitionStoreException: Line 67 in XML document from file [C:\pentaho2
biserver-ce\pentaho-solutions\system\pentahoObjects.spring.xml] is invalid; nes
ed exception is org.xml.sax.SAXParseException; lineNumber: 67; columnNumber: 50
The value of attribute "value" associated with an element type "property" must
not contain the '<' character.
it is complaining about <property name="datasourceNameFormat" value="<![CDATA[{0}-{1}]]>
any ideas on what cause this error, or is there any other way to do this
Thanks
I am not sure about your way, but there is simply possibility to have dynamic jndi. You can have jndi in variable in xaction and can use it in xaction for distinguishing target database.
<inputs>
<JNDDDI type="string">
<sources>
<request>JNDDDI</request>
</sources>
<default-value><![CDATA[jndi_database1]]></default-value>
</JNDDDI>
....
<action-definition>
<component-name>SQLLookupRule</component-name>
<action-type>hourly</action-type>
<action-inputs>
<JNDDDI type="string"/>
</action-inputs>
<action-outputs>
<prepared_component type="sql-query"/>
</action-outputs>
<component-definition>
<jndi>{JNDDDI}</jndi>
<query><![CDATA[select ...from ...]]></query>
<live><![CDATA[true]]></live>
</component-definition>
And same thing if you use JasperReport Component.