Aspose.Cells .NET: upgrading 6.0.1 to 7.3.1, WorkBookDesigner.SetDataSource() fails - cells

Scenario: add two DataSets by invoking WorkBookDesigner.SetDataSource(DataSet) twice, each of the DataSets has a DataTable of customers, the DataTables have different names.
6.0.1: worked fine
7.3.1: Exception
Test method Nirvana.Reporting.Engines.Aspose.Tests.Cells.AsposeCellsEngineTests.Execute_Report_NoTemplate_TemplateTypeDesigner_FormatXLS_ReturnsEmptySpreadSheet threw exception:
Nirvana.Reporting.Core.ReportExecutionException: An error occured executing report 'CustomerList' ---> System.ArgumentException: Item has already been added. Key in dictionary: 'PHONENUMBERS' Key being added: 'PHONENUMBERS'
System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
System.Collections.Hashtable.Add(Object key, Object value)
Aspose.Cells.WorkbookDesigner.SetDataSource(DataTable dataTable)
Nirvana.Reporting.Engines.Aspose.Cells.AsposeCellsEngine.AssignDataSourcesToWorkbookDesigner(IReport report, WorkbookDesigner designer) in C:\Workspaces\ja38524\KBC.ServiceOrganisation\Framework\Trunk\Source\Nirvana.Solution\Nirvana.Reporting.Engines.Aspose\Cells\AsposeCellsEngine.cs: line 344
Nirvana.Reporting.Engines.Aspose.Cells.AsposeCellsEngine.ExecuteDesignerReport(IReport report) in C:\Workspaces\ja38524\KBC.ServiceOrganisation\Framework\Trunk\Source\Nirvana.Solution\Nirvana.Reporting.Engines.Aspose\Cells\AsposeCellsEngine.cs: line 298
Nirvana.Reporting.Engines.Aspose.Cells.AsposeCellsEngine.Execute(Guid reportInstanceId, IReport report) in C:\Workspaces\ja38524\KBC.ServiceOrganisation\Framework\Trunk\Source\Nirvana.Solution\Nirvana.Reporting.Engines.Aspose\Cells\AsposeCellsEngine.cs: line 103
Nirvana.Reporting.Engines.Aspose.Cells.AsposeCellsEngine.Execute(Guid reportInstanceId, IReport report) in C:\Workspaces\ja38524\KBC.ServiceOrganisation\Framework\Trunk\Source\Nirvana.Solution\Nirvana.Reporting.Engines.Aspose\Cells\AsposeCellsEngine.cs: line 120
Nirvana.Reporting.Engines.Aspose.Tests.Cells.AsposeCellsEngineTests.Execute_Report_NoTemplate_TemplateTypeDesigner_FormatXLS_ReturnsEmptySpreadSheet() in C:\Workspaces\ja38524\KBC.ServiceOrganisation\Framework\Trunk\Source\Nirvana.Solution\Nirvana.Reporting.Engines.Aspose.Tests\Cells\AsposeCellsEngineTest.cs: line 188
How can I solve?

This issue looks like a regression but it might be solved in latest versions. So, you should give a try to latest version: Aspose.Cells for .NET 8.4.2 and see if it makes any difference.
Note: I am working as Developer Evangelist at Aspose

Related

Using Optaplanner for VRPPD

