Let's talk about Flex, AIR, ActionScript, ColdFusion and more    

floating number bug on CF + MySQL DECIMAL

Everyone knows, there is a problem which is conversion My SQL DECIMAL into CF number. I checked it with CF line debugging. There is very very interesting behavior.

There is "9.95" decimal in MySQL. When I got the value on AIR/Flex through LCDS, it was transformed into "9.94". Who stole a cent??

I believe type conversion of Java to AS is very precise. So I guessed the criminal must be CF. Consequentially yes it is.

When I looked it at first time, it was "9.95" in variable view of CF debugging. But I was convinced "this '9.95' must be an illusion". To ensure that it was "9.95", I tried this.



You know waht? How much is "num"? It's "9.94"! I though "WHAT!!"

So I checked this step by step with CF debugger. Then it happened.

I stepped over at "num = num * 100;"


Then num was transformed into "994.9999999999999"


Oh, Give me a break!! What the hell is this?? But I have to correct this. So I did like this.


Now I got "9.95"!!



Wait a minute. Why am I taking time for such thing?

RMI exception on executing "get-method" of LCDS

On my local environment, "get-method" works fine. But on customer environment, it doesn't work and I got an exception of LCDS. There is no error in CF console. So this must be communication error of RMI.

This is so strange. Because "fill-method" works too on customer environment...

How can I solve this problem??


Error details is below.
DataService Fault event : (mx.rpc::Fault)#0
errorID = 0
faultCode = "Server.Processing"
faultDetail = (null)
faultString = "Error invoking get-method for destination hoge:
error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException:
coldfusion.runtime.TemplateProxyWrapper (no security manager: RMI
class loader disabled)"

message = "faultCode:Server.Processing faultString:'Error invoking
get-method for destination hoge: error unmarshalling return;
nested exception is:
java.lang.ClassNotFoundException:
coldfusion.runtime.TemplateProxyWrapper (no security manager: RMI
class loader disabled)' faultDetail:'null'"

name = "Error"
rootCause = (Object)#1
cause = (Object)#2
cause = (null)
exception = (null)
localizedMessage = "coldfusion.runtime.TemplateProxyWrapper (no
security manager: RMI class loader disabled)"

message = "coldfusion.runtime.TemplateProxyWrapper (no security
manager: RMI class loader disabled)"

detail = (Object)#2
localizedMessage = "error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException:
coldfusion.runtime.TemplateProxyWrapper (no security manager: RMI
class loader disabled)"

message = "error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException:
coldfusion.runtime.TemplateProxyWrapper (no security manager: RMI
class loader disabled)"



There are so many troubles on developing LCDS with CF. I think this is not a quality enough as an enterprise product.



UPDATE: Sep. 26, 2008
I figured out this. The solution is to update CF from 8.0.0 to 8.0.1 + Hotfix1.

Data Management Services + CF is useless !!

If destination isn't nested and you don't need to edit data at server-side, it might work fine. But if the data was changed at server-side (CF), Data Management Service doesn't synchronize correctly the data at client-side with the data at server-side. Actually I tried changeObject.addChangedPropertyName but it never worked at all. It seems LCDS never reads changedPropertyNames of returned value from CF although id of data is applied.

So I tried an another way. It is the EventGateway for Data Management Service. But it failed sending message SOMETIMES BUT NOT ALWAYS. And stack trace is below.
coldfusion.eventgateway.flex.FlexDataManagementGateway$BadEventStructException: エラー : Error performing Data Management transaction: Error invoking fill-method 'fill' for destination hoge: Error invoking CFC fill operation:java.lang.NullPointerException; nested exception is: flex.data.adapters.AdapterException: Error invoking fill-method 'fill' for destination hoge: Error invoking CFC fill operation:java.lang.NullPointerException イベント structure に必要なエントリが含まれていることを確認してください。 at coldfusion.eventgateway.flex.FlexDataManagementGateway.outgoingMessage(FlexDataManagementGateway.java:173) at coldfusion.runtime.CFPage.SendGatewayMessage(CFPage.java:257) at cfDmsProxy2ecfc291354852$funcEXECUTE.runFunction(D:\ColdFusion801\wwwroot\WEB-INF\classes\org\pepe\DmsProxy.cfc:67) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471) at cfDmsProxy2ecfc291354852$funcSENDSYNCREQUEST.runFunction(D:\ColdFusion801\wwwroot\WEB-INF\classes\com\lightingconcepts\pos\DmsProxy.cfc:47) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453) at coldfusion.flash.filter.CFCInvokeFilter.invoke(CFCInvokeFilter.java:143) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at coldfusion.flash.filter.CFCInvokePathFilter.invoke(CFCInvokePathFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.flash.messaging.ColdFusionAdapter.invoke(ColdFusionAdapter.java:223) at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173) at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165) at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:757) at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:117) at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:48) at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145) at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:122) at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:438) at coldfusion.flex.ColdFusionMessageBrokerServlet.service(ColdFusionMessageBrokerServlet.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


I checked what kind of data is caused error many times. But I couldn't figure out it.

When sending message failed, you know conflict will happen at next commit.


Data Management Services which can't synchronize is useless !!

Don't you think so?

LCDS 2.5.1 : Application scope of CFDataServicesAdapter and CFC

I noticed something about Application scope of LCDS 2.5.1.

When I set "application" for scope property of destination of CFDataServicesAdapter, there is odd behavior in CFC.

Application scope exists when LCDS calls these methods.
doCreate
doUpdate
doDelete

But Application scope doesn't exists when LCDS calls these method.
get
sync

"fill" method is odd specially.
When I call "fill" method by dataService.fill, there is Application scope in CFC. But when LCDS calls "fill" method internally, there is not Application scope in CFC.

When I set "request" for scope property of destination of CFDataServicesAdapter, there is always Application scope in CFC.

Are these expected behaviors? Or some kind of bug?


And when I use "grassfish" instead of JRun for LCDS 2.5.1, I got a same exception as LCDS 2.6 at "get" method.

java.lang.ClassNotFoundException:
coldfusion.runtime.TemplateProxyWrapper (no security manager: RMI
class loader disabled)



I'm very worry about which LCDS is integrated with CF well. Or not much...

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.5.005.