Announcement Announcement Module
Collapse
No announcement yet.
SpringBlazeDS on GAE throws java.security.AccessControlException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringBlazeDS on GAE throws java.security.AccessControlException

    Hi,
    Im using GAE SDK 1.2.5 and spring 2.5.6 plus SpringBlazeDS
    I can run my app on local but when I update my application on Google and
    call nameService through a Flex client I get this exception:

    Code:
    org.springframework.web.servlet.FrameworkServlet initServletBean: Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    here is my flex-servlet.xml
    Code:
      
    ...
    <bean id="nameService" class="test.blazeds.SampleService">
       
        <flex:message-broker>
            <flex:message-service
                    default-channels="my-amf"/>
       
        </flex:message-broker>
    
    
        <flex:remoting-destination ref="nameService"/>
    and this is services-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>

    <channels>

    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
    class="flex.messaging.endpoints.AMFEndpoint"/>

    </channel-definition>

    </channels>

    <logging>
    <target class="com.adstrim.JavaUtilLogTarget" level="Debug"/>

    </logging>

    <system>
    <manageable>false</manageable>

    <redeploy>
    <enabled>false</enabled>

    </redeploy>
    </system>

    </services-config>

  • #2
    I noticed the exception is this:
    Code:
    creating bean with name '_messageBroker' defined in ServletContext resource [/WEB-INF/blazeds-servlet.xml]: 
    Invocation of init method failed; nested exception is java.security.AccessControlException: 
    access denied (java.lang.RuntimePermission getClassLoader)
    ...
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    	at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
    	at flex.messaging.util.ClassUtil.classLoaderToString(ClassUtil.java:213)
    	at flex.messaging.MessageBroker.start(MessageBroker.java:338)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:164)
    can someone help me

    Comment


    • #3
      That stack trace definitely shows that the problem is with BlazeDS itself violating some of the sandbox restrictions on GAE. From a brief look at the offending code, it is oddly enough only doing this ClassLoader check if the BlazeDS log level is set to debug. Try turning down the log level and see if that works.

      Of course you may still run into other problems even if it does. Has BlazeDS been otherwise verified to work correctly on GAE?

      Have you checked out Cloud Foundry? (http://www.cloudfoundry.com/) I'm really not saying that just because it's our own product. I genuinely think this is exactly the sort of headache that Cloud Foundry is intended to help you avoid, since it imposes no such restrictions.

      Comment

      Working...
      X