Josh2007 pisze:
> Thanks Grzegorz,

No problem.

> Servlet implementation and Spring bean registration:
> I've, then, been able to set my XQuery Servlet in a block registered as a
> bean.
> I patched the block web.xml to implement eXist database servlet, and add the
> required dependencies in the pom.xml (after installing then in my mvn local
> repositery).
> It works. I can now start XQuery block using [mvn jetty:run] and execute any
> XQuery file stored in my block under the root webapp and, in the meantime,
> access the database.
> 
> Servlet Service functionality:
> I tried to access this block from another block (named block test1) by:
> adding the XQuery block (named test2) as a dependency of the block test1, in
> test1 pom.xml.
> adding the XQuery block entry in test1 servlet-sevice.xml 
> creating, in test1 block, a sitemap pipeline calling the XQuery servlet:
> 
> pipeline :
> <map:match pattern="trytest2">
>   <map:generate src="servlet:test2:/header.xml" type="file"/>
>   <map:serialize type="xml"/>
> </map:match>
> 
> note: 
> XQuery block has no use of sitemap.xmap but I kept
> src/main/resources/COB-INF directory.
> I've been succesful accessing another block from test1 block (this block was
> based on org.apache.cocoon.sitemap.SitemapServlet)
>  
> problem with my XQuery Servlet called from test1 block: 
> I got an error:
> 

<snip/>

> servlet:test2:/test2/header.xml_S-xml-;encoding=ISO-8859-1
> 2008-01-25 20:27:04,665 btpool0-1 DEBUG util.ConfigurationHelper - Got eXist
> home from broker: C:\Users\BMS\Documents\test\test1
> 
> \target\rcl\webapp\WEB-INF
> 2008-01-25 20:27:04,665 btpool0-1 WARN  http.Descriptor - Giving up unable
> to read descriptor file from C:\Users\BMS\Documents\test\test1
> 
> \target\rcl\webapp\WEB-INF\descriptor.xml
> 2008-01-25 20:27:04,666 btpool0-1 WARN  http.Descriptor - Giving up unable
> to read descriptor.xml file from classloader in package 
> 
<snip/>

The detail worth attention is classloader words here.

> It seems it cannot find the file, but if I execute only the XQuery Servlet,
> it works.
> Here's my XQuery Servlet bean:
> <bean id="com.mycompany.test2.service"
> class="org.exist.http.servlets.XQueryServlet">
>     <servlet:context mount-path="/test2"
> context-path="blockcontext:/test2/"/>
> </bean>
> 
> Any idea?

When you run a block using just jetty:run in block's directory the Cocoon 
RCL[1] is run as well. It'
s purpose is to enable RAD thus it plays with class reloading which may be an 
issue for eXist I
think. I would suggest to try assembly a WAR archive by using webapp 
archetype[2]. If you run your
app using:
cd myCocoonWebapp
mvn clean jetty:run

it will assemble a WAR package and run it with plain Jetty container. This way 
you will be able to
find out if it's RCL's fault. Depending on your findings we will try to 
investigate further.

[1] http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1295_1_1.html
[2] http://cocoon.apache.org/2.2/1362_1_1.html

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to