ByteArray to String and String to ByteArray  error at readUTF from datainpu

hi everybody this is my first post I hope I can find the help I need I have been doing some research and couldnt find the solution thanks in advanced
The Objective:
im building a client server application with java and I need to send a response from the server to the client via Socket
so the response is like this : <Signal : ByteArray> where Signal is a String so the client can Identify the Type of response
and the ByteArray is an Array of bytes containing the Information I need
The Problem:
I have an Array of bytes containing the info to send and I need to pass this byte[] to a String add some String that let me Identify the data in the client side then remove the identifier in the client side and convert the resulting String back to an array of bytes this doesnt work
The Code:
Server Side (Creating the Byte Array):
public byte[] createData(){
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                DataOutputStream dos = new DataOutputStream(baos);               
                dos.writeUTF(requestedFile.getName());
                dos.flush();
                byte[] data = baos.toByteArray();
                return data;
}Server Side (Converting the byte[] to String and Add some Identifier)
byte[] data= createData(); //Obtain the data  in a byte[]
String response = new String(data);  //Convert the Data to String
String Identifier= "14"; // to identify in the client side the data received this will be removed later
response = Identifier+response;  // add the identifier to the String
sendToClient( response.getBytes() );  //obtain bytes from the complete Response and send them to clientClient Side ( Receive the response that is a byte array containing the identifier plus the info <Identifier : info> )
            int index=response.indexOf(":")+1;  //find the index of the : so i can delete the identifier
            response=response.substring(index); // delete the identifier
            byte[] data = response.getBytes(); // obtains the bytes for the info ONLY cause the string no longer has identif
            receiveData ( data ); // send the data to be read by this method Client Side (Receive the Info sent from the server and read it)
            public void receiveData ( byte[] data ) {
               ByteArrayInputStream bais = new ByteArrayInputStream ( data );
               DataInputStream dis= new DataInputStream ( bais );
               setTotalSize ( dis.readUTF( ) ); // here is the error  it catches an EndOfFileException without read the info
            }im tried sending other values like long and int and i was able to read them but the problem is with the Strings at the ReadUTF()
Im tried to be the most clear as possible please help me this is driving me nuts
and I would really appreciatte all your comments thanks

