You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Amr Mohamed Mahmoud Hassanien <am...@ey.ae> on 2011/10/13 15:44:00 UTC

Uncaught exception when tried to return a StreamResponse

Hi Guys,

	I want to export data in excel sheet, so I made a page class as the following without a template file(.tml)

public class ExportExcel {
	.
	.
	.
	
	StreamResponse OnActivate(){
		List<User> users = userManager.getAllActiveUsers();        // break point here never got hit
		return export(users);
	}
	
	public StreamResponse export(List<List<String>> rows) {
		// some logic to export the data in .xls
	}
}

And this is the error I got:
Page export/Excel did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.


And I am using this page link.
<t:pagelink t:page="export/excel"
                      title="message:export-label"/>

any idea what is the problem ?

Thanks in Advance,
Amr Hassanin

################################################################################################################
DISCLAIMER:
This message is for the named person's use only. It may contain confidential information, proprietary 
in nature or legally privileged information. All trade secret, know how, formulas, researches, database, 
software, codes diagrams, documentations, attachments, voice, concepts and visual content are strictly 
protected by United Arab Emirates Laws and Dubai Media Incorporated codes which will have the right to 
take any legal action if you fail in doing the hereunder steps. If you receive this message in error, 
please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and 
destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.  
You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message (email) 
if you are not the intended recipient.
################################################################################################################

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Uncaught exception when tried to return a StreamResponse

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Here is a simple example with which you can compare 

public class ExportXML {

    StreamResponse onActivate(){
        return new StreamResponse() {
            @Override
            public String getContentType() {
                return "text/xml";
            }

            @Override
            public InputStream getStream() throws IOException {
                String xml = "<?xml version='1.0'?>\n" +
                        "<message>Hello</message>";
                ByteArrayInputStream in = new ByteArrayInputStream(
                    xml.getBytes()
                );

                return in;
            }

            @Override
            public void prepareResponse(Response response) {
            }
        };
    }
}

BTW what tapestry version are you using( just to ensure we are dealing with tapestry5 :))

Also I remember one case where a developer had implemented StreamResponse as a public class in the pages sub-package. That can also lead to this issue.

regards
Taha

On Oct 16, 2011, at 10:21 AM, Amr Mohamed Mahmoud Hassanien wrote:

> Ok ...you are right and  I changed the 'O' to 'o'. but the same I am getting , break point not hit and an error.
> 
> OnEvent the same too.
> 
> Regards,
> 
> -----Original Message-----
> From: Taha Hafeez Siddiqi [mailto:tawus.tapestry@gmail.com] 
> Sent: 13 أكتوبر, 2011 05:47 م
> To: Tapestry users
> Subject: Re: Uncaught exception when tried to return a StreamResponse
> 
> Hi Amr
> 
> Are you sure your onActivate() is being called. BTW, your onActivate() has 'O' in uppercase.  To avoid such typos I prefer the OnEvent annotation
> 
> regards
> Taha
> 
> On Oct 13, 2011, at 7:14 PM, Amr Mohamed Mahmoud Hassanien wrote:
> 
>> Hi Guys,
>> 
>> 	I want to export data in excel sheet, so I made a page class as the 
>> following without a template file(.tml)
>> 
>> public class ExportExcel {
>> 	.
>> 	.
>> 	.
>> 	
>> 	StreamResponse OnActivate(){
>> 		List<User> users = userManager.getAllActiveUsers();        // break point here never got hit
>> 		return export(users);
>> 	}
>> 	
>> 	public StreamResponse export(List<List<String>> rows) {
>> 		// some logic to export the data in .xls
>> 	}
>> }
>> 
>> And this is the error I got:
>> Page export/Excel did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
>> 
>> 
>> And I am using this page link.
>> <t:pagelink t:page="export/excel"
>>                     title="message:export-label"/>
>> 
>> any idea what is the problem ?
>> 
>> Thanks in Advance,
>> Amr Hassanin
>> 
>> ######################################################################
>> ##########################################
>> DISCLAIMER:
>> This message is for the named person's use only. It may contain 
>> confidential information, proprietary in nature or legally privileged 
>> information. All trade secret, know how, formulas, researches, 
>> database, software, codes diagrams, documentations, attachments, 
>> voice, concepts and visual content are strictly protected by United 
>> Arab Emirates Laws and Dubai Media Incorporated codes which will have 
>> the right to take any legal action if you fail in doing the hereunder steps. If you receive this message in error, please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.
>> You must not, directly or indirectly, use, disclose, distribute, 
>> print, or copy any part of this message (email) if you are not the intended recipient.
>> ######################################################################
>> ##########################################
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> ################################################################################################################
> DISCLAIMER:
> This message is for the named person's use only. It may contain confidential information, proprietary 
> in nature or legally privileged information. All trade secret, know how, formulas, researches, database, 
> software, codes diagrams, documentations, attachments, voice, concepts and visual content are strictly 
> protected by United Arab Emirates Laws and Dubai Media Incorporated codes which will have the right to 
> take any legal action if you fail in doing the hereunder steps. If you receive this message in error, 
> please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and 
> destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.  
> You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message (email) 
> if you are not the intended recipient.
> ################################################################################################################
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Uncaught exception when tried to return a StreamResponse

