xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Sauer-Limbach <...@gslweb.de>
Subject Re: Help for servlet!
Date Mon, 30 Apr 2007 20:25:58 GMT
Yes, it is a classpath problem. The class shown in the exception
message cannot be loaded.

You need to make all the classes needed available to your web
app. I.e. put xindice.jar into the WEB-INF/lib of your
webapp. Then it should work.

cheers
Georg

michele.mordenti@libero.it wrote:
> Thank you Georg for help!
> I had done like you said. The error is:
>
> Error java.lang.ClassNotFoundException: org.apache.xindice.client.xmldb.DatabaseImpl
>
> What is the problem?? I don't understand....maybe classpath??
> I'll waiting for your response.
> Bye
>
> ---------- Initial Header -----------
>
> >From      : "Georg Sauer-Limbach" gsl@gslweb.de
> To          : xindice-users@xml.apache.org
> Cc          : 
> Date      : Mon, 30 Apr 2007 18:09:16 +0200
> Subject : Re: Help for servlet!
>
>
>
>
>
>
>
>   
>> Hi,
>>
>> to see the problem you should print the exception, not only its
>> detail message. Replace
>>
>> out.write("Error " + e.getMessage());
>>
>> by
>>
>> out.write("Error " + e );
>>
>> I guess you will then see something like
>>
>> java.lang.ClassDefNotFoundException: org.apache.xindice.client.xmldb.DatabaseImpl
>>
>> It is a common mistake in Java to output only
>> ex.getMessage(), but this is only the "detail
>> message".
>>
>> Tell us which exception you got.
>>
>> Regards
>> Georg
>>
>> michele.mordenti@libero.it wrote:
>>     
>>> Thank for previous help!
>>> Now I have a most specific problem....so, i use tomcat 5.5,cocoon 2.1 and xindice
1.1b4. 
>>> I want make a servlet for update database. After the correction of PartsXupdate.java,
i had made this servlet:
>>>
>>>
>>> import org.xmldb.api.base.*;
>>> import org.xmldb.api.modules.*;
>>> import org.xmldb.api.*;
>>> import javax.servlet.*;
>>> import javax.servlet.http.*;
>>> import java.io.*;
>>> import org.w3c.dom.*;
>>> import org.apache.xindice.client.xmldb.DatabaseImpl;
>>> import org.apache.xindice.client.xmldb.services.*;
>>>
>>> public class PartsXupdate extends HttpServlet {
>>>
>>> public void doGet(HttpServletRequest request, HttpServletResponse response)
>>> 	throws ServletException, IOException {
>>>
>>> 	Collection col = null;
>>> 	PrintWriter out = response.getWriter();
>>>
>>> 	try {
>>>         
>>> 	String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
>>> 	Class c = Class.forName(driver);
>>>          
>>>         Database database = (Database) c.newInstance();
>>>         DatabaseManager.registerDatabase(database);
>>>          
>>>         col = DatabaseManager.getCollection("xmldb:xindice://localhost:8080/db/test");
>>>          
>>> 	String xupd = "<xupdate:modifications version=\"1.0\" xmlns:xupdate=\"http://www.xmldb.org/xupdate\">"
 + 
>>> 	"<xupdate:insert-after select=\"/scheda/info\">"  +
>>> 	"<xupdate:element name=\"commento\">Bel libro!</xupdate:element>"
 + 
>>> 	"</xupdate:insert-after>"  + 
>>> 	"</xupdate:modifications>"; 
>>>
>>> 	String nome = "4.xml";   
>>>
>>>         /* We are using XUpdateQueryService */
>>>         XUpdateQueryService service =
>>>         (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
>>>                
>>>         service.updateResource(nome, xupd);
>>>   	}
>>>       
>>> 	catch(Exception e) {
>>>                 out.write("Error " + e.getMessage());
>>>             }
>>>
>>> /*
>>> 	catch (XMLDBException e) {
>>>         System.err.println("XML:DB Exception occurred " + e.errorCode);
>>>         }
>>> */      
>>>
>>> 	finally {
>>>     	}
>>> }
>>> }
>>>
>>>
>>> The error message is:
>>>
>>> org.apache.xindice.client.xmldb.DatabaseImpl
>>>
>>> Where is the problem? I post my classpath:
>>>
>>> C:\xindice-1.1b4\xindice-1.1b4.jar;
>>> C:\xindice-1.1b4\lib\commons-logging-1.0.3.jar;
>>> C:\xindice-1.1b4\lib\servlet-2.3.jar;
>>> C:\xindice-1.1b4\lib\xalan-2.5.2.jar;
>>> C:\xindice-1.1b4\lib\xerces-2.6.0.jar;
>>> C:\xindice-1.1b4\lib\xml-apis.jar;
>>> C:\xindice-1.1b4\lib\xmldb-api-20030701.jar;
>>> C:\xindice-1.1b4\lib\xmldb-api-sdk-20030701.jar;
>>> C:\xindice-1.1b4\lib\xmldb-common-20030701.jar;
>>> C:\xindice-1.1b4\lib\xmldb-xupdate-20040205.jar;
>>> C:\xindice-1.1b4\lib\xmlrpc-1.1.jar;
>>> .;
>>>
>>> Is it correct?
>>> Thank for any help!
>>> Bye
>>>
>>>
>>> ------------------------------------------------------
>>> Leggi GRATIS le tue mail con il telefonino i-modeTM di Wind
>>> http://i-mode.wind.it/
>>>
>>>
>>>
>>>   
>>>       
>
>
> ------------------------------------------------------
> Leggi GRATIS le tue mail con il telefonino i-modeā„¢ di Wind
> http://i-mode.wind.it/
>
>
>
>   

Mime
View raw message