You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by jascpaint <Vi...@dsto.defence.gov.au> on 2008/06/16 09:49:17 UTC

Uploading files via WebDav questions

I am new with Jackrabbit and would appreciate your help.
Currently I use WebDav for upload files into repository. I am wondering how
nt:primaryType property is assigned to the newly created node and whether it
is possible to assign this property to a subtype of nt:file. It seems like
all files are assigned to this primaryType automatically, or I am missing
some config settings somewhere?

Thank you.
-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17859587.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by jascpaint <Vi...@dsto.defence.gov.au>.
Thank you for the reply. I've written a custom IOHandler and tried to change
the config.xml but there seems to be a problem:
- I changed 
<iohandler>
            <class name="org.apache.jackrabbit.server.io.DefaultHandler" />
</iohandler>

to 
<iohandler>
            <class name="myproject.mypackage.MyHandler" />
</iohandler>

I did the same thing for the <propertyhandler> item. However no matter how I
change config.xml, it's content always reverts back to what it was before my
change when I run the repository.

Any pointers on why this is the case? Does config.xml get written from some
other source template?

Thanks!


Alexander Klimetschek wrote:
> 
> On Mon, Jun 16, 2008 at 9:49 AM, jascpaint
> <Vi...@dsto.defence.gov.au> wrote:
>>
>> I am new with Jackrabbit and would appreciate your help.
>> Currently I use WebDav for upload files into repository. I am wondering
>> how
>> nt:primaryType
> 
> You probably mean jcr:primaryType. It is the auto-created property
> which indicates the primary node type of the current node. Have a look
> at the JCR specification (JSR-170), section 6.7 "Node Types".
> 
>> property is assigned to the newly created node and whether it
>> is possible to assign this property to a subtype of nt:file. It seems
>> like
>> all files are assigned to this primaryType automatically, or I am missing
>> some config settings somewhere?
> 
> Folders and files are mapped to nt:folder and nt:file node types,
> which are part of the JCR specification (you can also define your own
> node types). They can be found in the spec starting at section
> 6.7.22.5 "nt:hierarchyNode". Any JCR application working with files
> should map the content onto these node types, so that's why WebDAV is
> doing this.
> 
> You can write custom IOHandlers [1] if you want to import different
> content structures via WebDAV. They are configured in the file
> config.xml [2] (that can be found in the jackrabbit webapp under
> WEB-INF).
> 
> Regards,
> Alex
> 
> [1]
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOHandler.java
> [2]
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/config.xml
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17876495.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by jascpaint <Vi...@dsto.defence.gov.au>.
Thanks for your prompt reply.

- I use Jackrabbit 1.4.4 and jackrabbit-jcr-server 1.4.
- MyHandler extends org.apache.jackrabbit.server.io.DefaultHandler
- MyHandler is visible to the ResourceConfig because of the debug printout
statements

but it still gives me this "not a valid IOHandler". I don't understand why.




Alexander Klimetschek wrote:
> 
> On Tue, Jun 17, 2008 at 5:49 AM, jascpaint
> <Vi...@dsto.defence.gov.au> wrote:
>> Actually, it says
>> ResourceConfig: Resource configuration: the handler is not a valid
>> IOHandler. (ResourceConfig.java, line 108)
>> ResourceConfig: Resource configuration: the handler is not a valid
>> PropertyHandler. (ResourceConfig.java, line 108)
> 
> Which version of Jackrabbit (or the jackrabbit-jcr-server.jar in
> particular) do you use? In the current code, the error message is
> logged in a different line. It is thrown when the class does not
> implement IOHandler (or PropertyHandler) or if it cannot be created
> due to a wrong configuration or some other error - although there
> should be an additional error message before. Maybe it cannot find
> your classes.
> 
> I would suggest to use the latest Jackrabbit 1.4.x and make sure that
> your classes are in the classpath.
> 
> Regards,
> Alex
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p18021335.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Jun 17, 2008 at 5:49 AM, jascpaint
<Vi...@dsto.defence.gov.au> wrote:
> Actually, it says
> ResourceConfig: Resource configuration: the handler is not a valid
> IOHandler. (ResourceConfig.java, line 108)
> ResourceConfig: Resource configuration: the handler is not a valid
> PropertyHandler. (ResourceConfig.java, line 108)