Posted by Amr Mohamed Mahmoud Hassanien <am...@ey.ae>.
Ok ...you are right and  I changed the 'O' to 'o'. but the same I am getting , break point not hit and an error.

OnEvent the same too.

Regards,

-----Original Message-----
From: Taha Hafeez Siddiqi [mailto:tawus.tapestry@gmail.com] 
Sent: 13 أكتوبر, 2011 05:47 م
To: Tapestry users
Subject: Re: Uncaught exception when tried to return a StreamResponse

Hi Amr

Are you sure your onActivate() is being called. BTW, your onActivate() has 'O' in uppercase.  To avoid such typos I prefer the OnEvent annotation

regards
Taha
 
On Oct 13, 2011, at 7:14 PM, Amr Mohamed Mahmoud Hassanien wrote:

> Hi Guys,
> 
> 	I want to export data in excel sheet, so I made a page class as the 
> following without a template file(.tml)
> 
> public class ExportExcel {
> 	.
> 	.
> 	.
> 	
> 	StreamResponse OnActivate(){
> 		List<User> users = userManager.getAllActiveUsers();        // break point here never got hit
> 		return export(users);
> 	}
> 	
> 	public StreamResponse export(List<List<String>> rows) {
> 		// some logic to export the data in .xls
> 	}
> }
> 
> And this is the error I got:
> Page export/Excel did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
> 
> 
> And I am using this page link.
> <t:pagelink t:page="export/excel"
>                      title="message:export-label"/>
> 
> any idea what is the problem ?
> 
> Thanks in Advance,
> Amr Hassanin
> 
> ######################################################################
> ##########################################
> DISCLAIMER:
> This message is for the named person's use only. It may contain 
> confidential information, proprietary in nature or legally privileged 
> information. All trade secret, know how, formulas, researches, 
> database, software, codes diagrams, documentations, attachments, 
> voice, concepts and visual content are strictly protected by United 
> Arab Emirates Laws and Dubai Media Incorporated codes which will have 
> the right to take any legal action if you fail in doing the hereunder steps. If you receive this message in error, please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.
> You must not, directly or indirectly, use, disclose, distribute, 
> print, or copy any part of this message (email) if you are not the intended recipient.
> ######################################################################
> ##########################################
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

