Hi Ahmed,

Not sure, where exactly you get the NullPointerException. You should be more
specific. Thanks.

Regards
Felix

On 6/21/07, siraj ahmed <[EMAIL PROTECTED]> wrote:


I am getting null pointer exception here, I think the code is correct
then what is the problem

public Node getBlogEntryNode(String blogTitle, Session session)
            throws BlogApplicationException {
        if (_logger.isDebugEnabled())
            _logger.debug("Entering JackrabbitBlogEntryDAO.getNode() "
                    + blogTitle);
        Node blogEntry;
        try {
            Workspace workSpace = session.getWorkspace();

            QueryManager queryManager = workSpace.getQueryManager();

            StringBuffer queryStr = new StringBuffer("//[EMAIL PROTECTED]
= '");
            queryStr.append(blogTitle);
            queryStr.append("']");

            Query query = queryManager.createQuery(queryStr.toString(),
                    Query.XPATH);


            QueryResult queryResult = query.execute();


            NodeIterator queryResultNodeIterator = queryResult.getNodes();




        blogEntry = null;
            while (queryResultNodeIterator.hasNext()) {
                blogEntry = queryResultNodeIterator.nextNode();
            }
        } catch (InvalidQueryException e) {
            throw new BlogApplicationException(e);
        } catch (RepositoryException e) {
            throw new BlogApplicationException(e);
        }
        if (_logger.isDebugEnabled())
            _logger.debug("Exiting JackrabbitBlogEntryDAO.getNode() "
                    + blogEntry);
        return blogEntry;
    }

-----------------------------------------------------------
Hurix Mumbai telephone numbers have changed. New numbers are:

Mumbai 1: Simran Center -    +91 22 6677 4888

Mumbai 2: Solitiare Center - +91 22 6709 6888
===========================================================
***Disclaimer***


This email, and any attachments ("this email"), is confidential. If you
are not the addressee
please tell the sender immediately, and destroy this email without using,
sending or storing
it. Any opinions, express or implied, in this email, are those of the
sender, and are not
necessarily approved by Hurix Systems. Except as expressly stated, this
e-mail should not be
regarded as an offer, solicitation, recommendation or agreement to buy or
sell products or
services, or to enter into any contract. E-mail transmissions are not
secure and may suffer
errors, viruses, delay, interception and amendment. Hurix Systems does not
accept liability
for damage caused by any of the foregoing.

HURIX SYSTEMS MAY MONITOR ALL INCOMING AND OUTGOING MAILS
============================================================

Reply via email to