Peter MacDonald | 1 Nov 2007 04:23

NullPointerError in transform:transform

I am trying to transform an XML (TEI P5) file that I have in eXist with an XSL file sitting on another Web server.

The XML and XSL files work together just fine when I call the XSL file from within the XML file, as in...
     <?xml-stylesheet type="text/xsl" href="http://burkelib-07.hamilton.edu/exist/xsl/tei/html/tei.xsl"?>)

It also works when I send a REST URL with the XML and XSL filenames, as in
     http://burkelib-07.hamilton.edu:8080/exist/rest/db/dldocs/x-spe-civ-cad-02610_TEIP5.xml?
            _xsl=http://burkelib-07.hamilton.edu/exist/xsl/tei/html/tei.xsl

But Java throws a NullPointerException when I use the transform:transform function, as in

let $xml := doc("/db/dldocs/x-spe-civ-cad-02600_TEIP5.xml")
let $xsl := xs:anyURI("http:burkelib-07.hamilton.edu/exist/xsl/tei/html/tei.xsl")
let $params := ()
let $out := transform:transform($xml, $xsl, $params)
return (
$out
)

The XML is definitely there in eXist, so it looks like eXist cannot find the XSL file. Am I right about that?

If so, am I using the wrong syntax to reference the XSL file?

Thank you,
Peter

Exception StackTrace

org.xmldb.api.base.XMLDBException: java.lang.NullPointerException
    at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:64)
    at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:36)
    at org.exist.xmldb.RemoteXPathQueryService.execute(RemoteXPathQueryService.java:244)
    at org.exist.client.QueryDialog$QueryThread.run(QueryDialog.java:401)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.NullPointerException
    at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:457)
    at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:163)
    at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:53)
    ... 3 more
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.NullPointerException
    at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:457)
    at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:163)
    at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:53)
    at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:36)
    at org.exist.xmldb.RemoteXPathQueryService.execute(RemoteXPathQueryService.java:244)
    at org.exist.client.QueryDialog$QueryThread.run(QueryDialog.java:401)

--
Peter MacDonald
Library Information Systems Specialist
Hamilton College Library
pmacdona <at> hamilton.edu
315 859-4493

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Wolfgang | 1 Nov 2007 09:14
Picon

Re: ArrayIndexOutOfBoundsException during insertion process

> I have done a couple of test with ngram indexes, qname, qname + range, range and fulltext on another machine
with rev 6555, indexing only dc:subject elements.
> Some rudimentary results that came up on these tests are: 
> 
> fulltext --> ((#exist:optimize#) {
collection('/db/test_range')//oai:record[((#exist:optimize#) {.//dc:subject &=
'Libraries'})]}) 10secs 

The second exist:optimize is not required and may even irritate the 
query rewriter. Please try

collection('/db/test_range')//((#exist:optimize#) { 
oai:record[.//dc:subject &= 'Libraries'] })

Please also enable trace-level logging in log4j.xml:

<root>
   <priority value="debug"/>
   <appender-ref ref="console"/>
</root>

and check the log output for messages from the Optimize class. It should 
tell you if the query could be rewritten or not.

The query times for fulltext queries should not be much slower than the 
corresponding range index query with (even when using 
util:qname-index-lookup).

Wolfgang

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Pierrick Brihaye | 1 Nov 2007 09:17
Picon
Favicon

Re: NullPointerError in transform:transform

Hi,

Peter MacDonald a écrit :

> let $xsl := 
> xs:anyURI("http:burkelib-07.hamilton.edu/exist/xsl/tei/html/tei.xsl")

Is this a URL ?

> Exception StackTrace
> 
> org.xmldb.api.base.XMLDBException: java.lang.NullPointerException
>     at 
> org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:64)

Please provide the *local* stack trace, which should be in eXist's logs.

Cheers,

p.b.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Adam Retter | 1 Nov 2007 12:06
Picon
Favicon

Re: NullPointerError in transform:transform


The URL is incorrect, also you need to set any proxy's if required so that eXist can retrieve that XSL. What happens if in the eXist admin client you try using doc() on that URL? Do you get the document or not?


-----Original Message-----
From: exist-open-bounces <at> lists.sourceforge.net on behalf of Pierrick Brihaye
Sent: Thu 01/11/2007 08:17
To: Peter MacDonald
Cc: exist-open <at> lists.sourceforge.net
Subject: Re: [Exist-open] NullPointerError in transform:transform

Hi,

Peter MacDonald a écrit :

> let $xsl :=
> xs:anyURI("http:burkelib-07.hamilton.edu/exist/xsl/tei/html/tei.xsl")

Is this a URL ?

> Exception StackTrace
>
> org.xmldb.api.base.XMLDBException: java.lang.NullPointerException
>     at
> org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:64)

Please provide the *local* stack trace, which should be in eXist's logs.

Cheers,

p.b.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Adam Retter | 1 Nov 2007 12:07
Picon
Favicon

