javaee / metro-wsit

https://javaee.github.io/metro-wsit/
Other
9 stars 24 forks source link

Using JDK1.6.0 - test fails to run with : wsimport [ERROR] duplicate "message" entity: "PingRequest" ; test runs with JDK1.5.0_x #293

Closed glassfishrobot closed 16 years ago

glassfishrobot commented 17 years ago

Setup: Glassfish v2 build 30 using JDK1.6.0 WSIT build 1491 installed on Glassfish

Attachments: 1)testcase zip [ etc/ contains wsimport classpath=common-targets.xml , WsSecurity10/ contains wsdl,schemas for the Sun->Sun testcase , src/WsSecurity10/ contains the source files and the jax-ws customization files ]

Description: This is a Sun->Sun Security Interop test.This runs successfully without the current problem when JDK1.5.0_x is used. The test fails to run with the following message : generate-client-s2s: [echo] http://localhost:8080/WsSecurity10/X10?wsdl=============== [wsimport] Consider using / so that wsimport won't do unnecessary compilation [wsimport] command line: wsimport /space/install/jdk1.6.0/jre/bin/java -Dhttp.proxyHost=webcache.sfbay.sun.com -Dhttp.proxyPort=8080 -classpath /space/install/jdk1.6.0/lib/tools.jar:/space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/etc:/space/workspace/glassfish-installs/glassfish-v2b30/lib/webservices-rt.jar:/space/workspace/glassfish-installs/glassfish-v2b30/lib/webservices-tools.jar:/space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/lib/nbjunit.jar:/space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/lib/junit.jar:/space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/lib/insanelib.jar com.sun.tools.ws.WsImport -d /space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/src/build/classes -extension -keep -verbose http://localhost:8080/WsSecurity10/X10?wsdl -b /space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/src/WsSecurity10-X10/etc/custom-client.xml -b /space/workspace/tango-workspace/jdk6-test/tango/qe-tests/wssecurity/interop/src/WsSecurity10-X10/etc/custom-schema-client.xml [wsimport] parsing WSDL...

[wsimport] [ERROR] duplicate "message" entity: "PingRequest" [wsimport] unknown location

[wsimport] Failed to parse the WSDL.

The testcase wsdl is in the attached zip at etc/WsSecurity10/WsSecurity10.wsdl

The test runs successfully in the Sun->Microsoft mode.It may be mentioned that to run the Sun->Microsoft mode a localized wsdl is used [ when client does a wsimport on the service wsdl ]. For Sun->Sun scenarios , the client does a wsimport on the published wsdl at localhost:8080.

Environment

Operating System: All Platform: All

Affected Versions

[current]

glassfishrobot commented 17 years ago

Reported by eric_ekka@java.net

glassfishrobot commented 17 years ago

eric_ekka@java.net said: Created an attachment (id=176) test case zip

glassfishrobot commented 17 years ago

eric_ekka@java.net said: Added some description to the Issue summary.

glassfishrobot commented 17 years ago

vivekp@java.net said: I have no familiarity with the testcase you have indicated. A more standalone testcase would have been more helpful. Anyway I tried your wsdl in the attachment and with some changes related to resolving imports and in customization file I could run it. I tried it on GF b30. I could compile it on jdk 1.5. When I try on JDK 1.6, I get:

Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootst rap classloader, but this RI (from jar:file:/C:/glassfish/lib/webservices-rt.jar!/com/sun/xml/b ind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to pl ace jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/s tandards/)

When I resolve the endorsed mechanism(copied $AS_HOME/lib/javaee.jar to $JDK6_HOME/jre/lib/endorsed) then I see wsimport compiling wsdl correctly.

Looking at the error message there isnt any way wsimport will generate such error for the wsdl that you are poining out.

I can't reproduce it, there might be some mix up in the testcase or your environment that might be causing wsimport to pickup some different wsdl.

glassfishrobot commented 17 years ago

eric_ekka@java.net said: I continue to get the same error with the latest hudson build [ b1511 ] on GF b30 and GF b31. This test-case is part of the Security Interop test workspace.I tried double-checking if there is a mix-up with the wsdl being picked up when the test is run.But couldn't see anything of that sort. The test runs fine when JDK1.5.0_06 is used.The java.home property is the only variable which changes when the testrun is switched from jdk1.5.0_06 to jdk1.6.0. [apart from moving javaee.jar in GF/lib to $JAVA_HOME/jre/lib/endorsed and GF/lib/endorsed].

glassfishrobot commented 17 years ago

vivekp@java.net said: Can you provide me a standalone test that I could use to reproduce? Or alternatively if someone local from wsit team knows how to run this security test could reproduce it then it will let me understand whats going on?

I tried with the jdk6 GF b30 and javaee.jar in jdk6/jre/lib/endorsed and also in GFv2/lib/endorsed and cant reproduce it with standalone wsdl you provided.

glassfishrobot commented 17 years ago

eric_ekka@java.net said: Th test workspace is loacted at tango/qe-tests/wssecurity [CVS root=wpts]. tango/qe-test/wssecurity/test/README gives instructions how to setup the env and run the test.

glassfishrobot commented 17 years ago

vivekp@java.net said: Its problem with WSDL publishing. For your test, its easy workaround - in your client configuration file where you have the endpoint address for the main wsdl and the associated customization file which has wsdlLocation, the URL ends with query - "?wsdl" replace it with "?WSDL" and it will just work fine.

Its a bug on the server side, where obviously the map order is different in JDK 6 and so the wsdl you try to access, looks like - http://localhost:8080/WsSecurity11/XD?wsdl, however in the imported wsdl, which is http://localhost:8080/WsSecurity11/XD?wsdl=1, there is another import at the end which looks like http://localhost:8080/WsSecurity11/XD?WSDL.

Semantically for wsimport http://localhost:8080/WsSecurity11/XD?wsdl and http://localhost:8080/WsSecurity11/XD?WSDL are different, so it determines they are different and complains that there are duplicate elements.

So to fix it all you do is to modify wsdl location in your build.properties and custom-client.xml by replacing ?wsdl with ?WSDL.

glassfishrobot commented 17 years ago

jitu@java.net said: ?wsdl, ?WSDL point to the same SDDocument. In the revWsdls map, one is overriding the other. And this order is not defined as it is based Iterator (which seems to be different for J2SE 5 and 6). Now revWsdls is updated to contain only ?wsdl so that published documents always contain ?wsdl for imported locations.

glassfishrobot commented 17 years ago

vivekp@java.net said: jitu has fixed it so that jaxws will always publish the service imports in the WSDL with ?wsdl (all lowercase). this should fix this issue reported. Make sure you are using lower case ?wsdl as this test does.

glassfishrobot commented 17 years ago

mmatula@java.net said: This issue was fixed before we created 1.0 branch, so the fix is in 1.0 -> setting target milestone to say so.

glassfishrobot commented 17 years ago

File: interop-testcase.zip Attached By: eric_ekka@java.net

glassfishrobot commented 17 years ago

Was assigned to vivekp@java.net

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA WSIT-293

glassfishrobot commented 16 years ago

Marked as fixed on Tuesday, November 13th 2007, 11:46:28 pm