[YANGTOOLS-614] master fails mounting controller-config Created: 19/May/16  Updated: 10/Apr/22  Resolved: 26/May/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Giles Heron Assignee: Igor Foltin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive karaf.zip    
Issue Links:
Blocks
blocks NETCONF-208 Controller-config still fails to operate Resolved
Duplicate
is duplicated by NETCONF-202 No netconf connector can be spawned d... Resolved
is duplicated by NETCONF-208 Controller-config still fails to operate Resolved
External issue ID: 5917

 Description   

not sure if issue is netconf, config or yangtools

logs are:

201 - org.opendaylight.netconf.sal-netconf-connector - 1.4.0.SNAPSHOT RemoteDevice {controller-config}: Unexpected error resolving device sources: java.lang.IllegalStateException: Unable to serialize AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)get, (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)input]}
2016-05-19 05:10:59,214 | ERROR | sing-executor-10 | NetconfDevice | 201 - org.opendaylight.netconf.sal-netconf-connector - 1.4.0.SNAPSHOT | RemoteDevice{controller-config}

: Initialization in sal failed, disconnecting from device
java.lang.IllegalStateException: Unable to serialize AbsoluteSchemaPath

{path=[(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)get, (urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)input]}

full zipped logs attached.



 Comments   
Comment by Giles Heron [ 19/May/16 ]

Attachment karaf.zip has been added with description: zipped logs

Comment by Giles Heron [ 19/May/16 ]

OK - so Donald's seeing the same issue, and has noticed this in the log:

Caused by: java.io.IOException: Unable to transform anyXml((urn:ietf:params:xml:ns:netconf:base:1.0?revision=2011-06-01)filter) value: javax.xml.transform.dom.DOMSource@711972f5

looks like this is being caused by the library lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_2.jar.

It appears that wasn't there in Beryllium but is there in Master, and as a "lib/endorsed" lib will be picked in preference to the jars in the bundle class paths.

Comment by Donald Hunter [ 19/May/16 ]

org.apache.servicemix.bundles.xalan-2.7.2_2.jar got included as part of karaf 3.0.6 so this is a side-effect of the upgrade from karaf 3.0.3

Comment by Tomas Cere [ 20/May/16 ]

This is a duplicate of 5910 but i'll close that one since this one contains more info.

Comment by Igor Foltin [ 20/May/16 ]

Fix pushed:

https://git.opendaylight.org/gerrit/#/c/39167/

Comment by Robert Varga [ 20/May/16 ]

The proper fix needs to do the following:

  • define the com.sun. string as a private constant
  • initialized the factory using a static initializer, which will consult a system property (org.opendaylight.yangtools.yang.impl.TransformerFactory), and if it is present, use that property's string for instantiation
  • if the property is not present and the com.sun. thing fails to instantiate, fall back to TransformerFactory.newInstance()
Comment by Robert Varga [ 23/May/16 ]

Actually the default factory is already controllable via javax.xml.transform.TransformerFactory. Digging through karaf, they have changed the default in 3.0.6 to read:

javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

Hence we have to figure out why is a different implementation breaking us, and if we cannot fix it via normal APIs, then we'll resort to changing the default system property in controller's custom.properties.

Comment by Robert Varga [ 24/May/16 ]

Igor has tracked the problem down to Xalan's org.apache.xalan.processor.TransformerFactoryImpl rejecting a StAXResult as a valid target.

Hence we have two options:

  • stop using StAXResult
  • note we require StAX support and change the karaf result
Comment by Donald Hunter [ 24/May/16 ]

The issue is that org.apache.servicemix.bundles.xalan-2.7.2_2.jar contains a META_INF/services/javax.xml.transform.TransformFactory file with the content

org.apache.xalan.processor.TransformerFactoryImpl

This would appear to be an older xalan factory that only supports DOMResult and SAXResult.

The Java 8 default TransformerFactory uses com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl

So the presence of xalan-2.7.2_2.jar in lib/endorsed is effectively causing a downgrade of behaviour.

It does seem like the best solution is to set

org.apache.xalan.processor.TransformerFactoryImpl = com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl

in etc/custom.properties in the opendaylight-karaf-resources project.

Comment by Igor Foltin [ 24/May/16 ]

Fix: https://git.opendaylight.org/gerrit/#/c/39312/

Comment by Robert Varga [ 24/May/16 ]

controller patch: https://git.opendaylight.org/gerrit/39368

Comment by Vratko Polak [ 26/May/16 ]

https://git.opendaylight.org/gerrit/#/c/39368/5 (for distributions based on karaf-parent)
https://git.opendaylight.org/gerrit/#/c/39402/1 (for integration/distribution)

Merged, CSIT confirms symptom of NETCONF-208 is not there anymore.

Generated at Wed Feb 07 20:53:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.