So, I am able to persist to the database the Blob, BUT when it trys to resume execution on the flow I get a big fat fileNotFound Exception. Any help would be appreciated.
Thanks,
Matt
UserService.java
jsp fragmentCode:Images images = new Images(); try { images.setContent(Hibernate.createBlob(user.getFile().getBytes())); } catch (IOException e) {} images.setName(user.getFile().getOriginalFilename()); images.setSize(new Long(user.getFile().getSize()).intValue()); images.setType(user.getFile().getContentType()); user.getPerson().setImages(images); personDao.save(user.getPerson());
register.xmlCode:<label class="float-left" for="person.images"><spring:message code="profilePhoto" /></label> <span class="float-right"><form:input type="file" class="text ui-widget-content ui-corner-all" path="file" /> </span> <br class="clear-float"/>
PersonData.javaCode:<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <var name="user" class="com.discdogevents.custom.pojo.PersonData"/> <var name="breedList" class="java.util.ArrayList"/> <var name="emailTypeList" class="java.util.ArrayList"/> <var name="phoneTypeList" class="java.util.ArrayList"/> <var name="genderList" class="java.util.ArrayList"/> <var name="dog" class="com.discdogevents.custom.pojo.DogData"/> <var name="dogs" class="java.util.ArrayList"/> <var name="dogId" class="java.lang.String"/> <on-start> <evaluate expression="txtService.findAllDogBreeds(flowRequestContext)" result="flowScope.breedList"/> <evaluate expression="txtService.findAllGender(flowRequestContext)" result="flowScope.genderList"/> </on-start> <view-state id="register1" model="user" view="userForm"> <on-render> <evaluate expression="txtService.findAllEmailTypes(flowRequestContext)" result="flowScope.emailTypeList"/> <evaluate expression="txtService.findAllPhoneTypes(flowRequestContext)" result="flowScope.phoneTypeList"/> </on-render> <transition on="register1" to="dogList"> <evaluate expression="userService.createGuestUser(user)" /> </transition> <transition on="cancelRegistration" to="cancelRegistration" validate="false"/> </view-state> ...... ...... <end-state id="cancelRegistration" view="welcome"/> <end-state id="cancel" view="welcome"/> </flow>
Stack TraceCode:public class PersonData implements java.io.Serializable{ private Club club = new Club(); private Address address = new Address(); private Person person = new Person(); private Users userInfo = new Users(); private MultipartFile file; private List<Email> emailBook = new ArrayList<Email>(10); private List<Phone> phoneBook = new ArrayList<Phone>(10); private List<DogData> dogs = new ArrayList<DogData>(10); ..... }
Code:root cause org.springframework.webflow.execution.repository.snapshot.SnapshotUnmarshalException: IOException thrown deserializing the flow execution stored in this snapshot -- this should not happen! root cause java.io.FileNotFoundException: C:\Users\mattsrum\discdogevents\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost\discdogevents\upload_659c1ac6_12ed983e1f0__8000_00000021.tmp (The system cannot find the file specified) java.io.FileInputStream.open(Native Method) java.io.FileInputStream.<init>(Unknown Source) org.apache.commons.fileupload.disk.DiskFileItem.readObject(DiskFileItem.java:719)


Reply With Quote