You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Nellai <ng...@eforceglobal.com> on 2003/02/14 08:55:29 UTC

Running Lucene on WebLogic

Hi!

Is there anyone tried running Lucene successfully  in Weblogic.

If so then kindly guide me as am new to weblogic 6.0


Thanks
Nellai...



RE: OutOfMemoryException while Indexing an XML file

Posted by Rob Outar <ro...@ideorlando.org>.
Forgot to mention I am indexing 1000's of XML files.  I ran a little test to
see if that file was the problem, but it was abled to be indexed after some
time and memory usage was huge.  I think maybe because I index these files
one after the other something is not getting cleaned up leading to the
exception.

Thanks,

Rob


-----Original Message-----
From: Rob Outar [mailto:routar@ideorlando.org]
Sent: Friday, February 14, 2003 8:25 AM
To: Lucene Users List
Subject: RE: OutOfMemoryException while Indexing an XML file


So to the best of your knowledge the Lucene Document Object should not cause
the exception even though the XML file is huge and 1000's of fields are
being added to the Lucene Document Object?

Thanks,

Rob


-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Sent: Friday, February 14, 2003 8:21 AM
To: Lucene Users List
Subject: Re: OutOfMemoryException while Indexing an XML file


Nothing in the code snippet you sent would cause that exception.
If I were you I'd run it under a profiler to quickly see where the leak
is.  You can even use something free like JMP.

Otis

--- Rob Outar <ro...@ideorlando.org> wrote:
> Hi all,
>
> 	I was using the sample code provided I believe by Doug Cutting to
> index an
> XML file, the XML file was 2 megs (kinda large) but while adding
> fields to
> the Document object I got an OutOfMemoryException exception.  I work
> with
> XML files a lot, I can easily parse that 2 meg file into a DOM tree,
> I can't
> imagine a Lucene document being larger than a DOM Tree, pasted below
> is the
> SAX handler.
>
> public class XMLDocumentBuilder
> extends DefaultHandler {
>
>     /** A buffer for each XML element */
>     private StringBuffer elementBuffer = new StringBuffer();
>
>     private Document mDocument;
>
>
>     public void buildDocument(Document doc, String xmlFile) throws
> IOException,
>     SAXException {
>
>         this.mDocument = doc;
>         SAXReader.parse(xmlFile, this);
>     }
>
>     public void startElement(String uri, String localName, String
> qName,
>     Attributes atts) {
>
>         elementBuffer.setLength(0);
>
>         if (atts != null) {
>
>             for (int i = 0; i < atts.getLength(); i++) {
>
>                 String attname = atts.getLocalName(i);
>                 mDocument.add(new Field(attname, atts.getValue(i),
>                 true, true, true));
>             }
>         }
>     }
>
>     // call when cdata found
>     public void characters(char[] text, int start, int length) {
>         elementBuffer.append(text, start, length);
>     }
>
>     public void endElement(String uri, String localName, String
> qName) {
>         mDocument.add(Field.Text(localName,
> elementBuffer.toString()));
>     }
>     public Document getDocument() {
>         return mDocument;
>     }
> }
>
> Any help would be appreciated.
>
> Thanks,
>
> Rob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


RE: OutOfMemoryException while Indexing an XML file

Posted by Rob Outar <ro...@ideorlando.org>.
So to the best of your knowledge the Lucene Document Object should not cause
the exception even though the XML file is huge and 1000's of fields are
being added to the Lucene Document Object?

Thanks,

Rob


-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Sent: Friday, February 14, 2003 8:21 AM
To: Lucene Users List
Subject: Re: OutOfMemoryException while Indexing an XML file


Nothing in the code snippet you sent would cause that exception.
If I were you I'd run it under a profiler to quickly see where the leak
is.  You can even use something free like JMP.

Otis

--- Rob Outar <ro...@ideorlando.org> wrote:
> Hi all,
>
> 	I was using the sample code provided I believe by Doug Cutting to
> index an
> XML file, the XML file was 2 megs (kinda large) but while adding
> fields to
> the Document object I got an OutOfMemoryException exception.  I work
> with
> XML files a lot, I can easily parse that 2 meg file into a DOM tree,
> I can't
> imagine a Lucene document being larger than a DOM Tree, pasted below
> is the
> SAX handler.
>
> public class XMLDocumentBuilder
> extends DefaultHandler {
>
>     /** A buffer for each XML element */
>     private StringBuffer elementBuffer = new StringBuffer();
>
>     private Document mDocument;
>
>
>     public void buildDocument(Document doc, String xmlFile) throws
> IOException,
>     SAXException {
>
>         this.mDocument = doc;
>         SAXReader.parse(xmlFile, this);
>     }
>
>     public void startElement(String uri, String localName, String
> qName,
>     Attributes atts) {
>
>         elementBuffer.setLength(0);
>
>         if (atts != null) {
>
>             for (int i = 0; i < atts.getLength(); i++) {
>
>                 String attname = atts.getLocalName(i);
>                 mDocument.add(new Field(attname, atts.getValue(i),
>                 true, true, true));
>             }
>         }
>     }
>
>     // call when cdata found
>     public void characters(char[] text, int start, int length) {
>         elementBuffer.append(text, start, length);
>     }
>
>     public void endElement(String uri, String localName, String
> qName) {
>         mDocument.add(Field.Text(localName,
> elementBuffer.toString()));
>     }
>     public Document getDocument() {
>         return mDocument;
>     }
> }
>
> Any help would be appreciated.
>
> Thanks,
>
> Rob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: OutOfMemoryException while Indexing an XML file

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Nothing in the code snippet you sent would cause that exception.
If I were you I'd run it under a profiler to quickly see where the leak
is.  You can even use something free like JMP.

