Method not found: 'PHP.Library.PhpStrings.Translate'.

Discussion about the open-source Phalanger [?] project.

Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby kripper » November 11th, 2012, 1:33 am

I'm recieving:

Code: Select all
System.MissingMethodException: Method not found: 'PHP.Library.PhpStrings.Translate'.


While calling strtr($str, $array) inside a function defined in a MSA.

The strange thing is, if I move the function into a SSA, there is no problem.

I'm running on Mono. On Windows, there is no problem at all.
This problem appeared after updating to latest SVN version.
kripper
 
Posts: 44
Joined: February 19th, 2012, 1:02 am

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby Jakub Misek » November 11th, 2012, 10:10 am

It is possible latest release changes signature of this method, and .NET cannot locate the previous one.

Try to recompile MSA and try again, with new libraries. Ensure you are compiling against the same DLLs you are using at run time.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby kripper » November 12th, 2012, 12:18 pm

It makes sense,but...

I recompiled the MSA (and the changes take effect).
I'm also deleting mono's cache before testing, without success.

The same MSA binary (WebPages.dll) works on Windows, but not on Mono.
At the moment, I only noted problems calling strtr() from the MSA on mono.

Does PHPC keep a cache that may be referencing an older ClassLibrary version on my windows installation (and thus working)?

How can I analyze the problem?

Thanks.
kripper
 
Posts: 44
Joined: February 19th, 2012, 1:02 am

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby Jakub Misek » November 12th, 2012, 12:36 pm

Post the rest of the exception ... the arguments of that missing method are crucial.

MSA simply references PhpNetClassLibrary.dll and PhpNetClassLibrary.dynamic.dll ... just check these DLLs are up-to-date .. ensure where the DLLs are - GAC, local, Bin, ... common .NET references hell
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby kripper » November 12th, 2012, 5:05 pm

This is the whole exception:

