OleDbException was unhandled - was

I'm using Access as database, but it seems the OleDbDataReader reader = cmd.ExecuteReader(); throws the error:
OleDbException was unhandled

Related

Unhandled Exception: FileSystemException: Cannot retrieve length of file

When I try to rename a File it throws a FileSystemException Exception
this is the exception:
E/flutter (12252): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FileSystemException: Cannot retrieve length of file, path = '' (OS Error: No such file or directory, errno = 2)
this is the code:
for (String path in _files.paths)
{
for (File file in _pickedFiles)
{
if(file.path == path)
{
await _pickedFiles.last.rename(_path.withoutExtension(file.path) + '()' + _path.extension(file.path));
}
}
}
Please help me
Thank you.

java.lang.NoSuchMethodError: io.searchbox.client.config.HttpClientConfig.isRequestCompressionEnabled()Z

I am trying to use Jest Client for REST calls for elastic search. I am getting the following error in line JestClient client = factory.getObject();:
Exception in thread "main" java.lang.NoSuchMethodError: io.searchbox.client.config.HttpClientConfig.isRequestCompressionEnabled()Z
at io.searchbox.client.JestClientFactory.getObject(JestClientFactory.java:51)
at JestTest.main(JestTest.java:22)
Following is the code:
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://localhost:9200")
.multiThreaded(true)
.build());
JestClient client = factory.getObject();
How can fix this error?

Identity 2 RoleStore Error

In my WebApi 2 app I am using StructureMap. The error is being thrown in my ConfigureContainer.
The error: There is no implicit reference conversion from Microsoft.Asp.Identity.EntityFramework.RoleStore to Microsoft.Asp.Identity.EntityFramework.IRoleStore
The IUserStore code is exactly the same and no error thrown there.
public void ConfigureContainer()
{
ObjectFactory.Configure(x =>
{
x.For<DbContext>().Use(() => new ApartmentContext());
x.For<IAuthRepository>().Use<AuthRepository>();
x.For<IUserStore<ApplicationUser>>().Use<UserStore<ApplicationUser>>();
x.For<IRoleStore<ApplicationRole>>().Use<RoleStore<ApplicationRole>>(); <-- error thrown here
});
}

Magento API error --- SoapHeaderException: Procedure 'login' not present

I am lost. I do not even know where to begin. This is the error I am getting:
Procedure 'login' not present
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapHeaderException: Procedure 'login' not present
Source Error:
Line 375: service.Url = account.APIURL;
Line 376:
Line 377: string sessionId = service.login(account.APIUser, account.APIPassword);
Line 378:
Line 379: var orders = service.salesOrderList(sessionId, InitialiseSOAPOrderCriteria(account.TriggerOrderStatus));
Source File: c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs Line: 377
Stack Trace:
[SoapHeaderException: Procedure 'login' not present]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1772421
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +345
Adapters.MagentoSOAP.MagentoSOAP.MagentoService.login(String username, String apiKey) in C:\Work\WebCatch\SF\StoreFeeder\Middlewares\SFMWMagento\Adapters.MagentoSOAP\Web References\MagentoSOAP\Reference.cs:663
Settings_ChannelHeader.magentoTestConnection(String channelGuid) in c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs:377
Settings_ChannelHeader.btnTestConnection_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\UAT.SFSystem\Settings\ChannelHeader.ascx.cs:154
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
I was getting the same error while using the v2 magento api, but problem resolved when I switched back to v1 soap api of magento

Drools: Compiling rules (or loading compiled rules) fails with obscure exceptions in JamVM

