xforms:submit error while using Standalone eXist

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

xforms:submit error while using Standalone eXist

ilango_g
Hi
I am not able to submit to an xml file in the eXist database (installed separately).
This is what I have done so far:


<xforms:submission id="save_to_eXist"
                                ref="instance('taskoutput')" method="put"
                                action="../post.xpl"
                                replace="none" >
                                <xforms:message ev:event="xforms-submit-error" level="modal">
An error occurred while saving!</xforms:message>
                        </xforms:submission>


And my submit button is simply:

xforms:submit submission="save_to_eXist" appearance="minimal">
                        <xforms:label>Save</xforms:label>
                    </xforms:submit>

What I want to do is to invoke the xpl file here which would have a submission element as follows: My intention is to overwrite macbeth.xml with my submitted instance. Probably my approach is naive here. There is something I am not doing right.
Could it be the URL to the eXist resource? When I test this code I get the error:

An error occurred while saving!

I had hoped to 'put' the file into the database by having the XPL file submit the instance and replace the macbeth.xml, while the eXist database is running on port 8080.

The XPL file is pasted below: It is also attached.


<p:processor name="oxf:xforms-submission"> 
        <p:input name="submission"> 
            <xforms:submission method="put"
                        action="http://localhost:8080/exist/rest/db/shakespeare/plays/macbeth.xml"/> 
        </p:input> 
        <p:input name="request"> 
            <gaga/> 
        </p:input> 
        <p:output name="response" id="dummy"/> 
    </p:processor> 
    <p:processor name="oxf:null-serializer"> 
        <p:input name="data" href="#dummy"/> 
    </p:processor> 
</p:config> 

I have attached a test case here. Many thanks in advance.


test_eXist.xhtml
post.xpl
Reply | Threaded
Open this post in threaded view
|

Re: xforms:submit error while using Standalone eXist

fl.schmitt(ops-users)
hi someperson,

> (...) What I want to do is to invoke the xpl file here which would have a
> submission element as follows: My intention is to overwrite macbeth.xml with
> my submitted instance. Probably my approach is naive here. There is
> something I am not doing right.
> Could it be the URL to the eXist resource?  (...)

What do the logs tell? Usually there's a more detailed error message
describing what went wrong.

> action="http://localhost:8080/exist/rest/db/shakespeare/plays/macbeth.xml"/>

This is one of the examples files that are shipped with exist. By
default, they belong to user admin, group dba, permissions rwur-ur-u. I
suppose it's a matter of permissions - to execute a put command, you may
need also write permissions on the specific file. If you don't provide
authentication information, exist assumes user guest, group guest:

http://www.exist-db.org/devguide_rest.html#N101AC

A put request issues a delete on a existing resource and, after that,
the creation of the new resource:

http://www.exist-db.org/devguide_rest.html#N10282

So you need write permissions on the existing file to delete it, and
also write permissions regarding the collection where the file should be
created, too.

So i would do the following:

- check the Orbeon logs for a detailed error message;
- if it's an authentication matter:
     -- add credentials to the put command in the XPL
     or
     -- change permissions for the target resource and
        collection in the db.

HTH
florian




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xforms:submit error while using Standalone eXist

ilango_g
The logs are telling me:
error code recieved when submitting instance: 500

I changed permission to allow write for both the file and the collection. I hope I am able to get the file in now.


fs(ops-users) wrote
hi someperson,

> (...) What I want to do is to invoke the xpl file here which would have a
> submission element as follows: My intention is to overwrite macbeth.xml with
> my submitted instance. Probably my approach is naive here. There is
> something I am not doing right.
> Could it be the URL to the eXist resource?  (...)

What do the logs tell? Usually there's a more detailed error message
describing what went wrong.

> action="http://localhost:8080/exist/rest/db/shakespeare/plays/macbeth.xml"/>

This is one of the examples files that are shipped with exist. By
default, they belong to user admin, group dba, permissions rwur-ur-u. I
suppose it's a matter of permissions - to execute a put command, you may
need also write permissions on the specific file. If you don't provide
authentication information, exist assumes user guest, group guest:

http://www.exist-db.org/devguide_rest.html#N101AC

A put request issues a delete on a existing resource and, after that,
the creation of the new resource:

http://www.exist-db.org/devguide_rest.html#N10282

So you need write permissions on the existing file to delete it, and
also write permissions regarding the collection where the file should be
created, too.

So i would do the following:

- check the Orbeon logs for a detailed error message;
- if it's an authentication matter:
     -- add credentials to the put command in the XPL
     or
     -- change permissions for the target resource and
        collection in the db.

HTH
florian




--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: xforms:submit error while using Standalone eXist

fl.schmitt(ops-users)
hi someperson,

