cancel
Showing results for 
Search instead for 
Did you mean: 

at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89) ??

Former Member
0 Kudos

Hi ,

I am working with webservices. I am trying to open a PDF window, I am getting the following exception.

"at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)"

java.lang.NullPointerException

at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)

at com.sap.tc.webdynpro.services.sal.util.cache.ResourcePool$PublicResourcePoolElement.<init>(ResourcePool.java:322)

at com.sap.tc.webdynpro.services.sal.util.cache.ResourcePool$PublicResourcePoolElement.<init>(ResourcePool.java:312)

at com.sap.tc.webdynpro.services.sal.util.cache.ResourcePool.add(ResourcePool.java:190)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.url.PublicCachedWebResource.<init>(PublicCachedWebResource.java:59)

at com.sap.tc.webdynpro.serverimpl.wdc.url.WebResourceFactory.getPublicCachedWebResource(WebResourceFactory.java:145)

at com.sap.tc.webdynpro.services.sal.url.api.WDWebResource.getPublicCachedWebResource(WDWebResource.java:115)

Everything is fine. I don knw why iam getting this exception.

Anyone has idea on this..

GS

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you send me the code snippet , which you are using to open window..

Regards

LakshmiNarayana

Former Member
0 Kudos

Hi,

byte[] pdfContent = wdContext.currentChnnode().getPdf_Data();

String pdfFileName = Constants.PdfName;

WDDeployableObjectPart objPart=wdThis.wdGetAPI().getComponent().getDeployableObjectPart();

IWDCachedWebResource pdfResource= WDWebResource.getPublicCachedWebResource(pdfContent,WDWebResourceType.PDF,WDScopeType.APPLICATION_SCOPE,objPart,Constants.page1);

try

{

wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();

}

catch (WDURLException e)

{

wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);

}

GS

Former Member
0 Kudos

Hi,

Code is fine Mr.Sathish... Check the datatype of attribute Pdf_data, if binary or not.

and change this statement as I worked

wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(0),pdfFileName).show();

Regards

LakshmiNarayana

Former Member
0 Kudos

Hi ,

PDF_Data is binary only.

And i cant make tht statement as u mentioned. As tht we cant pass int values as parameters.......

Any suggestions

GS

Former Member
0 Kudos

Hi,

Sorry for it... My code is this one

data=wdContext.currentcontextElement().getPdfsource();

IWDResource resource = WDResourceFactory.createCachedResource(data , "PDF Report", WDWebResourceType.PDF);

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getUrl(0), "PDF Report");

window.show();

Try this way

LakshmiNarayana