Bug 1192591

Summary: [DOC] (6.4.z) jboss-ejb-iiop_1_0.xsd is invalid
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Carlo de Wolf <cdewolf>
Component: EJBAssignee: Carlo de Wolf <cdewolf>
Status: CLOSED CURRENTRELEASE QA Contact: Jiří Bílek <jbilek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: bmaxwell, cdewolf, jbilek, lywang, mcada, msochure, myarboro, rnetuka, rstancel, rstryker, sgilda
Target Milestone: CR1   
Target Release: EAP 6.4.17   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-06 13:35:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1426887, 1450092    
Attachments:
Description Flags
Screen shot of the error
none
Maven settings.xml file
none
Screenshot of errors reported in duplicate bug 1193543 none

Description Carlo de Wolf 2015-02-13 19:03:23 UTC
Following xml should validate without a hitch:
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
               xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:iiop="urn:iiop"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                  http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
                  urn:iiop jboss-ejb-iiop_1_0.xsd"
               version="3.1"
               impl-version="2.0">
    <assembly-descriptor>
        <iiop:iiop>
            <ejb-name>InvoiceManagerEJBImpl</ejb-name>
            <iiop:binding-name>jts-quickstart/InvoiceManagerEJBImpl</iiop:binding-name>
        </iiop:iiop>
    </assembly-descriptor>
</jboss:ejb-jar>

Yet it gives problems:

org.xml.sax.SAXParseException; lineNumber: 31; columnNumber: 32; cvc-complex-type.2.4.a: Invalid content was found starting with element 'iiop:binding-name'. One of '{"urn:iiop":ejb-name}' is expected.

Adding <iiop:ejb-name>InvoiceManagerEJBImpl</iiop:ejb-name> (which is invalid) yields:
org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 21; cvc-complex-type.2.4.b: The content of element 'iiop:iiop' is not complete. One of '{"urn:iiop":ior-security-config}' is expected.

Comment 5 Weston M. Price 2015-05-06 23:43:44 UTC
Strange, currently I'm not seeing any validation errors against the sample xml with the IIOP descriptor using JAXP and straight Java code. However, I am seeing validation errors with xmllint and other utilities. Carlo, could you specify how you produced this error> I am attaching my files as well so someone can verify that validation works fine and I didn't miss anything.

Comment 7 Weston M. Price 2015-05-07 22:07:48 UTC
*** Bug 1193543 has been marked as a duplicate of this bug. ***

Comment 8 Weston M. Price 2015-05-11 17:48:52 UTC
Thanks. Ill have a closer look.

Comment 9 Weston M. Price 2015-05-11 17:49:12 UTC
Thanks. Ill have a closer look.

Comment 10 sgilda 2015-05-18 11:24:29 UTC
Hi Weston,

Follow the steps below to reproduce the issue.

1. Configure your Maven settings to use the following repositories (see attached example):
        http://maven.repository.redhat.com/techpreview/all
        http://maven.repository.redhat.com/earlyaccess/all/
        http://jboss-developer.github.io/temp-maven-repo/
        http://repository.jboss.org/nexus/content/groups/public/
2. Checkout the quickstarts from the default 7.0.x-develop branch: 
        https://github.com/jboss-developer/jboss-eap-quickstarts
3. Start JBoss Developer Studio 8
4. Import the 'jts' quickstart into JBoss Developer Studio.
5. Note the Problems window displays 2 errors and 10 warnings. Screen shot is attached. This is the error that the bug refers to:

    cvc-complex-type.2.4.a: Invalid content was found starting with element 'iiop:binding-name'. One of '{"urn:iiop":ejb-name}' is expected.    jboss-ejb3.xml    /jboss-jts-application-component-2/src/main/resources/META-INF    line 30    XML Problem

Please let me know if you have any other questions.

Thanks,
Sande

Comment 11 sgilda 2015-05-18 11:25:48 UTC
Created attachment 1026665 [details]
Screen shot of the error

This is a screen shot of the the error that displays when you import the `jts` quickstart.

Comment 12 sgilda 2015-05-18 11:52:07 UTC
Created attachment 1026670 [details]
Maven settings.xml file

Comment 13 Weston M. Price 2015-05-22 12:24:48 UTC
Thanks Sande, especially the settings file.