Re: Fixed it Something weird going on with xmldb: login call....


Brilliant thanks, I am currently re-working the eXist Scheduler, it should not mean any changes to the extension modules though.

-----Original Message-----
From: Andrzej Jan Taramina [mailto:andrzej <at> chaeron.com]
Sent: Wed 31/10/2007 21:31
To: exist-open <at> lists.sourceforge.net
Cc: wolfgang Meier; Adam Retter
Subject: Fixed it Something weird going on with xmldb: login call....

I found and have fixed the problem.

Turns out the Scheduler extension module was getting the user when the
constructor was called, and keeping it around.  Problem with that approach is
that the user that was in context when the constructor for the function is
called, can be changed by the xmldb:login call later, but the scheduler
extension functions were still using a reference to the old user.

So I fixed the scheduler extensions code so that it grabs the user just
before it executes the scheduling function call, which resolved this little
problem.

Just finishing my testing and will check into SVN shortly.

You're welcome, Adam! ;-)

.....A


> I'm trying to get my scheduler stuff running, but unless I can log in as
> something other than guest, it's not going to work.
>
> So I tried something like this in the XQuery sandbox:
>
>  xquery version "1.0";
>
>  declare namespace scheduler="http://exist-db.org/xquery/scheduler";
>
>  let $login := xmldb:login( "/db", "admin", "admin" )
>
>  let $jobs         := ( $login, scheduler:get-scheduled-jobs() )
>
>  return $jobs
>
> If you have not logged in previously with the web admin function, the you get
> a result like this:
>
> true
> <scheduler:jobs xmlns:scheduler="http://exist-db.org/xquery/scheduler"
> count="0"/>
>
> So the login worked, but you don't see any scheduled jobs, even though you got
> logged in as admin who has dba group priviledges.
>
> If you then immediately run the query again in the sandbox, you get a full
> list of the system scheduled jobs.
>
> It's as if the first time the xmldb:login() call is not being applied to the
> currently executing xquery for some reason, which is contrary to the
> documentation for this function.  Or maybe there is a bug in how the scheduler
> picks up the current user that is logged in?
>
> Very strange!


Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Adam Retter | 1 Nov 2007 12:12
Picon
Favicon

Re: Scheduled jobs running as guest?


As the comment in conf.xml (I think?) says, you can use xmldb:login() inside your scheduled job to elevate privileges and then run tasks as other users...

-----Original Message-----
From: Andrzej Jan Taramina [mailto:andrzej <at> chaeron.com]
Sent: Wed 31/10/2007 19:25
To: Adam Retter
Cc: exist-open <at> lists.sourceforge.net
Subject: Scheduled jobs running as guest?

Adam:

If you schedule a job in conf.xml it seems to run as "guest".

I would have thought a job like that would run as admin.

Causing me a bit of grief since I've created a generic job scheduler xquery
that I can call from conf.xml using the job scheduler entry capability, but
that xquery can't in turn schedule my other jobs, not even user ones, since
it's running as guest.

Just curious at to the thinking behind this?

Thanks!


Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
SourceForge.net | 1 Nov 2007 13:49
Picon
Favicon

[ exist-Bugs-1824038 ] Fluent stack trace during initialization

Bugs item #1824038, was opened at 2007-11-01 13:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=117691&aid=1824038&group_id=17691

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dannes Wessels (dizzzz)
Assigned to: Piotr Kaminski (pkaminsk2)
Summary: Fluent stack trace during initialization

Initial Comment:
When running fluent testcases run as part of the whole jUnit suite, the SOAP tests fail.

The attachment show the stack trace.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=117691&aid=1824038&group_id=17691

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Alex Milowski | 1 Nov 2007 14:40

Re: eXist with Ruby on Rails

On 10/31/07, Mike Elkink <melkink <at> gmail.com> wrote:
> Hey folks,
>
> My team is planning on integrating eXist with a Ruby on Rails
> application that we're developing.  I'm curious as to whether anyone
> has created a Rails plugin to define an API to eXist (either through
> SOAP or XML-RPC).

Why wouldn't you just use the REST interface and use the existing
HTTP API in Ruby?

--Alex Milowski

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Ariel Lira | 1 Nov 2007 16:30
Picon
Favicon

NPE while querying a fulltext indexed collection


Hi, 
I built-dist the current svn rev (6839) and created a new collection with 2 FT indexes only.
	
		
		
	

then I stored 15176 files ~ 2.2GB (took 2435secs) without problems, but when I run the following query

a NullPointerException is raised 

