java.lang.NullPointerException at org.exist.cocoon.XQueryGenerator.setup

View: New views
3 Messages — Rating Filter:   Alert me  

java.lang.NullPointerException at org.exist.cocoon.XQueryGenerator.setup

by Tomek Piechowicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wanted to execute some simple xml query via XQueryGenerator in my
cocoon pipeline. After I executed code :

<map:pipeline>
          <map:match pattern="Exist">
              <map:generate src="people.xq" type="xquery">
                  <map:parameter name="user" value="tomek"/>
                  <map:parameter name="password" value="tomek"/>  
              </map:generate>
              <map:serialize encoding="UTF-8" type="xml"/>
          </map:match>
      </map:pipeline>

server threw exception :

java.lang.NullPointerException at
org.exist.cocoon.XQueryGenerator.setup(XQueryGenerator.java:187)

I`ve been using latest production release of eXist 1.2.6, can anyone
help me with understanging meaning of this exception ? Lack of jars ?
Wrong xquery syntax ? Bug in eXist code ?

Regards,
Tomasz.

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: java.lang.NullPointerException at org.exist.cocoon.XQueryGenerator.setup

by Tomek Piechowicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tomek Piechowicz pisze:

> I wanted to execute some simple xml query via XQueryGenerator in my
> cocoon pipeline. After I executed code :
>
> <map:pipeline>
>          <map:match pattern="Exist">
>              <map:generate src="people.xq" type="xquery">
>                  <map:parameter name="user" value="tomek"/>
>                  <map:parameter name="password" value="tomek"/>  
>              </map:generate>
>              <map:serialize encoding="UTF-8" type="xml"/>
>          </map:match>
>      </map:pipeline>
>
> server threw exception :
>
> java.lang.NullPointerException at
> org.exist.cocoon.XQueryGenerator.setup(XQueryGenerator.java:187)
>
> I`ve been using latest production release of eXist 1.2.6, can anyone
> help me with understanging meaning of this exception ? Lack of jars ?
> Wrong xquery syntax ? Bug in eXist code ?
>
> Regards,
> Tomasz.
>
So, finally after suggestion from Maciej Rosiek I added some code in
XQueryGenerator.java in the begining  of setup() function :

try
{  
       parameterize(parameters);
 }
 catch(ParameterException pe)
 {
       System.out.println("ERROR");
 }

after this changes I tested some simple xml query and XQueryGenerator
seems to work ok with cocoon 2.2.

Important : I`m NOT(!) eXist developer, this is only my temporary
solution till official release of eXist with support for Cocon 2.2.

Regards,
Tomasz Piechowicz


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: java.lang.NullPointerException at org.exist.cocoon.XQueryGenerator.setup

by Loren Cahlander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A suggestion:

Add log4j support and log the error instead of printing to standard out.


import org.apache.log4j.Logger;

/** The Constant logger. */
protected final static Logger logger = Logger.getLogger(XQueryGenerator.class);


logger.error("Problems processing parameters", pe);

On Jul 7, 2009, at 01:55 PM, Tomek Piechowicz wrote:

So, finally after suggestion from Maciej Rosiek I added some code in
XQueryGenerator.java in the begining  of setup() function :

try
{  
      parameterize(parameters);
}
catch(ParameterException pe)
{
      System.out.println("ERROR");
}

after this changes I tested some simple xml query and XQueryGenerator
seems to work ok with cocoon 2.2.

Important : I`m NOT(!) eXist developer, this is only my temporary
solution till official release of eXist with support for Cocon 2.2.

Regards,
Tomasz Piechowicz


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open