Junk Characters while persisting data with CMP beans

Hi
when i am entering some data and saving the data to the data base using CMP beans ,its converting the data to junk characters like ��@y some times .Do you have any idea why its happening ?pls respond asap

whats the data type you are using ? whats the App. server, the database ?

Similar Messages

  • Handling BLOBs with CMP Beans

    Hi,
    is there a detailed example how to handle Blob's with CMP Beans?
    I'm trying to store some images in a database (Oracle 9i) using CMP Beans and Oracle iAS 9.03 and jdk 1.4.
    Thanks in advance
    Jens

    We are currently developing a How-To on this and will put this on OTN.
    1) Code snippet from Bean Class:
    public abstract byte[] getPicture();
    public abstract void setPicture(byte[] newPicture);
    public Long ejbCreate(Long empno, byte[] newPicture)
    setEmpno(empno);
    setPicture(newPicture);
    return empno;
    public void ejbPostCreate(Long empno, byte[] newPicture)
    2) Mapping in the orion-ejb-jar.xml:
    <entity-deployment name="EmployeePicture" data-source="jdbc/OracleDS" table="EMPPIC">
    <primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(8)"/>
    </primkey-mapping>
    <cmp-field-mapping name="empno" persistence-name="EMPNO" persistence-type="NUMBER(8)"/>
    <cmp-field-mapping name="picture" persistence-name="PICTURE" persistence-type="BLOB(4000)"/>
    </entity-deployment>
    3) Create the client to create the bean:
    Long empNo =(Long) Long.valueOf(request.getParameter("EmpNo"));
    String fileName =request.getParameter("ImageFileName");
    InputStream is = new BufferedInputStream(new FileInputStream(fileName));
    int len;
    // Initialize byte array
    byte byteValue[] = new byte[2048000];
    len = is.read(byteValue);
    EmployeePictureLocal employeePicture = empHome.create(empNo , byteValue);
    out.println("Picture of Emp#:"+empNo +" successfully Loaded into DB <br> <br>");
    4) Code snippet to view the image :
    Long empNo =(Long) Long.valueOf(request.getParameter("EmpNo"));
    out.println("Picture of Emp#"+empNo);
    EmployeePictureLocal emp = empHome.findByPrimaryKey(empNo);
    response.setContentType("image/jpeg");
    OutputStream os = null;
    os = response.getOutputStream() ;
    byte[] pic = emp.getPicture();
         os.write(pic);
    os.close();
    os = null;
    Let me know if this helps
    thanks
    Debu

  • Problem while uploading data with GUI UPLOAD Function

    Hi,
      I am facing problem while uploading data with FM GUI UPLOAD    in out text file there are 7 row  but after the FM GUI UPLOAD  there are 14 entries are coming in Internal table   and each alternate row is coming as blank  with  0000 in some column   in internal table first row is proper and second line is blank so on.
    what can be the problem .
    The program in which we are using this we are using it from last 2 year but we are facing problem today only.
    regards,
      zafar

    Hi,
      The file formate is same as it is from last two years it is automatically generated by one another bar code server and there is no change  in the file formate.
      So waht can be the problem  to check any inconsistancy in system  i have develop a samll program fro  uploading a text file with same function module ,  but it is working fine.
    regards,
      zafar

  • Caching data with Entity Bean

    Hello,
    I am performing some tests concerning the benefit of caching data with Entity Bean.
    Here is the case :
    I have an Entity Bean with a business method getName() to retrieve a name field in the EJB.
    I understand that in order to cach data, I have to set the NOT_SUPPORTED transaction attr for this method. In this way, when this method is called, the ejbReload() is not called and the data is retreived from the EJB ready instance (and not from the database).
    Is it true and is it the good way to use the cach mechanism ?
    Now if we consider that this instance is the only one in the ready stage, and it is never pooled (it seems so !), what about a modification of the database from a tier (or from an other EB instance)? The Entity Bean is not able to see this modification seence it does not call the ejbLoad method.
    Is there a way to force an Entity Bean to be periodically polled in order to recover data from the data store when activated ?
    Thanks in advance,
    Thierry

    No, This is wrong way of doing what you want. Most of the application servers provide various configuration settings for this. Eg. caching mechanism, interval on when to call ejbLoad and ejbStore, read only beans. You have to check the documentation for this.
    --Ashwani

  • How to remove special characters while typing data in edit cell in datagrid in flex4

    Hi Friends,
    I am facing this problem "how to remove special characters while typing data in edit cell in datagrid in flex4".If know anyone please help in this
    Thanks,
    Anderson.

    Removes any characters from
    @myString that do not meet the
    provided criteria.
    CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
    RETURNS varchar(500) AS
    BEGIN
    While @myString like '%[^' + @validChars + ']%'
    Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
    Return @myString
    END
    Go
    Declare @testStr varchar(1000),
    @i int
    Set @i = 1
    while @i < 255
    Select
    @TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
    @i = @i + 1
    Select @TestStr
    Select dbo.GetCharacters(@TestStr,'a-z')
    Select dbo.GetCharacters(@TestStr,'0-9')
    Select dbo.GetCharacters(@TestStr,'0-9a-z')
    Select dbo.GetCharacters(@TestStr,'02468bferlki')
    perfect soluction

  • Mapping Dates with CMP

    Hello,
    It seems that the old requirement to represent persistent Dates using a
    database, low-level java.sql.Date CMP type instead of a classic,
    business-level, java.util.Date is still valid. I can understand the
    technical need for a java.sql.Date as a low-level issue but I don't
    unterstand why we need to get it at the EJB level. It's sad to see that,
    even at the EJB 2.0 Abstract Persistence Schema level, we still have to
    jungle with java.sql.Dates.
    Maybe someone can give me a good reason for that ?
    Jérôme.

    java.util.Date will be supported in the GA release.
    Please only post message to one newsgroup only.
    Michael
    "Jérôme Beau" wrote:
    Hello,
    It seems that the old requirement to represent persistent Dates using a
    database, low-level java.sql.Date CMP type instead of a classic,
    business-level, java.util.Date is still valid. I can understand the
    technical need for a java.sql.Date as a low-level issue but I don't
    unterstand why we need to get it at the EJB level. It's sad to see that,
    even at the EJB 2.0 Abstract Persistence Schema level, we still have to
    jungle with java.sql.Dates.
    Maybe someone can give me a good reason for that ?
    Jérôme.

  • Error Occuring While Processing Data With DIAdem 8.1Excepti​on EAccessVio​lation in module ntdll.dll at 000111DE. Access violation at address 7C9111DE in module 'ntdll.dll​". Read address 37363430

    Hello,
    We are having an issue running Diadem 8.1 on a new HP XW 9400 with Windows XP SP2. 3 errors have been occuring with frequent crashes, they are:
    1) "1Exception EAccessViolation in module ntdll.dll at 000111DE. Access violation at address 7C9111DE in module 'ntdll.dll". Read address 37363430.
    2) The instruction at "0x7c9111de" referenced memory at "0x352e302d". The memory could not be "read".
     3) ---Error---   DIAdem
    Error in Autosequence - processing in line: 74 (IARV_VAR_GET)
    Runtime Error while executing command "Iarv2Txt$ := FR(T9,L1)"
    Error type: ACCESS VIOLATION
    Error address: 000101DE
    Module name:ntdll.dll
    We are using the same scripts and version 8.1 on a variety of Dell desktop computers (W2K and XP SP2) without any issue, looking for suggestions as this affects no other software on the HP XW 9400 other than DIAdem. Appreciate any suggestions.
    Message Edited by swillh on 06-25-2007 08:55 AM

    Christian,
    I will answer your questions in the text below. Thanks for your help.
    Hi swillh,
    I also would like to help you.
    Unfortunately, The reported access violation in the central Windows ntdll.dll is very unspecific.
    May be the following questions will help you to provide me more info.
    1. You mentioned that the aut's and - I think - also the accessed text file reside on a server.
    Is there a stable network connection?
    The server can sometimes be a little slow but the connection is good. This computer is using the same connection that the prior computer utilized without issue.
    Are the files accessed by multiple clients simultaneously?
    It is possible that more than one computer can be accessing the same file, but again, this has never been an issue. We are reading the files only, not writing to them.
    The processing routines we are running have used for over 5 years without any issues until adding this computer.
    Is the text file read by one client while another client is writing the same file?
    No, files are "read only"
    2. Have you already tested opening the file with the FileOpen command before calling FR?
    Yes
    Do you see any chance to convert the aut to a vbs file? This gives you more alternatives in accessing text files.
    3. What do you mean with "processing ATD's with 30 or more channels of data"? Where is the relation between ATD files and data channels?
    Processing Crash Dummy data with file sets low in channel count (15 channels) result in successful processing without any crashes or access errors.  When processing dummies with more than 20 channels we sometimes encounter these issues. The higher channel count may be the only common factor I can find in these faults.
    Steve
    Message Edited by swillh on 07-09-2007 08:44 AM

  • Partial queries with CMP beans

    Hi,
    I have a custom finder method called findBySurname which takes in a string. I've set up the partial query to read: surname=$1 (where surname is the cmp field mapped to the table column). I've checked the orion-ejb-jar.xml file and the query has been inserted. However, when I run the sample client, I get a resultset that contains all the records in the table! I've got similar finder methods on 3 CMP beans and they all do the same thing. Is this a bug in the Release Candidate 2 version of Jdeveloper (which I'm using) or am I missing something?
    Thanks in advance,
    Gillian

    Known Issues along with the bug # are documented in the release notes of the product.
    You can see the release notes from Help menu of the product.
    raghu
    JDev Team

  • Error while importing data with DTW

    Hi Guys,
    I received an error when i try to upload data with DTW
    method '~' of object '~' failed65171
    When i click on run simulation again,
    I received another error 65172.
    There's two different error.
    Can anyone help?

    Hi,
    This error means that your Obscommon user is corrupt and you  cannot connect to the SBO-Common database to download the  OBServer.dll that is stored in the temporary directory.
    For more information, see SAP Note 858475, 642564, or 614946.
    Thanks & Regards,
    Nagarajan

  • Junk Characters while opening a file from webdynpro ABAP

    Hi All,
    We have a Webdynpro ABAP application ,  in that application from a link we are opening DOC,PDF,JPG........files . When we click on that link it is opening in a Junk charcters .  We have another webdynpro ABAP application in portal , in that application the files are opening fine.
    Could you please let me know why it is opening in a junk characters in first application?
    Regards,
    Krishna.

    Hi ,
    The files are opening fine in IE7 but when we try to open in IE8 and IE9 they are opening in a junk characters.
    I am not sure in another webdynpro ABAP application the files opening correctly in IE 8 .
    Regards,
    Krishna.

  • Problem with Polish Characters while downloading data using GUI_DOWLOAD

    Hi,
    I was trying to create a file on the presentation server using GUI_DOWLOAD.
    I am facing a problem with the data that contains polish characters.. like Ą , Ł..
    There is  a vendor numer in the system as FRĄCZEK, when i was tring to download, the vendor number is downloaded as FR¥CZEK, even i tried to download from SE16 also, still i am facing the same problem.
    I am facing the above problem with soem other polish characters..
    Is there any solution  to download the data properly.. ?
    Guys please help me.
    Thanks in advacnce.
    Regards,
    Sriram.
    Edited by: Srirama Murthy Maddirala on Oct 27, 2009 8:10 AM

    Hi Sriram,
    <li>Get the front-end code page using NLS_GET_FRONTEND_CP.
    <li>Pass the code page through GUI_DOWNLOAD.
    REPORT  ztest.
    TYPE-POOLS:abap.
    DATA:frontend_codepage TYPE  cpcodepage.
    DATA:codepage          TYPE  abap_encoding.
    "Get the Frontend Code page
    CALL FUNCTION 'NLS_GET_FRONTEND_CP'
      EXPORTING
        langu             = sy-langu
      IMPORTING
        frontend_codepage = frontend_codepage.
    "Pass the codepage through GUI_DOWNLOAD function module
    codepage = frontend_codepage.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = 'C:\temp\data.xls'
        filetype = 'ASC'
        codepage = codepage
      TABLES
        data_tab = it_data.
    Thanks
    Venkat.O

  • Problem with CMP bean and MySQL: please help me!!!

    Hi,
    I am using J2EE Sun server 1.3 and Mysql 4.0 database with its MySQL Connector/J 3.0.
    The driver connection to the database is fine since "Generate Default SQL" in deploytool gives "SQL generation complete".
    However, I can't have a simple row with one text field called test being created in my mysql table called test.
    Of course , the mysql server is started and the test table set for use.
    Here is my code (I try to access my database from a servlet using a CMP Entity bean):
    try{
    Context initial = new InitialContext();
    Object objref = initial.lookup(EntityHome.JNDI_NAME);
    EntityHome home = (EntityHome)PortableRemoteObject.narrow(objref,EntityHome.class);     
    Entity test= home.create("zob");               
    /*EntityHome home = (EntityHome)PortableRemoteObject.narrow(objref,EntityHome.class);     
    catch (Exception ex){                                                                out.println("exception message : " + ex.getMessage()+"</body></html>");}
    I get the following exception message :
    RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: nested exception is: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"EntityCMPTable" WHERE "test" = 'zob'' at line 1"; nested exception is: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"EntityCMPTable" WHERE "test" = 'zob'' at line 1"
    I would be very grateful for help since I have a close deadline for this!!!!!!!!
    Thank you very much in advance dear java experts!!!!!!!
                                       

    Hallo
    I have the same problem and the same configuration.
    Do you have a solution for this problem ??
    Thanks
    Georg

  • Problem with CMP BEAN ON SUN JAVA APPLICATION SERVER 1.3.1

    I am trying to deploy an entity bean with container managed persistence on sun java app. server 1.3.1. When I go for Deploy, the error 'SQL code not generated for following beans' is comming, when verified with verifier tool, the error shown is 'transaction attributes are not specified' , What should be the problem ?

    Which appserver are you using exactly? the J2EE 1.3.1 RI, SJAS 7.0, SJSAS 7.1....etc
    You need to make sure for that you have specified the correct deployment attributes for your CMP methods. You can pull the ear/jar into deploytool and review it there

  • Problem with chinese characters while sending mail with .CSV attachment

    Hi,
    i am sendin .CSV file as an attachment with mail using "SO_DOCUMENT_SEND_API1" FM,
    whle opening the mail attachment the chinese characters are not displaying properly.
    currently i am using ECC 5.0
    can any body help in this regard.
    Thanks,
    Rahim

    Hi Kang Ring,
    please convert the content of the attachement into the binary format and then add it as a mail attachment.
    LOOP AT i_data ASSIGNING <wa_data>.
    if s_output is INITIAL.
    CONCATENATE <wa_data> cl_abap_char_utilities=>cr_lf into s_output.
    else.
    CONCATENATE s_output <wa_data> INTO s_output SEPARATED BY cl_abap_char_utilities=>cr_lf.
    endif.
    ENDLOOP.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = s_output
    IMPORTING
    buffer = x_output.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = x_output
    TABLES
    binary_tab = imail_att.
         OR
    please use ABAP-Object classes like CL_BCS , CL_document_BCS.....
    please findthe below sample code.
      cl_bcs_convert=>string_to_solix(
              EXPORTING
                iv_string   = s_output
                iv_codepage = '4103'          "suitable for MS Excel, leave empty
                iv_add_bom  = 'X'               "for other doc types
              IMPORTING
                et_solix  = s_output_binary  "(of type solix_tab)
                ev_size   = size ).
    attachment->add_attachment(                       "attachment of type ref to cl_document_bcs
              i_attachment_type    = 'xls'                     
              i_attachment_subject = l_subject    
              i_attachment_size    = size
              i_att_content_hex    = s_output_binary ).
    you need to write the code for adding the receipents, subject and adding this "attachment " as an attachment to the mail.
    Hope this will helps to you....,
    thanks,
    Rahim.

  • Error:UNCAUGHT_EXCEPTION while loading data with exception  CX_RSR_X_MESSAG

    Hi,
    Ours is a fresh installation..
    When i am loading for the first time till PSA it is successful..
    As HR data sources are 3.5 datasources, i am loading cube via infopackage..
    When i start the load to cube it is giving me dump with exception CX_RSR_X_MESSAG.
    i checked note  615389 which talks about "buffering of number range object BIM9999998".  the 0REQID is not buffered, but it does not throw any error msg in RSRV to correct the error..
    and one more note 1157796 which talks about patches with version BI 7.0.
    Now we are in BI 730 with heighest level 0005.
    Not sure how to solve this error
    Any ideas?

    S Simran wrote:
    Hi,
    >
    > Ours is a fresh installation..
    >
    > When i am loading for the first time till PSA it is successful..
    >
    > As HR data sources are 3.5 datasources, i am loading cube via infopackage..
    >
    > When i start the load to cube it is giving me dump with exception CX_RSR_X_MESSAG.
    >
    > i checked note  615389 which talks about "buffering of number range object BIM9999998".  the 0REQID is not buffered, but it does not throw any error msg in RSRV to correct the error..
    >
    > and one more note 1157796 which talks about patches with version BI 7.0.
    >
    > Now we are in BI 730 with heighest level 0005.
    >
    > Not sure how to solve this error
    >
    > Any ideas?
    What's your SP? Are you having any master data updates left unattended? Check the Master data objects, check the flows. Related SAP Notes : 914304 / Check 967202(SP10) and 998673(SP11), 1157796, 763203 and 615389
    Edited by: Arun Bala G on Feb 12, 2012 9:50 PM

Maybe you are looking for