exist.log
01 nov 2007 12:12:57,348 [SocketListener0-3] DEBUG (QueryResultCache.java [checkTimestamps]:59) -
Removing result set Thu Nov 01 12:07:56 ART 2007 
01 nov 2007 12:12:57,353 [SocketListener0-3] TRACE (Optimizer.java [visitLocationStep]:97) -
Rewriting expression: descendant-or-self::dc:subject[self::node() &= "Library"] 
01 nov 2007 12:12:57,354 [SocketListener0-3] DEBUG (XQuery.java [compile]:160) - Query diagnostics:
collection("/db/test_fulltext")
(# exist:optimize #)
{
    descendant-or-self::dc:subject[self::node() &= "Library"]
}

01 nov 2007 12:12:57,354 [SocketListener0-3] DEBUG (XQuery.java [compile]:166) - Compilation took 5 ms 
01 nov 2007 12:12:57,357 [SocketListener0-3] DEBUG (RpcConnection.java [checkPragmas]:442) -
Setting serialization property from pragma: highlight-matches = none 
01 nov 2007 12:12:57,418 [SocketListener0-3] TRACE (Optimize.java [visitFtExpression]:171) -
exist:optimize: found optimizable: org.exist.xquery.functions.ExtFulltext 
01 nov 2007 12:12:57,419 [SocketListener0-3] TRACE (Optimize.java [before]:198) - exist:optimize:
context step: descendant-or-self::dc:subject[self::node() &= "Library"] 
01 nov 2007 12:12:57,419 [SocketListener0-3] TRACE (ExtFulltext.java [checkForQNameIndex]:268) -
cannot use index on QName: dc:subject. Collection /db/test_fulltext/repositorio98 does not define an
index 
01 nov 2007 12:12:57,419 [SocketListener0-3] TRACE (Optimize.java [eval]:139) - exist:optimize:
Cannot optimize expression. 
01 nov 2007 12:13:12,356 [SocketListener0-3] TRACE (ExtFulltext.java [checkForQNameIndex]:268) -
cannot use index on QName: dc:subject. Collection /db/test_fulltext/repositorio98 does not define an
index 
01 nov 2007 12:13:13,671 [SocketListener0-3] DEBUG (RpcServer.java [handleException]:583) -  
java.lang.NullPointerException
        at org.exist.storage.NativeBroker.getTextEngine(NativeBroker.java:455)
        at org.exist.xquery.functions.ExtFulltext.getSearchTerms(ExtFulltext.java:322)
        at org.exist.xquery.functions.ExtFulltext.evalQuery(ExtFulltext.java:279)
        at org.exist.xquery.functions.ExtFulltext.eval(ExtFulltext.java:220)
        at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59)
        at org.exist.xquery.PathExpr.eval(PathExpr.java:242)
        at org.exist.xquery.Predicate.selectByNodeSet(Predicate.java:317)
        at org.exist.xquery.Predicate.evalPredicate(Predicate.java:191)
        at org.exist.xquery.LocationStep.applyPredicate(LocationStep.java:193)
        at org.exist.xquery.LocationStep.eval(LocationStep.java:342)
        at org.exist.xquery.Optimize.eval(Optimize.java:140)
        at org.exist.xquery.ExtensionExpression.eval(ExtensionExpression.java:71)
        at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59)
        at org.exist.xquery.PathExpr.eval(PathExpr.java:242)
        at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:59)
        at org.exist.xquery.XQuery.execute(XQuery.java:216)
        at org.exist.xquery.XQuery.execute(XQuery.java:183)
        at org.exist.xmlrpc.RpcConnection.doQuery(RpcConnection.java:329)
        at org.exist.xmlrpc.RpcConnection.queryP(RpcConnection.java:2281)
        at org.exist.xmlrpc.RpcConnection.queryP(RpcConnection.java:2234)
        at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:877)
        at org.exist.xmlrpc.RpcServer.queryP(RpcServer.java:859)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java:120)
        at org.exist.xmlrpc.AuthenticatedHandler.execute(AuthenticatedHandler.java:67)
        at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:128)
        at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:185)
        at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151)
        at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
        at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:93)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
java.lang.NullPointerException
	
If I try a query that doesn't use FT extensions like
	collection('/db/test_fulltext')//dc:subject[contains(.,"Library")] 
no errors occurs.

Could this error indicate a corrupted fultext index? 

Thanks

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Wolfgang | 1 Nov 2007 18:17
Picon

Re: NPE while querying a fulltext indexed collection

> 01 nov 2007 12:13:13,671 [SocketListener0-3] DEBUG (RpcServer.java [handleException]:583) -  
> java.lang.NullPointerException
>         at org.exist.storage.NativeBroker.getTextEngine(NativeBroker.java:455)
>         at org.exist.xquery.functions.ExtFulltext.getSearchTerms(ExtFulltext.java:322)

I'm currently doing some redesign work. The fulltext index has now been 
moved into an extension module, which means it is no longer loaded by 
default. However, some functions do still require the fulltext index to 
be present all the time, so eXist won't work without it (until we 
completed the redesign).

Please check your conf.xml. It should contain a line

<module id="ft-legacy-index" class="org.exist.fulltext.FTIndex"/>

in the <modules> section.

Wolfgang

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

Gmane