Bug 780133 (SOA-2502) - FileSystemConnector should perform validation on filenamefilter
Summary: FileSystemConnector should perform validation on filenamefilter
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2502
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0.ER3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 5.2.0 ER1
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-27 19:35 UTC by Jiri Pechanec
Modified: 2011-10-21 08:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-21 08:48:22 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2502 0 None None None Never

Description Jiri Pechanec 2010-10-27 19:35:58 UTC
Affects: Release Notes
Workaround Description: The correct class name is specified.
project_key: SOA

This code does not work
                Session session = RepositoryReferenceFactory.getRepository("test-file").login();
                ValueFactory vf = session.getValueFactory();

                Node root = session.getRootNode();
                Node file = root.addNode("createfile.mode", "nt:file");
                Node content = file.addNode("jcr:content", "nt:resource");
                content.setProperty("jcr:data", vf.createBinary(new ByteArrayInputStream("Write 1".getBytes())));
                session.save();

                session.getNode("/createfile.mode");

It throws an exception
javax.jcr.PathNotFoundException: Unable to find "{}createfile.mode"; lowest existing path is "/"
        at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:779)
        at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:649)
        at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:106)
        at org.jboss.soa.modeshape.qa.tests.BrokenFileConnectorTest.fileCreate(BrokenFileConnectorTest.java:31)

Connector configuration
                        <mode:source jcr:name="test-file"
                                mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                                mode:creatingWorkspaceAllowed="true"
                                mode:retryLimit="3"
                                mode:defaultWorkspaceName="default"
                                mode:filenameFilter="*.mode"
                                mode:updatesAllowed="true"
                                >
                                <xsl:attribute name="mode:workspaceRootPath">
                                        <xsl:value-of select="$repositorypath"/>
                                </xsl:attribute>
                                <mode:predefinedWorkspaceNames>file1</mode:predefinedWorkspaceNames>
                                <mode:predefinedWorkspaceNames>file2</mode:predefinedWorkspaceNames>
                                <mode:predefinedWorkspaceNames>custom-federated</mode:predefinedWorkspaceNames>
                        </mode:source>


The file is not physically created after the session.save(). Creating folders works reliably.
This code was worked in ER2.

Comment 1 Van Halbert 2010-10-27 19:36:53 UTC
The file system connector should validate the filenamefilter to ensure its value, if present, is a valid class name.

Comment 2 Van Halbert 2010-10-27 19:38:02 UTC
Link: Added: This issue depends MODE-986


Comment 3 Anne-Louise Tangring 2010-10-28 16:22:43 UTC
Candidate for SOA 5.1.0


Comment 4 Van Halbert 2010-11-10 14:52:53 UTC
The changes have been committed to the 2.2.x product branch and should be in the ER5 build.

Comment 5 Jiri Pechanec 2011-01-06 10:15:53 UTC
It is still possible to configure FileSystemConnector like this
<mode:source jcr:name="test-file" mode:classname="org.modeshape.connector.filesystem.FileSystemSource" mode:creatingWorkspaceAllowed="true" mode:retryLimit="3" mode:defaultWorkspaceName="default" mode:filenameFilter="THISISNONSENSE" mode:updatesAllowed="true" mode:workspaceRootPath="/home/jpechane/workspace/SOATests/tests/modeshape/build/test-repositories">
and it works


Comment 6 Van Halbert 2011-01-12 13:10:11 UTC
Release Notes Docs Status: Added: Documented as Known Issue
Release Notes Text: Added: If an invalid filenamefilter is specified, a javax.jcr.PathNotFoundException will be thrown, instead of a user friendly exception explaining the configuration issue.
Workaround Description: Added: The correct class name is specified.


Comment 7 Van Halbert 2011-01-12 13:50:02 UTC
Affects: Added: [Release Notes]


Comment 9 Boris Belovic 2011-06-24 13:50:58 UTC
Thisissue is fixed in Modeshape 2.5.x which is contained in SOA-P 5.2, but the patch wasn't applied to 2.2.1 branch. If there will be cumulative patch releases of SOA-P 5.1 with Modeshape 2.2.x contained we should request this fix to be applied on 2.2.x branch.

Comment 10 David Le Sage 2011-09-08 00:08:50 UTC
Release Notes Docs Status: Removed: Documented as Known Issue Added: Documented as Resolved Issue
Writer: Added: dlesage
Release Notes Text: Removed: If an invalid filenamefilter is specified, a javax.jcr.PathNotFoundException will be thrown, instead of a user friendly exception explaining the configuration issue. Added: If an invalid filenamefilter was specified, a javax.jcr.PathNotFoundException was thrown, instead of a user-friendly exception explaining the configuration issue.  A patch has been applied to Modeshape to rectify this issue.


Comment 11 Jiri Pechanec 2011-10-21 08:48:22 UTC
Verified in ER5


Note You need to log in before you can comment on or make changes to this bug.