Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Anjum Naseer  
View profile  
 More options Apr 18 2012, 7:31 am
From: Anjum Naseer <A.Nas...@Resilientplc.com>
Date: Wed, 18 Apr 2012 11:31:47 +0000
Local: Wed, Apr 18 2012 7:31 am
Subject: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

java.util.concurrent.ExecutionException: java.lang.NumberFormatException: multiple points
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at javax.swing.SwingWorker.get(SwingWorker.java:602)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
        at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
        at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
        at java.awt.EventQueue.access$000(EventQueue.java:101)
        at java.awt.EventQueue$3.run(EventQueue.java:666)
        at java.awt.EventQueue$3.run(EventQueue.java:664)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at com.versionone.DB$DateTime.<init>(DB.java:494)
        at com.versionone.apiclient.AttributeDefinition.coerce(AttributeDefinition.jav a:79)
        at com.versionone.apiclient.SingleValueAttribute.loadValue(SingleValueAttribut e.java:149)
        at com.versionone.apiclient.Asset.loadAttributeValue(Asset.java:197)
        at com.versionone.apiclient.Services.parseAttributeNode(Services.java:347)
        at com.versionone.apiclient.Services.parseAssetNode(Services.java:377)
        at com.versionone.apiclient.Services.parseAssetListQueryResult(Services.java:3 96)
        at com.versionone.apiclient.Services.parseHistoryQueryResult(Services.java:432 )
        at com.versionone.apiclient.Services.parseQueryResult(Services.java:267)
        at com.versionone.apiclient.Services.retrieve(Services.java:53)
        at com.teamphone.versionone.api.impl.DefaultV1Task.queryWorkflow(DefaultV1Task .java:352)
        at com.teamphone.versionone.api.impl.DefaultV1Task.getWorkflow(DefaultV1Task.j ava:300)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:173)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:154)
        at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at javax.swing.SwingWorker.run(SwingWorker.java:335)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1 110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 603)
        at java.lang.Thread.run(Thread.java:722)

I am using the Java SwingWorker class to fetch these in the background.

The query is along the lines of:

      final IAssetType assetType = metaModel.getAssetType("Task");
      final IAttributeDefinition changeDateAttribute = assetType.getAttributeDefinition("ChangeDate");
      final Query query = new Query(assetType, true);
      final FilterTerm changeDateFilterTerm = new FilterTerm(changeDateAttribute);
      changeDateFilterTerm.exists();
      query.setFilter(new AndFilterTerm(changeDateFilterTerm, createTaskOidFilter(metaModel,taskOid)));
      query.getOrderBy().minorSort(changeDateAttribute, OrderBy.Order.Ascending);
      query.getSelection().add(changeDateAttribute);
      query.getSelection().add(assetType.getAttributeDefinition("ChangedBy.Name") );
      query.getSelection().add(assetType.getAttributeDefinition("ChangedBy.Nickna me"));
      query.getSelection().add(assetType.getAttributeDefinition("Status.Name"));

      return services.retrieve(query);

Looks like it is having problems parsing the date/time. Anyone know how to fix this?

NOTE: I originally thought this might be to do with having temporary empty dates in the V1 database (which is why I added changeDateFilterTerm.exists()) but it still throws this error intermittently.

Thanks,

Anjum


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anjum Naseer  
View profile  
 More options Apr 18 2012, 7:52 am
From: Anjum Naseer <A.Nas...@Resilientplc.com>
Date: Wed, 18 Apr 2012 11:52:41 +0000
Local: Wed, Apr 18 2012 7:52 am
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

I tracked this down to com.versionone.DB - the constructor at line 481 is coded as follows:

