You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Florin Tudor <fl...@sap.ro> on 2002/05/24 16:17:04 UTC

XMLDB in servlets

I have a BIG problem:
When I compile and run Example1.java that comes in the Developer's Guide, it's OK. (a basic query with the XMLDB API).
Now I want to do the same thing from a servlet, because this is the way I want to use it.
BUT... the same code doesn't even compile !!!

Compile error:
XMLDBQuery.java:40: registerDatabase(org.xmldb.api.base.Database) in org.xmldb.api.DatabaseManager cannot be applied to (Database)
                                DatabaseManager.registerDatabase(db);

I checked the API but all seems OK, tried with JDK1.3 and 1.4, with different versions of servlet.jar, doesn't help.
I have a servlet that does the same thing using XML-RPC and it works.
Attached is the damn servlet.



Florin Tudor

Web Application Developer / Consultant
Middleware & Programming Dept.
Integrator /SAP Romania
www.sap.ro, www.integrare.ro

Re: XMLDB in servlets

Posted by Øyvind Vestavik <Oy...@idi.ntnu.no>.
Have you entered the jars mentioned in developers guide into the webapps
library??

Those jars should be copied  into \web-inf\lib so that the
servlet-containers classloader can find them.
When making servlets this is the same as setting
classpath when using applications.

Most servlet containers also lets you use a library directory into wich
libraries commonly available for all web-apps should be placed.
In jakarta tomcat this is the common\lib folder.

Øyvind

Øyvind Vestavik
Øvre Møllenberggt 44b
7014 Trondheim
oyvindve@idi.ntnu.no
41422911

On Fri, 24 May 2002, Florin Tudor wrote:

> I have a BIG problem:
> When I compile and run Example1.java that comes in the Developer's Guide, it's OK. (a basic query with the XMLDB API).
> Now I want to do the same thing from a servlet, because this is the way I want to use it.
> BUT... the same code doesn't even compile !!!
>
> Compile error:
> XMLDBQuery.java:40: registerDatabase(org.xmldb.api.base.Database) in org.xmldb.api.DatabaseManager cannot be applied to (Database)
>                                 DatabaseManager.registerDatabase(db);
>
> I checked the API but all seems OK, tried with JDK1.3 and 1.4, with different versions of servlet.jar, doesn't help.
> I have a servlet that does the same thing using XML-RPC and it works.
> Attached is the damn servlet.
>
>
>
> Florin Tudor
>
> Web Application Developer / Consultant
> Middleware & Programming Dept.
> Integrator /SAP Romania
> www.sap.ro, www.integrare.ro
>