Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5115

camel-example-gae errors: dependency, restricted classes, deprecated api

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • jboss-fuse-6.3
    • jboss-fuse-6.2.1
    • Camel
    • None
    • % %
    • Hide

      Download fresh 6.2.1 distribution of fuse.
      edit src/main/webapp/WEB-INF/appengine-web.xml for application id
      mvn clean install
      appcfg.sh update target/camel-example-gae-2.15.1.redhat-621084
      Browse to http://

      {application_id}

      .appspot.com

      Show
      Download fresh 6.2.1 distribution of fuse. edit src/main/webapp/WEB-INF/appengine-web.xml for application id mvn clean install appcfg.sh update target/camel-example-gae-2.15.1.redhat-621084 Browse to http:// {application_id} .appspot.com
    • 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:

      Namespace Error

      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.

      Restricted Class Error

      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.

            johnpoth John Poth
            rhn-support-shiggs Stephen Higgs
            Jan Kasztura Jan Kasztura (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: