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

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"

Related

RTI DDS creating own data types

I am working on a .Net example where I define my own data type using RTI Connext DDS.
Instead of creating the application from the beginning, I got help from the source code of the hello_world_xml_dynamic example in rti_workspace directory. I have made several changes to the USER_QOS_PROFILES.xml file to create my own data type and changes its name to MY_PROFILES.xml
But when I compile the application and run it from the command line, I get the following error:
DDS_DomainParticipantFactory_create_participant_from_config_w_paramsI:ERROR: Profile library 'MyParticipantLibrary::PublicationParticipant' not found
! Unable to create DDS domain participant
The line of code that catching the error:
if (this.participant == null)
{
this.participant = DDS.DomainParticipantFactory.get_instance().
create_participant_from_config(
"MyParticipantLibrary::PublicationParticipant");
if (this.participant == null)
{
Console.Error.WriteLine("! Unable to create DDS domain participant");
return;
}
}
this is the configuration file MY_PROFILES.xml :
<!--
RTI Data Distribution Service Deployment
-->
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/6.0.1/rti_dds_profiles.xsd">
<!-- Qos Library -->
<qos_library name="qosLibrary">
<qos_profile name="DefaultProfile">
</qos_profile>
</qos_library>
<!-- types -->
<types>
<struct name="FlightData">
<member name="Latitude" type="double"/>
<member name="Longitude" type="double"/>
<member name="Altitude" type="double"/>
</struct>
</types>
<!-- Domain Library -->
<domain_library name="MyDomainLibrary" >
<domain name="FlightDataDomain" domain_id="0">
<register_type name="FlightDataType"
type_ref="FlightData" />
<topic name="FlightDataTopic"
register_type_ref="FlightDataType">
<topic_qos name="FlightData_qos"
base_name="qosLibrary::DefaultProfile"/>
</topic>
</domain>
</domain_library>
<!-- Participant library -->
<domain_participant_library name="MyParticipantLibrary">
<domain_participant name="PublicationParticipant"
domain_ref="MyDomainLibrary::FlightDataDomain">
<publisher name="MyPublisher">
<data_writer name="FlightDataWriter"
topic_ref="FlightDataTopic"/>
</publisher>
</domain_participant>
<domain_participant name="SubscriptionParticipant"
domain_ref="MyDomainLibrary::FlightDataDomain">
<subscriber name="MySubscriber">
<data_reader name="FlightDataReader"
topic_ref="FlightDataTopic">
<datareader_qos name="FlightData_reader_qos"
base_name="qosLibrary::DefaultProfile"/>
</data_reader>
</subscriber>
</domain_participant>
</domain_participant_library>
</dds>
where am i making a mistake?
Your XML file looks correct. From the 'not found' error message, it seems that you may not have taken the right steps to instruct your application to load that profiles-file MY_PROFILES.xml to actually learn about your desired Participant. You can easily verify that this is the case by introducing an error in your XML file (for example by incorrectly renaming one tag) and rerun your application. If it does not complain about the syntax or schema of the XML, then your file did not get loaded and this hypothesis is correct.
If that turns out to be your problem indeed, then you have several options to fix that. They are listed in the User's Manual section 18.5 How to Load XML-Specified QoS Settings.

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.

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

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.

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.