Comment 15 Weston M. Price 2015-06-01 05:54:59 UTC
I have a workaround for this, but it's a solution that neither Carlo or myself care for. It appears there are duplicated elements across namespaces/schema that need some explanation. As Stuart Douglas 'maintains' the IIOP schema, or was at least the last one to work with it, I'm going to speak with him about why this was needed. Stuart was on PTO last week but has returned. I will talk with him this morning.

Comment 16 Weston M. Price 2015-06-01 07:32:28 UTC
Sorry, forgot to include the workaround. In order to get past the current issue, your XML file should read: 

<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
               xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:iiop="urn:iiop"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                  http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
                  urn:iiop http://www.jboss.org/j2ee/schema/jboss-ejb-iiop_1_0.xsd"
               version="3.1"
               impl-version="2.0">
    <assembly-descriptor>
		<iiop:iiop>
			<ejb-name>ejbName</ejb-name>
			<iiop:ejb-name>ejbName</iiop:ejb-name>
			<iiop:binding-name>bindingName</iiop:binding-name>
			<iiop:ior-security-config></iiop:ior-security-config>
		</iiop:iiop>		
    </assembly-descriptor>
</jboss:ejb-jar>

The duplication comes obviously in the ejbName portion. Ideally, the ejbName element should be taken from the javaee:jboss-assembly-descriptor-bean-entryType complex which the iiopConfigType extends using an extension base. This is not happening and as a result, the ejbName needs to be duplicated. I can't see why we would need this. 

Again, I will speak with Stuart to verify. If we can remove it, the ejbName will be taken from the IIOP config and the schema should validate with no issues. 

Note, there are a few other bugs around this issue, some are duplicates. I am trying to track the rest down. I marked one as duplicate recently and I think I can track back from there.

Comment 17 Carlo de Wolf 2015-11-27 12:44:02 UTC
Note that using the work-around mentioned in the description gives an error in the parser:
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[34,51]
Message: found: CHARACTERS, expected START_ELEMENT or END_ELEMENT
	at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.nextTag(XMLStreamReaderImpl.java:1250)
	at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:64)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.AbstractEJBBoundMetaDataParser.processElements(AbstractEJBBoundMetaDataParser.java:66)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.IIOPMetaDataParser.parse(IIOPMetaDataParser.java:50)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.IIOPMetaDataParser.parse(IIOPMetaDataParser.java:45)
	at org.jboss.metadata.ejb.parser.spec.ExtendingMetaDataParser.processElement(ExtendingMetaDataParser.java:83)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossAssemblyDescriptorMetaDataParser.processElement(JBossAssemblyDescriptorMetaDataParser.java:59)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossAssemblyDescriptorMetaDataParser.processElement(JBossAssemblyDescriptorMetaDataParser.java:42)
	at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)
	at org.jboss.metadata.ejb.parser.spec.ExtendingMetaDataParser.parse(ExtendingMetaDataParser.java:59)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.parseAssemblyDescriptor(JBossEjb3MetaDataParser.java:107)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:148)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:42)
	at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)
	at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.parse(JBossEjb3MetaDataParser.java:102)
	at org.jboss.metadata.ejb.test.common.UnmarshallingHelper.unmarshalJboss(UnmarshallingHelper.java:104)
	at org.jboss.metadata.ejb.test.common.UnmarshallingHelper.unmarshalJboss(UnmarshallingHelper.java:91)
	at org.jboss.metadata.ejb.test.common.UnmarshallingHelper.unmarshalJboss(UnmarshallingHelper.java:85)
	at org.jboss.metadata.ejb.test.bz1192591.IIOPParserTestCase.testIIOPWorkaround(IIOPParserTestCase.java:80)

Comment 18 Carlo de Wolf 2015-11-27 13:03:31 UTC
https://github.com/jboss/metadata/pull/98

Comment 19 Mike McCune 2016-03-28 22:23:55 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 20 Rob Stryker 2016-04-20 22:48:06 UTC
For what versions of EAP / Wildfly does this workaround actually work? Can we, for example, push the workaround to the eap7-quickstarts repository?

Comment 21 sgilda 2017-01-05 16:52:15 UTC
Created attachment 1237760 [details]
Screenshot of errors reported in duplicate bug 1193543

Comment 25 Petr Penicka 2017-09-06 13:35:56 UTC
Released on 2017-09-05 as part of the EAP 6.4.17 release.