Problem sending queries to embedded BaseX server

Thursday, 7 July 2011 · 3 messages · last reply 8 Jul 2011
HV
Huib Verwey7 Jul 2011 16:36 #
Hi, I am trying to use BaseX JAX-RX embedded, e.g. start it from my desktop application when the user clicks "Open App" in the system tray menu. The server starts up fine, but when I try to send it a query the Jersey server generates an error, see the log below after the user clicks "Open App". ================================================================================================ 7-jul-2011 16:25:01 com.sun.jersey.api.core.PackagesResourceConfig init INFO: Scanning for root resource and provider classes in the packages: org.jaxrx.resource 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig logClasses INFO: Root resource classes found: class org.jaxrx.resource.XMLResource class org.jaxrx.resource.JaxRxResource 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig init INFO: No provider classes found. 7-jul-2011 16:25:02 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO: Initiating Jersey application, version 'Jersey: 1.6 03/25/2011 01:14 PM' 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write SEVERE: A message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, and Java type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type text/xml; omit-xml-declaration=no was not found 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write SEVERE: The registered message body writers compatible with the MIME media type are: */* -> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse logException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, and Java type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type text/xml; omit-xml-declaration=no was not found
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1310)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1213)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
================================================================================================
I already tried removing the "; omit-xml-declaration=no" but that didn't help. Any ideas on why this does not work? Hartelijke groet, Huib Verweij.
-- Drs. Huib Verweij Senior software developer - The Language Archive Max Planck Institute for Psycholinguistics P.O. Box 310 6500 AH Nijmegen The Netherlands t +31-24-3521911 e huib.verwey at mpi.nl<mailto:huib.verwey at mpi.nl> w http://www.mpi.nl/
CG
Christian Grün8 Jul 2011 16:20 #
Huib, unfortunately, as far as I know, no one in our team managed to reproduce your problem. Do you have some more step-by-step details what you did (which BaseX version/OS/etc you used)? Christian
Quoted text · Huib Verwey · 77 lines
On Thu, Jul 7, 2011 at 4:36 PM, Huib Verwey <Huib.Verwey at mpi.nl> wrote: > Hi, > I am trying to use BaseX JAX-RX embedded, e.g. start it from my desktop > application when the user clicks "Open App" in the system tray menu. The > server starts up fine, but when I try to send it a query the Jersey server > generates an error, see the log below after the user clicks "Open App". > ================================================================================================ > 7-jul-2011 16:25:01 com.sun.jersey.api.core.PackagesResourceConfig init > INFO: Scanning for root resource and provider classes in the packages: > org.jaxrx.resource > 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig > logClasses > INFO: Root resource classes found: > class org.jaxrx.resource.XMLResource > class org.jaxrx.resource.JaxRxResource > 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig init > INFO: No provider classes found. > 7-jul-2011 16:25:02 > com.sun.jersey.server.impl.application.WebApplicationImpl _initiate > INFO: Initiating Jersey application, version 'Jersey: 1.6 03/25/2011 01:14 > PM' > 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write > SEVERE: A message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, > and Java type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type > text/xml; omit-xml-declaration=no was not found > 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write > SEVERE: The registered message body writers compatible with the MIME media > type are: > */* -> > com.sun.jersey.server.impl.template.ViewableMessageBodyWriter > 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse > logException > SEVERE: Mapped exception to response: 500 (Internal Server Error) > javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A > message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, and Java > type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type text/xml; > omit-xml-declaration=no was not found > at > com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285) > at > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1310) > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223) > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1213) > at > com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414) > at > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) > at > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) > ================================================================================================ > I already tried removing the "; omit-xml-declaration=no" but that didn't > help. > Any ideas on why this does not work? > Hartelijke groet, > Huib Verweij. > -- > Drs. Huib Verweij > Senior software developer - The Language Archive > Max Planck Institute for Psycholinguistics > P.O. Box 310 > 6500 AH Nijmegen > The Netherlands > t +31-24-3521911 > e huib.verwey at mpi.nl > w http://www.mpi.nl/ > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
HV
Huib Verweij8 Jul 2011 21:00 #
Hi Christian, Op 8 jul 2011, om 16:20 heeft Christian Grün het volgende geschreven:
Quoted text · Christian Grün · 3 lines
> unfortunately, as far as I know, no one in our team managed to > reproduce your problem. Do you have some more step-by-step details > what you did (which BaseX version/OS/etc you used)?
Sure, of course. I work on Mac OS X Snow Leopard, Java version 1.6.0_26. I am using BaseX 6.7.1-SNAPSHOT, just updated. In my code I have this method that starts the JaxRxServer, it is called when a menu option is selected by the user.:
    // Start the database.
    protected static Boolean startDb() {
        db = new JaxRxServer();
        return true;
    }
When the database has started a webserver is started next. At the index.html webpage a user can login, which causes a request to the db over the JAX-RX interface. At that point I get the reported error. If you need more info let me know! Hartelijke groet, Huib Verweij.
Quoted text · Huib Verwey · 58 lines
> > On Thu, Jul 7, 2011 at 4:36 PM, Huib Verwey <Huib.Verwey at mpi.nl> wrote: >> Hi, >> I am trying to use BaseX JAX-RX embedded, e.g. start it from my desktop >> application when the user clicks "Open App" in the system tray menu. The >> server starts up fine, but when I try to send it a query the Jersey server >> generates an error, see the log below after the user clicks "Open App". >> ================================================================================================ >> 7-jul-2011 16:25:01 com.sun.jersey.api.core.PackagesResourceConfig init >> INFO: Scanning for root resource and provider classes in the packages: >> org.jaxrx.resource >> 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig >> logClasses >> INFO: Root resource classes found: >> class org.jaxrx.resource.XMLResource >> class org.jaxrx.resource.JaxRxResource >> 7-jul-2011 16:25:02 com.sun.jersey.api.core.ScanningResourceConfig init >> INFO: No provider classes found. >> 7-jul-2011 16:25:02 >> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate >> INFO: Initiating Jersey application, version 'Jersey: 1.6 03/25/2011 01:14 >> PM' >> 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write >> SEVERE: A message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, >> and Java type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type >> text/xml; omit-xml-declaration=no was not found >> 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse write >> SEVERE: The registered message body writers compatible with the MIME media >> type are: >> */* -> >> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter >> 7-jul-2011 16:25:03 com.sun.jersey.spi.container.ContainerResponse >> logException >> SEVERE: Mapped exception to response: 500 (Internal Server Error) >> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A >> message body writer for Java class org.basex.api.jaxrx.BXJaxRx$2, and Java >> type class org.basex.api.jaxrx.BXJaxRx$2, and MIME media type text/xml; >> omit-xml-declaration=no was not found >> at >> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285) >> at >> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1310) >> at >> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223) >> at >> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1213) >> at >> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414) >> at >> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) >> at >> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) >> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) >> ================================================================================================ >> I already tried removing the "; omit-xml-declaration=no" but that didn't >> help. >> Any ideas on why this does not work?

⚡Generated with XQuery