Which version of Jackrabbit (or the jackrabbit-jcr-server.jar in
particular) do you use? In the current code, the error message is
logged in a different line. It is thrown when the class does not
implement IOHandler (or PropertyHandler) or if it cannot be created
due to a wrong configuration or some other error - although there
should be an additional error message before. Maybe it cannot find
your classes.

I would suggest to use the latest Jackrabbit 1.4.x and make sure that
your classes are in the classpath.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Uploading files via WebDav questions

Posted by jascpaint <Vi...@dsto.defence.gov.au>.
Yes, I extended DefaultHandler. I event tried it without overriding any of
the DefaultHandler's methods and it still gave me the error.
Thanks for your help.

Maybe someone else has some other ideas?


Alexander Klimetschek wrote:
> 
> Not sure, since I haven't written an IOHandler myself. Did you extend
> the DefaultHandler? That might probably the best way to start. If that
> still gives the error, I am clueless...
> 
> Regards,
> Alex
> 
> On Tue, Jun 17, 2008 at 5:49 AM, jascpaint
> <Vi...@dsto.defence.gov.au> wrote:
>>
>> Actually, it says
>> ResourceConfig: Resource configuration: the handler is not a valid
>> IOHandler. (ResourceConfig.java, line 108)
>> ResourceConfig: Resource configuration: the handler is not a valid
>> PropertyHandler. (ResourceConfig.java, line 108)
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17877579.html
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17957312.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by Alexander Klimetschek <ak...@day.com>.
Not sure, since I haven't written an IOHandler myself. Did you extend
the DefaultHandler? That might probably the best way to start. If that
still gives the error, I am clueless...

Regards,
Alex

On Tue, Jun 17, 2008 at 5:49 AM, jascpaint
<Vi...@dsto.defence.gov.au> wrote:
>
> Actually, it says
> ResourceConfig: Resource configuration: the handler is not a valid
> IOHandler. (ResourceConfig.java, line 108)
> ResourceConfig: Resource configuration: the handler is not a valid
> PropertyHandler. (ResourceConfig.java, line 108)
>
>
> --
> View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17877579.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Uploading files via WebDav questions

Posted by jascpaint <Vi...@dsto.defence.gov.au>.
Actually, it says 
ResourceConfig: Resource configuration: the handler is not a valid
IOHandler. (ResourceConfig.java, line 108)
ResourceConfig: Resource configuration: the handler is not a valid
PropertyHandler. (ResourceConfig.java, line 108)


-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17877579.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by jascpaint <Vi...@dsto.defence.gov.au>.
Thank you for your reply.
I have written a custom IOHandler that simply extends the DefaultHandler
with method importProperties being overridden. 

I have changed jackrabbit-war.1.4.war's config.xml to use
"myproject.mypackage.MyHandler" instead of the DefaultHandler.

I now have this problem when uploading a file through WebDav:

17.06.2008 12:40:18 *INFO * AbstractConfig: Configuration of BootstrapConfig
(AbstractConfig.java, line 101)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
102)
17.06.2008 12:40:18 *INFO * AbstractConfig:   jndiConfig:
org.apache.jackrabbit.j2ee.JNDIConfig@1aaf194 (AbstractConfig.java, li
 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiConfig:
org.apache.jackrabbit.j2ee.RMIConfig@1da5362 (AbstractConfig.java, line
06)
17.06.2008 12:40:18 *INFO * AbstractConfig:   repositoryHome:
data/repository (AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   repositoryConfig:
data/repository/repository.xml (AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   class: class
org.apache.jackrabbit.j2ee.BootstrapConfig (AbstractConfig.java, line
06)
17.06.2008 12:40:18 *INFO * AbstractConfig:   valid: true
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   repositoryName: my.repository
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
108)
17.06.2008 12:40:18 *INFO * AbstractConfig: Configuration of JNDIConfig
(AbstractConfig.java, line 101)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
102)
17.06.2008 12:40:18 *INFO * AbstractConfig:   jndiName: my.repository
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   class: class
org.apache.jackrabbit.j2ee.JNDIConfig (AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   jndiEnv:
{java.naming.provider.url=http://www.apache.org/jackrabbit, java.naming.f
tory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory}
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   valid: true
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   jndiEnabled: true
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
108)
17.06.2008 12:40:18 *INFO * AbstractConfig: Configuration of RMIConfig
(AbstractConfig.java, line 101)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
102)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiName: my.repository
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiUri:
//localhost:1099/my.repository (AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiEnabled: true
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiPort: 1099
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   rmiHost: localhost
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   class: class
org.apache.jackrabbit.j2ee.RMIConfig (AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:   valid: true
(AbstractConfig.java, line 106)
17.06.2008 12:40:18 *INFO * AbstractConfig:
---------------------------------------------- (AbstractConfig.java, line
108)
17.06.2008 12:40:18 *INFO * RepositoryAccessServlet: Acquired repository via
JNDI. (RepositoryAccessServlet.java, line 207)
[stderr] java.io.IOException: Error transferring file:
Unsupported_Media_Type

Maybe my custom handler is implemented incorrectly?




Alexander Klimetschek wrote:
> 
> On Mon, Jun 16, 2008 at 9:49 AM, jascpaint
> <Vi...@dsto.defence.gov.au> wrote:
>>
>> I am new with Jackrabbit and would appreciate your help.
>> Currently I use WebDav for upload files into repository. I am wondering
>> how
>> nt:primaryType
> 
> You probably mean jcr:primaryType. It is the auto-created property
> which indicates the primary node type of the current node. Have a look
> at the JCR specification (JSR-170), section 6.7 "Node Types".
> 
>> property is assigned to the newly created node and whether it
>> is possible to assign this property to a subtype of nt:file. It seems
>> like
>> all files are assigned to this primaryType automatically, or I am missing
>> some config settings somewhere?
> 
> Folders and files are mapped to nt:folder and nt:file node types,
> which are part of the JCR specification (you can also define your own
> node types). They can be found in the spec starting at section
> 6.7.22.5 "nt:hierarchyNode". Any JCR application working with files
> should map the content onto these node types, so that's why WebDAV is
> doing this.
> 
> You can write custom IOHandlers [1] if you want to import different
> content structures via WebDAV. They are configured in the file
> config.xml [2] (that can be found in the jackrabbit webapp under
> WEB-INF).
> 
> Regards,
> Alex
> 
> [1]
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOHandler.java
> [2]
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/config.xml
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Uploading-files-via-WebDav-questions-tp17859587p17877318.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Uploading files via WebDav questions

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Jun 16, 2008 at 9:49 AM, jascpaint
<Vi...@dsto.defence.gov.au> wrote:
>
> I am new with Jackrabbit and would appreciate your help.
> Currently I use WebDav for upload files into repository. I am wondering how
> nt:primaryType

You probably mean jcr:primaryType. It is the auto-created property
which indicates the primary node type of the current node. Have a look
at the JCR specification (JSR-170), section 6.7 "Node Types".

> property is assigned to the newly created node and whether it
> is possible to assign this property to a subtype of nt:file. It seems like
> all files are assigned to this primaryType automatically, or I am missing
> some config settings somewhere?

Folders and files are mapped to nt:folder and nt:file node types,
which are part of the JCR specification (you can also define your own
node types). They can be found in the spec starting at section
6.7.22.5 "nt:hierarchyNode". Any JCR application working with files
should map the content onto these node types, so that's why WebDAV is
doing this.

You can write custom IOHandlers [1] if you want to import different
content structures via WebDAV. They are configured in the file
config.xml [2] (that can be found in the jackrabbit webapp under
WEB-INF).

Regards,
Alex

[1] http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOHandler.java
[2] http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/config.xml

-- 
Alexander Klimetschek
alexander.klimetschek@day.com