List Info

Thread: Created: (JBSEAM-835) After Upload the Conversation id seems to be l




Created: (JBSEAM-835) After Upload the Conversation id seems to be l
country flaguser name
United States
2007-02-12 16:24:30
After Upload the Conversation id seems to be lost when use a
button to move forward from the "upload" screen.
------------------------------------------------------------
-------------------------------------------------

                 Key: JBSEAM-835
                 URL: http://j
ira.jboss.com/jira/browse/JBSEAM-835
             Project: JBoss Seam
          Issue Type: Bug
          Components: ICE Faces Integration
    Affects Versions: 1.1.6.GA
            Reporter: Tony Herstell
         Assigned To: Gregory Dick


11:13:27,070 ERROR [[Blocking Servlet]] Servlet.service()
for servlet Blocking Servlet threw exception
javax.faces.FacesException: Error calling action method of
component with id _id62:done
	at
org.apache.myfaces.application.ActionListenerImpl.processAct
ion(ActionListenerImpl.java:74)
	at
javax.faces.component.UICommand.broadcast(UICommand.java:106
)
	at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRo
ot.java:94)
	at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.j
ava:136)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValue
s(LifecycleImpl.java:219)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle
Impl.java:71)
	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.renderCycle
(BlockingServlet.java:456)
	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.receiveUpda
tes(BlockingServlet.java:444)
	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.executeRequ
est(BlockingServlet.java:324)
	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(Blo
ckingServlet.java:186)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi
lter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App
licationFilterChain.java:173)
	at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl
yHeaderFilter.java:96)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi
lter(ApplicationFilterChain.java:202)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App
licationFilterChain.java:173)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar
dWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(Standar
dContextValve.java:178)
	at
org.jboss.web.tomcat.security.SecurityAssociationValve.invok
e(SecurityAssociationValve.java:175)
	at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccCo
ntextValve.java:74)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo
stValve.java:126)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
rtValve.java:105)
	at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(Ca
chedConnectionValve.java:156)
	at
org.apache.catalina.core.StandardEngineValve.invoke(Standard
EngineValve.java:107)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
apter.java:148)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Proce
ssor.java:869)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection
Handler.processConnection(Http11BaseProtocol.java:664)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo
lTcpEndpoint.java:527)
	at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(Maste
rSlaveWorkerThread.java:112)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.faces.el.EvaluationException: /upload.xhtml
61,49 action="#{uploadController.done}":
javax.ejb.EJBException: java.lang.IllegalStateException: no
long-running conversation for Conversational bean:
uploadController
	at
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodB
inding.java:73)
	at
org.apache.myfaces.application.ActionListenerImpl.processAct
ion(ActionListenerImpl.java:63)
	... 29 more
Caused by: javax.ejb.EJBException:
java.lang.IllegalStateException: no long-running
conversation for Conversational bean: uploadController
	at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3Tx
Policy.java:69)
	at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83
)
	at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterce
ptor.java:191)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropa
gationInterceptor.java:76)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(S
tatefulInstanceInterceptor.java:83)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(
AuthenticationInterceptor.java:77)
	at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke
(Ejb3AuthenticationInterceptor.java:102)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagati
onInterceptor.java:47)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(A
synchronousInterceptor.java:106)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.stateful.StatefulContainer.localInvoke(Statef
ulContainer.java:203)
	at
org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLo
calProxy.java:98)
	at $Proxy129.done(Unknown Source)
	at
nz.co.risingstars.actions.upload.UploadController$$FastClass
ByCGLIB$$cd1d79c6.invoke(<generated>)
	at
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
	at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootI
nvocationContext.java:45)
	at
org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(Cli
entSideInterceptor.java:74)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:55)
	at
org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecess
ary(RemoveInterceptor.java:40)
	at sun.reflect.GeneratedMethodAccessor181.invoke(Unknown
Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
	at
org.jboss.seam.intercept.RootInterceptor.createSeamInvocatio
nContext(RootInterceptor.java:144)
	at
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(Ro
otInterceptor.java:129)
	at
org.jboss.seam.intercept.RootInterceptor.invoke(RootIntercep
tor.java:102)
	at
org.jboss.seam.intercept.ClientSideInterceptor.interceptInvo
cation(ClientSideInterceptor.java:83)
	at
org.jboss.seam.intercept.ClientSideInterceptor.intercept(Cli
entSideInterceptor.java:52)
	at
nz.co.risingstars.actions.upload.UploadController$$EnhancerB
yCGLIB$$f25dc804.done(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
	at
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.
java:274)
	at
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpr
ession.java:68)
	at
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodB
inding.java:69)
	... 30 more
