I tested your setup by using some example I found on the web (http://www.jboss.org/feeds/post/a_simple_resteasy_maven_archetype) and latest snapshots of both PAx Web and Pax Web Extender. Even if it does not work (see bellow) at least it does not fail. So, to be able to work on your issues please do create the jira issue and specify the versions of Pax Web and PAx Web Extender your are using. VEry good will be if you can add an exampel of what you have and fails.
Now why it does not work. First of all you must have latest Pax Web Extender / Pax Web as there are some issues that I solved in this upcoming releases (http://issues.ops4j.org/browse/PAXWEB-129 and http://issues.ops4j.org/browse/PAXWEBEX-39). Then the problem is within the scannotation-1.0.2 library that will not work in OSGi due to this small part in WarUrlFinder#findWebInfClassesPath: File fp = new File(path); if(!fp.exists()) return null; try { return fp.toURL(); } catch(MalformedURLException e) { throw new RuntimeException(e); } They use this method to get the /WEB-INF/classes" URLs to search for annotated resources. In this case they could have actually used the servlet context getResource that directly returns an URL, and in that case everything would have worked just fine. On Thu, Apr 9, 2009 at 12:01 AM, Josh Holtzman <[email protected]> wrote: > I'm trying to deploy a servlet and a servlet listener using Pax Web's > extended HTTP service. My servlet (actually, it's JBoss' resteasy servlet) > calls getServletContext() in it's init(ServletConfig) method, and an > exception is thrown: > > java.lang.IllegalStateException: ServletConfig has not been initialized > at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:185) > > I have a few questions about pax web: > > 1) When I register a servlet, does pax call that servlet's init() method? > 2) servlet.getServletConfig() seems to be null. Is this expected? > 3) getServletContext() is also null, causing genericServlet to throw an > exception. > > Do I need to rewrite these servlets so they do not rely on traditional > servlet-spec stuff, or am I missing some critical step(s)? > > Thanks, > Josh > > -- > Josh Holtzman > Educational Technology Services, UC Berkeley > [email protected] > > > > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general > -- Alin Dreghiciu http://www.ops4j.org - New Energy for OSS Communities - Open Participation Software. http://www.qi4j.org - New Energy for Java - Domain Driven Development. Looking for a job. Sent from Cluj-Napoca, CJ, Romania _______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