I'm developing a framework that, as one of its features, enables robots to use a rule based system. We began with Jess as the RBS, and now wanted to implement drools (using Drools 5.2.0 final), which works on our development machines running on OpenJDK 6.
Our robot controller runs ARM Linux and JamVM, previously 1.4.3, but I recently compiled 1.5.4 because it was missing classes needed by drools. After failures, I installed JamVM in a virtual machine using the same configurations as when I compiled it for the controller, and there it failed with the same exceptions.
A little research showed that there are bug reports for Drools + JamVM, but this also means that it generally does work.
When Running the framework with precompiled rules with the following code...
kBase = KnowledgeBaseFactory.newKnowledgeBase();
ObjectInputStream in;
Collection<KnowledgePackage> kpkgs;
try {
in = new ObjectInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(
packageFile));
kpkgs = (Collection<KnowledgePackage>) in.readObject();
in.close();
} catch(IOException e) {
throw new DisboticsException("Couldn't read drools knowledge package file!", e);
} catch(ClassNotFoundException e) {
throw new DisboticsException("Drools knowledge package file didn't contain expected instance.", e);
}
kBase.addKnowledgePackages(kpkgs);
kSession = kBase.newStatefulKnowledgeSession();
...I got this exception:
java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:131)
at java.util.AbstractList.add(AbstractList.java:152)
at org.drools.rule.JavaDialectRuntimeData.write(JavaDialectRuntimeData.java:383)
at org.drools.rule.JavaDialectRuntimeData.merge(JavaDialectRuntimeData.java:266)
at org.drools.rule.JavaDialectRuntimeData.clone(JavaDialectRuntimeData.java:251)
at org.drools.rule.DialectRuntimeRegistry.merge(DialectRuntimeRegistry.java:110)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:496)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:427)
at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:149)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:76)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
Exception in thread "main" org.drools.RuntimeDroolsException: java.lang.UnsupportedOperationException
at org.drools.rule.JavaDialectRuntimeData.write(JavaDialectRuntimeData.java:386)
at org.drools.rule.JavaDialectRuntimeData.merge(JavaDialectRuntimeData.java:266)
at org.drools.rule.JavaDialectRuntimeData.clone(JavaDialectRuntimeData.java:251)
at org.drools.rule.DialectRuntimeRegistry.merge(DialectRuntimeRegistry.java:110)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:496)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:427)
at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:149)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:76)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
Caused by: java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:131)
at java.util.AbstractList.add(AbstractList.java:152)
at org.drools.rule.JavaDialectRuntimeData.write(JavaDialectRuntimeData.java:383)
...9 more
...which works in OpenJDK. weirdly, it turns out that the list in question in JavaDialectRuntimeData is obtained via Collections.emptyList() and is never changed again (or so eclipse suggests...).
When running with bare .drl files using this code:
Properties props = new Properties();
props.put("drools.dialect.java.compiler", "JANINO");
KnowledgeBuilderConfiguration kbConfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props,
(ClassLoader[]) null);
KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbConfig);
kBuilder.add(ResourceFactory.newClassPathResource("disbotics/core/rules/drools/function.drl",
DroolsRulesPlugin.class), ResourceType.DRL);
kBuilder.add(ResourceFactory.newClassPathResource(rulesFile, DroolsRulesPlugin.class), ResourceType.DRL);
if(kBuilder.hasErrors()) {
String errorMessage = "";
for(KnowledgeBuilderError error:kBuilder.getErrors())
errorMessage = errorMessage + error.getMessage() + "\n";
throw new DisboticsException(errorMessage);
}
kBase = KnowledgeBaseFactory.newKnowledgeBase();
kBase.addKnowledgePackages(kBuilder.getKnowledgePackages());
kSession = kBase.newStatefulKnowledgeSession();
... I get these (unexpected) exceptions from the rules compiler:
Exception in thread "main" disbotics.core.common.DisboticsException: Line 2:8 unexpected exception at input '"mvel"'. Exception: java.lang.UnsupportedOperationException. Stack trace:
java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:131)
at java.util.AbstractList.add(AbstractList.java:152)
at org.drools.lang.descr.PackageDescr.addAttribute(PackageDescr.java:138)
at org.drools.lang.api.impl.PackageDescrBuilderImpl.attribute(PackageDescrBuilderImpl.java:93)
at org.drools.lang.ParserHelper.start(ParserHelper.java:684)
at org.drools.lang.DRLParser.stringAttribute(DRLParser.java:1289)
at org.drools.lang.DRLParser.attribute(DRLParser.java:1062)
at org.drools.lang.DRLParser.statement(DRLParser.java:276)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:155)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:352)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:55)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
[ERR 107] Line 2:8 mismatched input '"mvel"' expecting one of the following tokens: '[package, import, global, declare, function, rule, query]'.
Line 4:0 unexpected exception at input 'global'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.pop(Stack.java:109)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:421)
at org.drools.lang.ParserHelper.end(ParserHelper.java:732)
at org.drools.lang.DRLParser.globalStatement(DRLParser.java:401)
at org.drools.lang.DRLParser.statement(DRLParser.java:261)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:155)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:352)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:55)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
Parser returned a null Package
Line 2:8 unexpected exception at input '"java"'. Exception: java.lang.UnsupportedOperationException. Stack trace:
java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:131)
at java.util.AbstractList.add(AbstractList.java:152)
at org.drools.lang.descr.PackageDescr.addAttribute(PackageDescr.java:138)
at org.drools.lang.api.impl.PackageDescrBuilderImpl.attribute(PackageDescrBuilderImpl.java:93)
at org.drools.lang.ParserHelper.start(ParserHelper.java:684)
at org.drools.lang.DRLParser.stringAttribute(DRLParser.java:1289)
at org.drools.lang.DRLParser.attribute(DRLParser.java:1062)
at org.drools.lang.DRLParser.statement(DRLParser.java:276)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:155)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:352)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:57)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
[ERR 107] Line 2:8 mismatched input '"java"' expecting one of the following tokens: '[package, import, global, declare, function, rule, query]'.
Line 4:0 unexpected exception at input 'import'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.pop(Stack.java:109)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:421)
at org.drools.lang.ParserHelper.end(ParserHelper.java:732)
at org.drools.lang.DRLParser.importStatement(DRLParser.java:349)
at org.drools.lang.DRLParser.statement(DRLParser.java:258)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:155)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:352)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:57)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
Line 6:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.pop(Stack.java:109)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:421)
at org.drools.lang.ParserHelper.end(ParserHelper.java:732)
at org.drools.lang.DRLParser.rule(DRLParser.java:886)
at org.drools.lang.DRLParser.statement(DRLParser.java:267)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:155)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:352)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:57)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
Parser returned a null Package
at disbotics.core.config.DroolsRulesPlugin.initialize(DroolsRulesPlugin.java:63)
at disbotics.core.common.DisboticsCore.startFramework(DisboticsCore.java:109)
at disbotics.core.common.DisboticsCore.main(DisboticsCore.java:56)
again, compiling the rules worked just fine in OpenJDK. We're using Janino, and it is properly referenced on the classpath (the classpath used at runtime is created by the Maven build, so contains all jars referenced by drools/janino/ anything else)
Does anyone know what's going on here and/or how to get Drools working with JamVM?
Are you compiling the knowledge packages using OpenJDK 1.6? and then trying to load it with 1.5.4? You should try compiling the original packages using 1.5.4 and see if you have the same errors.
For the stack trace, it looks like you are trying to add something to an unmodifiable list right?
Basically you are getting the exception here: kBase.addKnowledgePackages(kpkgs);
Right?