Caused by: java.lang.IllegalStateException: no long-running
conversation for Conversational bean: uploadController
	at
org.jboss.seam.interceptors.ConversationalInterceptor.checkC
onversationForConversationalBean(ConversationalInterceptor.j
ava:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
	at
org.jboss.seam.interceptors.MethodContextInterceptor.aroundI
nvoke(MethodContextInterceptor.java:27)
	at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown
Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
	at
org.jboss.seam.intercept.RootInterceptor.createSeamInvocatio
nContext(RootInterceptor.java:144)
	at
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(Ro
otInterceptor.java:129)
	at
org.jboss.seam.intercept.RootInterceptor.invoke(RootIntercep
tor.java:102)
	at
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke
(SessionBeanInterceptor.java:50)
	at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown
Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(Inv
ocationContextImpl.java:118)
	at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invok
e(EJB3InterceptorsInterceptor.java:63)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationI
nterceptor.invoke(ExtendedPersistenceContextPropagationInter
ceptor.java:71)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.entity.TransactionScopedEntityManagerIntercep
tor.invoke(TransactionScopedEntityManagerInterceptor.java:54
)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOp
erationsInterceptor.java:46)
	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
	at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79
)
	... 72 more



>From code:
									<ice:panelGrid columns="1">
										<ice:inputFile style="border:none;
width:400px; height:70px;"
                               
			actionListener="#{uploadController.action}"/>
; <!--
progressListener="#{uploadController.progress}"
-->
                        				<ice:outputProgress
id="progress"
value="#{uploadController.percent}"/>
									</ice:panelGrid>

									<ice:panelGrid columns="1"
width="100%">
										<div align="right">
											<ice:commandButton
action="#{uploadController.cancel}"
												value="#{messages.button_cancel}"
immediate="true"
												type="submit" />
											<ice:commandButton id="done"
type="submit"
												value="#{messages.button_done}"
immediate="true"
												action="#{uploadController.done}"