481:                        public DateTime(Object value) {
482:                                        if ((value != null) && (!(value instanceof NullObject))) {
483:                                                        if (value instanceof String) {
484:                                                                        String strValue = (String) value;
485:                                                                        if (!strValue.equals("")) {
486:                                                                                        final SimpleDateFormat format;
487:                                                                                        if (strValue.contains("T")) {
488:                                                                                                        format = DAY_N_TIME_FORMAT;
489:                                                                                        } else {
490:                                                                                                        format = DAY_FORMAT;
491:                                                                                        }
492://                        format.setTimeZone(TimeZone.getTimeZone("UTC"));
493:                                                                                        try {
494:                                                                                                        setDate(format.parse(strValue));
495:                                                                                        } catch (ParseException e) {
496:                                                                                                        throw new RuntimeException("Cannot Parse Value", e);
497:                                                                                        }
498:                                                                        }
499:                                                        } else if (value instanceof Date) {
500:                                                                        setDate((Date) value);
501:                                                        } else if (value instanceof DateTime) {
502:                                                                        DateTime other = (DateTime) value;
503:                                                                        if (!other.isNull())
504:                                                                                        setDate(other.getValue());
505:                                                        } else
506:                                                                        throw new RuntimeException(UnknownConversionMessage(value));
507:                                        }
508:                        }

It throws at line 494 in this file.

I noticed that if this throws a ParseException then it is converted to a RuntimeException at line 496.
It might be useful to add the value of strValue to this exception to aid diagnostics.

The actual exception thrown in this case is a NumberFormatException so it wouldn't be caught. It might be worth catching this as well so that you can add more context to the exception message before re-throwing it.

Thanks,

Anjum

From: versionone-dev@googlegroups.com [mailto:versionone-dev@googlegroups.com] On Behalf Of Anjum Naseer
Sent: 18 April 2012 12:32
To: versionone-dev@googlegroups.com
Subject: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

java.util.concurrent.ExecutionException: java.lang.NumberFormatException: multiple points
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at javax.swing.SwingWorker.get(SwingWorker.java:602)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
        at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
        at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
        at java.awt.EventQueue.access$000(EventQueue.java:101)
        at java.awt.EventQueue$3.run(EventQueue.java:666)
        at java.awt.EventQueue$3.run(EventQueue.java:664)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at com.versionone.DB$DateTime.<init>(DB.java:494)
        at com.versionone.apiclient.AttributeDefinition.coerce(AttributeDefinition.jav a:79)
        at com.versionone.apiclient.SingleValueAttribute.loadValue(SingleValueAttribut e.java:149)
        at com.versionone.apiclient.Asset.loadAttributeValue(Asset.java:197)
        at com.versionone.apiclient.Services.parseAttributeNode(Services.java:347)
        at com.versionone.apiclient.Services.parseAssetNode(Services.java:377)
        at com.versionone.apiclient.Services.parseAssetListQueryResult(Services.java:3 96)
        at com.versionone.apiclient.Services.parseHistoryQueryResult(Services.java:432 )
        at com.versionone.apiclient.Services.parseQueryResult(Services.java:267)
        at com.versionone.apiclient.Services.retrieve(Services.java:53)
        at com.teamphone.versionone.api.impl.DefaultV1Task.queryWorkflow(DefaultV1Task .java:352)
        at com.teamphone.versionone.api.impl.DefaultV1Task.getWorkflow(DefaultV1Task.j ava:300)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:173)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:154)
        at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at javax.swing.SwingWorker.run(SwingWorker.java:335)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1 110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 603)
        at java.lang.Thread.run(Thread.java:722)

I am using the Java SwingWorker class to fetch these in the background.

The query is along the lines of:

      final IAssetType assetType = metaModel.getAssetType("Task");
      final IAttributeDefinition changeDateAttribute = assetType.getAttributeDefinition("ChangeDate");
      final Query query = new Query(assetType, true);
      final FilterTerm changeDateFilterTerm = new FilterTerm(changeDateAttribute);
      changeDateFilterTerm.exists();
      query.setFilter(new AndFilterTerm(changeDateFilterTerm, createTaskOidFilter(metaModel,taskOid)));
      query.getOrderBy().minorSort(changeDateAttribute, OrderBy.Order.Ascending);
      query.getSelection().add(changeDateAttribute);
      query.getSelection().add(assetType.getAttributeDefinition("ChangedBy.Name") );
      query.getSelection().add(assetType.getAttributeDefinition("ChangedBy.Nickna me"));
      query.getSelection().add(assetType.getAttributeDefinition("Status.Name"));

      return services.retrieve(query);

Looks like it is having problems parsing the date/time. Anyone know how to fix this?

