Return-Path: X-Original-To: apmail-incubator-stanbol-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-stanbol-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CF237FF3 for ; Thu, 11 Aug 2011 13:01:07 +0000 (UTC) Received: (qmail 32749 invoked by uid 500); 11 Aug 2011 13:01:07 -0000 Delivered-To: apmail-incubator-stanbol-dev-archive@incubator.apache.org Received: (qmail 32643 invoked by uid 500); 11 Aug 2011 13:01:06 -0000 Mailing-List: contact stanbol-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stanbol-dev@incubator.apache.org Delivered-To: mailing list stanbol-dev@incubator.apache.org Received: (qmail 32635 invoked by uid 99); 11 Aug 2011 13:01:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 13:01:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.47] (HELO mail-qw0-f47.google.com) (209.85.216.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 13:00:56 +0000 Received: by qwh5 with SMTP id 5so1139616qwh.6 for ; Thu, 11 Aug 2011 06:00:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.34.129 with SMTP id l1mr7140218qcd.145.1313067634981; Thu, 11 Aug 2011 06:00:34 -0700 (PDT) Sender: me@farewellutopia.com Received: by 10.229.37.132 with HTTP; Thu, 11 Aug 2011 06:00:34 -0700 (PDT) X-Originating-IP: [91.137.97.22] Date: Thu, 11 Aug 2011 15:00:34 +0200 X-Google-Sender-Auth: XYSCx_2A1jUFOIKrLuOHduhZmyw Message-ID: Subject: Registering individual jax-rs resources From: =?ISO-8859-1?Q?Reto_Bachmann=2DGm=FCr?= To: stanbol-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hello As you might know the registration of JAX-RS resources is different in Stanbol and in Clerezza, this is the main reason one cannot run the two UIs simultaneously. It would however be handy to have some of the clerezza tools (like graph-management and backup) available in stanbol as well. In clerezza a jax-rs resource is simply a service, in stanbol we have WebFragment-services that provide jax-rs resources as well as some non-jax-rs that make up a web-fragment. I've written a component that picks up clerezza style root-resources and wrapps them for Stanbol. The wrapper looks like this: /** * A WebFragment holding one Jax-rs resource */ class ResourceHolder(component: Object) extends WebFragment { def getName() = component.getClass.getName def getStaticResourceClassPath(): String = null import java.util._ def getJaxrsResourceClasses(): Set[Class[_]] = Collections.emptySet[Class[_]] def getJaxrsResourceSingletons(): Set[Object] = Collections.singleton(component); def getTemplateLoader(): TemplateLoader = null; def getLinkResources(): List[LinkResource] = Collections.emptyList[LinkResource] def getScriptResources(): List[ScriptResource] = Collections.emptyList[ScriptResource]; def getNavigationLinks(): List[NavigationLink] = Collections.emptyList[NavigationLink]; def getBundleContext(): BundleContext = null; } The log output indicates that for every new fragment jersey is reinitialized: 2011-08-11 14:34:40,856 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.webfragmentcreator.WFCreator - regstering: org.apache.clerezza.rdf.web.core.PlatformRestorer@16e4d6b 2011-08-11 14:34:40,887 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.commons.web.base.JerseyEndpoint - Unregistering aliases [/static/home, /static/enhancer, /static/entityhub, /static/owl, /static/ontonet, /static/rules, /] 2011-08-11 14:34:40,888 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.commons.web.base.JerseyEndpoint - Initializing the Jersey subsystem 2011-08-11 14:34:40,888 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.commons.web.base.JerseyEndpoint - Registering web fragment 'home' into jaxrs application 2011-08-11 14:34:40,888 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.commons.web.base.JerseyEndpoint - Registering web fragment 'sparql' into jaxrs application ... 2011-08-11 14:34:40,905 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 org.apache.stanbol.commons.web.base.JerseyEndpoint - Registering web fragment 'org.apache.clerezza.rdf.web.core.PlatformRestorer' into jaxrs application 2011-08-11 14:34:40,906 [ForkJoinPool-1-worker-15] INFO ForkJoinPool-1-worker-15 com.sun.jersey.server.impl.application.WebApplicationImpl - Initiating Jersey application, version 'Jersey: 1.7 05/20/2011 11:04 AM' However I cannot access the my root resources wrapped by the above wrapper. Is there any other requirement of the JerseyEndpoint to actually register the resource with Jersey? Cheers, Reto