Cannot find declaration of element handler-chains Jboss Developer Studio
Asked Answered
B

4

12

I have a handler-chain configuration for my Webservice handler

At my Webservice class I have;

 @HandlerChain(file = "jaxws-handlers-server.xml")
    public class RoleMemberServiceSoap11Impl{...}

and my jaxws-handlers-server.xml is ;

<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <handler-chain>
        <protocol-bindings>##SOAP11_HTTP</protocol-bindings>
        <handler>
            <handler-name>TransactionBridgeHandler</handler-name>
            <handler-class>org.jboss.jbossts.txbridge.inbound.JaxWSTxInboundBridgeHandler
            </handler-class>
        </handler>
        <handler>
            <handler-class>com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor
            </handler-class>
        </handler>
    </handler-chain>
</handler-chains>

In that xml file i got the following error for element.

Cannot find declaration of element handler-chains 

I ve searched and tried various workaround about changing xmlns:xsd urls. Also I tried the workaround that given at https://issues.jboss.org/browse/JBIDE-17859

but that does not help.

IDE : Jboss Developer Studio.

Project: Dynamic Web Project 2.4

Server Jboss 6.1+

Java : 1.6

Any suggestions will be appreciated.

Thanks.

Bourg answered 12/1, 2015 at 14:2 Comment(0)
B
23

I resolved the issue by replacing

 <handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

to

<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/javaee_web_services_metadata_handler_2_0.xsd">
Bourg answered 21/1, 2015 at 11:57 Comment(1)
namespace 'jaxb' seem unnecessary in this situation. It works even withoutMajunga
A
11

I had a similar problem in Eclipse + JDK 1.8 that was resolved by changing the address of the XMLNS attribute.

From:

<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema">


To:

<javaee:handler-chains xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">


See the link below that Oracle has changed the address of the new schemas: http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html#7

Ardeha answered 14/1, 2017 at 19:38 Comment(3)
@Bourg example worked for me in Red Hat Jboss Developer 10.2 (Eclipse) and JDK 1.8. Sorry didnt get to try your example.Baez
+1 for the link to javaee; please consider that the issue in quite well discussed in issues.jboss.org/browse/JBIDE-17859 and the solution that works for me with JDK 1.8 JEE7 is the one from @Jason Glass ( 2017-10-31): <handler-chains xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_web_services_metadata_handler_2_0.xsd">Saccharose
javaee_web_services_metadata_handler_2_0.xsd which defines javaee:handler-chains is an old schema (released 2007-11-21 according to oracle.com/webfolder/technetwork/jsc/xml/ns/javaee) and it uses the old namespace java.sun.com/xml/ns/javaee (not the new xmlns.jcp.org/xml/ns/javaee)Sunset
B
1

Maybe my solution help someone. I just change

<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">

to

<handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee">
Boatload answered 17/6, 2021 at 7:7 Comment(0)
K
0

After updating from JavaEE (javax.xml) to Jakarta (jakarta.xml), I had to change:

<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">

to

<handler-chains xmlns="https://jakarta.ee/xml/ns/jakartaee">

Note that the latter is https; I was stuck for a good long while because I accidentally put http.

Kalie answered 8/7 at 18:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.