NOTE: I originally thought this might be to do with having temporary empty dates in the V1 database (which is why I added changeDateFilterTerm.exists()) but it still throws this error intermittently.

Thanks,

Anjum

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.
To post to this group, send email to versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>.
To unsubscribe from this group, send email to versionone-dev+unsubscribe@googlegroups.com<mailto:versionone-dev+unsubscri be@googlegroups.com>.
For more options, visit this group at http://groups.google.com/group/versionone-dev?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ibuchanan  
View profile  
 More options Apr 18 2012, 8:07 am
From: ibuchanan <ian.bucha...@versionone.com>
Date: Wed, 18 Apr 2012 05:07:48 -0700 (PDT)
Local: Wed, Apr 18 2012 8:07 am
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

It does look like a problem that the SDK catches the wrong kind of
exception. I'll put a story in our backlog to address it. That said, it's
not exactly an explanation. I wonder if you could add the strValue to the
exception and recompile so we can learn a little more about the root cause.
I have a hard time imagining how the ChangeDate could be coming back as
something other than a parseable date. And the fact that it's intermitent
puzzles me, too.

Yours truly,
Ian Buchanan
Product Manager for Platform and Integrations

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anjum Naseer  
View profile  
 More options Apr 18 2012, 8:32 am
From: Anjum Naseer <A.Nas...@Resilientplc.com>
Date: Wed, 18 Apr 2012 12:32:19 +0000
Local: Wed, Apr 18 2012 8:32 am
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Ian,

I have amended the relevant code to this:

                                                                                                try {
                                                                                                                setDate(format.parse(strValue));
                                                                                                } catch (final ParseException e) {
                                                                                                                throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                } catch (final RuntimeException e) {
                                                        throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                }

And will let you have the details when it occurs again.

Thanks,

Anjum.

From: versionone-dev@googlegroups.com [mailto:versionone-dev@googlegroups.com] On Behalf Of ibuchanan
Sent: 18 April 2012 13:08
To: versionone-dev@googlegroups.com
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

It does look like a problem that the SDK catches the wrong kind of exception. I'll put a story in our backlog to address it. That said, it's not exactly an explanation. I wonder if you could add the strValue to the exception and recompile so we can learn a little more about the root cause. I have a hard time imagining how the ChangeDate could be coming back as something other than a parseable date. And the fact that it's intermitent puzzles me, too.

Yours truly,
Ian Buchanan
Product Manager for Platform and Integrations

On Wednesday, April 18, 2012 7:52:41 AM UTC-4, Anjum Naseer wrote:

I tracked this down to com.versionone.DB - the constructor at line 481 is coded as follows:

481:                        public DateTime(Object value) {
482:                                        if ((value != null) && (!(value instanceof NullObject))) {
483:                                                        if (value instanceof String) {
484:                                                                        String strValue = (String) value;
485:                                                                        if (!strValue.equals("")) {
486:                                                                                        final SimpleDateFormat format;
487:                                                                                        if (strValue.contains("T")) {
488:                                                                                                        format = DAY_N_TIME_FORMAT;
489:                                                                                        } else {
490:                                                                                                        format = DAY_FORMAT;
491:                                                                                        }
492://                        format.setTimeZone(TimeZone.getTimeZone("UTC"));
493:                                                                                        try {
494:                                                                                                        setDate(format.parse(strValue));
495:                                                                                        } catch (ParseException e) {
496:                                                                                                        throw new RuntimeException("Cannot Parse Value", e);
497:                                                                                        }
498:                                                                        }
499:                                                        } else if (value instanceof Date) {
500:                                                                        setDate((Date) value);
501:                                                        } else if (value instanceof DateTime) {
502:                                                                        DateTime other = (DateTime) value;
503:                                                                        if (!other.isNull())
504:                                                                                        setDate(other.getValue());
505:                                                        } else
506:                                                                        throw new RuntimeException(UnknownConversionMessage(value));
507:                                        }
508:                        }

It throws at line 494 in this file.

I noticed that if this throws a ParseException then it is converted to a RuntimeException at line 496.
It might be useful to add the value of strValue to this exception to aid diagnostics.

The actual exception thrown in this case is a NumberFormatException so it wouldn't be caught. It might be worth catching this as well so that you can add more context to the exception message before re-throwing it.

