question

jianwen1986 avatar image
0 Likes"
jianwen1986 asked ·

java.lang.IllegalArgumentException: 不支持:indent-number in java.lang.IllegalArgumentException: 不支持:indent-number

 

I try to use the  ebay Finding API  and copy the official HelloWorld demo,The response is correct,but get exception output before handling the response items.

 

exception trace info:

java.lang.IllegalArgumentException: 不支持:indent-number
at org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:576)
at com.ebay.common.handler.JAXWSHandler.sourceToSting(JAXWSHandler.java:130)
at com.ebay.common.handler.JAXWSHandler.getXmlString(JAXWSHandler.java:116)
at com.ebay.common.handler.JAXWSHandler.handleMessage(JAXWSHandler.java:60)
at com.ebay.common.handler.JAXWSHandler.handleMessage(JAXWSHandler.java:45)
at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:292)
at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:133)
at com.sun.xml.ws.handler.ClientSOAPHandlerTube.callHandlersOnRequest(ClientSOAPHandlerTube.java:138)
at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.client.Stub.process(Stub.java:222)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy41.findItemsByKeywords(Unknown Source)
at com.qianpin.api.ebay.find.EbayServiceImpl.findItemByKeywords(EbayServiceImpl.java:76)
at com.qianpin.test.api.ebay.find.EbayServiceImplTest.testFindItemsByKW(EbayServiceImplTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
atorg.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
atorg.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
atorg.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
atorg.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

 

 

 

 

Java program code:

 

 

// initialize service end-point configuration
     ClientConfig config = new ClientConfig();
     // endpoint address can be overwritten here, by default, production address is used,
     // to enable sandbox endpoint, just uncomment the following line
     //config.setEndPointAddress("http://svcs.sandbox.ebay.com/services/search/FindingService/v1");
     config.setApplicationId(EbayAPITools.getAPIConstants(EbayAPIConstants.AppID_Product));

     //create a service client
        FindingServicePortType serviceClient = FindingServiceClientFactory.getServiceClient(config);
        
        //create request object
        FindItemsByKeywordsRequest request = new FindItemsByKeywordsRequest();
        //set request parameters
        request.setKeywords("harry potter phoenix");
        PaginationInput pi = new PaginationInput();
        pi.setEntriesPerPage(2);
        request.setPaginationInput(pi);
        
        //call service
        FindItemsByKeywordsResponse result = serviceClient.findItemsByKeywords(request);
        
        //output result
        System.out.println("Ack = "+result.getAck());
        System.out.println("Find " + result.getSearchResult().getCount() + " items." );
        List<SearchItem> items = result.getSearchResult().getItem();
        for(SearchItem item : items) {
         System.out.println(item.getTitle());
        }

 

 

finding-api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

egpeters2ml2 avatar image
1 Like"
egpeters2ml2 answered ·
A few years late to the party, but this came up in the search results on google. You can modify the file: src/com/ebay/common/handler/JAXWSHandler.java & add a try/catch around the setAttribute call to get the kit to work. Example: // May 1 2013 - Added the try/catch around this based on: // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6486887 try { factory.setAttribute("indent-number", new Integer(2)); } catch (IllegalArgumentException e) { // ignore, file will still be correct }
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

wheijke avatar image
0 Likes"
wheijke answered ·

I also get the very same exception.

I suppose some undocumented missing dependency or wrong version... I suppose since ebay apparently doesn't know we have to find out ourselves.

 

Wouter

· 1 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Did you find the solution for the exception?my jdk version:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

0 Likes 0 · ·
$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ answered ·

Hi

 

Using the Finding Kit I was able to get the expected response with the sample you had provided.

 

Regards

 

· 1 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What is your jdk version? my jdk version:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.