> The logs are telling me:
> error code recieved when submitting instance: 500

Isn't there more? Exist sends quite detailed error messages. If they
don't appear in the logs, you may use a proxy [1] to show (and log) the
REST communication. Or you could try to use the eXist Sandbox [2]
shipped with the orbeon examples to check what happens.

> I changed permission to allow write for both the file and the collection. I
> hope I am able to get the file in now.

I'll keep my fingers crossed :-)

HTH
florian

[1] for example: http://www.xrayapp.com/trivialproxy/
[2] http://www.orbeon.com/ops/sandbox-exist/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: xforms:submit error while using Standalone eXist

ilango_g
I looked in the folder  eXist\tools\wrapper\logs and did not find any. Perhaps I am in the wrong place?
I will check the eXist sandbox though.

 
fs(ops-users) wrote
hi someperson,

> The logs are telling me:
> error code recieved when submitting instance: 500

Isn't there more? Exist sends quite detailed error messages. If they
don't appear in the logs, you may use a proxy [1] to show (and log) the
REST communication. Or you could try to use the eXist Sandbox [2]
shipped with the orbeon examples to check what happens.

> I changed permission to allow write for both the file and the collection. I
> hope I am able to get the file in now.

I'll keep my fingers crossed :-)

HTH
florian

[1] for example: http://www.xrayapp.com/trivialproxy/
[2] http://www.orbeon.com/ops/sandbox-exist/



--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xforms:submit error while using Standalone eXist

ilango_g
In reply to this post by fl.schmitt(ops-users)
I changed my xpl file to read as:
---------------
 <xforms:submission method="put"
                        action="http://localhost:8680/exist/rest//db/test/name.xml" xxforms:username="admin" xxforms:password="" ref="instance('taskoutput')" replace="none"/>
--------------------------------------------------------------------------- and it is this name.xml that appears in one of the log files.

I located log files in C:\Program Files\eXist\webapp\WEB-INF\logs and I looked under exist.log

and the first few lines in this log were:

 14:21:11,292 [main] DEBUG (ConfigurationHelper.java [getExistHome]:40) - Could not retieve instance of brokerpool: database instance 'exist' is not available
2008-03-17 14:21:11,292 [main] DEBUG (ConfigurationHelper.java [getExistHome]:49) - Got eXist home from system property 'exist.home': C:\Program Files\eXist
2008-03-17 14:21:11,292 [main] DEBUG (ConfigurationHelper.java [getExistHome]:40) - Could not retieve instance of brokerpool: database instance 'exist' is not available
2008-03-17 14:21:11,292 [main] DEBUG (ConfigurationHelper.java [getExistHome]:49) - Got eXist home from system property 'exist.home': C:\Program Files\eXist
2008-03-17 14:21:11,292 [main] INFO  (Configuration.java [<init>]:255) - Reading configuration from file C:\Program Files\eXist\conf.xml
2008-03-17 14:21:11,494 [main] DEBUG (Configuration.java [configureIndexer]:980) - indexer.stem: false

----------

and then I looked in xmldb.log

and I had the following messages in there:

2008-03-17 14:21:53,203 [P1-8] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 1356 ms.
2008-03-17 14:21:54,979 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 499 ms.
2008-03-17 14:22:32,465 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 47 ms.
2008-03-17 14:22:36,921 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 47 ms.
2008-03-17 14:23:09,453 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 16 ms.
2008-03-17 14:23:29,271 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 94 ms.
2008-03-17 14:23:48,715 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 0 ms.
2008-03-17 14:24:00,135 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 15 ms.
2008-03-17 14:26:26,516 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 187 ms.
2008-03-17 14:28:41,445 [P1-9] DEBUG (LocalCollection.java [storeResource]:647) - storing document name.xml
2008-03-17 14:28:41,476 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 109 ms.
2008-03-17 14:29:11,087 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 312 ms.
2008-03-17 14:29:14,048 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 31 ms.
2008-03-17 14:31:29,166 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 32 ms.
2008-03-17 14:31:40,449 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 203 ms.
2008-03-17 14:31:44,563 [P1-9] DEBUG (LocalCollectionManagementService.java [removeCollection]:171) - removing collection /db/test
2008-03-17 14:31:44,579 [P1-9] DEBUG (LocalCollection.java [removeResource]:595) - removing name.xml
2008-03-17 14:31:44,594 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 46 ms.
2008-03-17 14:31:47,103 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 15 ms.
2008-03-17 14:31:50,174 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 16 ms.
2008-03-17 14:31:52,527 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 31 ms.
2008-03-17 14:32:08,283 [P1-9] DEBUG (LocalCollection.java [storeResource]:647) - storing document name.xml
2008-03-17 14:32:08,329 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 46 ms.
2008-03-17 15:23:26,485 [P1-9] DEBUG (LocalXPathQueryService.java [execute]:206) - query took 4409 ms.
fs(ops-users) wrote
hi someperson,

