Problem in Storing ByteArray(Value) with String (Key) using put method

Hello Folks:
I wish to store a byte array with associated with a String. For this I use the put method in Java which stores put(Object key, Object value). I have written a piece of code which works but I am not able to understand it. Its not outputing what I want but something else.
I guess, I have some ignorance.
When I compile using
$javac testing.java propsput.java
$java testing
I get the following output.
Bytes Array:[B@1372a1a
I understand that B stands for Bytes array. Also, If I change the String I get the same thing. If I modify the code for Integer array
and store some Integer array I get [I@1372a1a.
I fail to understand why I am getting this 1372a1a again and again.
Instead where is my array.
May be I am not using the method getValue correctly.
Thank You very much for your help
Regards
//testing.java
import java.io.*;
import java.util.*;
public class testing{
public static void main(String args[]){
propsput headers=new propsput();
String s="Let me See how you do it";
byte buf[]=s.getBytes();
headers.put("Bytes Array",buf);
//propsput.java
import java.util.*;
import java.io.*;
public class propsput{
public void put (String key, byte[] value) throws IllegalArgumentException{
HashMap _props =new HashMap();
_props.put(key, value);
Set set =_props.entrySet();
Iterator i=set.iterator();
while(i.hasNext())
Map.Entry me=(Map.Entry) i.next();
System.out.print(me.getKey()+":");
System.out.println(me.getValue());
----------------------------------------------------------------

Hi Thanks for your help.
But I have included your method in the propsput class and also using it like this in the propsput class.
while(i.hasNext())
Map.Entry me=(Map.Entry) i.next();
System.out.print(me.getKey()+":");
byte a[]=me.getValue();
showBytes(a);
But while compiling with javac I get the following error:
propsput.java:24: incompatible types
found : java.lang.Object
required: byte[]
byte a[]=me.getValue();
Please let me know how should I use it so as to print my String.
Well, its still not clear in the previous code (my First Message) that why I am gettinng "1372a1a" everytime. (Even if I change the String. When I change the array to be an Integer array I get [I@1372a1a )
Othewise in the case of Strings I get ( [B@1372a1a)
Bytes Array:[B@1372a1a
Thanks and Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Set JArray values with invalid key value: "LastUpdatedTime" on new alert rule creation

    Hey all!
    I'm trying to create a new alert rule using version 0.9.11 of the Monitoring Library and am getting this error on alertsClient.rules.CreateOrUpdate:
    "Set JArray values with invalid key value: "LastUpdatedTime". Array position index expected."
    That's interesting because LastUpdatedTime is a DateTime object, and whether I set it or I don't, if I set a breakpoint, it does set itself correctly, but the API appears to be expecting a JSON hash?
    I've tested alertsClient and I'm able to get existing alerts (also metrics with metrics client), so I don't believe it's an access issue.
    Any ideas?
    The full code I'm using for the test (borrowed virtually verbatim from the Cloud Cover video
    here): 
    Rule newRule = new Rule
        Name = "CPU Over 90%",
        Id = Guid.NewGuid().ToString(),
        Description = "CPU Has been over 90% for 5 minutes",
        IsEnabled = true,
        LastUpdatedTime = DateTime.Now,
        Condition = new ThresholdRuleCondition
            Operator = Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ConditionOperator.GreaterThan,
            Threshold = 90,
            WindowSize = TimeSpan.FromMinutes(5),
            DataSource = new RuleMetricDataSource
                MetricName = "Percentage CPU",
                ResourceId = "",
                MetricNamespace = ResourceIdBuilder.BuildCloudServiceResourceId(<cloudservicename>, <deploymentname>)
    RuleAction action = new RuleEmailAction
        SendToServiceOwners = true,
    newRule.Actions.Add(action);
    OperationResponse alertResponse = alertsClient.Rules.CreateOrUpdate(new
    RuleCreateOrUpdateParameters { Rule = newRule });
    Console.WriteLine("Create alert rule response: " + alertResponse.StatusCode);

    Hi Greg,
    Thanks for your post!
    Error "JArray" has been fixed in the latest nugget package.
    Refer to:
    http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Monitoring/
    Hope this helps!
    Regards,
    Sadiqh

  • Key probelm w. Generic EnumMap -- How to replace a value with unknown key?

    Hi, i have a problem that i want to replace an value of an key/value pair, but I dont have the approiate key for that, to avoid passing the key throug all methods, I just implemented
    a method in the delegate class.
    public K getFirstAssociatedKey(BilanzObjekt bo){
               Set<K> keys = this.container.keySet();
               for(K key: keys){
                   V value = this.container.get(key);
                   if (bo == value){                    
                        return key;
               return null;
         }It works, but I can't use the retrieved key for a put-statement, cause the satic type comparision seems to fail. Even the key is retrieved from the original, the compilier is unable to validate that the key is in the approiate Enum, so it refuses the operation.
    In my special case I can avoid this by returning the value to the calling mehod inside the delegate, but that can't be the solution for all cases. Even If i would pass the key-vaue through all methods, the universial declaraction of ? extends Enum<?> would raise the same problem, that the compiler can't verify if the given key ist part of the Enum of the current EnumMap.
    Cause i still not an expert dfor generics, I might have overseen an solution.
    So is there any way to retrieve valid keys for the put-method at runtime without declaring a specilized subtype? Using rawtypes would supress compiler-errors, but that isn't the way what Generics intends. I allready have some lager Enums and some subsuets with EnumSet. But this solution isn't absolutly clean, cause you have to use the EnumSet to Iterate over the map and can't use keySet() anymore (Without special preparations for the values not contained in the EnumSet). Also I don't want to limit the code to only one type of Enum. So I my looking for another solution.
    Is there hoepfully any easy and gernerally solution to that problem?
    Thanks a lot in advance.
    Greetings Michael

    Hi, I redesigned my programm a little bit by returning the Objeckt which should be replaced to the delegate, but this causes the problem that I know that it is the exact type, cause the previous value had the same type before, but I can't replace it as long I don't except a fixed type for the value-parameter of the EnumMap.
    The workaround which worked with keys via Map.Entry, cause I didn't replaced them, don't work here.
    I found a solution which works for me (after the redisign mentioned above), even it is quite dirty., cause it moves the error detection form compiletime to runtime. But to gain more flexibilty, i prefer this. The else clause is just to find some programming faults as early as possible. I was quite suprised that the cast to V is legal, but the put -method will throw a ClassCastEcxception if it is not. So its a trade off betwenn flexibility and early error detection. I'm sure that should not used widely, but is a soluion or workaround for my problem.
    /* dirty cast */
    V new_v = (V) old.getReplacingValue();
                        if ( new_v != null){
                                  /* If the both instance are of the same base class, this operation is safe,
                                   * Cause if the previous value was ok, then the new value must be also OK!
                                   * This should be the default case.*/
                             if(new_v.getClass().getName().equals( old.getClass().getName()) ){                         
                                         this.container.put(key,  new_v);                         
                               }else{
                             /* Otherwise a class-cast exception is most likely,
                              * but should normally not reached, if replacing methods are always returning the most specialized type and are overwritten in all subtypes.  */
                                 try{
                                  this.container.put(key,  eBoNew);
                                  }catch(ClassCastException cce){
                                  cce.printStackTrace();
                   }Greetings Michael

  • Problem in storing float value into database form C++ thru OCCI

    Hi,
    We are working on a project where numerical accuracy is crucial. As per our client required float data like 23.12345678 should be stoted and retrieved back accurately from C++ application.
    We are using OCCI interface in C++ application. At the time of executing the query, we are moving the float value to host variable using setFloat() function. But oracle storing truncated or rounded value. Not exactly what we are proving.
    Even we are not able store 22.22 also properly. In oracle column is defined as NUMERIC.
    Its working fine, when we insert data from sql command promt by running a query. I guess we are missing some this in this process.
    Please provide us any suggestions on this. It would be great if you can provide some sample code.
    Regards,
    Newbe

    OTN has a C/C++ forum. Please delete this post and post your inquiry there.
    Thank you.

  • Setting value for attribute  'PO_NUMBER_SOLD'  using setter method

    Hi Experts,
    I need to set the value of a screen field according to some condition. I am using setter method of this attribute to set the value but it is not getting changed.
    I have written following code in DO_PREPARE_OUTPUT method of implementation class ZL_ZZBT131I_ZCREDITCHECK_IMPL using setter method of attribute
    Get Referral Authorization Code
          lv_val1 = me->typed_context->crechkresph->get_po_number( attribute_path = 'PO_NUMBER' ).
          me->typed_context->crechkresph->set_po_number( attribute_path = 'PO_NUMBER'
                                                            value     = ' ' ).
    while debugging I found that in method set_po_number set_property method has been used:--
    current->set_property(
                          iv_attr_name = 'PO_NUMBER_SOLD' "#EC NOTEXT
                          iv_value     = <nval> ).
    In set_property method  following code is getting executed
    if ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY.
              if <VALUE> ne IV_VALUE.
                if ME->MY_MANAGER_ENTRY->DELTA_FLAG is initial.
                first 'change' -> proof that entity is locked
                  if ME->MY_MANAGER_ENTRY->LOCKED = FALSE.
                    if ME->LOCK( ) = FALSE.
                      return.
                    endif.
                  endif.
                flag entity as modified
                  ME->MY_MANAGER_ENTRY->DELTA_FLAG = IF_GENIL_CONTAINER_OBJECT=>DELTA_CHANGED.
                endif.
                ME->ACTIVATE_SENDING( ).
              change value
                <VALUE> = IV_VALUE.
              log change
                set bit LV_IDX of ME->CHANGE_LOG->* to INDICATOR_SET.
              endif.
            else.
            check if it is a real read-only field or a display mode violation
              assert id BOL_ASSERTS subkey 'READ-ONLY_VIOLATION'
                     fields ME->MY_INSTANCE_KEY->OBJECT_NAME
                            IV_ATTR_NAME
                     condition ME->CHANGEABLE = ABAP_TRUE.
            endif.
    and in debugging I found that if part ( ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY) fails and hence else part is getting executed and hence my field a real read-only field or a display mode violation is happening according to comments in code.
    What shall I do so that I would be able to change the screen field value?
    Any help would be highly appreciated.
    Regards,
    Vimal

    Hi,
    Try this:
    data: lr_entity type cl_crm_bol_entity.
    lr_entity = me->typed_context->crechkresph->collection_wrapper->get_current( ).
    lr_entity->set_property( iv_attr_name = 'PO_NUMBER' value = '').
    Also, make sure the field is not read-only.
    Regards
    Prasenjit

  • LSMW help with DIRs by using BAPi method

    Hi experts,
    I am learning LSMW and I have been given exercise which I have to finish. The question is:
    Create a LSMW object for creation of DIRs by using BAPI method (UPLOAD_DOCUMENT)???
    Can anyone tell me how should I go forward and what DIRs stands for... ??
    I really appreciate your help..
    Regards,
       -Ashok Hansraj

    Hello Ashok,
    If you need a step - by - step approach for loading data using LSMW with various import techniques (like batch input, BAPI, IDOCS etc) you have to go thru this LSMW manual.
    And the files with DIR information, you should receive those fields from your business. Because you should know the structure of the data in those files in order to maintain source and target structures.
    Ask your business people over the format of the file you will be provided. In mean you can go thru this manual on this link.
    http://www.sapgenie.com/saptech/lsmw.htm
    Thanks,
    Naren

  • Java API, problem with secondary keys using multi key creator

    Hi,
    I'm developing an application that inserts a few 100k or so records into a Queue DB, then access them using one of four Hash SecondaryDatabases. Three of these secondary dbs use a SecondaryMultiKeyCreator to generate the keys, and one uses a SecondaryKeyCreator. As a test, I'm trying to iterate through each secondary key. When trying to iterate through the keys of any of the secondary databases that use a SecondaryMultiKeyCreator, I have problems. I'm attempting to iterate through the keys by:
    1: creating a StoredMap of the SecondaryDatabase
    2: getting a StoredKeySet from said map
    3: getting a StoredIterator on said StoredKeySet
    4: iterate
    The first call to StoredIterator.next() fails at my key binding (TupleBinding) because it is only receiving 2 bytes of data for the key, when it should be getting more, so an Exception is thrown. I suspected a problem with my SecondaryMultiKeyCreator, so I added some debug code to check the size of the DatabaseEntries it creates immediately before adding them to the results key Set. It checks out right. I also checked my key binding like so:
    1: use binding to convert the key object to a DatabaseEntry
    2: use binding to convert the created DatabaseEntry back to a key object
    3: check to see if the old object contains the same data as the new one
    Everything checked out ok.
    What it boils down to is this: my key creator is adding DatabaseEntries of the correct size to the results set, but when the keys are being read back later on, my key binding is only receiving 2 bytes of data. For the one SecondaryDatabase that doesn't use a SecondaryMultiKeyCreator, but just a SecondaryKeyCreator, there are no issues and I am able to iterate through its secondary keys as expected.
    EDIT: New discovery: if I only add ONE DatabaseEntry to the results set in my SecondaryMultiKeyCreator, I am able to iterate through the keys as I would like to.
    Any ideas or suggestions?
    Thank you for your attention,
    -Justin
    Message was edited by:
    Steamroller

    Hi Justin,
    Sorry about the delayed response here. I have created a patch that resolves the problem.
    If you apply the patch to your 4.6.21 source tree, and then rebuild Berkeley DB, the improper behavior should be resolved.
    Regards,
    Alex
    diff -rc db/db_am.c db/db_am.c
    *** db/db_am.c     Thu Jun 14 04:21:30 2007
    --- db/db_am.c     Fri Jun 13 11:20:28 2008
    *** 331,338 ****
           F_SET(dbc, DBC_TRANSIENT);
    !      switch (flags) {
    !      case DB_APPEND:
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    --- 331,337 ----
           F_SET(dbc, DBC_TRANSIENT);
    !       if (flags == DB_APPEND && LIST_FIRST(&dbp->s_secondaries) == NULL) {
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    *** 367,388 ****
    -            * Secondary indices:  since we've returned zero from an append
    -            * function, we've just put a record, and done so outside
    -            * __dbc_put.  We know we're not a secondary-- the interface
    -            * prevents puts on them--but we may be a primary.  If so,
    -            * update our secondary indices appropriately.
    -            * If the application is managing this key's data, we need a
    -            * copy of it here.  It will be freed in __db_put_pp.
    -           DB_ASSERT(dbenv, !F_ISSET(dbp, DB_AM_SECONDARY));
    -           if (LIST_FIRST(&dbp->s_secondaries) != NULL &&
    -               (ret = __dbt_usercopy(dbenv, key)) == 0)
    -                ret = __db_append_primary(dbc, key, &tdata);
                 * The append callback, if one exists, may have allocated
                 * a new tdata.data buffer.  If so, free it.
    --- 366,371 ----
    *** 390,401 ****
                /* No need for a cursor put;  we're done. */
                goto done;
    !      default:
    !           /* Fall through to normal cursor put. */
    !           break;
    !      if (ret == 0)
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    --- 373,379 ----
                /* No need for a cursor put;  we're done. */
                goto done;
    !      } else
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    diff -rc db/db_cam.c db/db_cam.c
    *** db/db_cam.c     Tue Jun  5 21:46:24 2007
    --- db/db_cam.c     Thu Jun 12 16:41:29 2008
    *** 899,905 ****
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    --- 899,905 ----
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey, tdata;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    *** 1019,1026 ****
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !      DB_ASSERT(dbenv, flags == DB_CURRENT || flags == DB_KEYFIRST ||
    !            flags == DB_KEYLAST || flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    --- 1019,1027 ----
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !       DB_ASSERT(dbenv, flags == DB_APPEND || flags == DB_CURRENT ||
    !             flags == DB_KEYFIRST || flags == DB_KEYLAST ||
    !             flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    *** 1048,1053 ****
    --- 1049,1107 ----
                     goto err;
                have_oldrec = 1; /* We've looked for the old record. */
    +      } else if (flags == DB_APPEND) {
    +           /*
    +            * With DB_APPEND, we need to do the insert to populate the
    +            * key value. So we swap the 'normal' order of updating
    +            * secondary / verifying foreign databases and inserting.
    +            *
    +            * If there is an append callback, the value stored in
    +            * data->data may be replaced and then freed.  To avoid
    +            * passing a freed pointer back to the user, just operate
    +            * on a copy of the data DBT.
    +            */
    +           tdata = *data;
    +           /*
    +            * If this cursor is going to be closed immediately, we don't
    +            * need to take precautions to clean it up on error.
    +            */
    +           if (F_ISSET(dbc_arg, DBC_TRANSIENT))
    +                dbc_n = dbc_arg;
    +           else if ((ret = __dbc_idup(dbc_arg, &dbc_n, 0)) != 0)
    +                goto err;
    +
    +           pgno = PGNO_INVALID;
    +
    +           /*
    +            * Append isn't a normal put operation;  call the appropriate
    +            * access method's append function.
    +            */
    +           switch (dbp->type) {
    +           case DB_QUEUE:
    +                if ((ret = __qam_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           case DB_RECNO:
    +                if ((ret = __ram_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           default:
    +                /* The interface should prevent this. */
    +                DB_ASSERT(dbenv,
    +                    dbp->type == DB_QUEUE || dbp->type == DB_RECNO);
    +
    +                ret = __db_ferr(dbenv, "DBC->put", 0);
    +                goto err;
    +           }
    +           /*
    +            * The append callback, if one exists, may have allocated
    +            * a new tdata.data buffer.  If so, free it.
    +            */
    +           FREE_IF_NEEDED(dbenv, &tdata);
    +           pkey.data = key->data;
    +           pkey.size = key->size;
    +           /* An append cannot be replacing an existing item. */
    +           nodel = 1;
           } else {
                /* Set pkey so we can use &pkey everywhere instead of key.  */
                pkey.data = key->data;
    *** 1400,1405 ****
    --- 1454,1465 ----
      skip_s_update:
    +       * If this is an append operation, the insert was done prior to the
    +       * secondary updates, so we are finished.
    +       */
    +      if (flags == DB_APPEND)
    +           goto done;
    +      /*
            * If we have an off-page duplicates cursor, and the operation applies
            * to it, perform the operation.  Duplicate the cursor and call the
            * underlying function.

  • Cannot decrypt returned value with same key and alogirthm

    I have a simple java program which encrypts some plaintext using Azure KeyVault and then decrypts it.
    However the decrypt always fails with {"error":{"code":"BadParameter","message":"Request body not specified"}}
    Here is the java test class
    package uk.co.his.azure.keyvault.test;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import java.net.URI;
    import java.net.URISyntaxException;
    import java.util.concurrent.ExecutionException;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    import org.apache.commons.codec.binary.Base64;
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpHeaders;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.ClientProtocolException;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpUriRequest;
    import org.apache.http.client.methods.RequestBuilder;
    import org.apache.http.client.utils.URIBuilder;
    import org.apache.http.entity.ContentType;
    import org.apache.http.entity.InputStreamEntity;
    import org.apache.http.impl.client.HttpClientBuilder;
    import org.apache.http.util.EntityUtils;
    import org.junit.Test;
    import us.monoid.json.JSONException;
    import us.monoid.json.JSONObject;
    import com.microsoft.aad.adal4j.AuthenticationContext;
    import com.microsoft.aad.adal4j.AuthenticationResult;
    import com.microsoft.aad.adal4j.ClientCredential;
    public class CopyOfTestClientLogon {
    public final static String AAD_HOST_NAME = "login.windows.net";
    public final static String AAD_TENANT_NAME = "From Azure portal ActiveDirectory app page endpoints";
    public final static String AAD_TENANT_ENDPOINT = "https://" + AAD_HOST_NAME
    + "/" + AAD_TENANT_NAME + "/";
    public final static String AAD_CLIENT_ID = "From Azure portal ActiveDirectory app page";
    public final static String AAD_CLIENT_SECRET = "Copied From Portal";
    public final static String KEY_NAME = "TestKey1";
    private static final ContentType JsonContentType = ContentType.parse("application/json");
    private static final String KEY_ENCRYPT_ALG = "RSA1_5";
    @Test
    public void testEncryptWithKey() throws InterruptedException, ExecutionException, JSONException, URISyntaxException, ClientProtocolException, IOException
    AuthenticationContext ctx = new AuthenticationContext(AAD_TENANT_ENDPOINT, true, Executors.newFixedThreadPool(1));
    Future<AuthenticationResult> resp = ctx.acquireToken("https://vault.azure.net", new ClientCredential(AAD_CLIENT_ID, AAD_CLIENT_SECRET), null);
    AuthenticationResult res = resp.get();
    String plainText = "This is a test";
    String plainTextB64Encoded = Base64.encodeBase64URLSafeString(plainText.getBytes("UTF-8"));
    JSONObject req = new JSONObject();
    req.put("alg", KEY_ENCRYPT_ALG);
    req.put("value", plainTextB64Encoded);
    byte[] payload = req.toString().getBytes("UTF-8");
    ByteArrayInputStream message = new ByteArrayInputStream(req.toString().getBytes("UTF-8"));
    InputStreamEntity reqEntity = new InputStreamEntity(message, payload.length, JsonContentType);
    reqEntity.setChunked(true);
    URIBuilder ub = new URIBuilder(
    "https://aexpress-dev1-key-vault.vault.azure.net/keys/"+KEY_NAME+"/encrypt?api-version=2014-12-08-preview");
    URI uri = ub.build();
    HttpUriRequest request = RequestBuilder.post().setUri(uri)
    .setHeader(HttpHeaders.AUTHORIZATION, "Bearer "+res.getAccessToken())
    .setEntity(reqEntity).build();
    HttpClient client = HttpClientBuilder.create().build(); // TODO server
    // cert
    // authentication
    HttpResponse response = client.execute(request);
    int status = response.getStatusLine().getStatusCode();
    HttpEntity entity = response.getEntity();
    String body = null;
    if(entity==null) {
    System.err.println("No body");
    throw new ClientProtocolException("Response has no body");
    else {
    body = EntityUtils.toString(entity);
    JSONObject reply = new JSONObject(body);
    String encryptedText = reply.getString("value");
    entity.getContent().close();
    req = new JSONObject();
    req.put("alg", KEY_ENCRYPT_ALG);
    req.put("value", encryptedText);
    payload = req.toString().getBytes("UTF-8");
    System.out.println("Payload is "+req.toString()+" "+payload.length);
    message = new ByteArrayInputStream(payload);
    reqEntity = new InputStreamEntity(message, -1, JsonContentType);
    reqEntity.setChunked(true);
    ub = new URIBuilder(
    "https://aexpress-dev1-key-vault.vault.azure.net/keys/"+KEY_NAME+"/decrypt?api-version=2014-12-08-preview");
    uri = ub.build();
    request = RequestBuilder.post().setUri(uri)
    .setHeader(HttpHeaders.AUTHORIZATION, "Bearer "+res.getAccessToken())
    .setEntity(reqEntity).build();
    response = client.execute(request);
    status = response.getStatusLine().getStatusCode();
    entity = response.getEntity();
    body = null;
    if(entity==null) {
    System.err.println("No body");
    throw new ClientProtocolException("Response has no body");
    else {
    body = EntityUtils.toString(entity);
    The output from the Apache Http Client is
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    2015/04/09 17:16:40:939 BST [DEBUG] RequestAddCookies - CookieSpec selected: best-match
    2015/04/09 17:16:40:970 BST [DEBUG] RequestAuthCache - Auth cache not set in the context
    2015/04/09 17:16:40:970 BST [DEBUG] PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
    2015/04/09 17:16:41:002 BST [DEBUG] PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
    2015/04/09 17:16:41:002 BST [DEBUG] MainClientExec - Opening connection {s}->https://aexpress-dev1-key-vault.vault.azure.net:443
    2015/04/09 17:16:41:143 BST [DEBUG] HttpClientConnectionOperator - Connecting to aexpress-dev1-key-vault.vault.azure.net/191.235.161.98:443
    2015/04/09 17:16:41:268 BST [DEBUG] HttpClientConnectionOperator - Connection established 192.168.0.216:57719<->191.235.161.98:443
    2015/04/09 17:16:41:268 BST [DEBUG] MainClientExec - Executing request POST /keys/TestKey1/encrypt?api-version=2014-12-08-preview HTTP/1.1
    2015/04/09 17:16:41:268 BST [DEBUG] MainClientExec - Proxy auth state: UNCHALLENGED
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> POST /keys/TestKey1/encrypt?api-version=2014-12-08-preview HTTP/1.1
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Authorization: Bearer .... snip ... a real bearer code
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Transfer-Encoding: chunked
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Content-Type: application/json
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Host: aexpress-dev1-key-vault.vault.azure.net
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Connection: Keep-Alive
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.6 (java 1.5)
    2015/04/09 17:16:41:284 BST [DEBUG] headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "POST /keys/TestKey1/encrypt?api-version=2014-12-08-preview HTTP/1.1[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Authorization: Bearer .... snip ... a real bearer code[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Transfer-Encoding: chunked[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Content-Type: application/json[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Host: aexpress-dev1-key-vault.vault.azure.net[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "2e[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "{"alg":"RSA1_5","value":"VGhpcyBpcyBhIHRlc3Q"}[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "0[\r][\n]"
    2015/04/09 17:16:41:284 BST [DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "Cache-Control: no-cache[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "Content-Type: application/json; charset=utf-8[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "Expires: -1[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "Server: Microsoft-IIS/8.5[\r][\n]"
    2015/04/09 17:16:41:346 BST [DEBUG] wire - http-outgoing-0 << "x-ms-keyvault-service-version: 1.0.0.82[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "X-AspNet-Version: 4.0.30319[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "X-Powered-By: ASP.NET[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000;includeSubDomains[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "Date: Thu, 09 Apr 2015 16:16:41 GMT[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "Content-Length: 457[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "[\r][\n]"
    2015/04/09 17:16:41:362 BST [DEBUG] wire - http-outgoing-0 << "{"kid":"https://aexpress-dev1-key-vault.vault.azure.net/keys/TestKey1/a23c0f08a4ef453ba8f2ab80c468e8ae","value":"m575654yUIZNml4-pBjL2hBZEdhr8P11uAbylFpMEO-7RQA7L-WpyDq2WV5YjDPHtnGNrMZb-rOyw-vC1uh9_WlhhA3wdlYaRohj_OMFZTzzLR3Zt0Sc7egIGoIqdoJBgu-INh2rV2GuwmBd9jthSuVnp_qyVfOJsDXrCvsrgjT0aLBHa3QX54G75GzzuV1bE351YRC9klj8C1bg19Qd_BiZ_b9B0eGXBKBNmDbR2-AjfxUhlMALVWROTDTeABW60cs4ZMqi5HnQYyKulKK5CyvZD0lYmQH54PPWjIFuC__xkPF8_0W4Z3Ri8Nz4616LosKWL7EQjR87lZAwF9Ypdw"}"
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << HTTP/1.1 200 OK
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Cache-Control: no-cache
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Pragma: no-cache
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Content-Type: application/json; charset=utf-8
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Expires: -1
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Server: Microsoft-IIS/8.5
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << x-ms-keyvault-service-version: 1.0.0.82
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << X-AspNet-Version: 4.0.30319
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << X-Powered-By: ASP.NET
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000;includeSubDomains
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Date: Thu, 09 Apr 2015 16:16:41 GMT
    2015/04/09 17:16:41:362 BST [DEBUG] headers - http-outgoing-0 << Content-Length: 457
    2015/04/09 17:16:41:362 BST [DEBUG] MainClientExec - Connection can be kept alive indefinitely
    2015/04/09 17:16:41:362 BST [DEBUG] PoolingHttpClientConnectionManager - Connection [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443] can be kept alive indefinitely
    2015/04/09 17:16:41:362 BST [DEBUG] PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
    2015/04/09 17:16:41:377 BST [DEBUG] RequestAddCookies - CookieSpec selected: best-match
    2015/04/09 17:16:41:377 BST [DEBUG] RequestAuthCache - Auth cache not set in the context
    2015/04/09 17:16:41:377 BST [DEBUG] PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
    2015/04/09 17:16:41:377 BST [DEBUG] PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
    2015/04/09 17:16:41:377 BST [DEBUG] MainClientExec - Stale connection check
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 << "[read] I/O error: Read timed out"
    2015/04/09 17:16:41:393 BST [DEBUG] MainClientExec - Executing request POST /keys/TestKey1/decrypt?api-version=2014-12-08-preview HTTP/1.1
    2015/04/09 17:16:41:393 BST [DEBUG] MainClientExec - Proxy auth state: UNCHALLENGED
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> POST /keys/TestKey1/decrypt?api-version=2014-12-08-preview HTTP/1.1
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Authorization: Bearer .... snip ... a real bearer code
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Transfer-Encoding: chunked
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Content-Type: application/json
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Host: aexpress-dev1-key-vault.vault.azure.net
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Connection: Keep-Alive
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.6 (java 1.5)
    2015/04/09 17:16:41:393 BST [DEBUG] headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "POST /keys/TestKey1/decrypt?api-version=2014-12-08-preview HTTP/1.1[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Authorization: Bearer .... snip ... a real bearer code[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Transfer-Encoding: chunked[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Content-Type: application/json[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Host: aexpress-dev1-key-vault.vault.azure.net[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "171[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "{"alg":"RSA1_5","value":"m575654yUIZNml4-pBjL2hBZEdhr8P11uAbylFpMEO-7RQA7L-WpyDq2WV5YjDPHtnGNrMZb-rOyw-vC1uh9_WlhhA3wdlYaRohj_OMFZTzzLR3Zt0Sc7egIGoIqdoJBgu-INh2rV2GuwmBd9jthSuVnp_qyVfOJsDXrCvsrgjT0aLBHa3QX54G75GzzuV1bE351YRC9klj8C1bg19Qd_BiZ_b9B0eGXBKBNmDbR2-AjfxUhlMALVWROTDTeABW60cs4ZMqi5HnQYyKulKK5CyvZD0lYmQH54PPWjIFuC__xkPF8_0W4Z3Ri8Nz4616LosKWL7EQjR87lZAwF9Ypdw"}[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "0[\r][\n]"
    2015/04/09 17:16:41:393 BST [DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
    Payload is {"alg":"RSA1_5","value":"m575654yUIZNml4-pBjL2hBZEdhr8P11uAbylFpMEO-7RQA7L-WpyDq2WV5YjDPHtnGNrMZb-rOyw-vC1uh9_WlhhA3wdlYaRohj_OMFZTzzLR3Zt0Sc7egIGoIqdoJBgu-INh2rV2GuwmBd9jthSuVnp_qyVfOJsDXrCvsrgjT0aLBHa3QX54G75GzzuV1bE351YRC9klj8C1bg19Qd_BiZ_b9B0eGXBKBNmDbR2-AjfxUhlMALVWROTDTeABW60cs4ZMqi5HnQYyKulKK5CyvZD0lYmQH54PPWjIFuC__xkPF8_0W4Z3Ri8Nz4616LosKWL7EQjR87lZAwF9Ypdw"} 369
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Cache-Control: no-cache[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Content-Length: 72[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Content-Type: application/json; charset=utf-8[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Expires: -1[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Server: Microsoft-IIS/8.5[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "x-ms-keyvault-service-version: 1.0.0.82[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "X-AspNet-Version: 4.0.30319[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "X-Powered-By: ASP.NET[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000;includeSubDomains[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "Date: Thu, 09 Apr 2015 16:16:41 GMT[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "[\r][\n]"
    2015/04/09 17:16:41:459 BST [DEBUG] wire - http-outgoing-0 << "{"error":{"code":"BadParameter","message":"Request body not specified"}}"
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << HTTP/1.1 400 Bad Request
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Cache-Control: no-cache
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Pragma: no-cache
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Content-Length: 72
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Content-Type: application/json; charset=utf-8
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Expires: -1
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Server: Microsoft-IIS/8.5
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << x-ms-keyvault-service-version: 1.0.0.82
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << X-AspNet-Version: 4.0.30319
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << X-Powered-By: ASP.NET
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000;includeSubDomains
    2015/04/09 17:16:41:459 BST [DEBUG] headers - http-outgoing-0 << Date: Thu, 09 Apr 2015 16:16:41 GMT
    2015/04/09 17:16:41:459 BST [DEBUG] MainClientExec - Connection can be kept alive indefinitely
    400
    2015/04/09 17:16:41:459 BST [DEBUG] PoolingHttpClientConnectionManager - Connection [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443] can be kept alive indefinitely
    2015/04/09 17:16:41:459 BST [DEBUG] PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://aexpress-dev1-key-vault.vault.azure.net:443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]

    The problem was that the decrypt request does not like transfer encoding chunked and requires the Content length;
    reqEntity = new InputStreamEntity(message, -1, JsonContentType);
    reqEntity.setChunked(true);
    Should have been
    reqEntity = new InputStreamEntity(message, payload.length, JsonContentType);
    reqEntity.setChunked(false);
    For more see Stackoverflow answer to same question

  • Problems with string comparison using

    I have a problem using the > and < comparison operators.
    When the xsl:if test uses numeric values the comparison works OK. If the
    test uses string values it always returns a false result.
    The style sheet below shows an example (which should run against any
    XML doc with a root element)
    Note - the spurious
    tags are just for debugging- I write the
    output to an HTML page and IE happens to recognise them
    even though the rest of the HTML tags are missing !!
    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match="/">
    <xsl:for-each select="*">
    Starting numeric test :
    <xsl:if test="(1 < 2)">
    In Test, ID= <xsl:value-of select="generate-id()"/>
    </xsl:if>
    Finished numeric test :
    Starting alpha test :
    <xsl:if test="('a' < 'b')">
    In Test, ID= <xsl:value-of select="generate-id()"/>
    </xsl:if>
    Finished alpha test :
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    null

    Having looked at the XPath spec I believe what I am trying to do (compare strings with gt and lt type tests) is not supported. The spec indicates that they can only be used for node sets or numerics. Presumably the processor is attempting to convert the values to numbers but evaluating them both as NaN (not a number). Can someone confirm this.
    I find this restriction quite strange, is this a situation where an extension function is required ? If so can someone point me to some (Java) examples.
    null

  • Problem replacing  chart axis title  with &string. syntax

    Apex 4.1.1
    Hi,
    I am having a problem replacing a chart axis title with substitution syntax &P5_MYFIELD., where P5_MYFIELD is an item with Source Type PL/SQL Function Body:
    begin
    return web_message.show('LASTNAME', 'dk');
    end;
    The Item is defined on the same Page as the chart in a different region. I can see that function is working ok, because the return value is displayed in P5_MYFIELD.
    There is a second item in an other region on the same page where the source value is defined with substitution syntax &P5_MYFIELD. It also displays the expected value. But when I use the string &P5_MYFIELD. as axis title it is not displayed.
    I also defined a field P0_MYFIELD on Page Zero with the same function, when I reference that with &P0_MYFIELD. as axis title on Page 5 the value is displayed correctly. I tried the same with a field on Page 1, &P1_MYFIELD. and it is displayed correctly.
    I think, the chart axis title must be substituted before the item P5_MYFIELD is executing the PL/SQL function body to get its value. Can anyone tell me why?
    We want to use string substitution syntax to translate all our labels in different languages. I would like to create hidden items with source type PL/SQL function body for all labels on a page and reference these values as label definitions. I would like to place them on the same page as the labels.
    Thanks
    Anne

    I started the application again and now also the Items are not displayed, only the message 'Label not defined', so I probably did something wrong with the computation. Why the correct values were shown during the first run, I do not know, maybe i did not logout in between.
    Here is the debugging information, but I cannot see any error message:
    0.02844 0.00038 Computation point: Before Header 4
    0.02881 0.00032 ...Perform computation of item: P5_CYCLE, type=FUNCTION_BODY 4
    0.02913 0.00060 ...Performing function body computation 4
    0.02973 0.00464 ...Execute Statement: declare function x return varchar2 is begin begin return web_message.show('CYCLE','de'); end; return null; end; begin wwv_flow.g_computation_result_vc := x; end; 4
    0.03437 0.00042 ......Result = Wurf 4
    0.03479 0.00046 ...Session State: Save "P5_CYCLE" - saving same value: "Wurf" 4
    0.03526 0.00027 Processes - point: BEFORE_HEADER 4
    0.03553 0.00027 ...close http header 4
    0.03580
    Edited by: Anne-Marie Rosa on Jun 8, 2012 10:09 AM
    Now the correct value is displayed again in the P5_MYFIELD, because I had to set the item source back to PL/SQL Function body, but I am still getting the chart error and the chart is not displayed.
    Edited by: Anne-Marie Rosa on Jun 8, 2012 10:17 AM

  • Excel Storing Numeric values as String when send via Email in SAP

    I am using Function Module SO_NEW_DOCUMENT_ATT_SEND_API1 to send an EXCEL file via email.  Everything is working fine but when I open the spreadsheet I'm unable to use EXCEL Autosum command on my numbers.  It looks like my numbers may be in string format.  I tried numerous things in EXCEL to convert the numbers to string with no luck.  If I re-enter the number then the autosum works but I don't want to do that on a large report.  Has anybody encountered this problem and be willing to give me some help on resolving this issue if it can be resolved?

    Hi,
    Have a look at program Y_R_EITAN_TEST_10_02 .
    It is also sending CSV using cl_bcs (using the rules of CSV http://en.wikipedia.org/wiki/Comma-separated_values)
    see form FORM mail_1_prep_3
    Regards.

  • Java Applet problem in Internet Explorer 7 with Tab Key

    Hi
    I am developing some web pages in which iam using a java applet. so far the intended user are supposed to be using Internet Explorer 7. the problem i am facing is that when i press the tab key within the applet. the control get transferred to new tab position in the web page outside the applet and i have to click back to the applet to get control again transferred to the applet.
    i want to restrict the control of tab so that when tab is pressed within the applet the tab should not move to next tab position in the page and remain confined within the applet.
    Can someone please help me how can i achieve this and whether i have to do coding for it in the applet or in the web page...so that within the applet the Internet Explorer tab control should remain disabled..

    Hello all,
    I have the same problem, but I don't found a solution. Could you resolved the problem and who??
    Thank you.
    Jorge

  • Problem while sending ByteArray from as3 client through netconnection call method to red5 server

    Hi to all,
    I'm trying to send from as3 client a ByteArray of more or less 3 MB using NetConnection's call method but I am unable to do it, cause I get a timeout on the server and the client get disconnected (I have also increased the timeout limit in red5.properties but nothing changed). If I try to send a smaller ByteArray I don't have problem, even if the trasfer is really slow.
    Any solution?
    thanks

    put it in code tags so it's readable
    CLIENT
    public void sendLoginData(String data)
    int c=0;
    byte loginData[]=new byte[data.length()];
    loginData=data.getBytes();
    try
    out.write(loginData);
    System.out.println(client.isClosed());
    // here i want 2 receive the 1 byte data whch i hv sent frm server's RUN() method
    //following code is not working :( it gets hanged
    while((c=in.read())!=-1)
    System.out.print(c);
    System.out.print("hi");
    catch(Exception e)
    System.out.println("Caught:" + e);
    finally
    out.close();
    }SERVER
    public void run()
    boolean flag;
    try
    flag=verifyLoginData(ID); //this function verifies the login data by connecting to DB
    System.out.println(flag);
    if(flag==true)
    //send login valid
    bos.write(1);
    bos.close();
    else
    //send login invalid
    bos.write(0);
    bos.close();
    catch(Exception e)
    System.out.println("caught " + e);
    }

  • Problem in :    Integration of  ASP  with   R/3 using XI

    I am facing a problem in a particular scenario involving ASP  application.I am trying to Send a synchronous  message to R/3 using XI.
    I calling a business service of XI from ASP page to pass the  message across to XI.But I get an error on execution of the ASP page.The error is As  follows
    <b>" During the application mapping com/sap/xi/tf/_EMP_MM_a
      com.sap.aii.utixi.misc.api.BaseRuntimeException
       was thrown: FATAL ERROR com.sap.engine.lib.xml.parser.parser~"</b>
    The interface used for mapping is EMP_MM_a

    Actually the Mapping program is Perfect but while sending the message from ASP is in string but not in XML format.
    I am using the Plain HTTP adapter for connecting to XI
    How I want to call a Business service of XI and pass a XML Message from ASP page to XI.
    (Source)                        (Target)
    ASPPage  ->     XI   ->    R/3
    (I could n't attach the IMAGE file So please try to find the above archetechture)
    can you give the suggestions on this
    Message was edited by: Dhanabal T

  • Problems replacing BT Hub 5 with Airport Extreme using Airport Utility 6.3.2

    Hi
    I have spent all afternoon trying to connect to BT infinity using the Airport Extreme router. I have a BT Hub 5 which is OK apart from the fact that it cannot hold more than 3 wireless devices connected at any one time and keeps dropping wi fi connections.
    I am using OSX 10.9.4 (Mavericks), Airport Utility v. 6.3.2 and a iMac 2013 base model.
    I had some instructions but these refer to the previous version of Airport Utility which is quite different from the current one, so I had to improvise a little
    This is what I have done so far:
    1. I have connected the LAN1 port from the Openreach modem to the Gigabit ethernet WAN port of Airport Extreme and I have connected my iMac ethernet to one of the Gigabit Ethernet LAN ports of Airport Extreme
    2. I have named and passworded the network and given the base station a name as required
    3. In the Internet tab I have put in the account name as [email protected] and put in a space in the password box (I also tried writing BT in it with no result). I have set the PPoE connection as  local link only.
    The problem I have is that when I click on the internet icon on Airport Utility is shows disconnected and amber light, no matter what changes I make to the Airport Extreme which has a green light. I have noticed that in the new version of Airport Utility it doesn't seem to be possible to set the PPoE connection to be always on.
    In desperation I have disconnected the Airport Extreme router and reconnected the Home Hub 5 which works.
    What do I need to do?

    Your connection is Openreach Modem -> BT Home Hub 5 -> iMAC.
    After a bit of reading - http://www.broadbandchoices.co.uk/guides/hardware/bt-home-hub
    Openreach Modem - Optical Network Terminal (ONT).
    HH5 - is a 4-port Ethernet Router/Switch
    It looks like BT may be locking the MAC addresses of the modem and hh5 with access control lists, so customers cannot connect a device to replace the HH5.
    You have an option. Connect one of the HH5 LAN ports to the WAN port of the Airport.
    Set the Airport to Bridge mode, no DHCP address distribution, Create a Wireless Network.
    You can just ignore  the HH5 SSID(s) completely and just connect to the ones you create on the Extreme. The iMac can connect to any LAN port on the Extreme or one of the remaining HH5 LAN ports.
    The only challenge you may have is, if the number of IP addresses the HH5 can allocate is limited to 4 (by BT's configuration). It can be verified using more than four (4) devices.
    If this works, then there are alternatives where a new LAN within a LAN can be created if the IP address limitation becomes an issue.

Maybe you are looking for