Bug 1178748 - Errors and warnings when importing ejb-security-interceptors quickstart into JBDS
Summary: Errors and warnings when importing ejb-security-interceptors quickstart into ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Quickstarts
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: CR2
: EAP 6.4.0
Assignee: jboss-set
QA Contact: Nikoleta Hlavickova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-05 12:54 UTC by Nikoleta Hlavickova
Modified: 2019-08-19 12:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:41:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Referenced File Error Details for jboss-ejb3-spec-2_0.xsd errors on import (142.66 KB, image/png)
2015-02-18 14:19 UTC, sgilda
no flags Details

Description Nikoleta Hlavickova 2015-01-05 12:54:29 UTC
Errors:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jee:interceptor-binding'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":ejb-name}' is expected.
jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 26	
XML Problem

cvc-elt.1: Cannot find the declaration of element 'jboss'.
jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 20	
XML Problem

Referenced file contains errors (jar:file:/home/nziakova/tools/ide/jbds-8.0.0/studio/plugins/org.jboss.tools.as.catalog_3.0.0.Final-v20141016-1911-B95.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."
jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 1
XML Problem

Warnings:
Missing beans.xml file in the project jboss-ejb-security-interceptors. This file is required for bean archives [JSR-299 ยง12.1]
CDI Problem

Overriding managed version 7.5.0.Final-redhat-15 for jboss-as-security-api
pom.xml	/jboss-ejb-security-interceptors	line 92
Maven pom Loading Problem

Overriding managed version 7.5.0.Final-redhat-15 for wildfly-core-security-api
pom.xml	/jboss-ejb-security-interceptors	line 112
Maven pom Loading Problem

The import org.jboss.remoting3.Connection is never used
ServerSecurityInterceptor.java	/jboss-ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors	line 30
Java Problem

The import org.jboss.remoting3.security.UserInfo is never used
ServerSecurityInterceptor.java	/jboss-ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors	line 31
Java Problem

The import org.jboss.security.SecurityContext is never used
ServerSecurityInterceptor.java	/jboss-ejb-security-interceptors/src/main/java/org/jboss/as/quickstarts/ejb_security_interceptors	line 32
Java Problem

Comment 1 sgilda 2015-01-08 21:34:11 UTC
Fixed the Java Problems and missing beans.xml in this commit: https://github.com/jboss-developer/jboss-eap-quickstarts/commit/3546a1710eb68fa3a81e584f12004f48d06b65ef

I need help from Darran for the XML errors.

Comment 3 sgilda 2015-01-20 21:25:32 UTC
I forgot to mention. The pull with my changes is here:

https://github.com/jboss-developer/jboss-eap-quickstarts/pull/1315

Comment 4 sgilda 2015-01-21 16:25:37 UTC
Thanks to @fbricon! The final fixes are in this commit: https://github.com/jboss-developer/jboss-eap-quickstarts/commit/17eafe33b48599441a0d61397b26ff9a30d9b12a

Comment 5 Nikoleta Hlavickova 2015-02-11 10:00:04 UTC
Verified with EAP 6.4.0.ER2.

Comment 6 Nikoleta Hlavickova 2015-02-12 14:23:11 UTC
I have no idea how could I verify this issue. I imported the ejb-security-interceptors into JBDS now and I see these errors and warnings (plus some that are documented as expected) :

cvc-elt.1: Cannot find the declaration of element 'jboss'.
jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF line 20
XML Problem

Overriding managed version 7.5.0.Final-redhat-18 for jboss-as-security-api
pom.xml	/jboss-ejb-security-interceptors	line 95
Maven pom Loading Problem

Overriding managed version 7.5.0.Final-redhat-18 for wildfly-core-security-api	
pom.xml	/jboss-ejb-security-interceptors	line 115
Maven pom Loading Problem

I am terribly sorry for confusion. I hope you can reproduce the problems with EAP 6.4.0.ER2.

Comment 7 sgilda 2015-02-16 21:54:55 UTC
I'm actually getting different errors:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'jee:interceptor-binding'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":ejb-name}' is expected.	jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 26	XML Problem

cvc-elt.1: Cannot find the declaration of element 'jboss'.	jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 20	XML Problem

Referenced file contains errors (jar:file:/home/sgilda/tools/jbdevstudio/studio/plugins/org.jboss.tools.as.catalog_3.0.1.Final-v20141209-0156-B106.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."	jboss-ejb3.xml	/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 1	XML Problem

I need to investigate how to resolve these errors.

Comment 8 sgilda 2015-02-17 14:28:58 UTC
The jboss-ejb-container-interceptors_1_0.xsd schema is missing from http://www.jboss.org/j2ee/schema/.

Created ticket: https://engineering.redhat.com/rt/Ticket/Display.html?id=338204

Comment 9 sgilda 2015-02-17 19:56:10 UTC
Updated the jboss-ejb3.xml file in this commit:

https://github.com/jboss-developer/jboss-eap-quickstarts/commit/91f585fbf3410275e17c90cc7af8c0c24ee7833e

Still waiting for the schema to be copied to the public location.

I tested the quickstart and it works as expected.

Comment 10 sgilda 2015-02-18 14:18:02 UTC
I was able to fix all but the following errors:

1. cvc-complex-type.2.4.a: Invalid content was found starting with element 'jee:interceptor-binding'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":ejb-name}' is expected.	
jboss-ejb3.xml	
/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 31	
XML Problem

  *  Carlo: Is this a problem with the XML or with the schema. The schema has been uploaded to: http://www.jboss.org/j2ee/schema/jboss-ejb-container-interceptors_1_0.xsd

2. Referenced file contains errors (jar:file:/home/sgilda/tools/jbdevstudio/studio/plugins/org.jboss.tools.as.catalog_3.0.1.Final-v20141209-0156-B106.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."	
jboss-ejb3.xml	
/jboss-ejb-security-interceptors/src/main/resources/META-INF	line 1	XML Problem

  *  I created Bug 1193543 for the invalid jboss-ejb3-spec-2_0.xsd.

Comment 11 sgilda 2015-02-18 14:19:14 UTC
Created attachment 993114 [details]
Referenced File Error Details for jboss-ejb3-spec-2_0.xsd errors on import

It is not possible to copy and paste the error text, so this is a screen shot of the error details.

Comment 14 sgilda 2015-02-19 13:15:06 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1193948#c1

I have added the warnings to the shared JBDS instruction page and done as much as I can to mitigate the warnings on import. The quickstart does work as described in the README file, so I am marking it modified..

Comment 16 Nikoleta Hlavickova 2015-02-27 14:18:19 UTC
I can see the 2 documented XML errors:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jee:interceptor-binding'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":ejb-name}' is expected.

Referenced file contains errors (jar:file:/home/nziakova/tools/ide/jbds-8.0.0/studio/plugins/org.jboss.tools.as.catalog_3.0.0.Final-v20141016-1911-B95.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."

However, I do see the 2 warnings from comment 6:
Overriding managed version 7.5.0.Final-redhat-19 for jboss-as-security-api	pom.xml	/jboss-ejb-security-interceptors
line 95
Maven pom Loading Problem

Overriding managed version 7.5.0.Final-redhat-19 for wildfly-core-security-api	pom.xml	/jboss-ejb-security-interceptors
line 115
Maven pom Loading Problem

Comment 17 sgilda 2015-02-27 15:23:59 UTC
I don't see that issue with the 6.4.x-develop version of the quickstart, so it must be something with the 6.4.x Maven repository. 

I noticed Darran added the property <version.security.api>7.4.0.build-1</version.security.api> to both branches on March 6, 2014 with this commit:

This commit to the 6.4.x-develop branch: https://github.com/jboss-developer/jboss-eap-quickstarts/commit/9be73458bfc1cd909a19f5f1c175fbd0fe5b8160

Paul Gier modified the 6.4.x branch on September 13, 2014, removing the <version.security.api> property and changing the jboss-as-security-api artifact to use the <version.jboss.as> with this commit:
https://github.com/jboss-developer/jboss-eap-quickstarts/commit/f91044bfa86af00b88443bc9068db0e88b39951f

I need Paul's help on this one.

Comment 18 sgilda 2015-02-27 15:28:34 UTC
@pgier, please see Comment 16 and Comment 17 above.

Comment 19 Paul Gier 2015-03-19 14:09:02 UTC
The commit in question [1] sets the version of these jars to the correct supported version in EAP (7.4.0.Final-redhat-X), instead of the unsupported community version (7.4.0.build-1).  It sounds like something external to the POM is trying to override this version?

> Overriding managed version 7.5.0.Final-redhat-19

[1]https://github.com/jboss-developer/jboss-eap-quickstarts/commit/f91044bfa86af00b88443bc9068db0e88b39951f

Comment 20 Max Rydahl Andersen 2015-03-19 15:04:07 UTC
Paul, why do we have <version> specified on the <dependency> when it has a <dependencyManagement> section declaring what the version should be ?

The version under dependency is redundant - and that is kinda what the m2e warning is trying to flag.

Comment 21 Max Rydahl Andersen 2015-03-19 15:14:36 UTC
If you really want the version to be overridden with the exact same values then you can add <!--$NO-MVN-MAN-VER$--> to make m2e stop warning about it.

But I would recommend actually fixing the quickstart to not have the duplication/redundancy.

Comment 22 Max Rydahl Andersen 2015-03-19 15:17:33 UTC
Re-reading it - seems like the override is *explicit* and thus <!--$NO-MVN-MAN-VER$--> should be added if you want to not be warned about it.

Comment 23 Paul Gier 2015-03-19 15:39:44 UTC
>  Paul, why do we have <version> specified on the <dependency> when it has a <dependencyManagement> section declaring what the version should be ?

The current dependencyManagement section of this quickstart does not declare any version for those jars, so I don't think the version declaration there is redundant.

The error message seems to indicate that something is trying to override this version, but I'm not sure what is doing that.  Is JBDS trying to override the version for some reason?

Comment 24 Paul Gier 2015-03-19 16:29:18 UTC
Looks like I was wrong, these two jars are already version managed by the imported jboss-as-ejb-client-bom.  The dependencies are not declared directly in that BOM, but they are inherited into that BOM from the jboss-as-parent.

So I think the correct fix for this is to just remove those two lines (95 and 115) from the quickstart POM.

PR: https://github.com/jboss-developer/jboss-eap-quickstarts/pull/1401

Comment 25 Nikoleta Hlavickova 2015-03-31 06:47:22 UTC
No Maven pom Loading Problem in EAP 6.4.0.CR2.


Note You need to log in before you can comment on or make changes to this bug.