cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Illegal argument exception

Former Member
0 Kudos

Hi ,

I am doing File upload application. I am sending code

public void onActionUploadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionUploadFile(ServerEvent)

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(

IPrivateFileUploadView.ICtx_vn_UploadDownloadFileElement.CTX__VA__FILE_RESOURCE);

//Get Modifiable binary type from the attribute info ,

//requires type cast.

IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();

IPrivateFileUploadView.ICtx_vn_UploadDownloadFileElement fileElement = wdContext.currentCtx_vn_UploadDownloadFileElement();

if(fileElement.getCtx_va_FileResource() != null)

{

try{

String mimeType = binaryType.getMimeType().toString();

byte [] file = fileElement.getCtx_va_FileResource();

//Get Extension of Uploaded File

fileElement.setCtx_va_FileExtension(binaryType.getMimeType().getFileExtension());

msgMgr.reportSuccess("File Extension :" + wdContext.currentCtx_vn_UploadDownloadFileElement().getCtx_va_FileExtension());

msgMgr.reportMessage(IMessageFileUpDownloadComp.SF_UPLOAD,new Object[] {binaryType.getFileName()}, false);

}catch(Exception e)

{

throw new WDRuntimeException(e.getMessage());

}

}

For SF_Upload , I created message pool like message "File "" Created"

I am getting error in this action like "Illegal Argument Exception".

Please do the needfull.

Thanks

Risha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Risha,

Did u check which line of code is giving the exception?

If not, print some messages after each line of code and find out which line of code is raising the exception.

Regards,

VJR.

Former Member
0 Kudos

Hi ,

msgMgr.reportMessage(IMessageFileUpDownloadComp.SF_UPLOAD,new Object[] {binaryType.getFileName()}, false);

In the above line I am getting Exception.

Thanks in Advance.

Regards

Risha

Former Member
0 Kudos

Hi,

For that u have to create a message in the message pool.

U can see the message pool in the component which u created.

There add message

with message key SFUpload

and message type standerd

and message text type as messagetext

and and message text as File "" was uploaded successfully!

try this.

Regards,

H.V.Swathi

Former Member
0 Kudos

Hi ,

already I created messages in the message pool.

Thanks

Risha

Answers (0)