Thanks,

Anjum

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups. com>] On Behalf Of Anjum Naseer
Sent: 18 April 2012 12:32
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

java.util.concurrent.ExecutionException: java.lang.NumberFormatException: multiple points
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at javax.swing.SwingWorker.get(SwingWorker.java:602)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
        at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
        at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
        at java.awt.EventQueue.access$000(EventQueue.java:101)
        at java.awt.EventQueue$3.run(EventQueue.java:666)
        at java.awt.EventQueue$3.run(EventQueue.java:664)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at com.versionone.DB$DateTime.<init>(DB.java:494)
        at com.versionone.apiclient.AttributeDefinition.coerce(AttributeDefinition.jav a:79)
        at com.versionone.apiclient.SingleValueAttribute.loadValue(SingleValueAttribut e.java:149)
        at com.versionone.apiclient.Asset.loadAttributeValue(Asset.java:197)
        at com.versionone.apiclient.Services.parseAttributeNode(Services.java:347)
        at com.versionone.apiclient.Services.parseAssetNode(Services.java:377)
        at com.versionone.apiclient.Services.parseAssetListQueryResult(Services.java:3 96)
        at com.versionone.apiclient.Services.parseHistoryQueryResult(Services.java:432 )
        at com.versionone.apiclient.Services.parseQueryResult(Services.java:267)
        at com.versionone.apiclient.Services.retrieve(Services.java:53)
        at com.teamphone.versionone.api.impl.DefaultV1Task.queryWorkflow(DefaultV1Task .java:352)
        at com.teamphone.versionone.api.impl.DefaultV1Task.getWorkflow(DefaultV1Task.j ava:300)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:173)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. doInBackground(TaskWorkflowPanel.java:154)
        at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at javax.swing.SwingWorker.run(SwingWorker.java:335)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1 110)
        at
...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anjum Naseer  
View profile  
 More options Apr 19 2012, 7:42 am
From: Anjum Naseer <A.Nas...@Resilientplc.com>
Date: Thu, 19 Apr 2012 11:42:06 +0000
Local: Thurs, Apr 19 2012 7:42 am
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Hi Ian,

It hasn't occurred again yet. Just to be clear, intermittently here means that it happened twice in the past 3 weeks. So maybe I should have said "rarely" rather than intermittently.

I'll let you if it does occur again.

Thanks,

Anjum

From: versionone-dev@googlegroups.com [mailto:versionone-dev@googlegroups.com] On Behalf Of Anjum Naseer
Sent: 18 April 2012 13:32
To: versionone-dev@googlegroups.com
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Ian,

I have amended the relevant code to this:

                                                                                                try {
                                                                                                                setDate(format.parse(strValue));
                                                                                                } catch (final ParseException e) {
                                                                                                                throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                } catch (final RuntimeException e) {
                                                        throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                }

And will let you have the details when it occurs again.

Thanks,

Anjum.

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com] On Behalf Of ibuchanan
Sent: 18 April 2012 13:08
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

It does look like a problem that the SDK catches the wrong kind of exception. I'll put a story in our backlog to address it. That said, it's not exactly an explanation. I wonder if you could add the strValue to the exception and recompile so we can learn a little more about the root cause. I have a hard time imagining how the ChangeDate could be coming back as something other than a parseable date. And the fact that it's intermitent puzzles me, too.

Yours truly,
Ian Buchanan
Product Manager for Platform and Integrations

On Wednesday, April 18, 2012 7:52:41 AM UTC-4, Anjum Naseer wrote:

I tracked this down to com.versionone.DB - the constructor at line 481 is coded as follows:

