This discussion is archived
2 Replies Latest reply: Aug 30, 2011 2:37 AM by 801558 RSS

java.lang.RuntimeException: Malformed uri: p1

801558 Newbie
Currently Being Moderated
I am constantly getting this exception while generating service code using axis2

1. Retrieving document at 'src/main/resources/SecureService.wsdl'.
Aug 29, 2011 7:07:32 PM org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter getBindingPolicyFromMessage
2. - Malformed uri: p1
3. java.lang.RuntimeException: Malformed uri: p1
4. at org.apache.neethi.PolicyReference.getRemoteReferedElement(PolicyReference.java:162)
5. at org.apache.neethi.PolicyReference.getRemoteReferencedPolicy(PolicyReference.java:176)
6. at org.apache.neethi.PolicyReference.normalize(PolicyReference.java:112)
7. at org.apache.axis2.util.PolicyUtil.getMergedPolicy(PolicyUtil.java:290)
8. at org.apache.axis2.description.AxisBindingMessage.calculateEffectivePolicy(AxisBindingMessage.java:290)
9. at org.apache.axis2.description.AxisBindingMessage.getEffectivePolicy(AxisBindingMessage.java:223)
10. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getBindingPolicyFromMessage(AxisServiceBasedMultiLanguageEmitter.java:284)
11. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputElement(AxisServiceBasedMultiLanguageEmitter.java:2802)
12. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:2340)
13. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:2224)
14. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForSkeleton(AxisServiceBasedMultiLanguageEmitter.java:2138)
15. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeSkeleton(AxisServiceBasedMultiLanguageEmitter.java:2064)
16. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1389)
17. at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:253)
18. at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
19. at com.jpmc.CodeGenerator.main(CodeGenerator.java:6)
20. - Malformed uri: p1
21. java.lang.RuntimeException: Malformed uri: p1
22. at org.apache.neethi.PolicyReference.getRemoteReferedElement(PolicyReference.java:162)
23. at org.apache.neethi.PolicyReference.getRemoteReferencedPolicy(PolicyReference.java:176)
24. at org.apache.neethi.PolicyReference.normalize(PolicyReference.java:112)
25. at org.apache.axis2.util.PolicyUtil.getMergedPolicy(PolicyUtil.java:290)
26. at org.apache.axis2.description.AxisBindingMessage.calculateEffectivePolicy(AxisBindingMessage.java:290)
27. at org.apache.axis2.description.AxisBindingMessage.getEffectivePolicy(AxisBindingMessage.java:223)
28. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getBindingPolicyFromMessage(AxisServiceBasedMultiLanguageEmitter.java:284)
29. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getOutputElement(AxisServiceBasedMultiLanguageEmitter.java:2875)
30. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:2344)
31. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:2224)
32. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForSkeleton(AxisServiceBasedMultiLanguageEmitter.java:2138)
33. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeSkeleton(AxisServiceBasedMultiLanguageEmitter.java:2064)
34. at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1389)
35. at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:253)
36. at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
37. at com.jpmc.CodeGenerator.main(CodeGenerator.java:6)
38. - The .\src\main\java\com\ttdev\ss\SecureServiceSkeleton.java file cannot be overwritten.
39. - The .\src\main\java\com\ttdev\ss\SecureServiceMessageReceiverInOut.java file cannot be overwritten.



POM :

1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2. <modelVersion>4.0.0</modelVersion>
3. <groupId>SecureClient</groupId>
4. <artifactId>SecureClient</artifactId>
5. <version>0.0.1-SNAPSHOT</version>
6.
7.
8. <dependencies>
9.
10. <dependency>
11. <groupId>wsdl4j</groupId>
12. <artifactId>wsdl4j</artifactId>
13. <version>1.6.1</version>
14. </dependency>
15. <dependency>
16. <groupId>org.apache.xerces</groupId>
17. <artifactId>xercesImpl</artifactId>
18. <version>2.9.1</version>
19. </dependency>
20. <dependency>
21. <groupId>xerces</groupId>
22. <artifactId>xerces</artifactId>
23. <version>2.4.0</version>
24. </dependency>
25. <dependency>
26. <groupId>org.apache.axis2</groupId>
27. <artifactId>axis2-codegen</artifactId>
28. <version>1.5.2</version>
29. </dependency>
30. <dependency>
31. <groupId>org.apache.axis2</groupId>
32. <artifactId>axis2-adb-codegen</artifactId>
33. <version>1.5.2</version>
34. </dependency>
35. <dependency>
36. <groupId>org.apache.rampart</groupId>
37. <artifactId>rampart</artifactId>
38. <version>1.4</version>
39. <type>mar</type>
40. </dependency>
41. <dependency>
42. <groupId>org.apache.rampart</groupId>
43. <artifactId>rampart-core</artifactId>
44. <version>1.4</version>
45. </dependency>
46. </dependencies>
47.
48.
49. <build>
50. <plugins>
51. <plugin>
52. <groupId>org.apache.maven.plugins</groupId>
53. <artifactId>maven-compiler-plugin</artifactId>
54. <configuration>
55. <source>1.6</source>
56. <target>1.6</target>
57. </configuration>
58. </plugin>
59. </plugins>
60. </build>
61. </project>

