Help Arthur find his restricted class” or “how can I make google app engine happy?

FWIW I don't think :only will make a bit of difference to GAE. It's probably watching what classes you load, and refusing to refer to a function doesn't stop its code from being loaded.

Up vote 5 down vote favorite 1 share g+ share fb share tw.

Somewhere in here I'm using java.rmi.server. UID which is upsetting GAE. After :only'ing my dependencies to the bone I'm at an impasse.

(ns helloworld. Core (:use ;hiccup. Core hiccup.

Page-helpers :only (html5 include-css) clojure.contrib. String :only (split) compojure. Core :only (defroutes GET) hiccup.

Middleware :only (wrap-base-url)) (:require appengine-magic. Core :as ae compojure. Route :as route :only (resources not-found) compojure.

Handler :as handler :only (site)) (:gen-class :extends javax.servlet.http. HttpServlet)) (defn index-page (name (html5 :head :title (str "Hello " name) (include-css "/css/style. Css") :body :h1 (str "Hello " name))) ( (index-page "World"))) (def match-opperator { "add" + "subtract" - "multiply" * "divide" /}) (defroutes hello-routes (GET "/:f/*" f & x (index-page (apply (match-opperator f) (map #(Integer/parseInt %) (split #" " (:* x)))))) (GET "/" (index-page)) (route/resources "/") (route/not-found "Page not found")) (def app (-> (handler/site hello-routes) (wrap-base-url))) (ae/def-appengine-app helloworld-app #'app) I can load it up in jetty and it works fine, after loading it into the dev-appserver I get this: HTTP ERROR 500 Problem accessing /multiply/1%202%204%208.

Reason: java.rmi.server. UID is a restricted class. Please see the Google App Engine developer's guide for more details.

Caused by: java.lang. NoClassDefFoundError: java.rmi.server. UID is a restricted class.

Please see the Google App Engine developer's guide for more details. At com.google.appengine.tools.development.agent.runtime.Runtime. Reject(Runtime.

Java:51) at org.apache.commons.fileupload.disk.DiskFileItem.(DiskFileItem. Java:103) at java.lang.Class. ForName0(Native Method) at java.lang.Class.

ForName(Class. Java:186) at ring.middleware. Multipart_params$loading__4414__auto__.

Invoke(multipart_params. Clj:1) at ring.middleware. Multipart_params__init.

Load(Unknown Source) at ring.middleware. Multipart_params__init.(Unknown Source) at java.lang.Class. ForName0(Native Method) at java.lang.Class.

ForName(Class. Java:264) at clojure.lang.RT. LoadClassForName(RT.

Java:1578) at clojure.lang.RT. Load(RT. Java:399) at clojure.lang.RT.

Load(RT. Java:381) at clojure. Core$load$fn__4519.

Invoke(core. Clj:4915) ps: here is my project. Clj incase this helps: (defproject helloworld "1.0.0-SNAPSHOT" :description "FIXME: write description" :dependencies org.

Clojure/clojure "1.2.1" org. Clojure/clojure-contrib "1.2.0" compojure "0.6.2" hiccup "0.3.4" :dev-dependencies appengine-magic "0.4.1" swank-clojure "1.2.1") java google-app-engine clojure compojure appengine-magic link|improve this question edited May 31 '11 at 14:23Drew Sears8,811316 asked May 31 '11 at 3:06Arthur Ulfeldt15.7k33379 77% accept rate.

FWIW I don't think :only will make a bit of difference to GAE. It's probably watching what classes you load, and refusing to refer to a function doesn't stop its code from being loaded. With no domain-specific experience other than looking at the stacktrace, I think the handler that's causing the issue is probably compojure.

Handler/site, which includes wrap-multipart-params. I doubt you need that feature for your application, so see if you can make do with compojure. Handler/api.

Then if there are particular wrappers from site that you do need, wrap them in manually. Then again, given my earlier point about loading classes, I guess the code for multipart-params is getting loaded as soon as you require the compojure. Handler namespace, so what you do after that might not matter.

I suppose you might even have to just do all the wrapping from api and site manually; it's not very complicated. Then you should be able to avoid ever requireing the multipart-params namespace.

1 dropping all the references to compojure. Handler worked :) – Arthur Ulfeldt May 31 '11 at 3:45 (def app (-> (handler/site hello-routes) (wrap-base-url))) becomes just: (def app (-> hello-routes (wrap-base-url))) – Arthur Ulfeldt May 31 '11 at 3:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions