Return-Path: Delivered-To: apmail-incubator-abdera-dev-archive@locus.apache.org Received: (qmail 22967 invoked from network); 2 Sep 2008 23:03:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 23:03:34 -0000 Received: (qmail 89424 invoked by uid 500); 2 Sep 2008 23:03:32 -0000 Delivered-To: apmail-incubator-abdera-dev-archive@incubator.apache.org Received: (qmail 89415 invoked by uid 500); 2 Sep 2008 23:03:32 -0000 Mailing-List: contact abdera-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-dev@incubator.apache.org Received: (qmail 89404 invoked by uid 99); 2 Sep 2008 23:03:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 16:03:31 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 23:02:32 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Kaetq-0004Q9-MD for abdera-dev@incubator.apache.org; Tue, 02 Sep 2008 16:03:02 -0700 Message-ID: <19280091.post@talk.nabble.com> Date: Tue, 2 Sep 2008 16:03:02 -0700 (PDT) From: pratimat To: abdera-dev@incubator.apache.org Subject: Retrieving service document failing for AbderaServer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ptummala_09@yahoo.com X-Virus-Checked: Checked by ClamAV on apache.org I wish to run ABDERA on TOMCAT. The thing runs correctly when i have Jetty as well as tomcat. But fails when i try to just use TOMCAT. This is what i have so far. ------- web.xml ------- AbderaServlet org.apache.abdera.protocol.server.servlet.AbderaServlet org.apache.abdera.protocol.server.Provider AbderaServer.CustomProvider AbderaServlet /services/* ------------------- CustomProvider.java [ This is CustomProvider from Abdera website ] ------------------- public class CustomProvider extends AbstractWorkspaceProvider { public EmployeeCollectionAdapter ca = new EmployeeCollectionAdapter(); public CustomProvider() { setTargetResolver( new RegexTargetResolver() .setPattern("/services(\\?[^#]*)?", TargetType.TYPE_SERVICE) .setPattern("/services/([^/#?]+);categories", TargetType.TYPE_CATEGORIES, "collection") .setPattern("/services/([^/#?;]+)(\\?[^#]*)?", TargetType.TYPE_COLLECTION, "collection") .setPattern("/services/([^/#?]+)/([^/#?]+)(\\?[^#]*)?", TargetType.TYPE_ENTRY, "collection","entry") .setPattern("/search", OpenSearchFilter.TYPE_OPENSEARCH_DESCRIPTION) ); . . . /* Adding my workspace information */ SimpleWorkspaceInfo workspaceInfo = new SimpleWorkspaceInfo(); workspaceInfo.setTitle("My Workspace"); workspaceInfo.addCollection(ca); addWorkspace(workspaceInfo); . . . // End CustomProvider.java } ------------------------------ EmployeeCollectionAdapter.java ------------------------------ public class EmployeeCollectionAdapter extends AbstractEntityCollectionAdapter { // Feed metadata // Entry metadata // Methods - PostEntry, PutEntry, DeleteEntry } ----------------------- SingletonAbdera.java -------------------------- public class SingletonAbdera { private static Abdera abderaInstance = null; private static int instanceCounter = 0; /* Constructor */ protected Client(){ } public static synchronized Abdera getInstance() { if (abderaInstance == null) { abderaInstance = new Abdera(); instanceCounter++; System.out.println("INSTANCE COUNTER FROM client.java: "+instanceCounter); } return abderaInstance; } public static synchronized UtilityObjects getUtilityObjects(Abdera abderaInstance){ UtilityObjects utilityObject = new UtilityObjects(); utilityObject.setAbdera(abderaInstance); utilityObject.setAbderaClient(abderaInstance); utilityObject.setFactory(abderaInstance); utilityObject.setServiceDoc(); return utilityObject; } } ------------------- UtilityObjects.java ------------------- public class UtilityObjects { private Abdera abderaUtilityObject; private AbderaClient abderaClientUtilityObject; private Service serviceDocumentUtilityObject; public Abdera getAbdera(){ return abderaUtilityObject; } public void setAbdera(Abdera abdera){ this.abderaUtilityObject = abdera; } public AbderaClient getAbderaClient(){ return abderaClientUtilityObject; } public void setAbderaClient(Abdera abdera){ this.abderaClientUtilityObject = new AbderaClient(abdera); } public Service getServiceDoc(){ return serviceDocumentUtilityObject; } public void setServiceDoc(){ Document introspection = this.abderaClientUtilityObject.get("http://localhost:8080/services").getDocument(); this.serviceDocumentUtilityObject = introspection.getRoot(); } // End UtilityObjects.java } =============================================== UtilityOnjects.java instance is used elsewhere. SingletonAbdera.java is used to get the abderInstance and the abderaClientInstance [ Document introspection = this.abderaClientUtilityObject.get("http://localhost:8080/services").getDocument(); ] is constantly throwing Null pointer Exception or some error. So, eventually utilityObjectInstance.getServiceDoc().getCollection("My Workspace", "My database") -FAILS. I should at least get the service document, and then i can proceed further. Can anyone please give suggestions here? Thanks.. -- View this message in context: http://www.nabble.com/Retrieving-service-document-failing-for-AbderaServer-tp19280091p19280091.html Sent from the abdera-dev mailing list archive at Nabble.com.