Aptana returns "Malformed \uxxxx encoding." when debugging with PHP 5.4.x - aptana

When I try to debug or run a PHP script on my test Windows server using Aptana and PHP 5.4.24 (or the latest 5.4.x, 5.4.40), I am told "Malformed \uxxxx encoding" has occurred.
Given most material online about this error (with any Java code) refers to paths, I've tried installing this PHP version in two locations (and with an additionally different path), with no change. None of the paths contain the string "\u".
If I use PHP 5.5.12 instead, there's no error.
My production server uses 5.4.24, and I would prefer to leave it the way it is for the time being. I would like to debug using the same version of PHP.
A certain Igor appears to have had the same problem as me in July 2014: http://php.tutorialhorizon.com/how-to-debug-php-in-aptana-studio/#comment-2225
The offered solution "check your paths" hasn't helped me.
Log:
ENTRY org.eclipse.core.jobs 4 2 2015-04-21 13:44:19.026
!MESSAGE An internal error occurred during: "Launching website".
!STACK 0
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.isXDebugFunctional(XDebugExeLaunchConfigurationDelegate.java:310)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.launch(XDebugExeLaunchConfigurationDelegate.java:86)
at org2.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy.launch(PHPLaunchDelegateProxy.java:71)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Look at the property file or the file displayed in the error message and change the backslash to forwardslash:
...\user_projects... to .../user_projects...
Or
...\uxxxx... to .../uxxxx...
\u is a reserved keyword and throws the system off.
Note: "..." and "xxxx" are depicting anything in this case. Usually the error displays a line number one line below the actual line with the issue or so-called ...\u...
Reference: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6555979
It is really disappointing that so many of these issues with java plague many of us and so many articles send people on a wild goose chase. Hope this helps someone.

Are there paths with /usr in them somewhere? The windows version of PHP can do odd things with slashes and backslashes. Without seeing your config it is hard to say.

Related

Uploading manifest file failing

After making some changes in a JSON manifest file, I was trying to update it following the Amazon documentation:
ask smapi update-skill-manifest -g development -s amzn1.ask.skill.xxxx --manifest "skillManifest.json" --debug
I kept getting this error:
The error was not pointing to what the error was but my guess was that it was related to the parameters, but that was strange as I was following the documentation to letter.
I then tried, instead of passing the json file, to cat the content of the file, which would be either:
For Powershell: --manifest "$(type skillmanifest.json)"
For Linux: --manifest "$(cat skillmanifest.json)"
I still kept getting the same error.
Firstly, for debugging and getting a more accurate error, I checked my ASK-CLi version, which was outdated.
After updating ASK to the latest version I was still getting the same error.
At that point it started including an error object, which was saying:
When looking into Parsing error due to invalid body. and INVALID_REQUEST_PARAMETER through the error codes, it just said the body of the request cannot be parsed.
After research and playing around, the problem was the manifest parameter, changing it to "file:FILENAME" solved the issue:
--manifest "file:skillmanifest.json"
The documentation is not stating this but it seems necessary for it to go through.
I hope this helps someone out there avoid spending a full day troubleshooting.

JEdit plugin error while loading Isabelle

I am working with a Windows 10 device and after some work with Isabelle I get the following error:
The following plugin could not be loaded:
C:\Users\PC\Desktop\Isabelle2018\src\Tools\jEdit\dist\jars\Isabelle-jEdit.jar:
Cannot start:
*** [line 1 of "preferences"] error: bad input
I note this problem appears in this version and in a previous Windows 8 version when not switching off properly the machine.
In the Isabelle list I got an answer to this problem:
The error indicates that the $ISABELLE_HOME_USER/etc/preferences file is in a bad state: the file is written each time Isabelle/jEdit shuts down, and switching off the computer in the middle might have corrupted it.
You can try to repair or delete that file. The location of $ISABELLE_HOME_USER on Windows is usually something like C:\Users\my_name.isabelle\Isabelle2018.
I think this problem may be encountered by other people in the community and this answer may save some time to them.

Mono random CS0006 compilation errors w/ fastcgi-mono-server4