I am trying to run the example "optaplanner-mixedvrp-experiment" developed by Geoffrey De Smet and when I run it it throws me the following error:
Caused by: java.lang.IllegalStateException: The entity (MY) has a
variable (previousStandstill) with value (MUNO) which has a
sourceVariableName variable (nextVisit) with a value (WERBOMONT) which
is not null. Verify the consistency of your input problem for that
sourceVariableName variable.
I have not made any change, I have only cloned and executed it, I import and solve it and it throws me this error.
Do you know what could be happening?
I am applying it in the development of a variant of VRP with multiple deliveries and collections, but it throws me the same error. I have activated the FULL_ASSERT mode and nextVisit, previousStandstill, visitIndex are always null
It's been a long time since I looked at that code, so it's using an old version of optaplanner. Our goal is still to clean it up and offer an out of the box example for VRPPD (and probably remove some boilerplate along the way, using the upcoming #CollectionPlanningVariabe etc). That being said, we have multiple users&customers who used that optaplanner-mixedvrp-experiment to successfully build VRPPD implementations.
Which dataset did you try?
FWIW, that IllegalStateException says that when A.previous = B, the B.next is not A. So either the dataset importer didn't import it correctly - before calling solve() - especially if it fails before the first CH step in FULL_ASSERT. Or one of the custom moves corrupted the model.

I need help upgrading OroCommerce to 4.1.1

I just upgraded from 3.1.17 to 4.1.1 and I'm finding a problem with my shopping lists.
When I get to /customer/shoppinglist/5064 I see this:
Looking at my log files from production I see:
[2020-06-23 17:42:56] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "getDigitalAsset" of class "Proxies\__CG__\Oro\Bundle\AttachmentBundle\Entity\File"." at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php line 47 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Attempted to call an undefined method named \"getDigitalAsset\" of class \"Proxies\\__CG__\\Oro\\Bundle\\AttachmentBundle\\Entity\\File\". at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php:47)"} []
I went to look at the code and I see that in fact there is no method getDigitalAsset in oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php, nor in the proxy... how can this be?
I checked this on my VM (where the problem is not happening) and I see that there's this definition in the proxy class:
/**
* {#inheritDoc}
*/
public function getDigitalAsset()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getDigitalAsset', []);
return parent::getDigitalAsset();
}
But again, I don't see a method called getDigitalAsset in the parent class.
I had some issues when doing the upgrade (I realized my nodejs wasn't upgraded as I thought it was), could that have anything to do with the issue?
Thanks
Edit:
I went through my platform upgrade again and found that there were some problems that prevented it from finishing completely.
This is what I found:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In LoadImageSlider.php line 117:
Attempted to call an undefined method named "setMainImage" of class "Oro\Bundle\CMSBundle\Entity\ImageSlide".
I commented out the loop inside the load method and re-run the upgrade. Then I got:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In QueryException.php line 65:
[Semantical Error] line 0, col 117 near 'digitalAsset': Error: Class Oro\Bundle\AttachmentBundle\Entity\File has no association named digitalAsset
In QueryException.php line 43:
SELECT file, digitalAsset, sourceFile FROM Oro\Bundle\AttachmentBundle\Entity\File file INNER JOIN file.digitalAsset digitalAsset INNER JOIN digitalAsset.sourceFile sourceFile WHERE file.parentEntityClass = :parentEntityClass
AND file.parentEntityId = :parentEntityId AND file.parentEntityFieldName =
:parentEntityFieldName
Finally I was able to complete the upgrade by commenting out the whole body of the load method
I had some issues when doing the upgrade (I realized my nodejs wasn't upgraded as I thought it was), could that have anything to do with the issue?
It looks like you have multiple versions of nodejs installed. To make an application use the right one, you can provide the absolute path to the executable with the AssetBundle configuration, like:
# config/config.yml
oro_asset:
nodejs_path: /usr/local/node
npm_path: /usr/local/npm

FluentAssertions throws ArgumentOutOfRangeException when assertion fails (possibly NCrunch related)

I'm using FluentAssertions 5.3.0 run under NCrunch 3.14.0.1. When a test fails, I often seen this error as FluentAssertions tries to generate a report message...
System.ArgumentOutOfRangeException: startIndex cannot be larger than
length of string. Parameter name: startIndex at
System.String.Substring(Int32 startIndex, Int32 length) at
FluentAssertions.CallerIdentifier.ExtractVariableNameFrom(StackFrame
frame) at
FluentAssertions.CallerIdentifier.DetermineCallerIdentity() at
FluentAssertions.Execution.AssertionScope.GetIdentifier() at
FluentAssertions.Execution.AssertionScope.FailWith(String message,
Object[] args) at FluentAssertions.Numeric.NumericAssertions`1.Be(T
expected, String because, Object[] becauseArgs) at
TableTests.ConsolidatedMovementsTester.AlternativingMovementStatesAreRecognised()
in ...test.cs
The error is sporadic - often it will disappear if the test is rerun (in which case, a proper error report is shown). I've seen this in the last couple of versions of both FluentAssertions and NCrunch and it appears on multiple machines (all running some flavour of Visual Studio 2017 Professional).
Here's an example of the latest call to bite me...
results.Count(c => c.IsStationary).Should().Be(5);
where results is an ImmutableArray of POCOs
In this case, right-clicking on the failing test and selecting "rerun in new test runner" in the ncrunch window, caused the test to re-run and FA to emit the correct report.
Can anyone suggest a workaround for this?

Unhandled Exception using DotNetZip

I've been using DotNetZip for a month or so now and i like how it has worked but today my program started having a new issue that I'm clueless on.
During the zipping process it throws this error up and windows displays their "program name has stopped working" box.
Unhandled Exception: System.IO.FileNotFoundException: s:\(file path)\filename.pdf
at Ionic.Zip.SharedUtilities.GetFileLength(string fileName)
at ionic.Zip.ZipEntry.MaybeUnsetCompressionMethodForWriting(int32 cycle)
at Ionic.zip.Zipentry.WriteHeader(Stream s, Int32 cycle)
at Ionic.zip.ZipEntry.Write(Stream s)
at Ionic.zip.zipfile.save()
at ZipAJob_Instant.ConsoleMain.Main() in C:\users\(my name)\Documents\visual studio 2012\projects\zipAjob_Instant\zipAJob_Win32.vb:line 71
Line 71 refers to where i call zip.save()
From your comments, I take that what happened is exactly what happened to me a while ago.
I was getting a list of files to zip and stored into memory. The I would go zipping them one by one until this exception was thrown. The cause was someone removed the file after I got the list, but before I got the opportunity to zip it. This occured on a shared folder, btw.

NullPointer with playOrm 1.4.1 when persisting entity

I have mapped entities in playORM and my project was running fine with my entities mapped the way they were. However, after installing playORM 1.4.1, the lastest version released in maven, I got the null pointer bellow.
I want to find the error, but have no clue of where to start looking.
Any hint?
INFO: found meta=User locally
2012-11-09 17:32:22,918 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper waitForNodesToBeUpToDate
INFO: LOOP until all nodes have same schema version OR timeout in 300000 milliseconds
2012-11-09 17:32:22,939 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper tryToLoadColumnFamilyImpl
INFO: Well, we did NOT find any column family=User to load in cassandra(from virt=User)
2012-11-09 17:32:22,939 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper tryToLoadColumnFamilyVirt
INFO: Total time to LOAD column family meta from cassandra=21
java.lang.NullPointerException
at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumnImpl(MetaEmbeddedSimple.java:105)
at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumn(MetaEmbeddedSimple.java:93)
at com.alvazan.orm.impl.meta.data.MetaClassSingle.translateToRow(MetaClassSingle.java:82)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.putImpl(BaseEntityManagerImpl.java:102)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.put(BaseEntityManagerImpl.java:68)
at com.s1mbi0se.dmp.da.dao.UserDao.insertOrUpdateUser(UserDao.java:23)
at com.s1mbi0se.dmp.module.UserModule.persistData(UserModule.java:116)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:60)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:1)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:176)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:417)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:260)
17:32:22,946 WARN Thread-3 mapred.LocalJobRunner:298 - job_local_0001
java.lang.InterruptedException
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:63)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:1)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:176)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:417)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:260)
2012-11-09 17:32:27,237 com.s1mbi0se.dmp.processor.main.DmpProcessorRunner run
EDIT: This is fixed in master branch and soon to be released. 11/27/12
The log formatting seems a bit off but this is the important part
java.lang.NullPointerException at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumnImpl(MetaEmbeddedSimple.java:105)
line 105 finds this code...
for(T val : toBeAdded) {
byte[] name = formTheName(val);
Column c = new Column();
c.setName(name);
row.getColumns().add(c);
}
specifically line 105 is the first line so toBeAdded is null for some reason....looking at who called this method.
hmmm, it turns out ONE of your entities has a null list of something. We need to add code in here so if your entity has a null list we create an empty one instead. Can you file a ticket and link to this URL. We can fix this one easily.
NOTE: I have a habit of every entity with a field like so
private List something;
I 100% always define it like this
private List something = new ArrayList();
That avoids Nullpointers all over the place which is why I missed this one :( :(.....anyways, we will fix to allow this null lists.
thanks,
Dean
This is fixed in release 1.4.2 which is available in Maven repo