/>
										</div>
									</ice:panelGrid>


    TransactionAttribute(TransactionAttributeType.NOT_SUP
PORTED)
    public void action(ActionEvent event) {
    	log.info("> action");
        InputFile inputFile = (InputFile)
event.getSource();
        if (inputFile.getStatus() == InputFile.SAVED) {
            String fileName =
inputFile.getFileInfo().getFileName();
            String contentType =
inputFile.getFileInfo().getContentType();
            File file = inputFile.getFile();

            byte[] inputFileAsBytes = getAsBytes(file);
			
			Image image =
(Image)Component.getInstance("image", true);
			image.setName(fileName);
			image.setType(contentType);
			image.setThumbnail(inputFileAsBytes);
			image.setImage(inputFileAsBytes);
			image.setVersion(0);
	        em.persist(image);

			if (parentObjectKind == ParentObjectKind.ORGANISATION) {
				Organisation organisationToBeUploadedTo =
em.find(Organisation.class, primaryKey);
				if (organisationToBeUploadedTo == null) {
					log.warn("Organisation to be Uploaded to is not
found." + primaryKey);
				} else {
					organisationToBeUploadedTo.setPicture(image);
					em.persist(organisationToBeUploadedTo);
				}
			} else if (parentObjectKind == ParentObjectKind.USER) {
				User userToBeUploadedTo = em.find(User.class,
primaryKey);
				if (userToBeUploadedTo == null) {
					log.warn("User to be Uploaded to is not
found." + primaryKey);
				} else {
					userToBeUploadedTo.setPicture(image);
					em.persist(userToBeUploadedTo);
				}
    		} else {
    			log.error("action called with object type not
supported.");
    		}
        } else if (inputFile.getStatus() ==
InputFile.INVALID) {
           
inputFile.getFileInfo().getException().printStackTrace();
        } else if (inputFile.getStatus() ==
InputFile.SIZE_LIMIT_EXCEEDED) {
           
inputFile.getFileInfo().getException().printStackTrace();
        } else if (inputFile.getStatus() ==
InputFile.UNKNOWN_SIZE) {
           
inputFile.getFileInfo().getException().printStackTrace();
        }
        log.info("< action");
    }

    TransactionAttribute(TransactionAttributeType.NOT_SUP
PORTED)
    private byte[] getAsBytes(File file) {
    	byte[] valueToReturn = null;
    	log.info("> getAsBytes");
    	InputStream in = null;
        OutputStream out = null;
        try {
            in = new BufferedInputStream(new
FileInputStream(file));
            ByteArrayOutputStream baos = new
ByteArrayOutputStream();
            out = new BufferedOutputStream(baos);

            final int toRead = 1024;
            byte[] buffy = new byte[toRead];
            int read;
         
            while ((read = in.read(buffy)) != -1) {
                out.write(buffy, 0, read);
                out.flush();
            }

            valueToReturn = baos.toByteArray();

        } catch (IOException e) {
            throw new
IllegalStateException(e.getMessage());
        } finally { // Try to release any resources.
            try {
                if (in != null) {
                    in.close();
                }    
            } catch (IOException ignored) {}

            try {
                if (out != null) {
                    out.close();
                }
            } catch (IOException ignored) {}
        }
        log.info("< getAsBytes");
        return valueToReturn;
    }
    
    

    End
	public String done() {
		log.info("> done");
		String valueToReturn = null;
		if (parentObjectKind == ParentObjectKind.ORGANISATION) {
			valueToReturn = "findOrganisation";
		} else if (parentObjectKind == ParentObjectKind.USER) {
			valueToReturn = "findUser";
		} else {
			log.error("done called with object type not
supported.");
		}
		log.info("< done");
		return valueToReturn;
    }
    

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
_______________________________________________
jbossseam-issues mailing list
jbossseam-issueslists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbossseam-issu
es

Closed: (JBSEAM-835) After Upload the Conversation id seems to be lo
country flaguser name
United States
2007-03-21 16:58:49
     [ http://jira.jboss.com/jira/browse/JBSEAM-835?page=all
]

Tony Herstell closed JBSEAM-835.
--------------------------------

    Fix Version/s: 1.2.1.GA
       Resolution: Cannot Reproduce Bug

Gone since Development Drop 1.6.0.DR1.

> After Upload the Conversation id seems to be lost when
use a button to move forward from the "upload"
screen.
>
------------------------------------------------------------
-------------------------------------------------
>
>                 Key: JBSEAM-835
>                 URL: http://j
ira.jboss.com/jira/browse/JBSEAM-835
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: ICE Faces Integration
>    Affects Versions: 1.1.6.GA
>            Reporter: Tony Herstell
>         Assigned To: Gregory Dick
>             Fix For: 1.2.1.GA
>
>
> 11:13:27,070 ERROR [[Blocking Servlet]]
Servlet.service() for servlet Blocking Servlet threw
exception
> javax.faces.FacesException: Error calling action method
of component with id _id62:done
> 	at
org.apache.myfaces.application.ActionListenerImpl.processAct
ion(ActionListenerImpl.java:74)
> 	at
javax.faces.component.UICommand.broadcast(UICommand.java:106
)
> 	at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRo
ot.java:94)
> 	at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.j
ava:136)
> 	at
org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValue
s(LifecycleImpl.java:219)
> 	at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle
Impl.java:71)
> 	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.renderCycle
(BlockingServlet.java:456)
> 	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.receiveUpda
tes(BlockingServlet.java:444)
> 	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.executeRequ
est(BlockingServlet.java:324)
> 	at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(Blo
ckingServlet.java:186)
> 	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

> 	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi
lter(ApplicationFilterChain.java:252)
> 	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App
licationFilterChain.java:173)
> 	at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl
yHeaderFilter.java:96)
> 	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi
lter(ApplicationFilterChain.java:202)
> 	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App
licationFilterChain.java:173)
> 	at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar
dWrapperValve.java:213)
> 	at
org.apache.catalina.core.StandardContextValve.invoke(Standar
dContextValve.java:178)
> 	at
org.jboss.web.tomcat.security.SecurityAssociationValve.invok
e(SecurityAssociationValve.java:175)
> 	at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccCo
ntextValve.java:74)
> 	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo
stValve.java:126)
> 	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
rtValve.java:105)
> 	at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(Ca
chedConnectionValve.java:156)
> 	at
org.apache.catalina.core.StandardEngineValve.invoke(Standard
EngineValve.java:107)
> 	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
apter.java:148)
> 	at
org.apache.coyote.http11.Http11Processor.process(Http11Proce
ssor.java:869)
> 	at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection
Handler.processConnection(Http11BaseProtocol.java:664)
> 	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo
lTcpEndpoint.java:527)
> 	at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(Maste
rSlaveWorkerThread.java:112)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.faces.el.EvaluationException:
/upload.xhtml 61,49
action="#{uploadController.done}":
javax.ejb.EJBException: java.lang.IllegalStateException: no
long-running conversation for Conversational bean:
uploadController
> 	at
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodB
inding.java:73)
> 	at
org.apache.myfaces.application.ActionListenerImpl.processAct
ion(ActionListenerImpl.java:63)
> 	... 29 more
> Caused by: javax.ejb.EJBException:
java.lang.IllegalStateException: no long-running
conversation for Conversational bean: uploadController
> 	at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3Tx
Policy.java:69)
> 	at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83
)
> 	at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterce
ptor.java:191)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropa
gationInterceptor.java:76)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(S
tatefulInstanceInterceptor.java:83)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(
AuthenticationInterceptor.java:77)
> 	at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke
(Ejb3AuthenticationInterceptor.java:102)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagati
onInterceptor.java:47)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(A
synchronousInterceptor.java:106)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.stateful.StatefulContainer.localInvoke(Statef
ulContainer.java:203)
> 	at
org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLo
calProxy.java:98)
> 	at $Proxy129.done(Unknown Source)
> 	at
nz.co.risingstars.actions.upload.UploadController$$FastClass
ByCGLIB$$cd1d79c6.invoke(<generated>)
> 	at
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> 	at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootI
nvocationContext.java:45)
> 	at
org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(Cli
entSideInterceptor.java:74)
> 	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:55)
> 	at
org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecess
ary(RemoveInterceptor.java:40)
> 	at
sun.reflect.GeneratedMethodAccessor181.invoke(Unknown
Source)
> 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
> 	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
> 	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
> 	at
org.jboss.seam.intercept.RootInterceptor.createSeamInvocatio
nContext(RootInterceptor.java:144)
> 	at
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(Ro
otInterceptor.java:129)
> 	at
org.jboss.seam.intercept.RootInterceptor.invoke(RootIntercep
tor.java:102)
> 	at
org.jboss.seam.intercept.ClientSideInterceptor.interceptInvo
cation(ClientSideInterceptor.java:83)
> 	at
org.jboss.seam.intercept.ClientSideInterceptor.intercept(Cli
entSideInterceptor.java:52)
> 	at
nz.co.risingstars.actions.upload.UploadController$$EnhancerB
yCGLIB$$f25dc804.done(<generated>)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:39)
> 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
com.sun.el.parser.AstValue.invoke(AstValue.java:130)
> 	at
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.
java:274)
> 	at
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpr
ession.java:68)
> 	at
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodB
inding.java:69)
> 	... 30 more
> Caused by: java.lang.IllegalStateException: no
long-running conversation for Conversational bean:
uploadController
> 	at
org.jboss.seam.interceptors.ConversationalInterceptor.checkC
onversationForConversationalBean(ConversationalInterceptor.j
ava:52)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:39)
> 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
> 	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
> 	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
> 	at
org.jboss.seam.interceptors.MethodContextInterceptor.aroundI
nvoke(MethodContextInterceptor.java:27)
> 	at
sun.reflect.GeneratedMethodAccessor99.invoke(Unknown
Source)
> 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
> 	at
org.jboss.seam.intercept.Interceptor.aroundInvoke(Intercepto
r.java:169)
> 	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamI
nvocationContext.java:64)
> 	at
org.jboss.seam.intercept.RootInterceptor.createSeamInvocatio
nContext(RootInterceptor.java:144)
> 	at
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(Ro
otInterceptor.java:129)
> 	at
org.jboss.seam.intercept.RootInterceptor.invoke(RootIntercep
tor.java:102)
> 	at
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke
(SessionBeanInterceptor.java:50)
> 	at
sun.reflect.GeneratedMethodAccessor180.invoke(Unknown
Source)
> 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(Inv
ocationContextImpl.java:118)
> 	at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invok
e(EJB3InterceptorsInterceptor.java:63)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationI
nterceptor.invoke(ExtendedPersistenceContextPropagationInter
ceptor.java:71)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.entity.TransactionScopedEntityManagerIntercep
tor.invoke(TransactionScopedEntityManagerInterceptor.java:54
)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOp
erationsInterceptor.java:46)
> 	at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodIn
vocation.java:101)
> 	at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79
)
> 	... 72 more
> From code:
> 									<ice:panelGrid columns="1">
> 										<ice:inputFile style="border:none;
width:400px; height:70px;"
>                                
			actionListener="#{uploadController.action}"/>
