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 Lars Beuth <La...@gmx.net> on 2004/04/14 15:26:06 UTC

java.lang.OutOfMemoryError when trying to delete a collection

Hello,

when I try to delete a collection I get the following error:

org.xmldb.api.base.XMLDBException:
Failed to execute command 'RemoveCollection' on server:
http://localhost:8080/xindice/, message: java.lang.Exception:
java.lang.OutOfMemoryError

I use:
Xindice 1.1b4 (WAR) with Tomcat 5.0.19 and J2SDK 1.4.2_03
(I had the same problem with Xindice 1.1b3.)

Creating a collection and listing the content of a collection works - at
least until I deleted a collection. After deleting a collection, creating
one also leads to a "java.lang.OutOfMemoryError". I added the code for
creating and dropping a collection below. I guess it must be something
simple as I don't do anything complicated. (?)

Thank you very much in advance!

       Lars Beuth


I use the following code to create a collection:

(The methods for creating or dropping a collection are called from a servlet
through an event listener.)

Collection collection = null;
boolean success = false;
try
{
	Class c = Class.forName(dbDriver);
	Database database = (Database)c.newInstance();
	DatabaseManager.registerDatabase(database);

	String collectionName = getDestinationName(destination);
	collection = DatabaseManager.getCollection(getDestinationPath(destination)
);
	org.apache.xindice.client.xmldb.services.CollectionManager service =
(org.apache.xindice.client.xmldb.services.CollectionManager)collection.getService("CollectionManager",
"1.0");
	try {service.dropCollection(collectionName); } catch (Exception e) {}

	String collectionConfig =
"<collection compressed=\"true\" name=\"" + collectionName + "\">" +
" <filer class=\"org.apache.xindice.core.filer.BTreeFiler\"/>" +
"</collection>";

	service.createCollection(collectionName,
org.apache.xindice.xml.dom.DOMParser.toDocument(collectionConfig) );
	success = true;
}
catch (Exception exception) {printException(exception, ERRORFILE); }
finally {if (collection != null) collection.close(); }
return success;

... and to delete a collection:

Collection collection = null;
boolean success = false;
try
{
	Class c = Class.forName(dbDriver);
	Database database = (Database)c.newInstance();
	DatabaseManager.registerDatabase(database);

	collection = DatabaseManager.getCollection(getDestinationPath(destination)
);
	org.apache.xindice.client.xmldb.services.CollectionManager service =
(org.apache.xindice.client.xmldb.services.CollectionManager)collection.getService("CollectionManager",
"1.0");
	service.dropCollection(getDestinationName(destination) );
	success = true;
}
catch (Exception exception) {printException(exception, ERRORFILE); }
finally {if (collection != null) collection.close(); }
return success;

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/info


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Lars Beuth <La...@gmx.net>.
Hello,

> But you certainly have something different in your database / with your 
> environment, because clean deployment worked ok for me. If you want you 
> can (re)send me your java code and I can try running this too.

I use the following method to delete a collection from Xindice:

private boolean executeDropCollection(URI destination) throws Exception
{
	Collection collection = null;
	boolean success = false;
	try
	{
		Class c = Class.forName(dbDriver);
		Database database = (Database)c.newInstance();
		DatabaseManager.registerDatabase(database);

		// Destination is: "xmldb:xindice://localhost:8080/db/mdbm"
		collection = DatabaseManager.getCollection(getDestinationPath(destination)
);
		// the collection path is: 
                // "xmldb:xindice://localhost:8080/db/"
		org.apache.xindice.client.xmldb.services.CollectionManager service =
(org.apache.xindice.client.xmldb.services.CollectionManager)collection.getService("CollectionManager",
"1.0");
		// the collection name is: "mdbm"
		service.dropCollection(getDestinationName(destination) );
		success = true;
	}
	catch (Exception exception) {printException(exception, ERRORFILE); }
	finally {if (collection != null) collection.close(); }
	return success;
}

I am using JDK 1.4.2 and Tomcat 5.0.19 on Windows98.

Thanks in advance,

     Lars

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Lars Beuth wrote:

>Hello,
>
>  
>
>>BTW, subject of your email says "OutOfMemoryError", but here you say you 
>>have got "IndexOutOfBoundsException"....
>>    
>>
>
>I get an "OutOfMemoryError" when I try to delete a collection with my Java
>application and an "IndexOutOfBoundsException" when I do the same from the
>command line.
>

Got you!

But you certainly have something different in your database / with your 
environment, because clean deployment worked ok for me. If you want you 
can (re)send me your java code and I can try running this too.

PS I'm using jdk 1.4.2

Vadim


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Lars Beuth <La...@gmx.net>.
Hello,

> BTW, subject of your email says "OutOfMemoryError", but here you say you 
> have got "IndexOutOfBoundsException"....

I get an "OutOfMemoryError" when I try to delete a collection with my Java
application and an "IndexOutOfBoundsException" when I do the same from the
command line. Listing collections or documents and creating collections
works, but everytime I delete a collection I get one of these errors.

