views:

27

answers:

0

Hi,

I've got a JavaFx applet running in my web application. This applet has several functions that I want to invoke from my web page, so I have some buttons that execute methods inside the applet. Those work fine, all but one of them. This one has to invoke a hessian service in the server to retrieve some data. I've debugged it and I've verified that the method is being called in the server, the data retrieved from the database and the method invokes its return clause, but then, in the JavaFx client I receive the next exception:

java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
at com.caucho.hessian.io.JavaDeserializer.getFieldMap(JavaDeserializer.java)
at com.caucho.hessian.io.JavaDeserializer.<init>(JavaDeserializer.java)
at com.caucho.hessian.io.SerializerFactory.getDefaultDeserializer(SerializerFactory.java:276)
at com.caucho.hessian.io.SerializerFactory.getDeserializer(SerializerFactory.java)
at com.caucho.hessian.io.SerializerFactory.getDeserializer(SerializerFactory.java:385)
at com.caucho.hessian.io.SerializerFactory.readMap(SerializerFactory.java)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1126)
at com.caucho.hessian.io.CollectionDeserializer.readList(CollectionDeserializer.java)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java)
at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java)
at $Proxy34.retrieveInitialState(Unknown Source)
at message.utils.MessageBuffer.getState(MessageBuffer.java:147)
at controller.TrainController.startReplay(TrainController.fx:139)
at controller.MapController.replay(MapController.fx:110)
at application.Uvi.replay(Uvi.fx:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javafx.reflect.FXLocal$FunctionMember.invoke(Unknown Source)
at com.sun.javafx.runtime.liveconnect.FXClassDelegate$FunctionInfo.invoke(Unknown Source)
at com.sun.javafx.runtime.liveconnect.FXClassDelegate$FunctionBundle.invoke(Unknown Source)
at com.sun.javafx.runtime.liveconnect.FXClassDelegate.invoke(Unknown Source)
at com.sun.javafx.runtime.liveconnect.FXDelegate.invoke(Unknown Source)
at com.sun.javafx.runtime.adapter.LiveConnectBridgeImpl$AWTFXDelegate$1$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.runtime.adapter.LiveConnectBridgeImpl$AWTFXDelegate$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.sun.embeddedswing.EmbeddedEventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

I'm invoking the code from javascript in this way:

var app = document.getElementById("viewer-applet");
var d = replayDateTimeField.getValue();
var dd = new app.Packages.java.util.Date(d); 
app.script.replay(dd);

The applet is signed (Netbeans is signing it and its dependencies for me).

I've verified that if I create a button inside the applet to invoke this function it works without a problem.

What am I doing wrong?