lemaniak wrote:
The Objective:
im building a client server application with java and I need to send a response from the server to the client via Socket
so the response is like this : <Signal : ByteArray> where Signal is a String so the client can Identify the Type of response
and the ByteArray is an Array of bytes containing the Information I need
The Problem:
I have an Array of bytes containing the info to send and I need to pass this byte[] to a String add some String that let me Identify the data in the client side then remove the identifier in the client side and convert the resulting String back to an array of bytes this doesnt workFirst of all, well done: a nicely explained problem. I wish more people were as clear as you.
Second: I'm no expert on this stuff, so I may well be wrong, but I did note the following:
1. I can't see anywhere where you're putting out the ":" to separate your signal.
2. You seem to be doing an awful lot of conversions from Strings to bytes and vice-versa, but only your filename is specified as a UTF-8 conversion. Could you not do something like:
dos.writeUTF("14:" + requestedFile.getName());or indeed, more generically
dos.writeUTF(signal + ":" + messageBody);from inside a createMessage() method.
3. You haven't included the sendToClient() code, but your createData() looks suspiciously like what I would put in a method like that.
From what I understand, you usually want mirror-images of your streams at your sending and receiving ends, so if your client is expecting an DataInputStream wrapping a ByteArrayInputStream to be read via readUTF(), your server better be sending a ByteArrayOutputStream wrapped in a DataOutputStream created, in its entirety, by writeUTF().
But after your UTF conversion, you're adding your signal and then using String.getBytes(), which uses the default character set, not UTF.
HIH (and hope I'm right :-))
Winston

Similar Messages

  • ODBC functions SQLExecDirectW and SQLExecute functions return error:"DIAG [22001] [Microsoft][SQL Server Native Client 10.0]String data, right truncation (0) "

    Problem Description:
    ODBC functions SQLExecDirectW and SQLExecute functions return error:”DIAG [22001] [Microsoft][SQL Server Native Client 10.0]String data, right
    truncation (0) “. When we enable tracing in the ODBC administrator, in the SQL.log we see that values for the arguments: ColumnSize, BufferLength, and StrLen_or_IndPtr of ODBC function SQLBindParameter are not being displayed.
    Environment Used:
    OS: Microsoft Windows Server 2003 R2 Standard x64 Edition.
    Complier: Microsoft Visual Studio 2008 SP1 for x64.
    Database: Microsoft SQL Server 2008
    MDAC: Microsoft Data Access Components SDK 2.8
    Note: This problem is seen only in our 64bit application. However, in 32bit
    SQLExecDirectW and SQLExecute functions return successfully.
    As we could not find the values of 6<sup>th</sup>, 9<sup>th</sup> and 10<sup>th</sup> arguments(ColumnSize,
    BufferLength, and StrLen_or_IndPtr) passed to
    SQLBindParameter in the ODBC traces for 64bit, we are not sure whether the values for the above mentioned arguments are received correctly by SQLBindParameter or not. This information would help us to debug further. So, could you please let us know why
    these values are not displayed.
    1)Here is the extract of the SQL.log file for 32bit where the values for SQLULEN , SQLLEN and SQLLEN* are displayed properly:
    PR0CNFG 1028-15f0 ENTER SQLBindParameter
    HSTMT 0x006FBDD8
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN 23
    SWORD 0
    PTR 0x0595EBBA
    SQLLEN 46
    SQLLEN * 0x05A5FB00
    2)Here is the extract of the SQL.log file for 64bit where the values for SQLULEN , SQLLEN are not displayed properly and
    SQLExecDirectW function return error:”DIAG
    [22001] [Microsoft][SQL Server Native Client 10.0]String data, right truncation (0) “. :
    PR0CNFG a78-fe4 ENTER SQLBindParameter
    HSTMT 000000000431D2F0
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN SQLULEN SWORD 0
    PTR 0x0000000005364EFA
    SQLLEN SQLLEN
    SQLLEN * SQLLEN *
    PR0CNFG a78-fe4 EXIT SQLBindParameter with return code 0 (SQL_SUCCESS)
    HSTMT 000000000431D2F0
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN SQLULEN SWORD 0
    PTR 0x0000000005364EFA
    SQLLEN SQLLEN SQLLEN *

    Hi Nalsr,
    From my research, I found:
    "[Microsoft][ODBC SQL Server Driver]String
    data right truncation" error may be returned from a call to
    SQLBindParameter if the size of the string parameter being used is greater than the size of the column being compared to. In other words if the
    string size of the <expression> to the left of the <comparison_operator> is less than the
    string size of the <expression> to the
    right, ODBC may return this error.
    The resolution is to make the string size of the <expression> to the
    right of the <comparison_operator> less than or equal to the
    string size of the <expression> on the left.
    It is difficult to track down this type of problem when third party development applications are being used. ODBC Trace can be used to help determine if this problem is occuring.
    Here is an example where the customer has submitted a query "select count(*) from type1 where type1 = ?", type1 is varchar(5) and the
    data type being passed by the application is char[9].
    Here is the relevant portion of the trace. The following information from the "exit" of SQLDescribeParam
    SWORD * 0x0095e898 (12)
    UDWORD * 0x0095e880 (5)
    Maps to the following with the actual value in parenthesis - SQL_VARCHAR Size 5:
    SQLSMALLINT *DataTypePtr
    SQLUINTEGER *ParameterSizePtr
    The "exit" value from SQLBindParameter provides the following
    information:
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD 1 <SQL_C_CHAR>
    SQL Data Type SWORD 12 <SQL_VARCHAR>
    Parameter Size UDWORD 5
    SWORD 0
    Value PTR 0x0181c188
    Value Buffer Size SDWORD 5
    String Length SDWORD * 0x0181c103 (9)
    The string length parameter is the length of the
    string being bound to the parameter, in this instance there is a size mismatch which results in the SQLError and the SQLErrorW with the message "[Microsoft][ODBC SQL Server
    Driver]String data
    right truncation" .
    Hope this could be helpful.
    Best regards,
    Halin Huang

  • Strange "Scan From String" to Timestamp Error

    hi,
    i am trying to parse my time-string into a Time Stamp with "Scan From String" but i get some strange Error(1).
    The Code:
    The Error:
    can anyone confirm? do i have an error in my parser-string?
    is it possibly related to this Bug
    461196
    Scan From String VI returns Error 1 with "%t" as the format string input
    http://www.ni.com/product-documentation/52151/en/
    that should be fixed?
    my labview version is
    LV 2014 Service Pack 1 -- Version 14.0.1 (32bit)
    with the RealTime addon (but the code in question was not run on RT)
    thanks for your time.
    Solved!
    Go to Solution.

    Why do you have the square brackets around the scan from string format string? They are not there when you generate the timestamp string so it will fail when trying to convert it back as they are expected to be there.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Unflatten From String causes runtime error in LV2009

    I found this error when trying suggestions made in this thread.
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=458335
    Unflaten from string causes runtime Error 74 possible reason(s) Memory or data structure corrupt.
    Attachments:
    Unflatten runtime error.vi ‏8 KB
    error1.jpg ‏13 KB

    Of course you are getting the error. The data types are inconsistent. You convert the cluster to an array. You then define the type of flattened string as a cluster. Either don't convert to an array or define the data type as an of paths. Look again at the examples in that post.

  • If image file not exist in image path crystal report not open and give me exception error problem

    Hi guys my code below show pictures for all employees
    code is working but i have proplem
    if image not exist in path
    crystal report not open and give me exception error image file not exist in path
    although the employee no found in database but if image not exist in path when loop crystal report will not open
    how to ignore image files not exist in path and open report this is actually what i need
    my code below as following
    DataTable dt = new DataTable();
    string connString = "data source=192.168.1.105; initial catalog=hrdata;uid=sa; password=1234";
    using (SqlConnection con = new SqlConnection(connString))
    con.Open();
    SqlCommand cmd = new SqlCommand("ViewEmployeeNoRall", con);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    da.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    FileStream fs = null;
    fs = new FileStream("\\\\192.168.1.105\\Personal Pictures\\" + dr[0] + ".jpg", FileMode.Open);
    BinaryReader br = new BinaryReader(fs);
    byte[] imgbyte = new byte[fs.Length + 1];
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dr["Image"] = imgbyte;
    fs.Dispose();
    ReportDocument objRpt = new Reports.CrystalReportData2();
    objRpt.SetDataSource(dt);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Refresh();
    and exception error as below

    First: I created a New Column ("Image") in a datatable of the dataset and change the DataType to System.Byte()
    Second : Drag And drop this image Filed Where I want.
    private void LoadReport()
    frmCheckWeigher rpt = new frmCheckWeigher();
    CryRe_DailyBatch report = new CryRe_DailyBatch();
    DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter ta = new CheckWeigherReportViewer.DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter();
    DataSet1.DataTable_DailyBatch1DataTable table = ta.GetData(clsLogs.strStartDate_rpt, clsLogs.strBatchno_Rpt, clsLogs.cmdeviceid); // Data from Database
    DataTable dt = GetImageRow(table, "Footer.Jpg");
    report.SetDataSource(dt);
    crv1.ReportSource = report;
    crv1.Refresh();
    By this Function I merge My Image data into dataTable
    private DataTable GetImageRow(DataTable dt, string ImageName)
    try
    FileStream fs;
    BinaryReader br;
    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImageName))
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    else
    // if photo does not exist show the nophoto.jpg file
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    // initialise the binary reader from file streamobject
    br = new BinaryReader(fs);
    // define the byte array of filelength
    byte[] imgbyte = new byte[fs.Length + 1];
    // read the bytes from the binary reader
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dt.Rows[0]["Image"] = imgbyte;
    br.Close();
    // close the binary reader
    fs.Close();
    // close the file stream
    catch (Exception ex)
    // error handling
    MessageBox.Show("Missing " + ImageName + "or nophoto.jpg in application folder");
    return dt;
    // Return Datatable After Image Row Insertion
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Bi Dashboards issue works properly some times and after not display pointers data and give un expected error and throw login window

    HI,
    I have toff situation where  we deployed bi dashboards in our site and it works some time and some times not,
    and some times it keep loading and throw a login window.
    works when
    we restart performance point service  and if not work
    we re create secure store service and generated new key and create new pps service application
    before that we stopped secure store and pps service  using c.a in application server
    we are using ssas for datasource to connect  from dashboard designer
    we have seperate server for ssas dbs
    seperate application server running: pps service and secure store service
    two web front ends:  one of running secure store
    1 Domain controller + central admin service running
    some times after 4 -5 hours bi dashboards works , we dashboards not display data and throw un expected errors,
    also when we try to connect using a dashboard designer from a seperate client machine in same domain ,we have same issue , we unable to connect to ssas datasource server, and if connect some times unable to deploy dashboards.
    we tried every thin icreased server time out values  in ssas server
    :\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Config\msmdsrv.ini. in this location
    and in 
    c:\program files\common files\microsoft shared\web server extensions\14\webclients\ppsmonitoringServer\client.config
    maxStringContentLength="2147483647"
    maxNameTableCharCount="2147483647"
    maxBytesPerRead="2147483647"
    maxArrayLength="2147483647"
    maxDepth="2147483647" />
    even we have same issue
    is some thing happening when dashboards working some time and  after some time not 
    is a secure store crashing or its still request pending in IIS and not authenticating to data soruce why 
    below are the logs
    Here are the results of the log analysis :
    server wfe1 
    09/01/2014 14:43:44.66 w3wp.exe (0x2128) 0x158C PerformancePoint Service PerformancePoint Services 39 Critical A PerformancePoint service application call was aborted by the caller.  This may indicate the HttpRuntime executionTimeout for the Web Application
    is configured to a value smaller than the DataSourceQueryTimeout for the PerformancePoint Service Application. 8bc44f14-acef-49bf-b1c1-2755ea7e6e24
    09/01/2014 14:43:44.66 w3wp.exe (0x2128) 0x158C PerformancePoint Service PerformancePoint Services ef8z Critical ‏‏حدث
    استثناء
    أثناء عرض
    عنصر ويب.
    قد تساعد
    معلومات التشخيص
    التالية في
    تحديد سبب
    هذه المشكلة:  Microsoft.PerformancePoint.Scorecards.BpmException: ‏‏لقد
    انتهت
    مهلة الطلب
    أو تم
    إجهاضها. تم
    تسجيل تفاصيل
    إضافية من
    أجل المسؤول.  ‏‏رمز
    خطأ "خدمات PerformancePoint"
    هو 20700. 8bc44f14-acef-49bf-b1c1-2755ea7e6e24
    09/01/2014 14:43:44.66 w3wp.exe (0x2128) 0x158C SharePoint Foundation Runtime ba3q Medium Redirect to error.aspx?ErrorText=Request%20timed%20out%2E failed. Exception: System.Web.HttpException: The remote host closed the connection. The error code is 0x800704CD.    
    at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)     at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()     at System.Web.HttpResponse.Flush(Boolean finalFlush)    
    at System.Web.HttpResponse.End()     at Microsoft.SharePoint.Utilities.SPUtility.Redirect(String url, SPRedirectFlags flags, HttpContext context, String queryString) 8bc44f14-acef-49bf-b1c1-2755ea7e6e24
    09/01/2014 14:47:32.69 w3wp.exe (0x2128) 0x2154 Web Content Management Publishing Cache 7363 Critical Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases. To configure the account use
    the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.  Additional Data:  Current default
    super reader account: NT AUTHORITY\LOCAL SERVICE 78c107cd-0d4b-46f5-8e1a-0d9b4ebc7b29
    09/01/2014 15:07:40.74 w3wp.exe (0x2128) 0x209C PerformancePoint Service PerformancePoint Services 20 Critical The user "i:Anonymous" attempted to access an item in the following location:
    http://www.xxx.xxx.sa/ar-sa/Notary/Rspointer/Lists/PerformancePoint Content/28_.000  Verify that the location exists and that the user has the "Read Items" permission. 
    Exception details: Microsoft.PerformancePoint.Scorecards.BpmException: ‏‏لقد
    انتهت
    مهلة الطلب
    أو تم
    إجهاضها. تم
    تسجيل تفاصيل
    إضافية من
    أجل المسؤول.     at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location, SPListItem item)    
    at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location)     at Microsoft.PerformancePoint.Scorecards.Store.SPDataStore.SPItemGet(RepositoryLocation location, String
    spObjectTypeId) abf0263d-7333-4e4f-9cd4-a3a4dcb700c0
    09/01/2014 15:13:25.92 w3wp.exe (0x2128) 0x18DC PerformancePoint Service PerformancePoint Services 20 Critical The user "i:Anonymous" attempted to access an item in the following location:
    http://www.xxx.xxx.sa/ar-sa/Notary/Rspointer/Lists/PerformancePoint Content/218_.000  Verify that the location exists and that the user has the "Read Items" permission. 
    Exception details: Microsoft.PerformancePoint.Scorecards.BpmException: ‏‏لقد
    انتهت
    مهلة الطلب
    أو تم
    إجهاضها. تم
    تسجيل تفاصيل
    إضافية من
    أجل المسؤول.     at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location, SPListItem item)    
    at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location)     at Microsoft.PerformancePoint.Scorecards.Store.SPDataStore.SPItemGet(RepositoryLocation location, String
    spObjectTypeId) b35bf864-54f4-43fa-88a8-44cdf938bfa2
    09/01/2014 15:11:10.87 w3wp.exe (0x2128) 0x1F88 PerformancePoint Service PerformancePoint Services 20 Critical The user "i:Anonymous" attempted to access an item in the following location:
    http://www.xxx.xxx.sa/ar-sa/Courts/Bic/Lists/PerformancePoint Content/4_.000  Verify that the location exists and that the user has the "Read Items" permission. 
    Exception details: Microsoft.PerformancePoint.Scorecards.BpmException: ‏‏لقد
    انتهت
    مهلة الطلب
    أو تم
    إجهاضها. تم
    تسجيل تفاصيل
    إضافية من
    أجل المسؤول.     at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location, SPListItem item)    
    at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location)     at Microsoft.PerformancePoint.Scorecards.Store.SPDataStore.SPItemGet(RepositoryLocation location, String
    spObjectTypeId) 7cea0eb6-214f-4d7b-a6e7-97a0fe11c956
    09/01/2014 15:11:40.87 w3wp.exe (0x2128) 0x2150 PerformancePoint Service PerformancePoint Services 20 Critical The user "i:Anonymous" attempted to access an item in the following location:
    http://www.xxx.xxx.sa/ar-sa/Notary/Rspointer/Lists/PerformancePoint Content/162_.000  Verify that the location exists and that the user has the "Read Items" permission. 
    Exception details: Microsoft.PerformancePoint.Scorecards.BpmException: ‏‏لقد
    انتهت
    مهلة الطلب
    أو تم
    إجهاضها. تم
    تسجيل تفاصيل
    إضافية من
    أجل المسؤول.     at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location, SPListItem item)    
    at Microsoft.PerformancePoint.Scorecards.Store.Dao.SPListItemDao.Get(ISPFcoCache cache, Guid webSiteID, RepositoryLocation location)     at Microsoft.PerformancePoint.Scorecards.Store.SPDataStore.SPItemGet(RepositoryLocation location, String
    spObjectTypeId) 4154222b-6ff0-4b64-81b8-d08501a19278
    server wfe 2
    09/01/2014 14:50:59.05 w3wp.exe (0x1294) 0x1D88 Web Content Management Publishing Cache 7363 Critical Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases. To configure the account use
    the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.  Additional Data:  Current default
    super reader account: NT AUTHORITY\LOCAL SERVICE 382f711d-cdad-4c5d-be88-2e7d6f36dde2
    09/01/2014 14:50:59.05 w3wp.exe (0x1294) 0x1D88 Web Content Management Publishing Cache 7363 Critical Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases. To configure the account use
    the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.  Additional Data:  Current default
    super reader account: NT AUTHORITY\LOCAL SERVICE 382f711d-cdad-4c5d-be88-2e7d6f36dde2
    09/01/2014 14:50:59.05 w3wp.exe (0x1294) 0x1D88 Web Content Management Publishing Cache 7363 Critical Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases. To configure the account use
    the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.  Additional Data:  Current default
    super reader account: NT AUTHORITY\LOCAL SERVICE 382f711d-cdad-4c5d-be88-2e7d6f36dde2
    09/01/2014 14:50:59.05 w3wp.exe (0x1294) 0x1D88 Web Content Management Publishing Cache 7363 Critical Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases. To configure the account use
    the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.  Additional Data:  Current default
    super reader account: NT AUTHORITY\LOCAL SERVICE 382f711d-cdad-4c5d-be88-2e7d6f36dde2
    In the Roiscan logs we get an error in regards to the English Language pack:
    Review Items
    ============
    Error:                       Product {90140000-1015-0409-1000-0000000FF1CE} - Microsoft SharePoint Foundation 2010 1033 Lang Pack:  has unexpected
    file state(s).
    adil

    chinnijagadeesh,
    You suck!
    Signed: The rest of the universe.
    ... and quit crossposting FFS... it really is quite annoying!

  • A view, function and TO_DATE causing an error.

    I have the following statement which calls a view, VW_DIST_RPT_WORK_LIST which in turn calls a function which returns either 'Null' or a date string e.g. '07 Oct 2003' as a VARCHAR2 (alias PROJECTED_DELIVERY_DATE).
    Statement:
    SELECT CUSTOMER_NAME, PROTOCOL_REFERENCE, SHIPPING_REFERENCE, CUSTOMER_REFERENCE, COUNTRY, PROJECTED_DELIVERY_DATE, STATUS, NOTES,
    TO_DATE(PROJECTED_DELIVERY_DATE)
    FROM VW_DIST_RPT_WORK_LIST
    WHERE EXPECTED_DESP_DT IS NOT NULL
    AND UPPER(PROJECTED_DELIVERY_DATE) NOT LIKE('NULL%')
    AND EXPECTED_DESP_DT <= TO_DATE('07/10/2003', 'DD/MM/YYYY')
    AND TO_DATE(PROJECTED_DELIVERY_DATE) <= TO_DATE('31/12/2003', 'DD/MM/YYYY') --< Problem here
    I need to be able to specify a date filter on the PROJECTED_DELIVERY_DATE field and hence used the TO_DATE(PROJECTED_DELIVERY_DATE) <= TO_DATE('31/12/2003', 'DD/MM/YYYY') but this is generating an ORA-01858: a non-numeric character was found where a numeric character was expected.
    I think the problem lies with the fact that this field can contain 'Null' which cannot be converted to a date using TO_DATE. I've tried adding a NOT LIKE ('NULL%') statement to catch any nulls which may be creeping in bu this doesn't solve the problem.
    I've added TO_DATE(PROJECTED_DELIVERY_DATE) to the select above to determine if the nulls are being caught and if the TO_DATE in performing the conversion correctly which it is on both counts.
    Any ideas anyone ?

    The answer provided above by Monika will work for this situation. However, you should seriously think whether you should be using a string for date datatype. Ideally, you should rewrite the function that returns PROJECTED_DELIVERY_DATE and change the return type to DATE. The least you should do is to return NULL (instead of the string 'NULL') from the function. Oracle handles nulls perfectly, there is no reason you should write code to handle nulls;
    One more thing. Looking at the type of error you are receiving, it seems that you are using rule based optimizer. Why do I think so? Because, in rule based optimizer, the conditions are evaluated in a specific order (viz, bottoms-up for AND clauses). To show this, look at the following simple demonstration. I did this in Oracle 8.1.6 (also in 9.2.0.4.0 on Windows).
    -- Check the database version
    select * from v$version;
    BANNER
    Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    PL/SQL Release 8.1.6.1.0 - Production
    CORE 8.1.6.0.0 Production
    TNS for Solaris: Version 8.1.6.0.0 - Production
    NLSRTL Version 3.4.0.0.0 - Production
    -- Create the test table
    create table test (a number(2));
    insert into test(a) values (0);
    insert into test(a) values (1);
    insert into test(a) values (2);
    insert into test(a) values (3);
    insert into test(a) values (4);
    insert into test(a) values (5);
    insert into test(a) values (6);
    insert into test(a) values (7);
    commit;
    -- See that I have not analyzed the table. This will make use of RULE based optimizer
    select * from test
    where a > 0
    and 1/a < .25;
    and 1/a < .25
    ERROR at line 3:
    ORA-01476: divisor is equal to zero
    -- Look at the query clause. Even though I specifically asked for records where a is positive
    -- the evaluation path of rule based optimizer started at the bottom and as it evaluated the
    -- first row with a=0, and caused an error.
    -- Now look at the query below. I just re-arranged the conditions so that a > 0 is evaluated
    -- first. As a result, the row with a=0 is ignored and the query executes without any problem.
    select * from test
    where 1/a < .25
    and a > 0;
    A
    5
    6
    7
    -- Now I analyze the table to create statistics. This will make the query use the
    -- cost based optimizer (since optimizer goal is set to CHOOSE)
    analyze table test compute statistics;
    Table analyzed.
    -- Now I issue the erring query. See it executes without any problem. This indicates that
    -- the cost based optimizer was intelligent enough to evaluate the proper path instead of
    -- looking only at the syntax.
    select * from test
    where a > 0
    and 1/a < .25;
    A
    5
    6
    7
    Does the above example seem familiar to your case? Even though you had the AND UPPER(PROJECTED_DELIVERY_DATE) NOT LIKE('NULL%') in your query, a record with PROJECTED_DELIVERY_DATE = 'NULL' was evaluated first and that caused the error.
    Summary
    1. Use dates for dates and strings for strings
    2. Use cost based optimizer
    Thanks
    Suman

  • While trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'

    Hi,
    Our PI is getting data from WebSphere MQ and pushing to SAP. So our sender CC is JMS and receiver is Proxy. Our PI version is 7.31.
    Our connectivity between the MQ is success but getting the following error while trying to read the payload.
    Text: TxManagerFilter received an error:
    [EXCEPTION]
    java.lang.NullPointerException: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'
           at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:73)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
           at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:348)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
    I have searched SDN but couldn't fix it. Please provide your suggestion.
    With Regards
    Amarnath M

    Hi Amarnath,
    Where exactly you are getting this error?
    If you are getting at JMS Sender communication channel, try to stop and start the JMS communication channel and see the status, also use XPI Inspector to get the exact error log.
    for reference follow below blogs:
    Michal's PI tips: ActiveMQ - JMS - topics with SAP PI 7.3
    Michal's PI tips: XPI inspector - help OSS and yourself
    XPI Inspector

  • Approval task SP09: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'

    Hi everyone,
    I just installed SP09 and i was testing the solution. And I found a problem with the approvals tasks.
    I configured a simple ROLE approval task for validate add event. And when the runtime executes the task, the dispatcher log shows a error:
    ERROR: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'
    And the notifications configured on approval task does not start either.
    The approval goes to the ToDO tab of the approver, but when approved, also the ROLE stays in "Pending" State.
    I downgraded the Runtime components to SP08 to test, and the approvals tasks works correctly.
    Has anyone passed trough this situation in SP09?
    I think there is an issue with the runtime components delivered with this initial package of SP09.
    Suggestions?

    Hi Kelvin,2016081
    The issue is caused by a program error in the Dispatcher component. A fix will be provided in Identity Management SP9 Patch 2 for the Runtime component. I expect the patch will be delivered within a week or two.
    For more info about the issue and the patch please refer to SAPNote 2016081.
    @Michael Penn - I might be able to assist if you provide the ticket number
    Cheers,
    Kristiyan
    IdM Development

  • IIF with InStr and LEFT -1 Causes #Error in SSRS 2008R2

    Hello,
    I'm using IIF with InStr to test for a "/" in a field on a report.  The left function works fine unless I try to subtract 1 from it.  This code works fine:
    =IIF(InStr(Fields!WellCompName.Value,"/")=0, Fields!WellCompName.Value, left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")))
    But this code causes the True condition to yield #Error in the report when I add the -1 to the end of the left function:
    =IIF(InStr(Fields!WellCompName.Value,"/")=0, Fields!WellCompName.Value, left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")-1))
    I do need -1 to remove the "/" but it doesn't work with IFF and LEFT.
    Thanks

    Hi SomeDBGuyOutThere,
    I have tested on my local environment and can reproduce the issue, your issue caused by when the value in the field WellCompName don't contains "/". the function "left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")-1)"
    in the expression is invalid and will caused the error.
    In your scenario, please modify the second expression as below to avoid the error when there is no "/" in the string:
    =IIF(InStr(Fields!WellCompName.Value ,"/")=0,
    Fields!WellCompName.Value,
    left(Fields!WellCompName.Value,InStr(IIF(InStr(Fields!WellCompName.Value,"/")=0,"Test1/Test2",Fields!WellCompName.Value),"/")-1))
    Note: when WellCompName don't include "/" we given an test string "Test1/Test2" in the expression to avoid the error.
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • INI instrument driver and fatal run time errors

    Hey everyone, I'm experimenting with the INI instrument driver and running into a fatal run time error.  Here's what I know so far:
    The runtime error only happens during the very first Ini_Putxxx
    It only happens if the target INI file does not yet exist.  After the file is created with a Ini_WriteToFile, then the program will proceed with all my Put functions without any errors.
    Ideas?
    Solved!
    Go to Solution.

    Are you sure about that? I just tried calling these functions in the Interactive Execution window without errors (the destination file wasn't there before the call and has been created without errors):
    #include "inifile.h"
    static int error = 0;
    static IniText T = 0;
    T = Ini_New (0);
    Ini_PutString (T, "General", "Item 1", "Test string");
    Ini_PutInt (T, "General", "Item 2", 123);
    Ini_PutDouble (T, "General", "Item 3", Pi ());
    error = Ini_WriteToFile (T, "C:\\test.ini");
    Ini_Dispose (T);
    Ini_PutXX functions do not make any disk access, they work entirely in memory; the only functions where the instrument accesses the disk are Ini_WriteToFile and Ini_ReadFromFile. Which error are you receiving? Can you post a sample code that exhibits the error?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Tomcat and Jrun and get the same error.

    Hello freinds,
    iam facing problem with this.
    It cant able to find Enumeration although it finds Vector which is in the same package as Enumeration. but i tried its running this on both tomcat and Jrun and get the same error.
    <HTML>
    <HEAD><TITLE> Example use of Vectors </TITLE></HEAD>
    <BODY>
    <%! String name = new String("Jonh Doe");
    Integer ssn = new Integer(111223333);
    Double salary = new Double(65432.10);
    Vector employee = new Vector();
    String[] infoTitles = {"Name", "SSN", "Salary"};
    %>
    <% employee.addElement(name);
    employee.addElement(ssn);
    employee.addElement(salary);
    int i = 0;
    Enumeration employeeInfo = employee.elements();
    //while(employeeInfo.hasMoreElements()){ %>
    <P> Employee <%//= infoTitles[i++] %>: <%//= (Object)employeeInfo.nextElement() %>
    <% // } %>
    </BODY>
    </HTML>
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\Tomcat\Binary\work\localhost_8080%2Fexamples\_0002fjsp_0002fmyJSPs_0002fhour_00037_0002fusingEnumerations_0002ejspusingEnumerations_jsp_18.java:75: Class
    jsp.myJSPs.hour_00037.Enumeration not found.
    Enumeration employeeInfo = employee.elements();
    can any body help me
    todd

    Hi toddyj,
    problem in the code is you havent imported the package
    here iam giving below you my tested code..
    <HTML>
    <HEAD><TITLE> Example use of Vectors </TITLE></HEAD>
    <BODY>
    <%@ page language="java" import="packagename.*" %>
    <%! String name = new String("Jonh Doe");
    Integer ssn = new Integer(111223333);
    Double salary = new Double(65432.10);
    Vector employee = new Vector();
    String[] infoTitles = {"Name", "SSN", "Salary"};
    %>
    <% employee.addElement(name);
    employee.addElement(ssn);
    employee.addElement(salary);
    int i = 0;
    Enumeration employeeInfo = employee.elements();
    //while(employeeInfo.hasMoreElements()){ %>
    <P> Employee <%//= infoTitles[i++] %>: <%//= (Object)employeeInfo.nextElement() %>
    <% // } %>
    </BODY>
    </HTML>
    I hope by this import reason your not able to find Enumeration
    Regards,
    TirumalaRao
    Developer Technical support,
    Sun MicroSystem, India.

  • Cannot find package error and cannot resolve symbol error

    Hi
    I have a file Assignment.java in C:\TIJCode\c03 folder. But this file belongs to the default package. This file imports a package com.bruceeckel.simpletest which is in C:\TIJCode\ folder. Now this package has a file named Test.java which accesses a few more files fromt he same package.
    I set the classpath to C:\TIJCode. When i try to run the Assignment file I get an error saying package com.bruceeckel.simpletest cannot be found and cannot resolve symbol error. symbol: Test Class: Assignment.
    The files in com.bruceeckel.simpletest package were not compiled. So I first tried to do that. But I get a cannot resolve symbol error while trying to compile a file NumOfLinesException which inherits SImpleTestException file. The exact error message is
    NumOfLinesException.java : 7 : cannot resolve symbol
    symbol : class SimpleTestException
    location : class com.bruceeckel.simpletest.NumOfLinesException extends SimpleTestException
    The exact code in each of above mentioned files is
    //: c03:Assignment.java
    // Assignment with objects is a bit tricky.
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    import com.bruceeckel.simpletest.*;
    class Number {
    int i;
    public class Assignment {
    static Test monitor = new Test();
    public static void main(String[] args) {
    Number n1 = new Number();
    Number n2 = new Number();
    n1.i = 9;
    n2.i = 47;
    System.out.println("1: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    n1 = n2;
    System.out.println("2: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    n1.i = 27;
    System.out.println("3: n1.i: " + n1.i +
    ", n2.i: " + n2.i);
    monitor.expect(new String[] {
    "1: n1.i: 9, n2.i: 47",
    "2: n1.i: 47, n2.i: 47",
    "3: n1.i: 27, n2.i: 27"
    } ///:~
    //: com:bruceeckel:simpletest:SimpleTestException.java
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    public class SimpleTestException extends RuntimeException {
    public SimpleTestException(String msg) {
    super(msg);
    } ///:~
    //: com:bruceeckel:simpletest:NumOfLinesException.java
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    public class NumOfLinesException extends SimpleTestException {
    public NumOfLinesException(int exp, int out) {
    super("Number of lines of output and "
    + "expected output did not match.\n" +
    "expected: <" + exp + ">\n" +
    "output: <" + out + "> lines)");
    } ///:~
    //: com:bruceeckel:simpletest:Test.java
    // Simple utility for testing program output. Intercepts
    // System.out to print both to the console and a buffer.
    // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    package com.bruceeckel.simpletest;
    import java.io.*;
    import java.util.*;
    import java.util.regex.*;
    public class Test {
    // Bit-shifted so they can be added together:
    public static final int
    EXACT = 1 << 0, // Lines must match exactly
    AT_LEAST = 1 << 1, // Must be at least these lines
    IGNORE_ORDER = 1 << 2, // Ignore line order
    WAIT = 1 << 3; // Delay until all lines are output
    private String className;
    private TestStream testStream;
    public Test() {
    // Discover the name of the class this
    // object was created within:
    className =
    new Throwable().getStackTrace()[1].getClassName();
    testStream = new TestStream(className);
    public static List fileToList(String fname) {
    ArrayList list = new ArrayList();
    try {
    BufferedReader in =
    new BufferedReader(new FileReader(fname));
    try {
    String line;
    while((line = in.readLine()) != null) {
    if(fname.endsWith(".txt"))
    list.add(line);
    else
    list.add(new TestExpression(line));
    } finally {
    in.close();
    } catch (IOException e) {
    throw new RuntimeException(e);
    return list;
    public static List arrayToList(Object[] array) {
    List l = new ArrayList();
    for(int i = 0; i < array.length; i++) {
    if(array[i] instanceof TestExpression) {
    TestExpression re = (TestExpression)array;
    for(int j = 0; j < re.getNumber(); j++)
    l.add(re);
    } else {
    l.add(new TestExpression(array[i].toString()));
    return l;
    public void expect(Object[] exp, int flags) {
    if((flags & WAIT) != 0)
    while(testStream.numOfLines < exp.length) {
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e) {
    throw new RuntimeException(e);
    List output = fileToList(className + "Output.txt");
    if((flags & IGNORE_ORDER) == IGNORE_ORDER)
    OutputVerifier.verifyIgnoreOrder(output, exp);
    else if((flags & AT_LEAST) == AT_LEAST)
    OutputVerifier.verifyAtLeast(output,
    arrayToList(exp));
    else
    OutputVerifier.verify(output, arrayToList(exp));
    // Clean up the output file - see c06:Detergent.java
    testStream.openOutputFile();
    public void expect(Object[] expected) {
    expect(expected, EXACT);
    public void expect(Object[] expectFirst,
    String fname, int flags) {
    List expected = fileToList(fname);
    for(int i = 0; i < expectFirst.length; i++)
    expected.add(i, expectFirst[i]);
    expect(expected.toArray(), flags);
    public void expect(Object[] expectFirst, String fname) {
    expect(expectFirst, fname, EXACT);
    public void expect(String fname) {
    expect(new Object[] {}, fname, EXACT);
    } ///:~

    What do you have in the C:\TIJCode\ directory? Does the directory structure mimic the package structure for the stuff you're importing?

  • Invalid pakage declaration and can't impot error

    I am writing a shopping cart class that can store the shopping cart informations. But for some reason my
    Cart class can not import from ShoppingCart class,
    does anyone has anyidear
    Please help me out
    thanks in advance.
    import java.util.*;
    public class ShoppingCart {
    * default constructor
    public ShoppingCart(){
    this.itemid=0;
    this.attributeid = new Hashtable();
    this.orderid =0;
    this.price =0;
    this.quantity =0;
    public void setItemID(int itemid){
    this.itemid = itemid;
    public void setAttributeids( String key, String value){
    if(null==(String)attributeid.get(key)){
    attributeid.put(key,value);
    else{
    attributeid.remove(key);
    attributeid.put(key,value);
    public void setPrice(double price){
    this.price = price;
    public void setQuantity(int quantity){
    this.quantity = quantity;
    public void setOrderID(int orderid){
    this.orderid = orderid;
    public int getItemID(){
    return itemid;
    public Hashtable getAttributeids(){
    return this.attributeid;
    public double getPrice(){
    return this.price;
    public int getQuantity(){
    return this.quantity;
    public int getOrderID(){
    return this.orderid;
    private int itemid;
    private Hashtable attributeid;
    private int orderid;
    private double price;
    private int quantity;
    }// end class shoppingCart
    import java.util.*;
    import ShoppingCart;
    public class Cart{
    * default constructor
    public Cart(){
    cartHash = new Hashtable();
    public void setShoppingCart(ShoppingCart cart, String key){
    if(null==(ShoppingCart)cartHash.get(key)){
    cartHash.put(key,cart);
    public ShoppingCart getShoppingCart(String key){
    return cartHash.get(key);
    public int getTotal(){
    total = 0;
    Enumeration keys = attributeid.keys()
    while(keys.hasMoreElements()){
    ShoppingCart item = (ShoppingCart)cartHash.get((String)keys.nextElement());
    int subtotal = item.getQuantity()*item.getPrice();
    total + = subtotal;
    return total;
    public int getItem(){
    return cartHash.size();
    private Hashtable cartHash;

    WEB-INF/classes/Cart.java [11:1] Class ShoppingCart not found in type declaration or import.
    public void setShoppingCart(ShoppingCart cart, String key){
    ^
    WEB-INF/classes/Cart.java [17:1] Class ShoppingCart not found in type declaration or import.
    public ShoppingCart getShoppingCart(String key){
    ^
    2 errors
    Thanks for you replay.
    when i remove import ShoppingCart; it give me above errors. Please helps

  • Whenever I try to open Microsoft Word it doesn't open and shows me an error report!

    Whenever I try to open Microsoft Word it doesn't open and shows me an error report! I don't know what to do! Help!!!!
    This is the extra info that comes along with the error report:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2013-08-30 16:41:14 -0400
    Application Name: Microsoft Word
    Application Bundle ID: com.microsoft.Word
    Application Signature: MSWD
    Application Version: 14.1.0.110310
    Crashed Module Name: MBURibbon
    Crashed Module Version: 14.3.4.130416
    Crashed Module Offset: 0x000072f0
    Blame Module Name: MBURibbon
    Blame Module Version: 14.3.4.130416
    Blame Module Offset: 0x000072f0
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 0
    What should I do??????

    It might be a good idea to also ask here:
    Office for Mac forums

Maybe you are looking for

  • How to enhance the standard search with custom field?

    Hi all, I would like to know the general optimal procedure to enhance the standard searches like Opportunity search or Lead search. I've gone through some of the threads here. Some suggest, to add the new field using AET and copy the IMPL class of th

  • Any Bapi or function Module to update standard table

    Can u Plz let me know , is there any bapi or function module to update few fields of a standard table using an internable.

  • AS3 and Timeline

    envrionment: FlashPro CS6 (12.0.0.481) on Windows 7 This might be a bit of a newbie question, but I am struggling to understand how I can more efficiently load and display external swf to the stage without using the timeline. I have created 4 externa

  • Extra photo pages with out extra headers

    Big Time Newb here, I am looking to add extra photo pages as I like the template format and want them all to be under one category name in the header. For example the header might read "My Week" and then have sperate pages listed for Monday, Tuesday,

  • Performance and security trade-off

    h1. Scenario When I run my code without implementing security its performance decreases from 40% to 70% . My goals is to decide: do I really need any trade-off (speed vs security)? in either case I must provide arguments Any kind of advice will be ap