481:                        public DateTime(Object value) {
482:                                        if ((value != null) && (!(value instanceof NullObject))) {
483:                                                        if (value instanceof String) {
484:                                                                        String strValue = (String) value;
485:                                                                        if (!strValue.equals("")) {
486:                                                                                        final SimpleDateFormat format;
487:                                                                                        if (strValue.contains("T")) {
488:                                                                                                        format = DAY_N_TIME_FORMAT;
489:                                                                                        } else {
490:                                                                                                        format = DAY_FORMAT;
491:                                                                                        }
492://                        format.setTimeZone(TimeZone.getTimeZone("UTC"));
493:                                                                                        try {
494:                                                                                                        setDate(format.parse(strValue));
495:                                                                                        } catch (ParseException e) {
496:                                                                                                        throw new RuntimeException("Cannot Parse Value", e);
497:                                                                                        }
498:                                                                        }
499:                                                        } else if (value instanceof Date) {
500:                                                                        setDate((Date) value);
501:                                                        } else if (value instanceof DateTime) {
502:                                                                        DateTime other = (DateTime) value;
503:                                                                        if (!other.isNull())
504:                                                                                        setDate(other.getValue());
505:                                                        } else
506:                                                                        throw new RuntimeException(UnknownConversionMessage(value));
507:                                        }
508:                        }

It throws at line 494 in this file.

I noticed that if this throws a ParseException then it is converted to a RuntimeException at line 496.
It might be useful to add the value of strValue to this exception to aid diagnostics.

The actual exception thrown in this case is a NumberFormatException so it wouldn't be caught. It might be worth catching this as well so that you can add more context to the exception message before re-throwing it.

Thanks,

Anjum

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups. com>] On Behalf Of Anjum Naseer
Sent: 18 April 2012 12:32
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

java.util.concurrent.ExecutionException: java.lang.NumberFormatException: multiple points
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at javax.swing.SwingWorker.get(SwingWorker.java:602)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
        at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
        at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
        at java.awt.EventQueue.access$000(EventQueue.java:101)
        at java.awt.EventQueue$3.run(EventQueue.java:666)
        at java.awt.EventQueue$3.run(EventQueue.java:664)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at com.versionone.DB$DateTime.<init>(DB.java:494)
        at com.versionone.apiclient.AttributeDefinition.coerce(AttributeDefinition.jav a:79)
        at com.versionone.apiclient.SingleValueAttribute.loadValue(SingleValueAttribut e.java:149)
        at com.versionone.apiclient.Asset.loadAttributeValue(Asset.java:197)
        at com.versionone.apiclient.Services.parseAttributeNode(Services.java:347)
        at com.versionone.apiclient.Services.parseAssetNode(Services.java:377)
        at com.versionone.apiclient.Services.parseAssetListQueryResult(Services.java:3 96)
        at com.versionone.apiclient.Services.parseHistoryQueryResult(Services.java:432 )
        at com.versionone.apiclient.Services.parseQueryResult(Services.java:267)
        at com.versionone.apiclient.Services.retrieve(Services.java:53)
        at com.teamphone.versionone.api.impl.DefaultV1Task.queryWorkflow(DefaultV1Task .java:352)
        at com.teamphone.versionone.api.impl.DefaultV1Task.getWorkflow(DefaultV1Task.j ava:300)
        at
...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ibuchanan  
View profile  
 More options Apr 19 2012, 8:08 am
From: ibuchanan <ian.bucha...@versionone.com>
Date: Thu, 19 Apr 2012 05:08:02 -0700 (PDT)
Local: Thurs, Apr 19 2012 8:08 am
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

That's helpful clarification. If it's that infrequent, then it will
certainly be hard to reproduce. And yet, I still can't imagine how it would
happen so I'm only more intrigued. Is it wrong of me to wish you the
misfortune of having it happen again? ;)

Ian

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anjum Naseer  
View profile  
 More options Apr 19 2012, 8:10 am
From: Anjum Naseer <A.Nas...@Resilientplc.com>
Date: Thu, 19 Apr 2012 12:10:24 +0000
Local: Thurs, Apr 19 2012 8:10 am
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Ian,

:) - not at all - I am also hoping it occurs again as I am just as intrigued to find out why it fails.

Anjum.

Anjum Naseer, Senior Software Engineer
+44 20 3162 3073
Resilient Networks plc (web<http://www.resilientplc.com> )
From: versionone-dev@googlegroups.com [mailto:versionone-dev@googlegroups.com] On Behalf Of ibuchanan
Sent: 19 April 2012 13:08
To: versionone-dev@googlegroups.com
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

That's helpful clarification. If it's that infrequent, then it will certainly be hard to reproduce. And yet, I still can't imagine how it would happen so I'm only more intrigued. Is it wrong of me to wish you the misfortune of having it happen again? ;)