Code: Select all
System.MissingMethodException: Method not found: 'PHP.Library.PhpStrings.Translate'.
at <GTS/lib/ktk/classes/ktkCommon.php>.<Script>.strtolower_sp (object,PHP.Core.PhpStack) <0x0004f>
at PHP.Core.Reflection.DRoutineDesc.Invoke (PHP.Core.Reflection.DObject,PHP.Core.PhpStack) <0x0004d>
at PHP.Core.ScriptContext.CallInternal (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00573>
at PHP.Core.ScriptContext.CallValue (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00027>
at <GTS/lib/ktk/classes/ktkGTS.php>.<Script>.dwbGetDBIdentifier (PHP.Core.ScriptContext,object,object) <0x00357>
at <GTS/lib/ktk/classes/ktkGTS.php>.<Script>.dwbGetDBIdentifier (object,PHP.Core.PhpStack) <0x00067>
at PHP.Core.Reflection.DRoutineDesc.Invoke (PHP.Core.Reflection.DObject,PHP.Core.PhpStack) <0x0004d>
at PHP.Core.ScriptContext.CallInternal (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00573>
at PHP.Core.ScriptContext.CallValue (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00027>
at <GTS/lib/ktk/classes/ktkFormObject.php>.<Script>.ktkGetTableName (PHP.Core.ScriptContext,object) <0x00177>
at <GTS/lib/ktk/classes/ktkFormObject.php>.<Script>.ktkForm_GetRDBTable (PHP.Core.ScriptContext,object) <0x000eb>
at <GTS/lib/ktk/classes/ktkFormObject.php>.<Script>.ktkForm_GetRDBTable (object,PHP.Core.PhpStack) <0x0004f>
at PHP.Core.Reflection.DRoutineDesc.Invoke (PHP.Core.Reflection.DObject,PHP.Core.PhpStack) <0x0004d>
at PHP.Core.ScriptContext.CallInternal (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00573>
at PHP.Core.ScriptContext.CallValue (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00027>
at <GTS/lib/ktk/classes/ktkQueries.php>.ktkQuery.Query (PHP.Core.ScriptContext,object) <0x0996b>
at <GTS/lib/ktk/classes/ktkQueries.php>.ktkQuery.<Mediator> (PHP.Core.ScriptContext,object) <0x00017>
at <GTS/lib/ktk/classes/ktkQueries.php>.ktkQuery.Query (object,PHP.Core.PhpStack) <0x00093>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,PHP.Core.ScriptContext,object) <0x00226>
at <GTS/lib/ktk/classes/ktkQueries.php>.<Script>.ktkXMLDB_GetRows (PHP.Core.ScriptContext,object) <0x003d8>
at <GTS/lib/ktk/classes/ktkQueries.php>.<Script>.ktkList_GetObjects (PHP.Core.ScriptContext,object) <0x00087>
at <GTS/lib/ktk/classes/ktkQueries.php>.<Script>.ktkFormObject_GetObjectsList (PHP.Core.ScriptContext,object) <0x00097>
at <GTS/lib/ktk/classes/ktkQueries.php>.<Script>.ktkFormObject_GetObjectsList (object,PHP.Core.PhpStack) <0x0004f>
at PHP.Core.Reflection.DRoutineDesc.Invoke (PHP.Core.Reflection.DObject,PHP.Core.PhpStack) <0x0004d>
at PHP.Core.ScriptContext.CallInternal (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00573>
at PHP.Core.ScriptContext.CallValue (System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.NamingContext,object,string,PHP.Core.Reflection.DRoutineDesc&,PHP.Core.ScriptContext) <0x00027>
at <app/ecosa.net/login.php>.<Script>.<Main> (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x00f5f>
at (wrapper delegate-invoke) <Module>.invoke_object__this___ScriptContext_Dictionary`2<string, object>_DObject_DTypeDesc_bool (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x00098>
at PHP.Core.ScriptInfo.<get_Main>b__0 (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x00080>
at PHP.Core.ScriptContext.DynamicInclude (string,string,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,PHP.Core.Reflection.InclusionTypes) <0x00319>
at <index.php>.<Script>.ShowLogin (PHP.Core.ScriptContext) <0x007f3>
at <index.php>.<Script>.ShowLogin (object,PHP.Core.PhpStack) <0x0003b>
at <index.php>.<Script>.<Main> (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x0411f>
at (wrapper delegate-invoke) <Module>.invoke_object__this___ScriptContext_Dictionary`2<string, object>_DObject_DTypeDesc_bool (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x00098>
at PHP.Core.ScriptInfo.<get_Main>b__0 (PHP.Core.ScriptContext,System.Collections.Generic.Dictionary`2<string, object>,PHP.Core.Reflection.DObject,PHP.Core.Reflection.DTypeDesc,bool) <0x00080>
at PHP.Core.ScriptContext.<Include>b__0 (PHP.Core.ScriptInfo) <0x0007d>
at PHP.Core.ScriptContext.GuardedCall<PHP.Core.ScriptInfo, object> (System.Converter`2<PHP.Core.ScriptInfo, object>,PHP.Core.ScriptInfo,bool) <0x001e7>


This is the user-defined function calling strtr().

Code: Select all
function strtolower_sp($str) {
  $low = array('Á' => 'á', 'É' => 'é', 'Í' => 'í', 'Ó' => 'ó', 'Ú' => 'ú', 'Ü' => 'ü', 'Ñ' => 'ñ');
  return strtolower(strtr($str, $low));
}


When not calling strtr (but only strtolower) the exception is not thrown:

Code: Select all
function strtolower_sp($str) {
   return strtolower($str);
}


I also tested calling strrev() in the same way without problems.

When calling strtr($str, $src, $dst) instead of strtr($str, $arr), there is also no problem:

Code: Select all
function strtolower_sp($str) {
   $src = 'ÁÉ';
   $dst = 'áé';
   return strtolower(strtr($str, $src, $dst));
}


Thus, it seems Phalanger on Mono is not correctly resolving all function overloads.
kripper
 
Posts: 44
Joined: February 19th, 2012, 1:02 am

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby Jakub Misek » November 12th, 2012, 5:12 pm

It has nothing to do with Phalanger. There are different DLLs in compile time and runtime on your machine.

In 9/20/2012, signature of Translate method was changed (https://github.com/DEVSENSE/Phalanger/c ... e11169d52c) ... and you have probably old and new PhpNetClassLibrary.dll ... update the old one, and you won't see this JITter exception again.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby kripper » November 12th, 2012, 6:05 pm

Confirmed. Doing a clean + build of Phalanger fixed the problem.
Sorry for the false alarm.

Thanks
kripper
 
Posts: 44
Joined: February 19th, 2012, 1:02 am

Re: Method not found: 'PHP.Library.PhpStrings.Translate'.

Postby Jakub Misek » November 12th, 2012, 6:24 pm

No problem :-) I'm glad it works now.

Thanks.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 19 guests

cron

User Control Panel

Login

Who is online

In total there are 19 users online :: 0 registered, 0 hidden and 19 guests (based on users active over the past 5 minutes)
Most users ever online was 280 on March 29th, 2024, 5:38 am

Users browsing this forum: No registered users and 19 guests