I'm trying to deploy an ASP MVC project developed on Mono/OSX on my Linux server using mono 2.10.8.1 w/ fastcgi-mono-server4
The webapp always starts fine, but then I start getting random CS0006 compilation errors for various URIs, and once they break, they remain broken until I restart the server application.
An example error:
Server Error in '/' Application
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/root-temp-aspnet-0/ed68754/App_global.asax_40e709ea.dll' could not be found
~/Views/Order/Download.aspx
There is a related thread from January, but both the question and the answer seem to be mod_mono specific and rather hand-wavy. Anyone have any advice on what to try to debug/solve/work around this issue? It's getting very frustrating. In particular, is there any "unsupported" workaround where I can copy something from my Windows Server machines to use an MS implementation instead of the buggy mono one?
(I've filed a bug report too.)
Since the errors appear to be issue with the Mono JIT attempting to compile temporary files that don't exist, I spent a few days trying different methods of working around this issue (vs solving it). One solution that worked was using aspnet_compiler on Windows to create a binary version that could be copied and run as-is on Linux/Mono (as the latest versions of Mono now support precompiled ASP.NET applications).
However, I was looking for a native Linux solution, and I don't want to have to compile and sync binaries (vs syncing a GIT repo of code) to the server, so I was looking for another solution when I came across Mono ahead of time compilation, which is pretty much the equivalent of ngen.exe on Windows.
While it doesn't precompile everything, it seems to have done the trick. For me, this deployment script does the job without any runtime build failures:
xbuild SystemDiscs.sln
mono --aot -O=all SystemDiscs/bin/SystemDiscs*.dll
killall -9 mono
nohup fastcgi-mono-server4 /socket=tcp:127.0.0.1:8000 /applications=/:/var/asp/S
ystemDiscs/SystemDiscs/ > /var/log/systemdiscs.log &
Where SystemDiscs*.dll is the output of the solution compiled with xbuild in the first step. I don't think this precompiles the ASP pages (and --aot=full isn't supported on x86, as far as I can tell), but somehow it did the job. I was waiting to see whether or not that was just a fluke, but it's been going fine with maybe a dozen commits/deploys since I asked this ten days ago, so I reckon its safe to say it works.
I had a similiar problem:
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll' could not be found
/Default.aspx
But it didn't have anything to do with precompiling but with a backslash in my username. I use likewise-open to login to a windows domain, so my username is <DOMAIN/>\<username/> while my home-directory is without a backslash: /home/likewise-open/<DOMAIN/>/<username/>. This difference or just the backslash itself caused mono not finding the compiled global.asax in the temp directory. If you look closely to the detailed output you see that the backslash \ in the out parameter is changed to a forward slash /:
dmcs /target:library /lib:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin" /debug+ /optimize- /warn:4 /out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll" /r:"/usr/lib/mono/4.0/mscorlib.dll" /r:"/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll" /r:"/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll" /r:"/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll" /r:"/usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll" /r:"/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll" /r:"/usr/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll" /r:"/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll" /r:"/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll" /r:"/usr/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll" /r:"/usr/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll" /r:"/usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll" /r:"/usr/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll" /r:"/usr/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll" /r:"/usr/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll" /r:"/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll" /r:"/usr/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll" /r:"/usr/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll" /r:"/usr/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll" /r:"/usr/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll" /r:"/usr/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll" /r:"/usr/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll" /r:"/usr/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll" /r:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin/test9999.dll" /r:"/tmp/<domain/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll" /nowarn:0169 /d:DEBUG -- "/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd_0.cs"
So:
/out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll
becomes
/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll
If I copy the directory 5ed74d00 to /tmp/<DOMAIN/>/<username/>-temp-aspnet-0/ the application works as expected.
It took me almost 2 days to see this, so hopefully I can help others with this answer.

Error Loading Zend Gdata framework into Wordpress

I am trying to use the Zend Gdata framework with wordpress but I am having some issues.
Now everything works perfectly fine when I test on localhost with XAMPP. However on my web server my code breaks down.
Here is my code to include the framework.
`set_include_path(TEMPLATEPATH . '/includes/');
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_Youtube');`
That code produces the following error.
Warning: Zend_Loader::include_once(Zend/Gdata/Youtube.php) [zend-loader.include-once]: failed to open stream: No such file or directory in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='/home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/') in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Gdata/Youtube.php" does not exist or class "Zend_Gdata_Youtube" was not found in the file' in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php:99 Stack trace: #0 /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/modules/yt_link_checker.php(19): Zend_Loader::loadClass('Zend_Gdata_Yout...') #1 /home/damain/public_html/mysite.com/wp-includes/plugin.php(405): load_zend_gdata('') #2 /home/damain/public_html/mysite.com/wp-admin/admin.php(111): do_action('load_zend_gdata', Array) #3 /home/damain/public_html/mysite.com/wp-admin/index.php(10): require_once('/home/damain/...') #4 {main} thrown in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 99
I cannot seem to figure this issue out. Can anyone help?
The best solution in this case is to run the script requiring the Zend Loader and use var_dump(get_include_path()) to see what the server says the path is. Then keep modifying the php.ini include_path until the script finds it.
In your case, I'm not sure if 'damain' is supposed to be 'domain'. My include path which finally worked was:
/home2/thelove6/public_html/zf/ZendGdata/library" thelove6 being the username.
Did you look to see if those files exist in those directories? (/mysite/includes/Zend/Loader.php) and they have the correct permissions? It sounds like that could very well be the issue. The other thing to check with a simple phpinfo() would be that you have all of the libraries install on the live server.
Ok, the possible reason is: You're not using the proper case for the classname. For the version 1.11.11, it will be Zend_Gdata_YouTube rather than Zend_Gdata_Youtube.
Windows OS is ignoring the case, whereas the Linux server does not. Hope this will solve your problem, just look at the proper case of the Class or filenames.

QT QSslError being signaled with the error code set to NoError

My Problem
I compiled OpenSSL into QT to enable OpenSSL support. Everything appeared to go correctly in the compile.
However, when I try to use the official HTTP example application that can be found here, everytime I try to download an https page, it will signal two QSslError, each with contents NoError.
The types of QSslErrors, including NoError, are documented here, poorly. There is no explanation on why they even included an error type called NoError, or what it means.
Bizarrely, the NoError error code seems to be true, as it downloads the remote https document perfectly even while signaling the error.
Does anyone have any idea what this means and what could possibly be causing it?
Optional Background Reading
Here is the relevant part of the code from the example app (this is connected to the network connection's sslErrors signal by the constructor):
void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
{
QString errorString;
foreach (const QSslError &error, errors) {
if (!errorString.isEmpty())
errorString += ", ";
errorString += error.errorString();
}
if (QMessageBox::warning(this, tr("HTTP"),
tr("One or more SSL errors has occurred: %1").arg(errorString),
QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Ignore) {
reply->ignoreSslErrors();
}
}
I have tried the old version of this example, and it produced the same result.
I have tried OpenSSL 1.0.0a and 0.9.8o. I have tried tried compiling OpenSSL myself, I have tried using pre-compiled versions of OpenSSL from the net. All produce the same result.
If this were my first time using QT with SSL, I would almost think this is the intended result (even though their example application is popping up error warning message windows), if not for the fact that last time I played with QT, using what would now be an old version of QT with an old version of SSL, I distinctly remember everything working fine with no error windows.
My system is running Windows 7 x64.
The only path where a QSslError can be constructed with a NoError code is during conversion from OpenSSL error codes to QSslError::SslError values, when the error code is X509_V_OK. There is an interesting note about this error code in the OpenSSL docs:
If no peer certificate was presented, the returned result code is X509_V_OK. This is because no verification error occurred, it does however not indicate success.
Can you check with Wireshark or something similar if the certificate is being transmitted?
I get 4 errors, 3 times over.
The 4 (expected) errors are:
1.The host name did not match any of the valid hosts for this certificate
2.The issuer certificate of a locally looked up certificate could not be found
3.The root CA certificate is not trusted for this purpose
4.No certificates could be verified
I suspect your "NoError" refers to the last (#4)...
The reason I got 3 repeats appears to be because there are 3 threads running - each fires the same sslErrors signal.
I suspect your 2 repeats were due to 2 threads running in the WebView widget.

Resources