Ian

On Thursday, April 19, 2012 7:42:06 AM UTC-4, Anjum Naseer wrote:

Hi Ian,

It hasn't occurred again yet. Just to be clear, intermittently here means that it happened twice in the past 3 weeks. So maybe I should have said "rarely" rather than intermittently.

I'll let you if it does occur again.

Thanks,

Anjum

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups. com>] On Behalf Of Anjum Naseer
Sent: 18 April 2012 13:32
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: RE: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Ian,

I have amended the relevant code to this:

                                                                                                try {
                                                                                                                setDate(format.parse(strValue));
                                                                                                } catch (final ParseException e) {
                                                                                                                throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                } catch (final RuntimeException e) {
                                                        throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format ["+format+"]", e);
                                                                                                }

And will let you have the details when it occurs again.

Thanks,

Anjum.

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com] On Behalf Of ibuchanan
Sent: 18 April 2012 13:08
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: Re: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

Anjum,

It does look like a problem that the SDK catches the wrong kind of exception. I'll put a story in our backlog to address it. That said, it's not exactly an explanation. I wonder if you could add the strValue to the exception and recompile so we can learn a little more about the root cause. I have a hard time imagining how the ChangeDate could be coming back as something other than a parseable date. And the fact that it's intermitent puzzles me, too.

Yours truly,
Ian Buchanan
Product Manager for Platform and Integrations

On Wednesday, April 18, 2012 7:52:41 AM UTC-4, Anjum Naseer wrote:

I tracked this down to com.versionone.DB - the constructor at line 481 is coded as follows:

481:                        public DateTime(Object value) {
482:                                        if ((value != null) && (!(value instanceof NullObject))) {
483:                                                        if (value instanceof String) {
484:                                                                        String strValue = (String) value;
485:                                                                        if (!strValue.equals("")) {
486:                                                                                        final SimpleDateFormat format;
487:                                                                                        if (strValue.contains("T")) {
488:                                                                                                        format = DAY_N_TIME_FORMAT;
489:                                                                                        } else {
490:                                                                                                        format = DAY_FORMAT;
491:                                                                                        }
492://                        format.setTimeZone(TimeZone.getTimeZone("UTC"));
493:                                                                                        try {
494:                                                                                                        setDate(format.parse(strValue));
495:                                                                                        } catch (ParseException e) {
496:                                                                                                        throw new RuntimeException("Cannot Parse Value", e);
497:                                                                                        }
498:                                                                        }
499:                                                        } else if (value instanceof Date) {
500:                                                                        setDate((Date) value);
501:                                                        } else if (value instanceof DateTime) {
502:                                                                        DateTime other = (DateTime) value;
503:                                                                        if (!other.isNull())
504:                                                                                        setDate(other.getValue());
505:                                                        } else
506:                                                                        throw new RuntimeException(UnknownConversionMessage(value));
507:                                        }
508:                        }

It throws at line 494 in this file.

I noticed that if this throws a ParseException then it is converted to a RuntimeException at line 496.
It might be useful to add the value of strValue to this exception to aid diagnostics.

The actual exception thrown in this case is a NumberFormatException so it wouldn't be caught. It might be worth catching this as well so that you can add more context to the exception message before re-throwing it.

Thanks,

Anjum

From: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com> [mailto:versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups. com>] On Behalf Of Anjum Naseer
Sent: 18 April 2012 12:32
To: versionone-dev@googlegroups.com<mailto:versionone-dev@googlegroups.com>
Subject: I am getting a NumberFormatException intermittently when reading the historical records of a Task [Latest Java ApiClient]

java.util.concurrent.ExecutionException: java.lang.NumberFormatException: multiple points
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at javax.swing.SwingWorker.get(SwingWorker.java:602)
        at com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
        at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
        at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
        at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
        at java.awt.EventQueue.access$000(EventQueue.java:101)
        at java.awt.EventQueue$3.run(EventQueue.java:666)
        at java.awt.EventQueue$3.run(EventQueue.java:664)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at com.versionone.DB$DateTime.<init>(DB.java:494)
        at
...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »