Share

Universal Peer-to-Peer

Tracker: Bugs

9 can't find attached schema - ID: 1752116
Last Update: Settings changed ( ntartania )

- I created a schema using the SchemaTool

- I saved it on my desktop (myBogusCommunity.xsd)

- I created a new community and attached the schema

- then I tried viewing the schema of the created community and I got an
error: HTTP 404 the requested resource (/up2p/myBogusCommunity.xsd) is
unavailable

- same problem when attempting to create a resource for that community:

"Community XML Schema not found. It is required to render the default
create stylesheet for this community."

So it seems that it is looking in a particular place for the schema and it
can't find it. I thought that once the file is attached, the servlet would
know what to do with it and store it in the right place.

The problem occurred on a PC and a Mac. On the PC it was using the latest
from SVN, on the Mac it was using the binary distrib.


Babak Esfandiari ( esfandia ) - 2007-07-11 17:30

9

Closed

Fixed

Michael Yartsev

None

None

Public


Comments ( 6 )




Date: 2008-07-17 17:20
Sender: ntartaniaProject Admin


The problem was (fixed now) more general: attachments were not properly
uploaded, because they were not recognized as actual files. This was
because the HTML form used did not send multipart parameters (i.e. may be
either values or files) to the system.
The resolution is to change the form HTML tag in the page where it is
declared:

<form action="create" method="post"> is NOT sufficient, it must be:
<form action="create" method="post" enctype="multipart/form-data"
onsubmit="copyValue()">

This has been changed in the default XSL stylesheet, as well as in the
community-create.jsp page.
It must be done in any customized create pages.

There was also problems on the code side. I fixed those. (june 2008)


Date: 2007-07-12 18:45
Sender: anijap


> And speaking of schemas, I guess they are treated like any other
> attachment, so if any attachment can be loaded from anywhere in the
file
> system (is this true?), then so should the schema.

No, it's not true as far as I can tell.
Attachments can only be loaded from inside the tomcat5/webapps/up2p folder
(or any subfolder).

This might be because of the way up2p is coded, or it might be because of
tomcat permissions to access files.

However, the creating a community page DOES have a bug. Here's the
scenario:
- I have the xml schema stored in
"tomcat5/webapps/up2p/community/new/DesignPattern.xsd"
- I create a new community by filling out the required fields, clicking
browse to find the xml schema, and selecting that schema.
- I create the new community, but when attempting to search or create a
new resource, I get the same error message you mentioned earlier:
"Community XML Schema not found. It is required to render the default
search stylesheet for this community."

Here's why:
- The generated xml file looks like this:

<community title="A New Community">
<name>aNewCommunity</name>
<networkAdapter providerClass="up2p.peer.jtella.JTellaAdapter"
providerVersion="1.0"/>
<schemaLocation>DesignPattern.xsd</schemaLocation>
</community>

However the schemaLocation tag should be:
<schemaLocation>file://community/new/DesignPattern.xsd</schemaLocation>

As you can also see, there's no way to specify files outside of the
"tomcat5/webapps/up2p" directory.
This be *maybe* changed but it's not a bug, it's just how up2p has been
coded.


Date: 2007-07-12 15:19
Sender: nobody

Logged In: NO

Ok so the problem is that you are saving the .xsd file on your desktop.
Usually all the resources are located inside the up2p directory under
tomcat.

I created the same community with the schema at
up2p/community/new/DesignPattern.xsd and everything worked fine.

Now, I don't know if this should be considered a bug or not.
Do we want up2p to store it's data anywhere on the computer, or just
inside it's own working folder?


Date: 2007-07-12 11:01
Sender: esfandiaProject Admin


OK, here is one of the schemas I used. It was created using the
SchemaTool.
File Added: DesignPattern.xsd


Date: 2007-07-11 19:03
Sender: anijap


I meant attach the files here so I can download them and try them out on
my computer.


Date: 2007-07-11 19:01
Sender: anijap


Can you attach the schema files you created?


Log in to comment.




Attached File ( 1 )

Filename Description Download
DesignPattern.xsd a simple schema for design patterns Download

Changes ( 4 )

Field Old Value Date By
status_id Open 2008-07-17 17:22 ntartania
close_date - 2008-07-17 17:22 ntartania
resolution_id None 2008-07-17 17:20 ntartania
File Added 236693: DesignPattern.xsd 2007-07-12 11:01 esfandia