1 Reply Latest reply: Mar 27, 2012 10:11 AM by 926710 RSS

    java.lang.IllegalStateException 11g Web Services Administration

    871227
      Hello,

      When using Search 11g SES Web Services Administration,

      I get an error before it gives me the full xml of all the schedules (Code to Return All States of All Schedules). What is causing the java.lang.IllegalStateException: Stream already closed?

      I also want to narrow the results to give back only the status state property of all the schedules (Code to Narrow). When I try to narrow the results, it gives me no results, and an xml error. Is there an example on sending this in the List stateProperties argument for getAllStates(...)?

      Thanks

           /* getStatelessWebServiceClient, From SES Administration API Guide */
           private static AdminPortType getStatelessWebServiceClient(String webServiceURL) throws Exception
           {
                AdminService adminService = new AdminService(
                          new URL( webServiceURL ),
                          new QName(
                                    "http://search.oracle.com/Admin",
                                    "AdminService"
                                    )
                          );
                
                return adminService.getAdmin();
           }
                
           /* Code to Return All States of All Schedules - Does give the results */
           String webServiceURL = "http://host:port/search/api/admin/AdminService";          
           AdminPortType adminPort = getStatelessWebServiceClient( webServiceURL );

           Credentials credentials = new Credentials();
           credentials.setUserName("username");
           credentials.setPassword("password");

           String xmlResults = adminPort.getAllStates("schedule", null, null, credentials, null, "en").getObjectXML();
                     
           * Code to Return All States of All Schedules - Error */
           java.lang.IllegalStateException: Stream already closed
                at com.sun.xml.internal.org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:221)
                at com.sun.xml.internal.org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:196)
                at java.io.FilterInputStream.read(FilterInputStream.java:116)
                at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
                at weblogic.xml.babel.reader.XmlReader$Utf8Reader.read(XmlReader.java:660)
                at weblogic.xml.babel.reader.XmlReader.read(XmlReader.java:496)
                at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:400)
                at weblogic.xml.babel.scanner.ScannerState.expect(ScannerState.java:238)
                at weblogic.xml.babel.scanner.CloseTag.read(CloseTag.java:21)
                at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:256)
                at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
                at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
                at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.java:85)
                at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:481)
                at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
                at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
                at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
                at com.sun.xml.internal.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:462)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:349)
                at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
                at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
                at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:514)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
                at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
                at $Proxy32.getAllStates(Unknown Source)
                at com...printCrawlersRunning(SESAdminTester.java:34)
                at com...SESAdminTester.main(SESAdminTester.java:126)
           amount read:0inputBufferSize50877overflow256
                
           /* Code to Narrow - Not Working*/
           String webServiceURL = "http://host:port/search/api/admin/AdminService";          
           AdminPortType adminPort = getStatelessWebServiceClient( webServiceURL );

           Credentials credentials = new Credentials();
           credentials.setUserName("username");
           credentials.setPassword("password");

           List<String> stateProperties = new ArrayList<String>();
           stateProperties.add("status");

           String xmlResults = adminPort.getAllStates("schedule", stateProperties, null, credentials, null, "en").getObjectXML();
                
           /* Code to Narrow - Error */
                java.lang.IllegalStateException: Stream already closed
                at com.sun.xml.internal.org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:221)
                at com.sun.xml.internal.org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:196)
                at java.io.FilterInputStream.read(FilterInputStream.java:116)
                at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
                at weblogic.xml.babel.reader.XmlReader$Utf8Reader.read(XmlReader.java:660)
                at weblogic.xml.babel.reader.XmlReader.read(XmlReader.java:496)
                at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:400)
                at weblogic.xml.babel.scanner.ScannerState.expect(ScannerState.java:238)
                at weblogic.xml.babel.scanner.CloseTag.read(CloseTag.java:21)
                at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:256)
                at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
                at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
                at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.java:91)
                at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:481)
                at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
                at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
                at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
                at com.sun.xml.internal.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:462)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:349)
                at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
                at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
                at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:514)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
                at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
                at $Proxy32.getAllStates(Unknown Source)
                at com...SESAdminTester.printCrawlersRunning(SESAdminTester.java:40)
                at com...SESAdminTester.main(SESAdminTester.java:134)
           Error at line:447 col:78 Got character[0] expected a valid XML character
           amount read:0inputBufferSize19809overflow256
                at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:628)
                at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
                at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
                at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
                at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
                at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.java:91)
                at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:481)
                at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
                at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
                at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
                at com.sun.xml.internal.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:462)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:349)
                at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
                at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
                at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:514)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
                at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
                at $Proxy32.getAllStates(Unknown Source)
                at com...SESAdminTester.printCrawlersRunning(SESAdminTester.java:40)
                at com...SESAdminTester.main(SESAdminTester.java:134)
           Caught unexpected run-time exception
           message = Failed to read a response: javax.xml.bind.UnmarshalException
           - with linked exception:
           [javax.xml.stream.XMLStreamException: Error at line:447 col:78  Got character[0] expected a valid XML character]
           stackTrace =
           com.sun.xml.internal.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException
           - with linked exception:
           [javax.xml.stream.XMLStreamException: Error at line:447 col:78  Got character[0] expected a valid XML character]
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:113)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
                at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
                at $Proxy32.getAllStates(Unknown Source)
                at com...SESAdminTester.printCrawlersRunning(SESAdminTester.java:40)
                at com...SESAdminTester.main(SESAdminTester.java:134)
           Caused by: javax.xml.bind.UnmarshalException
           - with linked exception:
           [javax.xml.stream.XMLStreamException: Error at line:447 col:78  Got character[0] expected a valid XML character]
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:415)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:351)
                at com.sun.xml.internal.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:109)
                at com.sun.xml.internal.bind.api.Bridge.unmarshal(Bridge.java:222)
                at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:514)
                at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)
                ... 5 more
           Caused by: javax.xml.stream.XMLStreamException: Error at line:447 col:78 Got character[0] expected a valid XML character
                at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:206)
                at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
                at com.sun.xml.internal.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:462)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:349)
                ... 9 more
           Caused by: Error at line:447 col:78 Got character[0] expected a valid XML character
                at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:628)
                at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
                at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
                at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
                at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
                at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.java:91)
                at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:481)
                at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
                at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
                ... 13 more