spring-webflow icon indicating copy to clipboard operation
spring-webflow copied to clipboard

Cannot load flows and views from classpath correctly in SWF 2.2.1 and JSF 2 [SWF-1425]

Open spring-operator opened this issue 14 years ago • 0 comments

Donny A. Wijaya opened SWF-1425 and commented

I tried to put the flows and views inside META-INF in the classes folder (I am trying to experiment with SWF modularity by bundling the flows and views inside JAR). Unfortunately, the Spring Web Flow (2.2.1) will fail to load a flow identified by ID if base-path contains "classpath*:". Below is the configuration:

<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="classpath*:/META-INF/">
	<webflow:flow-location id="parent-flow" path="parent-flow.xml"/>
	<webflow:flow-location-pattern value="/**/flow.xml" />
</webflow:flow-registry>

The error message:

org.springframework.webflow.engine.model.builder.FlowModelBuilderException: Could not access the XML flow definition at ServletContext resource [/classpath*:/META-INF/parent-flow.xml]

From the example above, if i remove the parent-flow, it will throw the following error if I try to access one of the flows:

java.lang.IllegalStateException: A ContextResource is required to get relative view paths within this context; the resource was file [/Users/wolf/Development/Workspace/webproject/target/classes/META-INF/user/user.xhtml]

I have also configured RESOURCE_RESOLVER in web.xml using Jsf2FlowResourceResolver, but it didn't work. I also include the project files to simulate this issue. Thanks a lot.

Regards,

Donny


Affects: 2.2.1

Attachments:

Issue Links:

  • #509 The view path cannot be resolved if the flow is located in the classpath. ("duplicates")
  • #746 Modular bundling of Flows and XHTML ("is duplicated by")

spring-operator avatar Nov 15 '10 06:11 spring-operator