Hi all, We think we've discovered the problem.
We have some methods defined in our Service class that enable us to query the xfire instance. There are no Services defined in the service registry until a query is made (or a method is called on the service presumably). Once a method has been called, the Service is available through the ServiceRegistry. Weird huh. If anyone would like to comment on how you get the Service bootstrapped AND registered without having to make any external calls to the Service would be great.... Cheers Rob On Thu, 2007-09-27 at 15:18 +0530, Mayank Thakore wrote: > Each classloader WILL have its own static instances for class members. We > know this because we use this feature in our project. XFireFactory has a > static variable to store the singleton. So then you would have two instances > ! > > Regards > Mayank Thakore > Huawei Technologies > > **************************************************************************** > **************************** > This e-mail and attachments contain confidential information from HUAWEI, > which is intended only for the person or entity whose address is listed > above. Any use of the information contained herein in any way (including, > but not limited to, total or partial disclosure, reproduction, or > dissemination) by persons other than the intended recipient's) is > prohibited. If you receive this e-mail in error, please notify the sender by > phone or email immediately and delete it! > > -----Original Message----- > From: robert davey (JIC) [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 26, 2007 20-27 > To: [email protected]; [email protected] > Subject: RE: [xfire-user] ServiceRegistry empty, but wsdl available > > We've had some more thoughts about this. > > I'm suspecting that there may be ClassLoader issues going on. The JSP will > be compiled and the resulting JSP servlet instantiated using a different > classloader (JasperClassLoader) to that of the xfire instance instantiated > by the XFireFactory (webappClassLoader). > > Is the xfire instance REALLY a singleton, i.e. only one per _JVM_, or is > there one xfire instance by _ClassLoader_? > > This is a really important distinction, especially when dealing with Tomcat > and JSPs. > > Cheers > > Rob > > -----Original Message----- > From: Robert Davey [mailto:[EMAIL PROTECTED] > Sent: Tue 9/25/2007 11:46 AM > To: [email protected] > Subject: RE: [xfire-user] ServiceRegistry empty, but wsdl available > > Hi Mayank, > > There is only one singleton XFire instance per JVM (checked for by the > XFireFactory.newInstance() method), so I don't know why the JSP can't > get at the correct instance, when there should be only one. Even > stranger is how "externally" (by going to the service URL) the service > works fine in that you can get at the WSDL, but trying to get at the > published service "internally" (by polling the XFire ServiceRegistry) > for the very same instance returns no services... > > Anyone on the xfire project available for comment? > > Cheers > > Rob > > On Sat, 2007-09-22 at 11:34 +0530, Mayank Thakore wrote: > > Sorry. I might have misunderstood the problem. > > > > Maybe you are getting the xfire instance from the wrong xfirefactory > object. > > Can you send the code you use to get the xfire instance? > > > > Regards > > Mayank Thakore > > Huawei Technologies > > > > > **************************************************************************** > > **************************** > > This e-mail and attachments contain confidential information from HUAWEI, > > which is intended only for the person or entity whose address is listed > > above. Any use of the information contained herein in any way (including, > > but not limited to, total or partial disclosure, reproduction, or > > dissemination) by persons other than the intended recipient's) is > > prohibited. If you receive this e-mail in error, please notify the sender > by > > phone or email immediately and delete it! > > > > > > -----Original Message----- > > From: Robert Davey [mailto:[EMAIL PROTECTED] > > Sent: Friday, September 21, 2007 19-22 > > To: [email protected] > > Subject: [xfire-user] ServiceRegistry empty, but wsdl available > > > > Hi there, > > > > We have some data publishers set up that publish database schemas via > > XFire. These work great and we have some clients that can connect to > > these services and view the schemas successfully. > > > > However, we seem to have found a problem whereby we package up a jsp > > with the deployed publisher service that is designed to let a user > > visiting the parent URL browse the schema directly from the publisher, > > i.e. > > > > http://publisherurl/ - takes you to the index.jsp to browse the schema > > http://publisherurl/services/datapublisher?wsdl - web service url to > > view wsdl > > > > So, we can view the wsdl with no problems and the services seem to be > > registered fine with the ServiceRegistry. > > > > To browse the db schema, we need to retrieve it from the Service > > registered to the XFire instance. This code is in our index.jsp. > > > > <snip> > > XFire xfire = XFireFactory.newInstance().getXFire(); > > > > for (Object o : xfire.getServiceRegistry().getServices()) > > { > > org.codehaus.xfire.service.Service s = > > (org.codehaus.xfire.service.Service)o; > > > > FluxionService fs = > > (FluxionService)((AbstractInvoker)s.getInvoker()).getServiceObject(new > > MessageContext()); > > > > if (fs != null) > > { > > for (URI datasource : fs.getDataSources()) > > { > > ontology = fs.getSchema(datasource); > > session.setAttribute("ontology", ontology); > > } > > } > > else > > { > > html.append("Error: Cannot access null service."); > > } > > } > > </snip> > > > > The xfire instance returned from the XFireFactory appears to have no > > services registered, and this is shown by the > > xfire.getServiceRegistry().getServices() set having a size of 0. > > > > Can anyone shed any light as to why the wsdl is available for this > > service, yet a jsp packaged up with the publisher WAR cannot seem to > > access the correct xfire instance to retrieve services? > > > > Cheers > > > > Rob > > -- --------------------------------------- Dr. Rob Davey NCYC / Institute of Food Research Computational Biology / John Innes Centre Norwich Research Park Norwich, Norfolk, NR4 7HU http://www.comparagrid.org/ http://cbr.jic.ac.uk/dicks/ --------------------------------------- --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