Otis

--- Rob Outar <ro...@ideorlando.org> wrote:
> Hi all,
> 
> 	I was using the sample code provided I believe by Doug Cutting to
> index an
> XML file, the XML file was 2 megs (kinda large) but while adding
> fields to
> the Document object I got an OutOfMemoryException exception.  I work
> with
> XML files a lot, I can easily parse that 2 meg file into a DOM tree,
> I can't
> imagine a Lucene document being larger than a DOM Tree, pasted below
> is the
> SAX handler.
> 
> public class XMLDocumentBuilder
> extends DefaultHandler {
> 
>     /** A buffer for each XML element */
>     private StringBuffer elementBuffer = new StringBuffer();
> 
>     private Document mDocument;
> 
> 
>     public void buildDocument(Document doc, String xmlFile) throws
> IOException,
>     SAXException {
> 
>         this.mDocument = doc;
>         SAXReader.parse(xmlFile, this);
>     }
> 
>     public void startElement(String uri, String localName, String
> qName,
>     Attributes atts) {
> 
>         elementBuffer.setLength(0);
> 
>         if (atts != null) {
> 
>             for (int i = 0; i < atts.getLength(); i++) {
> 
>                 String attname = atts.getLocalName(i);
>                 mDocument.add(new Field(attname, atts.getValue(i),
>                 true, true, true));
>             }
>         }
>     }
> 
>     // call when cdata found
>     public void characters(char[] text, int start, int length) {
>         elementBuffer.append(text, start, length);
>     }
> 
>     public void endElement(String uri, String localName, String
> qName) {
>         mDocument.add(Field.Text(localName,
> elementBuffer.toString()));
>     }
>     public Document getDocument() {
>         return mDocument;
>     }
> }
> 
> Any help would be appreciated.
> 
> Thanks,
> 
> Rob
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


OutOfMemoryException while Indexing an XML file

Posted by Rob Outar <ro...@ideorlando.org>.
Hi all,

	I was using the sample code provided I believe by Doug Cutting to index an
XML file, the XML file was 2 megs (kinda large) but while adding fields to
the Document object I got an OutOfMemoryException exception.  I work with
XML files a lot, I can easily parse that 2 meg file into a DOM tree, I can't
imagine a Lucene document being larger than a DOM Tree, pasted below is the
SAX handler.

public class XMLDocumentBuilder
extends DefaultHandler {

    /** A buffer for each XML element */
    private StringBuffer elementBuffer = new StringBuffer();

    private Document mDocument;


    public void buildDocument(Document doc, String xmlFile) throws
IOException,
    SAXException {

        this.mDocument = doc;
        SAXReader.parse(xmlFile, this);
    }

    public void startElement(String uri, String localName, String qName,
    Attributes atts) {

        elementBuffer.setLength(0);

        if (atts != null) {

            for (int i = 0; i < atts.getLength(); i++) {

                String attname = atts.getLocalName(i);
                mDocument.add(new Field(attname, atts.getValue(i),
                true, true, true));
            }
        }
    }

    // call when cdata found
    public void characters(char[] text, int start, int length) {
        elementBuffer.append(text, start, length);
    }

    public void endElement(String uri, String localName, String qName) {
        mDocument.add(Field.Text(localName, elementBuffer.toString()));
    }
    public Document getDocument() {
        return mDocument;
    }
}

Any help would be appreciated.

Thanks,

Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Running Lucene on WebLogic

Posted by Nellai <ng...@eforceglobal.com>.
hi Steven J. Owens,
thanks!
just i want to know whether Lucene works in Weblogic and i have implemented
it successfully.

Thanks and regards
Nellai...

----- Original Message -----
From: "Steven J. Owens" <pu...@darksleep.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Friday, February 14, 2003 1:49 PM
Subject: Re: Running Lucene on WebLogic


> On Fri, Feb 14, 2003 at 01:25:29PM +0530, Nellai wrote:
> > Is there anyone tried running Lucene successfully  in Weblogic.
> > If so then kindly guide me as am new to weblogic 6.0
>
>      I ran lucene on weblogic 6 at my last job.  Had no problems on
> unix, though I ran into some funky file lock issues on win2K (since
> fixed in the lucne main, IIRC).  What's your problem?
>
> Steven J. Owens
> puff@darksleep.com
>
> "I'm going to make broad, sweeping generalizations and strong,
>  declarative statements, because otherwise I'll be here all night and
>  this document will be four times longer and much less fun to read.
>  Take it all with a grain of salt." - Me at http://darksleep.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Running Lucene on WebLogic

Posted by "Steven J. Owens" <pu...@darksleep.com>.
On Fri, Feb 14, 2003 at 01:25:29PM +0530, Nellai wrote:
> Is there anyone tried running Lucene successfully  in Weblogic.
> If so then kindly guide me as am new to weblogic 6.0

     I ran lucene on weblogic 6 at my last job.  Had no problems on
unix, though I ran into some funky file lock issues on win2K (since
fixed in the lucne main, IIRC).  What's your problem?

Steven J. Owens
puff@darksleep.com

"I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt." - Me at http://darksleep.com


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org