[seam-dev] Running weld + solder + wicket on GAE

Marek Śmigielski marek.smigielski at gmail.com
Tue Apr 19 09:00:17 EDT 2011


Hi,

I have managed to deploy and successfully test simple injection of
weld-servlet, seam-wicket and solder module to GAE. This task involves
making some modifcations in all of this modules.

1. seam-solder

In AbstractJndiBeanManagerProvider I have added catch for
NoClassDefFoundError just after NamingException. GAE can't initialize
InitialContext.
>> java.lang.NoClassDefFoundError: Could not initialize class com.google.apphosting.runtime.security.shared.stub.javax.naming.InitialContext

2. seam-wicket
I have added service ServletContextBeanManagerProvider which resolves
BeanManager from ServletContext as JNDI based providers does not work.

3. weld-core
I have changed catching exception from ResourceLoadingException to
Throwable. It is widest possible catch declaration, in fact catching
specific exceptions would be probably better or GAE exceptions should
be catch deeper and rethrown as ResourceLoadingException.

There is problem with adding this classes during deployment:
org.jboss.seam.solder.bean.generic.GenericBeanExtension$1
org.jboss.seam.solder.util.collections.AbstractMultiset$ElementSet$1
org.jboss.logging.JBossLogManagerProvider
org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension$1
org.jboss.seam.solder.util.collections.AbstractMultimap$KeySet$1
org.jboss.logging.Log4jLogger
org.jboss.logging.JBossLogManagerLogger

>>Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)

4. weld-core
In InstantiatorFactory I have commented out adding
ReflectionFactoryInstantiator. It is not allowed to use
ReflectionFactory on GAE. Adding reflection factory should be check
programmatically before creating new instance in some if clause.

>> java.lang.NoClassDefFoundError: sun.reflect.ReflectionFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
>>	at com.google.appengine.runtime.Request.process-609c29691be26e8f(Request.java)
>>	at sun.reflect.ReflectionFactory.<clinit>(ReflectionFactory.java)
>>	at java.lang.reflect.Method.invoke(Method.java:43)
>>    at org.jboss.weld.util.reflection.instantiation.ReflectionFactoryInstantiator.<init>(ReflectionFactoryInstantiator.java:45)


I have not tested yet which solder features are working and which ones
not. In wicket page injection works as expected.

If you are interested in providing support for GAE, I think it would
be great to have this changes apply to master branch. Some of them
(especially 3 and 4) need some more development and propably support
from weld team.

Marek


More information about the seam-dev mailing list