Any help is appreciated

Edited by: 798555 on Aug 29, 2011 6:42 AM
  • 1. Re: java.lang.RuntimeException: Malformed uri: p1
    EJP Guru
    Currently Being Moderated
    What does the POM have to do with it? Post the WSDL.
  • 2. Re: java.lang.RuntimeException: Malformed uri: p1
    801558 Newbie
    Currently Being Moderated
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://ttdev.com/ss" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512"
    xmlns:wsp="http://www.w3.org/Submission/2006/SUBM-WS-Policy-20060425"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-1.0.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecureService"
    targetNamespace="http://ttdev.com/ss">
    <wsp:Policy wsu:Id="p1">
    <sp:AsymmetricBinding>
    <wsp:Policy>
    <sp:InitiatorToken>
    <wsp:Policy>
    <sp:X509Token
    sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/12/securitypolicy/IncludeToken/AlwaysToRecipient">
    <wsp:Policy>
    <sp:WssX509V3Token10 />
    </wsp:Policy>
    </sp:X509Token>
    </wsp:Policy>
    </sp:InitiatorToken>
    <sp:RecipientToken>
    <wsp:Policy>
    <sp:X509Token
    sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/12/securitypolicy/IncludeToken/Never">
    <wsp:Policy>
    <sp:WssX509V3Token10 />
    </wsp:Policy>
    </sp:X509Token>
    </wsp:Policy>
    </sp:RecipientToken>
    <sp:AlgorithmSuite>
    <wsp:Policy>
    <sp:TripleDesRsa15 />
    </wsp:Policy>
    </sp:AlgorithmSuite>
    </wsp:Policy>
    </sp:AsymmetricBinding>
    <sp:Wss10>
    <wsp:Policy>
    <sp:MustSupportRefEmbeddedToken />
    <sp:MustSupportRefIssuerSerial />
    </wsp:Policy>
    </sp:Wss10>
    <sp:SignedParts>
    <sp:Body />
    </sp:SignedParts>
    <sp:EncryptedParts>
    <sp:Body />
    </sp:EncryptedParts>
    <sp:EncryptedElements>
    <sp:XPath>
    //*[local-name()='Signature']
    </sp:XPath>
    </sp:EncryptedElements>
    <sp:SignedSupportingTokens>
    <wsp:Policy>
    <sp:UsernameToken
    sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/12/securitypolicy/IncludeToken/AlwaysToRecipient" />
    </wsp:Policy>
    </sp:SignedSupportingTokens>
    </wsp:Policy>
    <wsdl:types>
    <xsd:schema targetNamespace="http://ttdev.com/ss">
    <xsd:element name="concat">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="s1" type="xsd:string" />
    <xsd:element name="s2" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="concatResponse">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="r" type="xsd:string">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="concatRequest">
    <wsdl:part element="tns:concat" name="parameters" />
    </wsdl:message>
    <wsdl:message name="concatResponse">
    <wsdl:part element="tns:concatResponse" name="parameters" />
    </wsdl:message>
    <wsdl:portType name="SecureService">
    <wsdl:operation name="concat">
    <wsdl:input message="tns:concatRequest" />
    <wsdl:output message="tns:concatResponse" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="SecureServiceSOAP" type="tns:SecureService">
    <wsp:PolicyReference URI="#p1" wsdl:required="true"/>
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="concat">
    <soap:operation soapAction="http://ttdev.com/ss/NewOperation" />
    <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SecureService">
    <wsdl:port binding="tns:SecureServiceSOAP" name="p1">
    <soap:address location="http://localhost:8080/ss/p1" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points