-
Bug
-
Resolution: Done
-
Minor
-
jboss-fuse-6.2.1
-
None
-
%
-
-
-
6.3 Sprint 4 (Mar 28 - Apr 29)
camel-example-gae in the Camel project does not work "out of the box". After setting the application id and successfully uploading the application to google app engine, the following error was ecountered:
javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext
org.springframework.web.context.ContextLoader initWebApplicationContext: Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace http://camel.apache.org/schema/spring
Offending resource: class path resource [context.xml]
Adding a dependency on camel-spring in the pom solved this problem. After adding the dependency, an error that indicated that java.misc.Unsafe was not available in the google app engine runtime.
javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext refresh: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'template': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: sun.misc.Unsafe is a restricted class. Please see the Google App Engine developer's guide for more details.
The camel-core src/main/java/org/apache/camel/util/LRUCache.java file was edited to use the ConcurrentHashMap instead of the CurrentLinkedHashMap and re-compiled. This allowed the web interface to successfully load.
The example uses a deprecated google api to retrieve city weather data; the example cannot be completed without using a different API.