In a week or so, I will try to install my application, Xindice, Tomcat ...
on another computer. (Right now I am busy with other work on my thesis.)
Maybe it solves the problem - although it does not feel good to leave this
unsolved.

Thank you very much for checking this error!

Sincerely,

     Lars

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Lars Beuth wrote:

>Hi,
>
>I ...
>  
>

Better late than nver... Tried today:


>... installed xindice.war (1.1b4) by copying it into the webapps-folder and
>starting Tomcat (5.0.19)
>  
>

Have it.


>... created a collection in the command line with:
>f:\>xindice ac -c xmldb:xindice://localhost:8080/db -n mdbm
>  
>

Done that:
"Created : xmldb:xindice://localhost:8080/db/mdbm"


>... tried to delete the collection again with:
>f:\>xindice dc -c xmldb:xindice://localhost:8080/db -n mdbm
>which leads to the java.lang.IndexOutOfBoundsException.
>  
>

I do not see any exceptions. I got:
"Deleted: xmldb:xindice://localhost:8080/db/mdbm"


BTW, subject of your email says "OutOfMemoryError", but here you say you 
have got "IndexOutOfBoundsException"....

Vadim



Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Lars Beuth <La...@gmx.net>.
Hi,

I ...

... installed xindice.war (1.1b4) by copying it into the webapps-folder and
starting Tomcat (5.0.19)
... created a collection in the command line with:
f:\>xindice ac -c xmldb:xindice://localhost:8080/db -n mdbm
... tried to delete the collection again with:
f:\>xindice dc -c xmldb:xindice://localhost:8080/db -n mdbm
which leads to the java.lang.IndexOutOfBoundsException.

I'm sorry, I did not understand what you meant - I'm new to this way of
working together on a problem.

       Lars

> How do *I* repeat it? Again, what are the steps to reproduce exception?
> 
> Vadim

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/info


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Lars Beuth wrote:

>Hi,
>
>when I delete a collection by using the command line tool
>(f:\xindice dc -c xmldb:xindice://localhost:8080/db -n wdbm), I get the
>following error:
>Failed to execute command 'RemoveCollection' on server:
>http://localhost:8080/xindice, message: java.lang.Exception:
>java.lang.IndexOutOfBoundsException
>
>The error message also appears after reinstalling Xindice in Tomcat.
>  
>

How do *I* repeat it? Again, what are the steps to reproduce exception?

Vadim


>       Lars
>
>  
>
>>>dropping a collection through a servlet:
>>>org.xmldb.api.base.XMLDBException:
>>>Failed to execute command 'RemoveCollection' on server:
>>>http://localhost:8080/xindice/, message: java.lang.Exception:
>>>java.lang.OutOfMemoryError
>>>      
>>>
>> <>Can you / have you tried to reproduce it using command line tool? If
>> yes, what are the steps?
>


Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Lars Beuth <La...@gmx.net>.
Hi,

when I delete a collection by using the command line tool
(f:\xindice dc -c xmldb:xindice://localhost:8080/db -n wdbm), I get the
following error:
Failed to execute command 'RemoveCollection' on server:
http://localhost:8080/xindice, message: java.lang.Exception:
java.lang.IndexOutOfBoundsException

The error message also appears after reinstalling Xindice in Tomcat.

       Lars

> > dropping a collection through a servlet:
> >org.xmldb.api.base.XMLDBException:
> >Failed to execute command 'RemoveCollection' on server:
> >http://localhost:8080/xindice/, message: java.lang.Exception:
> >java.lang.OutOfMemoryError
> 
> Can you / have you tried to reproduce it using command line tool? If 
> yes, what are the steps?

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/info


Re: xpath question

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Christopher Garwood wrote:

>Hi,
>
>I know this list is for Xindice but does anyone out there know a lot about
>xpath or can recommend some sites that address querying with xpath on
>multiple nested branches?
>

Not sure what exactly you need but you can use query like "//*" and put 
expression describing your "nested branches" as predicate...

    //*[(name() = 'myelement' or name() = 'anotherelement') and ....]

You'll need to complete this xpath with expression identifying your 
branches, I guess you'll need to use parent axis, see w3.com/TR/xslt for 
complete documentation.

Vadim



xpath question

Posted by Christopher Garwood <cg...@cs.man.ac.uk>.
Hi,

I know this list is for Xindice but does anyone out there know a lot about
xpath or can recommend some sites that address querying with xpath on
multiple nested branches?  Thanks.

Chris.



Re: java.lang.OutOfMemoryError when trying to delete a collection

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Lars Beuth wrote:

>Hello,
>
>when I try to delete a collection I get the following error:
>
>org.xmldb.api.base.XMLDBException:
>Failed to execute command 'RemoveCollection' on server:
>http://localhost:8080/xindice/, message: java.lang.Exception:
>java.lang.OutOfMemoryError
>  
>

Can you / have you tried to reproduce it using command line tool? If 
yes, what are the steps?

Vadim