################################################################################################################
DISCLAIMER:
This message is for the named person's use only. It may contain confidential information, proprietary 
in nature or legally privileged information. All trade secret, know how, formulas, researches, database, 
software, codes diagrams, documentations, attachments, voice, concepts and visual content are strictly 
protected by United Arab Emirates Laws and Dubai Media Incorporated codes which will have the right to 
take any legal action if you fail in doing the hereunder steps. If you receive this message in error, 
please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and 
destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.  
You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message (email) 
if you are not the intended recipient.
################################################################################################################

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Uncaught exception when tried to return a StreamResponse

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Hi Amr

Are you sure your onActivate() is being called. BTW, your onActivate() has 'O' in uppercase.  To avoid such typos I prefer the OnEvent annotation

regards
Taha
 
On Oct 13, 2011, at 7:14 PM, Amr Mohamed Mahmoud Hassanien wrote:

> Hi Guys,
> 
> 	I want to export data in excel sheet, so I made a page class as the following without a template file(.tml)
> 
> public class ExportExcel {
> 	.
> 	.
> 	.
> 	
> 	StreamResponse OnActivate(){
> 		List<User> users = userManager.getAllActiveUsers();        // break point here never got hit
> 		return export(users);
> 	}
> 	
> 	public StreamResponse export(List<List<String>> rows) {
> 		// some logic to export the data in .xls
> 	}
> }
> 
> And this is the error I got:
> Page export/Excel did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
> 
> 
> And I am using this page link.
> <t:pagelink t:page="export/excel"
>                      title="message:export-label"/>
> 
> any idea what is the problem ?
> 
> Thanks in Advance,
> Amr Hassanin
> 
> ################################################################################################################
> DISCLAIMER:
> This message is for the named person's use only. It may contain confidential information, proprietary 
> in nature or legally privileged information. All trade secret, know how, formulas, researches, database, 
> software, codes diagrams, documentations, attachments, voice, concepts and visual content are strictly 
> protected by United Arab Emirates Laws and Dubai Media Incorporated codes which will have the right to 
> take any legal action if you fail in doing the hereunder steps. If you receive this message in error, 
> please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and 
> destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.  
> You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message (email) 
> if you are not the intended recipient.
> ################################################################################################################
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Uncaught exception when tried to return a StreamResponse

Posted by Amr Mohamed Mahmoud Hassanien <am...@ey.ae>.
Page link never renders correctly if the page name is not correct and it thankfully gives suggestions for the page name like this :

Render queue error in BeginRender[user/List:pagelink]: Unable to resolve 'exportExcel' to a known page name. Available page names: (blank), About, Contact, ExceptionReport, Forbidden, Index, Login, PropertyDisplayBlocks, PropertyEditBlocks, ServiceStatus, export/Excel, export/ExportExcel, 


Still not fixed, any other possibilities? 

Regards,

-----Original Message-----
From: trsvax [mailto:trsvax@gmail.com] 
Sent: 13 أكتوبر, 2011 06:18 م
To: users@tapestry.apache.org
Subject: Re: Uncaught exception when tried to return a StreamResponse

It's likely your pagelink should be to exportexel not export/excel

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Uncaught-exception-when-tried-to-return-a-StreamResponse-tp4899262p4899377.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

################################################################################################################
DISCLAIMER:
This message is for the named person's use only. It may contain confidential information, proprietary 
in nature or legally privileged information. All trade secret, know how, formulas, researches, database, 
software, codes diagrams, documentations, attachments, voice, concepts and visual content are strictly 
protected by United Arab Emirates Laws and Dubai Media Incorporated codes which will have the right to 
take any legal action if you fail in doing the hereunder steps. If you receive this message in error, 
please immediately DELETE it and all copies of it from your system, DESTROY any hard copies of it and 
destroy any soft and backup copy of it saved in any kind of form under you possession and NOTIFY the sender.  
You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message (email) 
if you are not the intended recipient.
################################################################################################################

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Uncaught exception when tried to return a StreamResponse

Posted by trsvax <tr...@gmail.com>.
It's likely your pagelink should be to exportexel not export/excel

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Uncaught-exception-when-tried-to-return-a-StreamResponse-tp4899262p4899377.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org