Return-Path: X-Original-To: apmail-geronimo-user-archive@www.apache.org Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 129BED76E for ; Sun, 4 Nov 2012 10:16:52 +0000 (UTC) Received: (qmail 75851 invoked by uid 500); 4 Nov 2012 10:16:51 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 75683 invoked by uid 500); 4 Nov 2012 10:16:51 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 75636 invoked by uid 99); 4 Nov 2012 10:16:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Nov 2012 10:16:49 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.17.10] (HELO moutng.kundenserver.de) (212.227.17.10) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Nov 2012 10:16:41 +0000 Received: from [192.168.1.73] (host86-138-236-113.range86-138.btcentralplus.com [86.138.236.113]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LxOqw-1TJXKQ1Br0-016NWT; Sun, 04 Nov 2012 11:16:20 +0100 Message-ID: <50964072.5060707@baylishome.me.uk> Date: Sun, 04 Nov 2012 10:16:18 +0000 From: Michael Baylis User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: Servlet class not found for a REST application in OSGi bundle References: <50959028.7020604@baylishome.me.uk> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030705090902010504070606" X-Provags-ID: V02:K0:L+dx8Rn1zNCgTqmGQRKeo1hoxvdi+E/nCPOZuSyACyc fSDYMy5pQ9wr15PQvCwLVxGUtaGq/pb0vh7oqM4UkPCir/VENw 2NCS7HxwecjmXLcMJ8h5zBGW+y5ok6ddOzkMBducJB6Ub9G7XP 7/w7pxiQEKBW40h0TyjJTZW9m3mNl2q33g1155zSbD3tpWUXXl ZVNYTGO+qeCaOZqR+IgroOFqvJIldLA+4DTMU8E8ExKByK6zUt N3K0oTHB64nwMajipuR0on80rYZ4mgvWAJLfCIFG1RNe1xE1Z0 LxZfa9/OEM4yOIyArtvTeOjCKBfq4CIbDASmaxkGIgKLH4EZwL YqKOH5iyjUMIT6cooBz09KuS0XITg24U1qbrrzTla X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------030705090902010504070606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Ivan, I was indeed using a WAB. I had to add the following packages to the Import-Package list in the manifest:- org.apache.wink.server.internal.servlet, org.apache.geronimo.wink And REST is now working perfectly. Thank you Michael On 04/11/2012 04:44, Ivan wrote: > Think that you are using WAB ? If does, it is required to add all the > required import-packages, including the one used in web.xml > org.apache.wink.server.internal.servlet. Geronimo will only generate > import-packages for WAR, not for WAB, as WAB has already been a bundle. > > 2012/11/4 Michael Baylis > > > Hi, > I'm getting the following error when trying to use REST (WINK) > within a OSGi bundle:- > > org.apache.geronimo.common.DeploymentException: Fail to load > servlet class > at > org.apache.geronimo.web25.deployment.merge.annotation.ServletSecurityAnnotationMergeHandler.postProcessWebXmlElement(ServletSecurityAnnotationMergeHandler.java:79) > at > org.apache.geronimo.web25.deployment.merge.MergeHelper.processWebFragmentsAndAnnotations(MergeHelper.java:418) > at > org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.basicInitContext(AbstractWebModuleBuilder.java:493) > at > org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.initContext(AbstractWebModuleBuilder.java:436) > at > org.apache.geronimo.osgi.web.extender.WebApplication.doRun(WebApplication.java:213) > at > org.apache.geronimo.osgi.web.extender.WebApplication.run(WebApplication.java:125) > at java.util.concurrent.Executors$RunnableAdapter.call(Unknown > Source) > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) > at java.util.concurrent.FutureTask.run(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown > Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown > Source) > at java.lang.Thread.run(Unknown Source) > Caused by: java.lang.ClassNotFoundException: > org.apache.wink.server.internal.servlet.RestServlet > at > org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) > at > org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85) > at java.lang.ClassLoader.loadClass(Unknown Source) > at > org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345) > at > org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229) > at > org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207) > at > org.apache.geronimo.web25.deployment.merge.annotation.ServletSecurityAnnotationMergeHandler.postProcessWebXmlElement(ServletSecurityAnnotationMergeHandler.java:52) > ... 11 more > > This is my MANIFEST.MF:- > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: xxx.web > Bundle-SymbolicName: xxx.web > Bundle-Version: 0.1.0.qualifier > Bundle-ClassPath: WEB-INF/classes > Bundle-RequiredExecutionEnvironment: JavaSE-1.7 > Web-ContextPath: /ha > Import-Package: javax.el;version="2.0";resolution:=optional, > javax.servlet;version="2.5", > javax.servlet.annotation;resolution:=optional, > javax.servlet.http;version="2.5", > javax.servlet.jsp;version="2.0", > javax.servlet.jsp.el;version="2.0", > javax.servlet.jsp.tagext;version="2.0", > javax.ws.rs ;version="1.1.0" > > My web.xml:- > > > xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> > xxx.web > > JAX-RS Tools Generated - Do not modify > JAX-RS Servlet > org.apache.wink.server.internal.servlet.RestServlet > > javax.ws.rs > .Application > xxx.RestApplication > > 1 > > > JAX-RS Servlet > /rest/* > > > > I have no other setup files. I am using the full profile Geronimo > 3.0.0 release. > > Does anyone know what I have missed? I have not included the > wink jars in the project lib, as I want to use the one installed > in the server and I want the benefit on injection. > > Google and forum searches have drawn a blank :-( > > Thank you, > > Michael > > > > > -- > Ivan --------------030705090902010504070606 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Hi Ivan,
            I was indeed using a WAB.   I had to add the following packages to the Import-Package list in the manifest:-

 org.apache.wink.server.internal.servlet,
 org.apache.geronimo.wink

And REST is now working perfectly.

Thank you

Michael


On 04/11/2012 04:44, Ivan wrote:
Think that you are using WAB ? If does, it is required to add all the required import-packages, including the one used in web.xml org.apache.wink.server.internal.servlet. Geronimo will only generate import-packages for WAR, not for WAB, as WAB has already been a bundle.

2012/11/4 Michael Baylis <maillist@baylishome.me.uk>
Hi,
    I'm getting the following error when trying to use REST (WINK) within a OSGi bundle:-

org.apache.geronimo.common.DeploymentException: Fail to load servlet class
    at org.apache.geronimo.web25.deployment.merge.annotation.ServletSecurityAnnotationMergeHandler.postProcessWebXmlElement(ServletSecurityAnnotationMergeHandler.java:79)
    at org.apache.geronimo.web25.deployment.merge.MergeHelper.processWebFragmentsAndAnnotations(MergeHelper.java:418)
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.basicInitContext(AbstractWebModuleBuilder.java:493)
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.initContext(AbstractWebModuleBuilder.java:436)
    at org.apache.geronimo.osgi.web.extender.WebApplication.doRun(WebApplication.java:213)
    at org.apache.geronimo.osgi.web.extender.WebApplication.run(WebApplication.java:125)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.wink.server.internal.servlet.RestServlet
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
    at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
    at org.apache.geronimo.web25.deployment.merge.annotation.ServletSecurityAnnotationMergeHandler.postProcessWebXmlElement(ServletSecurityAnnotationMergeHandler.java:52)
    ... 11 more

This is my MANIFEST.MF:-
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: xxx.web
Bundle-SymbolicName: xxx.web
Bundle-Version: 0.1.0.qualifier
Bundle-ClassPath: WEB-INF/classes
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Web-ContextPath: /ha
Import-Package: javax.el;version="2.0";resolution:=optional,
 javax.servlet;version="2.5",
 javax.servlet.annotation;resolution:=optional,
 javax.servlet.http;version="2.5",
 javax.servlet.jsp;version="2.0",
 javax.servlet.jsp.el;version="2.0",
 javax.servlet.jsp.tagext;version="2.0",
 javax.ws.rs;version="1.1.0"

My web.xml:-

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>xxx.web</display-name>
  <servlet>
    <description>JAX-RS Tools Generated - Do not modify</description>
    <servlet-name>JAX-RS Servlet</servlet-name>
<servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
      <init-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>xxx.RestApplication</param-value>
      </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>JAX-RS Servlet</servlet-name>
    <url-pattern>/rest/*</url-pattern>
  </servlet-mapping>
</web-app>

I have no other setup files.  I am using the full profile Geronimo 3.0.0 release.

Does anyone know what I have missed?   I have not included the wink jars in the project lib, as I want to use the one installed in the server and I want the benefit on injection.

Google and forum searches have drawn a blank  :-(

Thank you,

Michael



--
Ivan

--------------030705090902010504070606--