; <!--
progressListener="#{uploadController.progress}"
-->
>                         				<ice:outputProgress
id="progress"
value="#{uploadController.percent}"/>
> 									</ice:panelGrid>
> 									<ice:panelGrid columns="1"
width="100%">
> 										<div align="right">
> 											<ice:commandButton
action="#{uploadController.cancel}"
> 												value="#{messages.button_cancel}"
immediate="true"
> 												type="submit" />
> 											<ice:commandButton id="done"
type="submit"
> 												value="#{messages.button_done}"
immediate="true"
> 												action="#{uploadController.done}"
/>
> 										</div>
> 									</ice:panelGrid>
>     TransactionAttribute(TransactionAttributeType.NOT_SUP
PORTED)
>     public void action(ActionEvent event) {
>     	log.info("> action");
>         InputFile inputFile = (InputFile)
event.getSource();
>         if (inputFile.getStatus() == InputFile.SAVED)
{
>             String fileName =
inputFile.getFileInfo().getFileName();
>             String contentType =
inputFile.getFileInfo().getContentType();
>             File file = inputFile.getFile();
>             byte[] inputFileAsBytes =
getAsBytes(file);
> 			
> 			Image image =
(Image)Component.getInstance("image", true);
> 			image.setName(fileName);
> 			image.setType(contentType);
> 			image.setThumbnail(inputFileAsBytes);
> 			image.setImage(inputFileAsBytes);
> 			image.setVersion(0);
> 	        em.persist(image);
> 			if (parentObjectKind ==
ParentObjectKind.ORGANISATION) {
> 				Organisation organisationToBeUploadedTo =
em.find(Organisation.class, primaryKey);
> 				if (organisationToBeUploadedTo == null) {
> 					log.warn("Organisation to be Uploaded to is
not found." + primaryKey);
> 				} else {
> 					organisationToBeUploadedTo.setPicture(image);
> 					em.persist(organisationToBeUploadedTo);
> 				}
> 			} else if (parentObjectKind ==
ParentObjectKind.USER) {
> 				User userToBeUploadedTo = em.find(User.class,
primaryKey);
> 				if (userToBeUploadedTo == null) {
> 					log.warn("User to be Uploaded to is not
found." + primaryKey);
> 				} else {
> 					userToBeUploadedTo.setPicture(image);
> 					em.persist(userToBeUploadedTo);
> 				}
>     		} else {
>     			log.error("action called with object type
not supported.");
>     		}
>         } else if (inputFile.getStatus() ==
InputFile.INVALID) {
>            
inputFile.getFileInfo().getException().printStackTrace();
>         } else if (inputFile.getStatus() ==
InputFile.SIZE_LIMIT_EXCEEDED) {
>            
inputFile.getFileInfo().getException().printStackTrace();
>         } else if (inputFile.getStatus() ==
InputFile.UNKNOWN_SIZE) {
>            
inputFile.getFileInfo().getException().printStackTrace();
>         }
>         log.info("< action");
>     }
>     TransactionAttribute(TransactionAttributeType.NOT_SUP
PORTED)
>     private byte[] getAsBytes(File file) {
>     	byte[] valueToReturn = null;
>     	log.info("> getAsBytes");
>     	InputStream in = null;
>         OutputStream out = null;
>         try {
>             in = new BufferedInputStream(new
FileInputStream(file));
>             ByteArrayOutputStream baos = new
ByteArrayOutputStream();
>             out = new BufferedOutputStream(baos);
>             final int toRead = 1024;
>             byte[] buffy = new byte[toRead];
>             int read;
>          
>             while ((read = in.read(buffy)) != -1) {
>                 out.write(buffy, 0, read);
>                 out.flush();
>             }
>             valueToReturn = baos.toByteArray();
>         } catch (IOException e) {
>             throw new
IllegalStateException(e.getMessage());
>         } finally { // Try to release any resources.
>             try {
>                 if (in != null) {
>                     in.close();
>                 }    
>             } catch (IOException ignored) {}
>             try {
>                 if (out != null) {
>                     out.close();
>                 }
>             } catch (IOException ignored) {}
>         }
>         log.info("< getAsBytes");
>         return valueToReturn;
>     }
>     
>     
>     End
> 	public String done() {
> 		log.info("> done");
> 		String valueToReturn = null;
> 		if (parentObjectKind ==
ParentObjectKind.ORGANISATION) {
> 			valueToReturn = "findOrganisation";
> 		} else if (parentObjectKind == ParentObjectKind.USER)
{
> 			valueToReturn = "findUser";
> 		} else {
> 			log.error("done called with object type not
supported.");
> 		}
> 		log.info("< done");
> 		return valueToReturn;
>     }
>     

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
_______________________________________________
jbossseam-issues mailing list
jbossseam-issueslists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbossseam-issu
es

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )