Issue 192 in restcomm: Jackson/JSON errors iterating over resources using restcomm-java-wrapper 1.0.0.FINAL

1 view
Skip to first unread message

rest...@googlecode.com

unread,
Sep 23, 2013, 8:00:53 PM9/23/13
to restcomm-issue...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Version-1.0.0.FINAL

New issue 192 by howardm...@screamingcoder.com: Jackson/JSON errors
iterating over resources using restcomm-java-wrapper 1.0.0.FINAL
http://code.google.com/p/restcomm/issues/detail?id=192

What steps will reproduce the problem?
1. Install RestComm
2. Connect to it using the restcomm-java-wrapper, using the default Account
3. Query the list of accounts and try to iterate over them, printing the
account SID to stdout.
Alternatively, add one or more IncomingPhoneNumbers to the default Account
and try to iterate over those.

What is the expected output? What do you see instead?
There should be one Account's SID printed to stdout (the default account
included in RestComm), or multiple IncomingPhoneNumber's SIDs.

What version of the product are you using? On what operating system?
- RestComm Tomcat 1.0.0.Final (which unzips into a
restcomm-sass-tomcat-1.0.0.CR1 directory, FYI)
- org.mobicents.servlet.sip:restcomm-java-wrapper:1.0.0.FINAL


Please provide any additional information below.
I have attached a simple maven project which reproduces the error against
the default RestComm installation when you build the project and the unit
tests are run. The tests assert that the list of Accounts and the list of
IncomingPhoneNumbers are not empty. The former should contain the default
account, the latter should contain IncomingPhoneNumbers which the test has
added to the default Account just prior to looking them up again. You may
need to update the AppTest.java:RESTCOMM_URL constant if running RestComm
on a different host or port.


Attachments:
restcomm-java-wrapper-iteration4.zip 3.1 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

rest...@googlecode.com

unread,
Sep 23, 2013, 8:04:44 PM9/23/13
to restcomm-issue...@googlegroups.com

Comment #1 on issue 192 by howardm...@screamingcoder.com: Jackson/JSON
errors iterating over resources using restcomm-java-wrapper 1.0.0.FINAL
http://code.google.com/p/restcomm/issues/detail?id=192

Sorry, forgot "What do you see instead?"

I see the below stack trace in the console, and no SIDs, as if both the
client.getAccounts().iterator() and the
client.getAccount().getIncomingPhoneNumbers().iterator() have returned
empty collections.

Running AppTest
test accounts iteration
org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance
of java.util.HashMap out of START_ARRAY token
at [Source: java.io.StringReader@78ac15cd; line: 1, column: 1]
at
org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
at
org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)
at
org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212)
at
org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:246)
at
org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:33)
at
org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2725)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1856)
at
com.twilio.sdk.parser.JsonResponseParser.parseJson(JsonResponseParser.java:33)
at
com.twilio.sdk.parser.JsonResponseParser.parse(JsonResponseParser.java:19)
at com.twilio.sdk.TwilioRestResponse.toMap(TwilioRestResponse.java:244)
at
com.twilio.sdk.resource.ListResource.parseResponse(ListResource.java:217)
at com.twilio.sdk.resource.Resource.load(Resource.java:53)
at com.twilio.sdk.resource.ListResource.getPageData(ListResource.java:201)
at com.twilio.sdk.resource.ListResource.iterator(ListResource.java:75)
at AppTest.iterateAccounts(AppTest.java:75)
at AppTest.testAccountsIteration(AppTest.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:96)
at
org.apache.maven.surefire.junit.JUnit3Provider.executeTestSet(JUnit3Provider.java:117)
at
org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

rest...@googlecode.com

unread,
Sep 25, 2013, 6:15:01 PM9/25/13
to restcomm-issue...@googlegroups.com

Comment #2 on issue 192 by howardm...@screamingcoder.com: Jackson/JSON
errors iterating over resources using restcomm-java-wrapper 1.0.0.FINAL
http://code.google.com/p/restcomm/issues/detail?id=192

Operating system was CentOS 5
Reply all
Reply to author
Forward
0 new messages