IMP:ClassCastException while using File upload UI in Webdynpro for java

Hi All,
I have used a FileUpload UI element in my screen , which is working fine for only the first time we upload a file. If we try to upload any file with out refreshing the application , a ClassCastException is being thrown. Please help me in resolving the issue.
Thanks in advance.
Srikanth

Thank you!!
1. But when i use the File Upload UI and try to use the 'data' property to retrieve the bytes i am getting a null pointer exception meaning the data is not being picked up by the UI even though browsed file has data.
2. How I am I supposed to set the 'Resource' property while downloading a PDF which has UTF-16 text and picture??
Note: I have done the same scenario using WD04 java without any trouble.
reg
vln

Similar Messages

  • Error while using File Upload through Frontend

    Hi,
    I need to upload an EXcel file , read the content and save the data to a db table. I used the
    <htmlb:fileUpload id = "FileUpload"
                                onUpload    = "HandleUpload"
                                upload_text = "Upload"
                         size        = "40"  />
    But while calling the function for clipboard
    CALL FUNCTION 'CLPB_IMPORT'
        TABLES
          data_tab   = excel_tab
        EXCEPTIONS
          clpb_error = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
        MESSAGE a037(alsmex).
      ENDIF.
    It is throwing the 'message a alsmex 037 cannot be processed in plugin mode https'. Can you pleas guide me how to rectify this problem. Is there a note for this?
    Regards,
    Shiny

    Hi Shiny,
    Did you ever come across a solution to this problem? I'm having the same issue myself.
    I have a function module that transfers the data from an excel file into database tables and when I try to call the FM from a BSP page I get the same error
    Message A ALSMEX 037 cannot be processed in plugin mode HTTP
    Just wondering if you ever solved this or found another way of uploading excel using BSP?
    Thanks,
    Darren

  • File Upload in Web Dynpro ABAP not using File Upload UI element

    Hi all ,
    I have searching for a way to upload a file using the file open dialog ( or even by manually specifying the path/file name) without using the file upload UI Element in ABAP web Dynpro . The  File Upload UI element works for smaller files however with large file sizes 64 MB , the system seems to be running of memory (SYSTEM_NO_ROLL) . This is due to a known fact that the UI element makes a duplicate copy of the whole copy while it does the upload.
    I have been looking at the ACFUPDOWNLOAD as a way to solve this problem but cannot seem to figure out how it works , even the sample program  provided  by SAP does not work. I am working with a regular abap server and not kpro( knowledge mananagement provider)  or portal .
    Any help would be greatly appreciated.
    thanks,
    Ali.

    If you are on NetWeaver 7.01, you can try both the ACFUpDownload UI element or try creating your own FileUpload in Adobe Flex with Flash Islands.  ACFUpDownload requires the KPRO by default (which is why the same application isn't working for you), but you can write your own handler class to act as the KPRO receiver.  Here is an eLearning on the topic:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    and source code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70645070-bb00-2c10-f086-f126721acdb4
    If you want an eLearning on the FlashIslands approach, you can find it here as well:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d42644-91ef-2b10-228c-9e0ae75b274e
    and Source Code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f044b62c-90ef-2b10-64a6-9ec25294d133
    However in both of these approaches you still have to be careful with how you handle large files.  The problem is that they are processed often a single binary string.  This makes the processing easy, but requires total amount of session memory at least as large as the file being uploaded.  In NetWeaver 7.02 ABAP adds the concept of Streams and Locators to help with the partial processing of large files.  This feature doesn't come until later this year, but if you are interested you can learn about it here:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80f983df-213e-2c10-ba89-b5a12ef178e8

  • Problem using File upload in portlets

    hello there
    I'm trying to use file upload component in one of my portlets. I searched a lot about a working component to be used in portlets since the standard one that comes with JSC doesn't work in portlets. I managed to get commons file upload and tomahawk to run in my portlet, but when I choose a file and try to get selected file's details it throughs a NullPointerException reporting that the file object is null.
    so please can anyone guide me to a working portlet example, I tried to find one but I couldn't. if that's hard to find, what should I do ?
    thank you in advance

    I added file upload component in JSF from portlets in Sun Java Portal server.
    Take a look...
    portlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description>SFTB Anonymous Mail Portlet</description>
    <portlet-name>SFTBAnonymousMailPortlet</portlet-name>
    <display-name>SFTBAnonymousMailPortlet</display-name>
    <portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class>
    <init-param>
    <name>portlet-class</name>
    <value>com.sun.faces.portlet.FacesPortlet</value>
    </init-param>
    <!-- Filter for MyFaces Tomahawk extension. -->
    <init-param>
    <name>portlet-filters</name>
    <value>jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter</value>
    </init-param>
    <init-param>
    <description>Portlet init page</description>
    <name>com.sun.faces.portlet.INIT_VIEW</name>
    <value>/jsp/index.jsp</value>
    </init-param>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>VIEW</portlet-mode>
    <portlet-mode>EDIT</portlet-mode>
    <portlet-mode>HELP</portlet-mode>
    </supports>
    <portlet-info>
    <title>&#1054;&#1090;&#1087;&#1088;&#1072;&#1074;&#1082;&#1072; &#1087;&#1088;&#1077;&#1076;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1081;</title>
    <short-title>&#1054;&#1090;&#1087;&#1088;&#1072;&#1074;&#1082;&#1072; &#1087;&#1088;&#1077;&#1076;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1081;</short-title>
    </portlet-info>
    </portlet>
    </portlet-app>
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>SFTBAnonymousMailComment</display-name>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <!--
    Extensions filter from Apache MyFaces Tomahawk used for uploads files.
    -->
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    <description>Set the size limit for uploaded files.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    <description>Set the threshold size - files
    below this limit are stored in memory, files above
    this limit are stored on disk.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>FacesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>FacesServlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>
    Files in WEB-INF/lib
    commons-beanutils-1.7.0.jar
    commons-collections-3.2.jar
    commons-digester-1.8.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.2.jar
    commons-logging-1.1.1.jar
    faces-response-filter-0.2.jar
    jsf-api-1.1_02.jar
    jsf-impl-1.1_02.jar
    jsf-portlet-1.1.5.jar
    jstl-1.1.0-D13.jar
    log4j-1.2.9.jar
    portals-bridges-portletfilter-1.0.jar
    standard-1.1.0-D13.jar
    tomahawk-1.1.6.jar
    tomahawk-bridge-0.9.1.jar
    Files tomahawk-bridge-0.9.1.jar, faces-response-filter-0.2.jar may be found there http://sourceforge.jp/projects/pal/
    In JSF beans I'm using org.apache.myfaces.custom.fileupload.UploadedFile
    Hope this helps.
    Bests,
    Alex Magdenko

  • Upload file without using file upload UI Element

    Hi all.
    I need upload a .txt file without using file upload UI Element because filename is not insert by user. The filename is generated by program. I try to use 'GUI_UPLOAD' and 'WS_UPLOAD' but don't work.
    Many thanks in advance.

    As you correctly pointed out we cannot use the gui_upload and gui_download fm's in webdynpro because they require sap gui and WD Components generally run in a HTML or Portal environment.
    The only option available is File Upload Element

  • How to upload multiple files in Webdynpro using File upload Screen Element

    Hi Experts,
          Can anybody tell me how to upload multiple files/pdfs in webdynpro using file upload screen element, and also please tell me what is the maximum storage limit of RAWSTRING data type,Advance Thanks.
    Regards,
    Sandesh

    Hi Sandesh,
    this is simply not supported, not in WebDynpro nor in standard HTML.
    A workaround is to upload a ZIP with all files and on server side unpack the ZIP and operate on the single files.
    I hope it will  help u..
    ----------------------OR-------------------------
    As you know using File upload UI element we can upload only one file at a time. There may be a scenario where user may want to upload any no of files at a time which is not determined at design time. This can be acheived using the ACF UpDownload UI element which requires a security whiltelist to be created
    http://scn.sap.com/docs/DOC-2270
    ----------------------OR-------------------------
    You can use Table UI element.
    Regards,
    Deepak Singh

  • Problem in Uploading excel file using WebDynpro for Java

    Hi  All
    I have followed for Uploading excel file using WebDynpro for Java added by  Tulasi Palnati
    I done all, but I'm getting 500 Exception please contact u r system admin meag  at run time also  Jxl/Workbook class not found msag  but i downloaded Jxl.jar file and  there is no error signals  in coding part. How can I solve the Problem.
    Thanks
    Polaka

    Please ask the people in the Web Dynpro Java forum for a solution.

  • I need to select and upload a image and corresponding url from an external website using file upload control in MVC4. Please help

    I need to select and upload a image and corresponding  url from an external website using file upload control in MVC4.
    Please help
    Latheesh K Contact No:+91-9747369936

    This forum supports .NET Framework setup.
    As your issue appears to have nothing to do with .NET Framework setup, please ask in the MVC forums for best support.
    http://forums.asp.net/1146.aspx/1?MVC

  • OutOfMemoryError while using File.list()

    I'm facing OutOfMemoryError while using file.list(). Below is the description of the requirement
    We have a directory structure of the following format -
    **sourcedir\<date folders>\No Retry\<reason folders>\..\..\....\<*.ini files>**
    sourcedir will be passed as argument to the program. The directories present in between "<>" can be in multiples of 10. The *.ini files can be in multiple of lacs in each directory.
    The program is required to browse through the directory structure and look for *.ini files. The *.ini files are parsed for some data which needs to be stored in data base. We are using "File.list()" to load the name of files and FileFilter to find *.ini" files. As the number of files are huge the program is throwing OutOfMemoryError. We have increased heap space, it solved the problem. But we are looking for a solution which will not throw this error in future as the number of files may increase.
    Can you please suggest us a technique to solve this permanently as we are beginners to java.

    I suggest you try using a memory profiler to see where your memory is being used.
    The problem you suggest shouldn't consume so much memory.

  • Reading/Writing .xlsx files using Webdynpro for Java

    Dear All
    I have a requirement to read/write excel files in .xlsx format. I am good in doing it with .xls format using jxl.jar. The jxl.jar doesn't support .xlsx format. Kindly help me in understanding how do I need to proceed on reading/writing .xlsx files using Webdynpro for Java.
    Thanks and Regards
    Ramamoorthy D

    i am using jdk 1.6.22 and IBM WebSphere
    when i use poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar  to read .xlsx file. but i am getting following errors
    The project was not built since its classpath is incomplete. Cannot find the class
    file for java.lang.Iterable. Fix the classpath then try rebuilding this project.
    This compilation unit indirectly references the missing type java.lang.Iterable
    (typically some required class file is referencing a type outside the classpath)
    how can i resolve it
    here is the code that i have used
    public class HomeAction extends DispatchAction {
         public ActionForward addpage(
                             ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                             throws Exception {     
                             String name = "C:/Documents and Settings/bharath/Desktop/Book1.xlsx";
               FileInputStream fis = null;
               try {
                   Object workbook = null;
                    fis = new FileInputStream(name);
                    XSSFWorkbook wb = new XSSFWorkbook(fis);
                    XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);
                    Iterator rows = sheet.rowIterator();
                    int number=sheet.getLastRowNum();
                    System.out.println(" number of rows"+ number);
                    while (rows.hasNext())
                        XSSFRow row = ((XSSFRow) rows.next());
                        Iterator cells = row.cellIterator();
                        while(cells.hasNext())
                    XSSFCell cell = (XSSFCell) cells.next();
                    String Value=cell.getStringCellValue();
                    System.out.println(Value);
               } catch (IOException e) {
                    e.printStackTrace();
               } finally {
                    if (fis != null) {
                         fis.close();
                return mapping.findForward("returnjsp");

  • Flex with webdynpro for java using Flex Island

    Hi Friends,
    I am on Netweaver/SAP Enterprise Portal 7.0 SPstack12, I am developing UI for BI reports using VC, I am interested in developing UI using flex and want to integrate those apps with EP, I came to know flux Island supports flux with webdynpro java,  basically I am a webdynpro for java developer, I want to develop flux applications with webdynpro for java in NWDS. And i want to know how to use Flex Island with webdynpro for java. So could u please post some useful links.
    Thank in advance
    Regards
    samba

    Hi
    If you want to try out using ADOBE Flash Islands with WDJ, you would need to download SAP CE 7.1 EhP1 trial version, if not done so already.
    The following link may help you in building the WDJ component with Flash Islands..
    The specified item was not found.
    If you donot want to develop the Flex project you can download the .swf file provided by the SAP mentors:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    Thanks.
    Chitrali

  • How to start to work on MDM JAVA API by using webdynpro for java

    Hi all
    I have basic idea on MDM business package thru portal by using standard iViews.
    now i am planning to work on MDM JAVA APIs by using Webdynpro for Java as UI.
    1) can you please share the required documents on the same. how to start working on this by using MDM JAVA APIs in webdynpro for java
    2) what are the JARs files are required and how to integrate those jar files into webdynpro for java application.
    3)  is there any SDN help on MDM JAVA API with webdynpro for java? . can you please send the link on the same.
    4) can you please help by providing sample code on how to use JAVA APIs for retrieving,deleting,inserting and Updating the data in the database.
    if anybody helps on the same then it is the great help to me.
    points are always rewardable...
    Regards
    Suresh babu

    Hi Suresh,
    You can have the MDM JAVA API javadocs from the link
    http://help.sap.com/javadocs/MDM/SP06P2/index.html
    There you can see a package named com.sap.mdm.examples.The classes in it contains some examples using which you can start understanding the code.
    You need to have MDM JAR files for it. And these JAR files to be used at build time can be added to the project thru :-
    Right click on project-> properties->Java Build Path - > Add external JARs
    At run time you can add them the reference in
    Right click on project-> properties->web dynpro references->library reference.
    Thanks
    Namrata

  • How to use BAPI in webdynpro for java application

    Hi all,
    Please help in getting started with calling a BAPI in a webdynpro for java application. I have got only the content needed to call a BAPI in a webdynpro for abap application but not in java. Kindly provide me some documents if possible.
    Thanks in advance

    Hi ,
    U have Created One Bapi u want to work with web Dyn pro for java Application Right .
    U need the Following
    1) NWDS (Netweaver Devloper Studio )
    2) jdk1.4 or Above installed in your system .
    After Installation of NWDS .
    1) Just Take J2EE Enginee Details
      a) Go to Window -> preferences  -> J2ee Enginee - > give ur port number , Host name Details . and click finsh .
    Go To Web Dyn Pro Perspective Click onj2EE engine .
    Click On Refresh U will see Green Colour button .
    Now ur Ready to import Ur BAPI .
    1) Go to File -> New -> Project - > Web Dyn pro Project -.
    Give Name , pkg Name Click On Finish .
    2) Expand ur project hirarchy -> go TO Application -> Right Click -> Create Application - > Give Application name and Pkg name -> Click on Finish .
    3) Now ur View And Controller Are Created by Default .
    4) Go to Model-> Right Click on it-> Create Model -> Give Model Name & Pkg name Should diff from Application pkg the Click On Next
    a) Here u have to Two JCo Destination Name Like Model Data And Meta data & R/3 System Details like System Number , Host name  Etc -> then Click on next .
    b) Here u will text filed where u want to search for ur Required BAPI . Type ur BAPI Name Click on Search . Ur bapi will be displyed In Down . click on Next .
    c) Now Ur model is Importedint into NWDS .Map ur model data To Controller and Controller Element to View Elements .
    After ur Model .
    Go to -> Project Name -> Right Click -> go to -> Deploy New Archive .
    after wards u have to go Apllication -> Right click -> deploy and Run .
    ur output will be displyed thru Browser .
    Thats it
    Regards ,
    venkat

  • Accessing knowledge management documents using webdynpro for java

    Dear all,
    iam having some documnets in KNLOWLEDGE MANAGEMENT documents folder in portal using webdynpro for java clicking on a link means perner(employee no) i should get that perpicular employee number documents.
    examples documents are stored like this in knowledege management folder 20016319.pdf  ,  20016397.pdf  ,  20016398.
    how to access those employee using webdynpro for java for perticular employee number if i want 20016319
    Send me the code for above requirement and where i have to wrirte that code exactly
    Regards

    Dear Kishore,
    To get the Employee ID you have to create a Adaptive RFC Model (call BAPI) which will return you the employee pernr, for this
    1. Create a model using  : BAPI_EMPLOYEE_GETDATA
    2. Get User ID using the code
    public java.lang.String getUserID( )
        //@@begin getUserID()
         String userID = new String();
              try
                    // getting Logged in userid
                   IWDClientUser myUser = WDClientUser.getCurrentUser();
                   userID = myUser.toString().substring(19).trim();
                   StringTokenizer filterdUID = new StringTokenizer(userID,")");
                   userID = filterdUID.nextToken();
              catch (WDUMException e)
                   e.printStackTrace();
                   return userID;
        //@@end
    3. Execute the BAPI
    public java.lang.String getEmployeeID( java.lang.String userID )
        //@@begin getEmployeeID()
         String employeeID = new String();
              Bapi_Employee_Getdata_Input employeeData = new Bapi_Employee_Getdata_Input();
              Bapi_Employee_Getdata_Output outData = new Bapi_Employee_Getdata_Output();
              Bapip0105B comm = new Bapip0105B();
              com.sap.aii.proxy.framework.core.AbstractList list = new Bapip0105B.Bapip0105B_List();
              list.add(comm);
              employeeData.setUserid(userID);
              Calendar cal = Calendar.getInstance(Locale.UK);
              Date date = new Date(cal.getTimeInMillis());
              employeeData.setDate(date);
              employeeData.setAuthority_Check("");
              employeeData.setCommunication(list);
              outData.addCommunication(comm);
              wdContext.nodeBapi_Employee_Getdata_Input().bind(employeeData);
              wdContext.nodeOutput_BAPI().bind(outData);
            try
                   wdContext.nodeBapi_Employee_Getdata_Input().currentBapi_Employee_Getdata_InputElement().modelObject().execute();
                   wdContext.nodeOutput_BAPI().invalidate();
            catch (WDDynamicRFCExecuteException e) {printMsg("Failed to Obtain Employee Data");
                 e.printStackTrace();
            employeeID = wdContext.nodeBapi_Employee_Getdata_Input().nodeOutput_BAPI().nodeOrg_Assignment().currentOrg_AssignmentElement().getPerno();
            return employeeID;
        //@@end
    Hope it Helps!!
    Warm Regards
    Upendra Agrawal

  • Playing sound/beep on the handheld device using WebDynpro for Java (NW7.01)

    Does anybody know if we could play sounds or beeps on the handheld device using WebDynpro for Java (NW7.01)? We have a client requirement to have the handheld device beeps/makes different kind of sounds after the goods receipt is posted. We are looking for a way to play the sounds thatu2019s saved on the deviceu2019s directory. Appreciate any suggestions or input.
    Thank you!
    Teeracha

    Hi Terracha,
    you can use bellow mentioned methods for playing a sound using javascript :
    function playSound( url ){  
      document.getElementById("sound").innerHTML="<embed src='"+url+"' hidden=true autostart=true loop=false>";
    or
    https://github.com/admsev/jquery-play-sound
    $.playSound('http://example.org/sound.mp3');
    Hope that helps you as a workaround way.
    Regards,
    Srinivas Divakarla

Maybe you are looking for

  • How to export full dump and metadata of particular table

    let us consider mytest schema is having 6 tables tname tabtype myt table myaxpertlog table abb table ccc table ddd table xxx table now from this schema i want full dump and also from myaxpertlog table i required metadata only not records. c:> export

  • Burning in Date/Time

    Can Premier Pro add date and time stamps to the clips that I import from by video camera? ======================================================================== Title edited by moderator to make it specific to the question. [On a forum that's dedic

  • Cisco UCCE/UCCH 7.2: need a NMS system

    Dear all, I have a ICM system with alot of component spreading on alot of servers. In each component, there are too many of processes. But I don't have any NMS system to monitor and alarm if any error. I want a NMS to respone one by one event: there

  • Change location of Special Folders in Mac OS X 10.5

    Hello, I want to change the location of some of the Special Folders in Mac OS X 10.5. I am specially interested in changing the location of Documents, Images, Music, Videos and Downloads. In Mac OS X 10.4 it was easy to move at least all the special

  • Layout change in ITS for SAP Retail Store

    Hi, We need to change standard layouts provided in SAP Retail store for Sales Invoice, Stock transfer note etc.we are using WAS 6.40 version. The requirement is to add some additional fields in the layout that gets displayed as standard in web. Pleas