commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Boyer <johnboye...@gmail.com>
Subject [configuration] Problem Migrating from 1.x to 2.x, my XMLBeanDeclaration is key no Longer Valid
Date Fri, 27 Oct 2017 20:26:29 GMT
Hello:

I’m working on migrating my codebase from Commons Configuration 1.x to 2.x. However, in
version 2, I receive an error indicating that the key I used in 1.x is invalid:
 
	org.apache.commons.configuration2.ex.ConfigurationRuntimeException: Passed in key must select
exactly one node (found 0): ios.invitation


—————————————————————————————————————————————————————-
The string dump of my XMLConfiguration appears as follows:

ios/invitation/@config-class=com.example.email.DefaultEventEmailFormatter
ios/invitation/@fileName=request-cancel
ios/invitation/@subject=Itty-Bitty Skedi | Invitation
ios/invitation/@name=Invitation
ios/invitation/@senderFirstName=Itty-Bitty
ios/invitation/@shortDescription=You have a new notification waiting for you in the Skedi
app.
ios/invitation/@fromEmailAddress=donotreply@example.com
ios/invitation/@contentType=text/plain
ios/invitation/@senderLastName=Skedi


—————————————————————————————————————————————————————-
The XML file is:

<?xml version="1.0" encoding="UTF-8"?>
<config>
	<ios>
		<!-- recipientFullName, toEmailAddress, and body need to be set -->
		<invitation
			config-class=“com.example.email.DefaultEventEmailFormatter”
			contentType="text/plain"
			fromEmailAddress=“donotreply@example.com”
			senderFirstName="Itty-Bitty"
			senderLastName="Skedi"
			subject="Itty-Bitty Skedi | Invitation"
			shortDescription="You have a new notification waiting for you in the Skedi app."
			name="Invitation"
			fileName="request-cancel"/>
	</ios>
</config>

—————————————————————————————————————————————————————-
The Java code snippet:

XMLConfiguration xmlConfig = builder.getConfiguration();
log.info(ConfigurationUtils.toString(xmlConfig));

BeanDeclaration decl = new XMLBeanDeclaration(xmlConfig, “ios.invitation”);//where `ios.invitation`
is the key

—————————————————————————————————————————————————————-

Can anyone help me to resolve this problem?

Thank you for your time in advance.

Regards,

John Boyer








---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message