> (...) What I want to do is to invoke the xpl file here which would have a
> submission element as follows: My intention is to overwrite macbeth.xml with
> my submitted instance. Probably my approach is naive here. There is
> something I am not doing right.
> Could it be the URL to the eXist resource?  (...)

What do the logs tell? Usually there's a more detailed error message
describing what went wrong.

> action="http://localhost:8080/exist/rest/db/shakespeare/plays/macbeth.xml"/>

This is one of the examples files that are shipped with exist. By
default, they belong to user admin, group dba, permissions rwur-ur-u. I
suppose it's a matter of permissions - to execute a put command, you may
need also write permissions on the specific file. If you don't provide
authentication information, exist assumes user guest, group guest:

http://www.exist-db.org/devguide_rest.html#N101AC

A put request issues a delete on a existing resource and, after that,
the creation of the new resource:

http://www.exist-db.org/devguide_rest.html#N10282

So you need write permissions on the existing file to delete it, and
also write permissions regarding the collection where the file should be
created, too.

So i would do the following:

- check the Orbeon logs for a detailed error message;
- if it's an authentication matter:
     -- add credentials to the put command in the XPL
     or
     -- change permissions for the target resource and
        collection in the db.

HTH
florian




--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xforms:submit error while using Standalone eXist

fl.schmitt(ops-users)
In reply to this post by ilango_g
hi someperson,

> I looked in the folder  eXist\tools\wrapper\logs and did not find any.

When using eXist in standalone mode, it uses webapp/WEB-INF/logs als
directory for its logs, i suppose. Apart from that, i would expect that
the error messages appear also in the orbeon logs.

HTH
florian





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xforms:submit error while using Standalone eXist

ilango_g
You are right. I found the logs in webapp/WEB-INF/logs. Did you get that mail I posted. I posted parts of the logs that I thought were relevant.
I will also look at the orbeon logs.

One observation: one of the lines in the log was telling me that the collection "test" was being removed.

This is strange, I thought.

fs(ops-users) wrote
hi someperson,

> I looked in the folder  eXist\tools\wrapper\logs and did not find any.

When using eXist in standalone mode, it uses webapp/WEB-INF/logs als
directory for its logs, i suppose. Apart from that, i would expect that
the error messages appear also in the orbeon logs.

HTH
florian





--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: xforms:submit error while using Standalone eXist

Erik Bruchez
Administrator
In reply to this post by ilango_g
500 usually means that it's not an authentication issue but something  
else.

-Erik

On Mar 17, 2008, at 12:38 PM, someperson wrote:

>
> The logs are telling me:
> error code recieved when submitting instance: 500
>
> I changed permission to allow write for both the file and the  
> collection. I
> hope I am able to get the file in now.
>
>
>
> fs(ops-users) wrote:
>>
>> hi someperson,
>>
>>> (...) What I want to do is to invoke the xpl file here which would  
>>> have a
>>> submission element as follows: My intention is to overwrite  
>>> macbeth.xml
>>> with
>>> my submitted instance. Probably my approach is naive here. There is
>>> something I am not doing right.
>>> Could it be the URL to the eXist resource?  (...)
>>
>> What do the logs tell? Usually there's a more detailed error message
>> describing what went wrong.
>>
>>> action="http://localhost:8080/exist/rest/db/shakespeare/plays/macbeth.xml 
>>> "/>
>>
>> This is one of the examples files that are shipped with exist. By
>> default, they belong to user admin, group dba, permissions rwur-ur-
>> u. I
>> suppose it's a matter of permissions - to execute a put command,  
>> you may
>> need also write permissions on the specific file. If you don't  
>> provide
>> authentication information, exist assumes user guest, group guest:
>>
>> http://www.exist-db.org/devguide_rest.html#N101AC
>>
>> A put request issues a delete on a existing resource and, after that,
>> the creation of the new resource:
>>
>> http://www.exist-db.org/devguide_rest.html#N10282
>>
>> So you need write permissions on the existing file to delete it, and
>> also write permissions regarding the collection where the file  
>> should be
>> created, too.
>>
>> So i would do the following:
>>
>> - check the Orbeon logs for a detailed error message;
>> - if it's an authentication matter:
>>     -- add credentials to the put command in the XPL
>>     or
>>     -- change permissions for the target resource and
>>        collection in the db.
>>
>> HTH
>> florian
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]  
>> mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/xforms%3Asubmit-error-while-using-Standalone-eXist-tp16086796p16100241.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws