Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: - postgis

I am new to postgresql/postgis and am unable to solve this problem. I have lat long values which I retrieve by the click event and split using
lonlat.split(",");
But when I pass them into the following query, I receive a syntax error.
$sql1=$conn->prepare("select id,ST_Contains(geom,GeomFromText(4326,'POINT(".$lon." ".$lat.")')) as yes_within from public.".$layername);
$sql1->execute();
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: ...om,GeomFromText('POINT( )',4326)) as yes_within from public. ^' in C:\xampp\htdocs... Stack trace: #0 PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs... on line 22

From the error
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: ...om,GeomFromText('POINT( )',4326)) as yes_within from public. ^' in C:\xampp\htdocs... Stack trace: #0 PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs... on line 22
That means that even though you think you're getting them from split, you're not getting them from split. You're concatenating an empty string. The problem isn't in PostgreSQL.
Aside from that, don't construct a point that way. Instead use,
ST_MakePoint(long,lat)::geography
Which creates a geography not a geometry and it does it without text-parsing.

Related

#main Thread 1: Fatal error: Index out of range

im getting the error
Thread 1: Fatal error: Index out of range
I know what it means but I have absolutely no clue what my code is doing that triggers this error, because I don't get it in a line like this:
array.remove(at: 5)
but there:
#main
(In my Main File)
Is there a way to figure out what triggers that error?
Thanks for your Help!

Facebook native SDK conflicts with Parse4CN1 on Android

I'm currently having some trouble with an issue that was previously fixed through a build hint some time ago as you can see in the following thread:
https://groups.google.com/forum/#!searchin/codenameone-discussions/parse4cn1%7Csort:date/codenameone-discussions/4xipU9Sy5rY/IbX1YMmGBQAJ
I'm still keeping the build hint android.excludeBolts=true as well as the facebook.appId build hint set to my app id, but it now fails with the following error:
2019-03-19 00:35:44.832 9571-9571/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.guarumo.ego, PID: 9571
java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/AppLinks;
at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155)
at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101)
at android.app.Application.dispatchActivityCreated(Application.java:208)
at android.app.Activity.onCreate(Activity.java:1110)
at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306)
at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53)
at android.app.Activity.performCreate(Activity.java:7383)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
at android.app.ActivityThread.-wrap12(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.AppLinks" on path: DexPathList[[zip file "/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155)
at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101)
at android.app.Application.dispatchActivityCreated(Application.java:208)
at android.app.Activity.onCreate(Activity.java:1110)
at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306)
at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53)
at android.app.Activity.performCreate(Activity.java:7383)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
at android.app.ActivityThread.-wrap12(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
On the other hand, if I set the android.excludeBolts build hint to false I get the problem presented on the previously mentioned thread:
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AggregateException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$UIThreadExecutor;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$ImmediateExecutor;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationToken;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationTokenRegistration;
Dex: Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Translation has been interrupted
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:615)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:313)
at com.android.dx.command.dexer.Main.runDx(Main.java:291)
at com.android.dx.command.dexer.Main.main(Main.java:247)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:607)
... 4 more
:transformClassesWithDexForRelease FAILED
:transformClassesWithDexForRelease (Thread[Daemon worker,5,main]) completed. Took 22.043 secs.
I think this might be being caused by the change to a newer version of the Facebook SDK, but couldn't confirm it. Could you please help me out with this problem?
Thanks in advance.
I'm guessing this relates to the second answer in this question. This was caused because of this fix. As a temporary workaround you can probably set the SDK to the older/deprecated facebook SDK with the build hint: android.facebookSdkVersion=4.7.0.
To property fix this problem (if that answer is indeed correct) you will need to add parse bolts to the build hints:
android.gradleDep=compile 'com.parse.bolts:bolts-tasks:1.4.0'; compile 'com.parse.bolts:bolts-applinks:1.4.0';

DNN HTML Module on 9.1.1 throwing the following error

Since applying the latest critical security update, all pages that have the HTML module on them are throwing the following error resulting in a 404 page for the user. Please advise! Is there a good replacement module that we can use instead?
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'ModuleContext' does not exist in the current context
Source Error:
Line 41: {
Line 42: var wasReplacing = false;
Line 43: ModuleContext.Settings["MyTokensReplace"] = false;
Line 44: if (ModuleContext.Settings["TEXTHTML_ReplaceTokens"] != "") {
Line 45: if (Convert.ToBoolean(ModuleContext.Settings["TEXTHTML_ReplaceTokens"]) == true) {
This appears to be related to the MyTokens module. See the post on their website here:
https://www.dnnsharp.com/helpcenter/case/62435

CMN0420E: The following command exception has occurred during processing

I am getting error when hit the site (WCS store) URL.
CMN0420E: The following command exception has occurred during processing: "com.ibm.commerce.foundation.internal.client.exception.RESTInvokeException". org.apache.commons.json.JSONException: Error occurred during input read.

SolrPhpClient not working

I have a question. SolrphpClient is not working with multicore.
I have two cores in my solr say core1 and core2.
While creating object of SolrPhpClient I am using the following syntax.
$solr = new Apache_Solr_Service('192.168.12.226', '8983', 'solr/core1/' );
It's giving a fatal error...
Fatal error: Uncaught exception 'Exception' with message '"500" Status: null_javalangNullPointerException_at_javaioStringReaderinitStringReaderjava50__at_orgapachelucenequeryParserQue' in C:\xampp\htdocs\solrsite\SolrPhpClient\Apache\Solr\Service.php:334 Stack trace: #0 C:\xampp\htdocs\solrsite\SolrPhpClient\Apache\Solr\Service.php(964): Apache_Solr_Service->_sendRawGet('http://192.168....') #1 C:\xampp\htdocs\solrsite\script\productlist.php(403): Apache_Solr_Service->search(NULL, 0, 15, Array) #2 C:\xampp\htdocs\solrsite\index.php(510): include_once('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\solrsite\SolrPhpClient\Apache\Solr\Service.php on line 334
Solr is working fine in admin part.
Any help will be appreciated.
Based on your url that you provided:
http://192.168.12.226:8983/solr/core1/select?fl=ST_StockCode%2CST_ItemCategory%2CST_Stone1%2CST_Stone2%2CST_LowPrice%2CST_WebPrice
%2CST_Name%2CST_ArticleType%2CST_MetalType%2CST_HighPrice%2CST_ImageFileName%2Cis_clearance%2CGroupName
%2CFreePnp%2CST_ItemSize%2CST_MarketPrice&sort=ST_Name+desc&version=1.2&wt=json&json.nl=map&start=0&rows=1
It does not look like you are providing an actual query q= value in your request. I would guess that is the reason for the error... I would suggest that you start with setting the SolrPhpClient so that is passes q=*:* to start with.

Resources