[ https://issues.apache.org/jira/browse/AXIS2-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Deepal Jayasinghe resolved AXIS2-3321. -------------------------------------- Resolution: Cannot Reproduce > AXIOM based Web_service, getting an unexpected exception > -------------------------------------------------------- > > Key: AXIS2-3321 > URL: https://issues.apache.org/jira/browse/AXIS2-3321 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Components: om > Environment: Win XP SP2, java 1.5.13: AXIOM libs: > axiom-api-1.2.5.jar, axiom-dom-1.2.5.jar, axiom-impl-1.2.5.jar > Reporter: acer > > I have the following snippet of code and i get a very strange > Exception(possibly a bug, it doesn't make any other sense). > sample code: > public OMElement webServiceMethod1(OMElement payload){ > //parse incoming OMElement-> successfully done.. > //Create the XML Model: > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs > =fac.createOMNamespace("http://authentication.liferay.services.acer.com","xsd"); > OMElement method = fac.createOMElement("authentication_response", > omNs); > //succeed > OMElement value1 = fac.createOMElement("succeed", null); > value1.addChild(fac.createOMText(value1, isSuccessful )); > //authentication_response<- (succeed) > method.addChild(value1); > > //CRITICAL PART: i try to print all "<method>"'s data: Trying to > System.out the OMElement > way1: > String response = result.getFirstElement().getText(); > System.out.println("response= "+response); > And i get: " Exception in thread "main" > org.apache.axiom.om.OMException: > java.lang.ClassCastException: > org.apache.axiom.om.impl.llom.OMElementImpl " > but it doesn't make sense, cause OMElement is of type: OMElementImpl! > way2: > OMFactory fac2 = OMAbstractFactory.getOMFactory(); > StAXOMBuilder builder=new > StAXOMBuilder(fac2,method.getXMLStreamReader(),method); > OMElement documentElement=builder.getDocumentElement(); > try { > System.out.println("xml= > "+documentElement.toStringWithConsume()); > } catch (XMLStreamException e) { > e.printStackTrace(); > } > And i get: > "Exception in thread "main" java.lang.IllegalStateException: attribute count > accessed in illegal event (7)! > at > org.apache.axiom.om.impl.llom.OMStAXWrapper.getAttributeCount(OMStAXWrapper.java:636) > at > org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:177) > at > org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:254) > at > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:90) > at > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:101)" > But it doesn't make sense again! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]