Connect By with composite Key

Hello
I have a table more or less like this
ID - CONTINENT- COUNTRY-CITY
1 ASIA
2 ASIA CHINA
3 ASIA CHINA BEIJING
4 ASIA CHINA XANGAI
5 ASIA JAPAN
6 ASIA JAPAN TOKIO
7 EUROPE
8 EUROPE GERMANY
Altough I have a sequencial primary key, that key os not used to relate to the "master record". The only way I have to know which record depends on which is by using a composite key (in the real table those three columns are numbers, and their combination is unique).
Is there a way to use an hierarquical query on this table?
Thanks for any help

Nuno wrote:
example:
CREATE TABLE PLACES
(ID, CONTINENT,COUNTRY,CITY,NAME)Does that command work when you run it? I get 'ORA-02263: need to specifuy the datatype for this column".
INSERT INTO PLACES (1,1,NULL,NULL,'ASIA')
INSERT INTO PLACES (2,1,1,NULL,'CHINA')
INSERT INTO PLACES (3,1,1,1,'BEIJING')
INSERT INTO PLACES (4,1,1,2,'XANGAI)
INSERT INTO PLACES (5,1,2,NULL,'JAPAN')
INSERT INTO PLACES (6,1,2,1,'TOKIO')
INSERT INTO PLACES (7,2,NULL,NULL,'EUROPE')
INSERT INTO PLACES (8,2,1,NULL,'GERMANY')Do those statements work for you? I get "ORA-00928: missing SELECT keyword".
Oracle 10g is the version used...
what I want is a list like this:
ASIA
CHINA
BEIJING
XANGAI
JAPAN
TOKIO
EUROPE
GERMANY
The way I used was to create a "dummy" ID and Mother ID using both case and concatenating CONTINENT,COUNTRY,CITY fields.
Don't know if there is other cleaner way...
CONTINENT || COUNTRY || CITYdummy_id,
          CASE
          WHEN COUNTRY IS NULL AND CITY IS NULL
          THEN NULL
          WHEN COUNTRY IS NOT NULL AND CITY IS NULL
          THEN CNUT1
          WHEN COUNTRY IS NOT NULL AND CITY IS NOT NULL
          THEN      CONTINENT || COUNTRY      
          END DUMMY_MOMUsing COALESCE, like Odie did, is a lot simpler.
Instead of generating a "dummy" parent_id, you may want to add a real parent_id column to the table. Then it sould be easier to do CONNECT BY queries when you needed to.
However, you can get the output you requested without anything hierarchical:
{code}
SELECT     name
FROM places
{code}
If the output somehow had to reflect the hierarchical structure then you'd have to do somehting different.
For example, to be sure children were displayed after their parents), add an ORDER BY clause:
{code}
SELECT     name
FROM places
ORDER BY continent
,      country     NULLS FIRST
,     city          NULLS FIRST
{code}
If your output need to be indented, post exactly what you want, with an explanation.
When posting any fomatted text on this site, type these 6 characters:
\{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Perhaps you want something like this:
{code}
SELECT     NVL2 (country, ' ', NULL)     ||
     NVL2 (city,     ' ', NULL)     ||
     name                         AS indented_name
FROM places
ORDER BY continent
,      country     NULLS FIRST
,     city          NULLS FIRST
{code}
You can always do a CONNECT BY query, as Odie demonstrated.

Similar Messages

  • Master-Detail query problem with composite key

    I have tested a MD form with EMP and DEPT tables and the MD query works okay.
    I have created two tables both with two fields EMP_ID and REPORT_DATE as a composite key. The problem I am having with the MD form is that it does not query back the results when I select the QUERY button. I have verified that the join is setup during the creation of the form.

    I have recreated the form and the MD query works fine.

  • CQL Join on Coherence Cache with Composite Key

    I have a Coherence Cache with a composite key and I want to join a channel to records in that cache with a CQL processor. When I deploy the package containing the processor, I get the following error:
    +italics14:32:35,938 | alter query SimpleQuery start                                                                        | [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)' | CQLServer | FATAL+
    +14:32:35,938 | alter query >>SimpleQuery<< start+
    +specified predicate requires full scan of external source which is not supported. please modify the join predicate | [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)' | CQLServer | FATAL+
    I think that I'm using the entire key. If I change the key to a single field, it deploys OK. I found a similar issue when I defined a Java class to represent the composite key. Is it possible to join in this way on a composite key cache?
    I could define another field which is a concatenation of the fields in the composite key but this is a little messy.
    My config is as below:
    <wlevs:caching-system id="MyCache" provider="coherence" />
    <wlevs:event-type-repository>
    <wlevs:event-type type-name="SimpleEvent">
              <wlevs:properties>
                   <wlevs:property name="field1" type="char" />
                   <wlevs:property name="field2" type="char" />
              </wlevs:properties>
    </wlevs:event-type>
    </wlevs:event-type-repository>
         <wlevs:channel id="InChannel" event-type="SimpleEvent" >
              <wlevs:listener ref="SimpleProcessor" />
         </wlevs:channel>
         <wlevs:processor id="SimpleProcessor">
              <wlevs:listener ref="OutChannel" />
              <wlevs:cache-source ref="SimpleCache" />
         </wlevs:processor>
         <wlevs:channel id="OutChannel" event-type="SimpleEvent" >
         </wlevs:channel>
         <wlevs:cache id="SimpleCache" value-type="SimpleEvent"
              key-properties="field1,field2"
              caching-system="MyCache" >
         </wlevs:cache>
    and the processor CQL is as follows:
    <processor>
    <name>SimpleProcessor</name>
    <rules>
    <query id="SimpleQuery">
    <![CDATA[ 
                select I.field1, I.field2 from InChannel [now] as I,
    SimpleCache as S where
    I.field1 = S.field1 and
    I.field2 = S.field2
    ]]> </query>
    </rules>
    </processor>
    Thanks
    Mike

    Unfortunately, joining on composite keys in Coherence is not supported in the released versions. This will be supported in 12g release.
    As you mention, defining another field as key, which is the concatenation of the original keys is the workaround.

  • ClassNotFound Exception integrating Coherence and Eclipselink with composite key entity objects

    I am hooking up coherence as an L2 cache for eclipselink in weblogic 12c (using the latest released weblogic and eclipselink 2.4.2.v20130514-5956486).  I have my application war and coherence gar packaged in the same EAR file.  For Entity Objects with single primary keys (Longs) coherence integration works as expected.  However I have several multi-part key Entity Objects that use an IdClass to represent the key.  When these objects get serialized, coherence throws a class not found exception.  I'm assuming its because the cachekey used is an instance of my applications IdClass, and the weblogic classloader doesn't have access to this.  Since eclipselink hides the cache integration with coherence, I cannot pass my classloader off to coherence (as i do with other caches i'm using directly with coherence).
    How can I get around this problem? 
    I saw this option in ExternalizableHelper.xml, but modifying it directly had no effect:
      <!-- if deploying Coherence in CLASSPATH and deploying application
           classes within a hot-redeployable archive (e.g. ".ear"), set this to
           true -->
      <!-- *** WARNING *** all cluster nodes must use the same setting -->
      <force-classloader-resolving>false</force-classloader-resolving>
    Here is the stack trace:
    ClassLoader: null) java.io.IOException: readObject failed: java.lang.ClassNotFoundException: com.oracle.pgbu.common.data.OverlayIdClass
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:623)
      at weblogic.coherence.service.internal.io.WLSObjectInputStream.resolveClass(WLSObjectInputStream.java:45)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2262)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
    ClassLoader: null
      at com.tangosol.util.Base.ensureRuntimeException(Base.java:286)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:50)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeRequest(PartitionedCache.CDB:61)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.run(PartitionedCache.CDB:1)
      at com.tangosol.coherence.component.util.DaemonPool.add(DaemonPool.CDB:20)
      at com.tangosol.coherence.component.util.DaemonPool.add(DaemonPool.CDB:1)
      at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:2)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:38)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:23)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
      at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:51)
      at java.lang.Thread.run(Thread.java:724)
    Caused by: java.io.IOException: readObject failed: java.lang.ClassNotFoundException: com.oracle.pgbu.common.data.OverlayIdClass
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:623)
      at weblogic.coherence.service.internal.io.WLSObjectInputStream.resolveClass(WLSObjectInputStream.java:45)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2262)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
    ClassLoader: null
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2270)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.deserializeProcessor(PartitionedCache.CDB:7)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeRequest(PartitionedCache.CDB:37)
      ... 10 more

    I am hooking up coherence as an L2 cache for eclipselink in weblogic 12c (using the latest released weblogic and eclipselink 2.4.2.v20130514-5956486).  I have my application war and coherence gar packaged in the same EAR file.  For Entity Objects with single primary keys (Longs) coherence integration works as expected.  However I have several multi-part key Entity Objects that use an IdClass to represent the key.  When these objects get serialized, coherence throws a class not found exception.  I'm assuming its because the cachekey used is an instance of my applications IdClass, and the weblogic classloader doesn't have access to this.  Since eclipselink hides the cache integration with coherence, I cannot pass my classloader off to coherence (as i do with other caches i'm using directly with coherence).
    How can I get around this problem? 
    I saw this option in ExternalizableHelper.xml, but modifying it directly had no effect:
      <!-- if deploying Coherence in CLASSPATH and deploying application
           classes within a hot-redeployable archive (e.g. ".ear"), set this to
           true -->
      <!-- *** WARNING *** all cluster nodes must use the same setting -->
      <force-classloader-resolving>false</force-classloader-resolving>
    Here is the stack trace:
    ClassLoader: null) java.io.IOException: readObject failed: java.lang.ClassNotFoundException: com.oracle.pgbu.common.data.OverlayIdClass
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:623)
      at weblogic.coherence.service.internal.io.WLSObjectInputStream.resolveClass(WLSObjectInputStream.java:45)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2262)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
    ClassLoader: null
      at com.tangosol.util.Base.ensureRuntimeException(Base.java:286)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:50)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeRequest(PartitionedCache.CDB:61)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.run(PartitionedCache.CDB:1)
      at com.tangosol.coherence.component.util.DaemonPool.add(DaemonPool.CDB:20)
      at com.tangosol.coherence.component.util.DaemonPool.add(DaemonPool.CDB:1)
      at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:2)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:38)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:23)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
      at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:51)
      at java.lang.Thread.run(Thread.java:724)
    Caused by: java.io.IOException: readObject failed: java.lang.ClassNotFoundException: com.oracle.pgbu.common.data.OverlayIdClass
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:623)
      at weblogic.coherence.service.internal.io.WLSObjectInputStream.resolveClass(WLSObjectInputStream.java:45)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1704)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2262)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
    ClassLoader: null
      at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2270)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2393)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2315)
      at oracle.eclipselink.coherence.integrated.internal.cache.RelationshipUpdateProcessor.readExternal(RelationshipUpdateProcessor.java:82)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2086)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2390)
      at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2336)
      at oracle.eclipselink.coherence.integrated.cache.WrapperSerializer.deserialize(WrapperSerializer.java:79)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2791)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:266)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.deserializeProcessor(PartitionedCache.CDB:7)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeRequest(PartitionedCache.CDB:37)
      ... 10 more

  • Class with composite Key,  attribute and relation

    Hello
    I am implementing the jpa part of my project however I have a quite common relation to set up between 2 tables and I think I am in the wrong way
    I have 3 entities : question - answer and project
    The code below should allow you to understand easierly :
    ----- project
    public class Project implements Serializable{
         private static final long serialVersionUID = 6478117913922953539L;
         @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
         private Long ProjId;
         @Column(nullable = false)
         private String Name;
         @OneToMany(mappedBy="project",targetEntity=AnswerPK.class)
         private List<Answer> Answers;
    ------- question
    public class Question implements Serializable{
         private static final long serialVersionUID = -1231353969246302525L;
         @Id @GeneratedValue
         private Long QuestId;
         @Column(nullable = false)
         private String Label;
         @Column(nullable = false)
         private String Type;
    -------- Answer
    public class Answer implements Serializable{
         private static final long serialVersionUID = -690621748466361598L;
         @EmbeddedId
         private AnswerPK key;
         private String result;
    ----------- AnswerPK
    public class AnswerPK implements Serializable { 
         private static final long serialVersionUID = 9172011321649468776L;
         @ManyToOne(optional=false)
         @JoinColumn(name = "ProjId",nullable = false)
         private Project project;
         @OneToOne(optional=false)
         @JoinColumn(name = "QuestId",nullable = false)
         private Question question;
    however I got this error
    Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.unmod.Domain.Project.Answers[com.unmod.Domain.AnswerPK]
    so I start thinking that's not the way to do that

    Numerous other things started going odd so I cleared out and re-installed jdev.
    The entities are generated correctly now.
    blew 4 hours on it though

  • Composite key in Time dimension

    Hi All,
    I would like to know Time dimension with Composite key. I have a requirement where I want to store 2 Calendars in Time dimension table. for e.g :
    for one calendar Weekstarts from SUN-SAT and for another it is from MON-TUE
    DateKey   Type WeekStart   WeekEnd
    20140101   1       Sun               Sat      
    20140101   2       Mon               Tue
    ..................etc
    I have a measure group which is related to Time dimension (DateKey and Type used a Composite key). This implementation has no issues for additive measures but there are few issues with semi-additive measures (last non-empty,...).
    Will composite Key have any effect on semi-additive measures ?
    what if i use surrogate key instead of composite key.
    Please suggest if the approach has any issue with Time intelligence. Advise if there is any better approach for the same.
    Ram MSBI Developer

    Hey.. Thanks!
    I am clear about the concept about defining annotation based composite key. Also, I read in the documentation that I'll be needing to define as direct, aggregate or one-to-one. But, I am not able to define and run the same in the project mapping xml of toplink.
    It would be great if you can share some sample code for defining the same. For e.g. in my mentioned example, there is TestEntity POJO having 'id' as the attribute which gets populated with the testEntityCode of the TestEntityKey POJO. Please suggest the same for the same:
    <opm:primary-key>
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="TEST_ENTITY_B" name="TEST_ENT_CODE" xsi:type="opm:column"/>
    </opm:primary-key>
    Thanks!

  • Trouble with a composite key & unique violation

    Hi all
    as mentioned yesterday I'm a novice so apologies in advance for any lack of clarity in my question:
    I'm doing the standard student estate agent database and I have come across an issue with a composite key.
    the table in question follows:
    CREATE TABLE Offer
    buyer_id CHAR(5) not null references buyer (buyer_id),
    property_id CHAR(5) not null references property (property_id),
    primary key (BUYER_ID, PROPERTY_ID),
    offer_date DATE not null,
    offer_time NUMBER(4) not null,
    offer_amount NUMBER(10,2) not null
    and I have all the other tables in position with data loaded. However, when I try to load data into this table the buyer_id & property_id can be duplicated (it makes sense a buyer could make several offers on the same property).
    I'm not sure how to get around it. When I simply remove the primary key line the the next line offer_date.... is not recognized. I'm I missing something obvious? I am not allowed to changed the structure of the table. Do I need another identifier for the composite key?
    thanks Jo

    If you want to stick with natural primary keys, you would probably need to use the combination of (buyer_id, property_id, offer_date), assuming that the same buyer wouldn't make simultaneous offers on the same property. Given that this creates a rather unwieldy key for any child tables to reference, and given that the BUYER and PROPERTY tables appear to have synthetic foreign keys, you would probably want to add an OFFER_ID column to your table that is the primary key for the table and is populated via a sequence.
    Justin

  • How to Work with Composite Primary Key

    Hi All,
    I'm working with Toplink JPA. Here I have A problem with inserting into database table which have composite Primary Key.
    What I'm doing is, I have two tables. to maintain many to many relation between these two tables I created another intermediate table which consists of foreign Keys (reference) of above two tables.
    Now these two foreign Keys in the Intermediate table made as composite Primary Keys.
    When I'm trying to the data in the Intermediate table I'm getting the foreign Keys values are null..
    could anyone suggest me how to work with composite Primary Keys
    Thanks,
    Satish

    I have the same problem, I have 3 tables with a join table joining them all. I have created an intermediate table entity. When I go to create a an entry, it says that I cannot enter null into "ID". Here is the SQl toplink generates:
    INSERT INTO Z_AUTH_USER_AUTHORIZATION (CONTEXT_ID, AUTHORIZATION_ID, USER_ID) VALUES (?, ?, ?)
    bind => [null, null, null]
    Here are the classes:
    -----------------------Join Table-----------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER_AUTHORIZATION")
    public class AuthUserAuthorization implements Serializable{
    @EmbeddedId
    private AuthUserAuthorizationPK compId;
    // bi-directional many-to-one association to AuthAuthorization
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "AUTHORIZATION_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthAuthorization authAuthorization;
    // bi-directional many-to-one association to AuthContext
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "CONTEXT_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthContext authContext;
    // bi-directional many-to-one association to AuthUser
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "USER_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthUser authUser;
    ---------------------------------------User table--------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER")
    public class AuthUser implements Serializable, IUser{
    @Id()
    @SequenceGenerator(name = "AUTH_USER_ID_SEQ", sequenceName = "Z_AUTH_USER_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_USER_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 10)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authUser", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    -----------------------------------Context table-----------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_CONTEXT")
    public class AuthContext implements Serializable, IContext{
    @Id()
    @SequenceGenerator(name = "AUTH_CONTEXT_ID_SEQ", sequenceName = "Z_AUTH_CONTEXT_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_CONTEXT_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authContext", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    ----------------------------Authorization table-------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_AUTHORIZATION")
    public class AuthAuthorization implements Serializable, IAuthorization{
    @Id()
    @SequenceGenerator(name = "AUTH_AUTHORIZATION_ID_SEQ", sequenceName = "Z_AUTH_AUTHORIZATION_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_AUTHORIZATION_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authAuthorization", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    I have tried to create the new entity several ways. I have tried to create one with the default constructor then set this entity on each of the other entities, I have also tried to pass in the entities to the join entity and set them there, but this doesn't work. Any help would be very appreciated!
    Thanks,
    Bill

  • How can i connect the mac with internet key?

    how can i connect the mac with internet key?
    I try but it tolds me that I haven't the javaruntime...

    I try, but to run javapreferences computer told me that I must have a Java runtime... thankyou

  • Why my MacBook pro with Maverick, when I'm connected with internet key and connect with usb cable my HTC One the Mac restat with error?

    Why my MacBook pro with Maverick, when I'm connected with internet key and connect with usb cable my HTC One the Mac restat with error?

    Solution may be found if you search in the "More Like This" section over in the right column. 

  • [DPL] Exception with composite SecondaryKey - Not a secondary key . . .

    Can I use a composite key with a SecondaryKey annotation over Java-DPL, reference guide says that is possible but I'm having the next exception: Exception in thread "main" java.lang.IllegalArgumentException: Not a secondary key: org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida#solicitudParaAcuse*.
    I defined a Persistent class DatosSSSalidaAcuse.java to help indexing information as a SecondaryKey inside SolServicioSalida.java. DatosSSSalidaAcuse.java encapsulates all attributes that I need and each one has its KeyField annotation so I don’t handle why during code execution the system throws that exception even I reviewed the class implementation for the secondary key following the same rules as for a primary key type.
    Use this URL to view my class diagram:
    [http://i200.photobucket.com/albums/aa90/nordlicher/Job/ClassDiagram.jpg]
    Code:
    LlaveSolServicio.java*
    import com.sleepycat.persist.model.Persistent;
    import com.sleepycat.persist.model.KeyField;
    @Persistent
    public class LlaveSolServicio implements Comparable <LlaveSolServicio> {
    @KeyField(1)
    private String numEvento;
    private LlaveSolServicio() { super(); } // Requerido para deserializar.
    public LlaveSolServicio(String numEvento) {
    this.numEvento = numEvento;
    public String obtenNumEvento() {
    return numEvento;
    @Override
    public boolean equals(Object obj) {
    if (obj == null) {
    return false;
    if (getClass() != obj.getClass()) {
    return false;
    final LlaveSolServicio other = (LlaveSolServicio) obj;
    if ((this.numEvento == null) ? (other.numEvento != null) : !this.numEvento.equals(other.numEvento)) {
    return false;
    return true;
    @Override
    public int hashCode() {
    int hash = 7;
    hash = 43 * hash + (this.numEvento != null ? this.numEvento.hashCode() : 0);
    return hash;
    @Override
    public int compareTo(LlaveSolServicio objeto) {
    int result = 0;
    if (!equals(objeto)) {
    result = hashCode() - objeto.hashCode();
    return result;
    DatosSSSalidaAcuse.java*
    import com.sleepycat.persist.model.Persistent;
    import com.sleepycat.persist.model.KeyField;
    @Persistent
    public class DatosSSSalidaAcuse implements Comparable <DatosSSSalidaAcuse> {
    @KeyField(1)
    private Integer idNegocio;
    @KeyField(2)
    private Integer idSubsistema;
    @KeyField(3)
    private Integer idEntidad;
    @KeyField(4)
    private Integer pivote;
    @KeyField(5)
    private Long secuencial;
    @KeyField(6)
    private Byte estado;
    private DatosSSSalidaAcuse() { super(); } // Requerido para deserializar.
    public DatosSSSalidaAcuse(Integer idNegocio, Integer idSubsistema,
    Integer idEntidad, Integer pivote, Long secuencial, Byte estado) {
    this.idNegocio = idNegocio;
    this.idSubsistema = idSubsistema;
    this.idEntidad = idEntidad;
    this.pivote = pivote;
    this.secuencial = secuencial;
    this.estado = estado;
    public Integer obtenIdNegocio() {
    return this.idNegocio;
    public Integer obtenIdSubsistema() {
    return this.idSubsistema;
    public Integer obtenIdEntidad() {
    return this.idEntidad;
    public Integer obtenPivote() {
    return pivote;
    public Long obtenSecuencial() {
    return secuencial;
    public Byte obtenEstado() {
    return estado;
    public void asignaEstado(Byte estado) {
    this.estado = estado;
    @Override
    public boolean equals(Object obj) {
    if (obj == null) {
    return false;
    if (getClass() != obj.getClass()) {
    return false;
    final DatosSSSalidaAcuse other = (DatosSSSalidaAcuse) obj;
    if (this.idNegocio != other.idNegocio) {
    return false;
    if (this.idSubsistema != other.idSubsistema) {
    return false;
    if (this.idEntidad != other.idEntidad) {
    return false;
    if (this.pivote != other.pivote && (this.pivote == null || !this.pivote.equals(other.pivote))) {
    return false;
    if (this.secuencial != other.secuencial && (this.secuencial == null || !this.secuencial.equals(other.secuencial))) {
    return false;
    if (this.estado != other.estado && (this.estado == null || !this.estado.equals(other.estado))) {
    return false;
    return true;
    @Override
    public int hashCode() {
    int hash = 7;
    hash = 29 * hash + this.idNegocio;
    hash = 29 * hash + this.idSubsistema;
    hash = 29 * hash + this.idEntidad;
    hash = 29 * hash + (this.pivote != null ? this.pivote.hashCode() : 0);
    hash = 29 * hash + (this.secuencial != null ? this.secuencial.hashCode() : 0);
    hash = 29 * hash + (this.estado != null ? this.estado.hashCode() : 0);
    return hash;
    @Override
    public int compareTo(DatosSSSalidaAcuse objeto) {
    int resultado = 0;
    if (!equals(objeto)) {
    resultado = hashCode() - objeto.hashCode();
    return resultado;
    SolServicioSalida.java*
    import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.LlaveSolServicio;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.SecondaryKey;
    import com.sleepycat.persist.model.PrimaryKey;
    import static com.sleepycat.persist.model.Relationship.MANY_TO_ONE;
    import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.acuses.DatosSSSalidaAcuse;
    @Entity
    public class SolServicioSalida {
    @PrimaryKey
    private LlaveSolServicio llave;
    @SecondaryKey(relate = MANY_TO_ONE)
    private DatosSSSalidaAcuse llaveAcuse;
    private Byte noServicio;
    private Byte [] infoServ;
    private SolServicioSalida() { super(); }; //Requerido para deserializar.
    public SolServicioSalida(LlaveSolServicio llave,
    Byte noServicio, Byte [] infoServ, Integer idNegocio,
    Integer idSubsistema, Integer idEntidad, Integer pivote,
    Long secuencial, Byte estado) {
    this.llaveAcuse = new DatosSSSalidaAcuse(idNegocio, idSubsistema,
    idEntidad, pivote, secuencial, estado);
    this.llave = llave;
    this.noServicio = noServicio;
    this.infoServ = infoServ;
    public void asignaLlave(LlaveSolServicio llave) {
    this.llave = llave;
    public LlaveSolServicio obtenLlave() {
    return llave;
    public Byte[] obtenInfoServ() {
    return infoServ;
    public Byte obtenNoServicio() {
    return noServicio;
    public DatosSSSalidaAcuse obtenLlaveSSSalidaAcuse() {
    return llaveAcuse;
    ColaSalida.java* _(Test class that implements main() method and storage operations)_
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.EntityCursor;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.SecondaryIndex;
    import com.sleepycat.je.DatabaseException;
    import com.sleepycat.je.Transaction;
    import com.sleepycat.je.LockConflictException;
    import org.banxico.dgobc.dsop.mav.foliado.persistencia.salida.configuracion.ColaSalidaConfig;
    import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.LlaveSolServicio;
    import org.banxico.dgobc.dsop.mav.foliado.llave.servicio.salida.acuses.LlaveSSSalidaAcuse;
    import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida;
    import org.banxico.dgobc.dsop.mav.foliado.servicio.salida.acuses.DatosSSSalidaAcuse;
    import static org.banxico.dgobc.dsop.utileria.registro.AsistenteRegistrador.*;
    import org.apache.log4j.BasicConfigurator;
    import org.apache.log4j.Level;
    import org.apache.log4j.Logger;
    public class ColaSalida {
    private final String nombreRepositorio = "ColaSalida";
    private EntityStore repositorio;
    private StoreConfig cfgRepositorio;
    private PrimaryIndex<LlaveSolServicio, SolServicioSalida>
    solicitudPorEvento;
    private SecondaryIndex<DatosSSSalidaAcuse, LlaveSolServicio,
    SolServicioSalida> solicitudParaAcuse;
    private final int INTENTO_MAX_DEADLOCK = 3;
    public ColaSalida(ColaSalidaConfig ambienteCfg) {
    if (ambienteCfg != null) {
    if (ambienteCfg.obtenAmbiente().isValid()) {
    cfgRepositorio = new StoreConfig();
    cfgRepositorio.setReadOnly(
    ambienteCfg.obtenConfiguracion().getReadOnly());
    cfgRepositorio.setAllowCreate(
    !ambienteCfg.obtenConfiguracion().getReadOnly());
    if (ambienteCfg.obtenConfiguracion().getTransactional()) {
    cfgRepositorio.setTransactional(true);
    } else {
    cfgRepositorio.setTransactional(false);
    try {
    repositorio = new EntityStore(ambienteCfg.obtenAmbiente(),
    nombreRepositorio, cfgRepositorio);
    /** Primary Index de la base de objetos. **/
    solicitudPorEvento = repositorio.getPrimaryIndex(
    LlaveSolServicio.class, SolServicioSalida.class);
    /** Secondary Index de la base de objetos. **/
    solicitudParaAcuse = repositorio.getSecondaryIndex(
    solicitudPorEvento,
    DatosSSSalidaAcuse.class,
    "solicitudParaAcuse");
    } catch (DatabaseException dbe) {
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
    "Ocurrio un error en la creacion de los indicies. "
    + dbe.getMessage());
    System.exit(-1);
    } else {
    System.out.println("Ambiente de Base de Datos es null, "
    + "ejecucion fallida.");
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
    "Ambiente de Base de Datos es null, ejecucion fallida.");
    System.exit(-1);
    public void cerrarRepositorio() {
    if (repositorio != null) {
    try {
    repositorio.close();
    } catch (DatabaseException dbe) {
    System.err.println("Error cerrando el repositorio "
    + dbe.getLocalizedMessage());
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
    "Error cerrando el repositorio " + dbe.getMessage());
    public EntityStore obtenRepositorio() {
    return this.repositorio;
    public StoreConfig obtenConfigRepositorio() {
    return this.cfgRepositorio;
    public SolServicioSalida seleccionarPorEvento(LlaveSolServicio llave) {
    if (solicitudPorEvento == null && llave == null) {
    return null;
    } else {
    return solicitudPorEvento.get(llave);
    public SolServicioSalida seleccionarParaAcuse(DatosSSSalidaAcuse llave) {
    if (solicitudParaAcuse == null && llave == null) {
    return null;
    } else {
    return solicitudParaAcuse.get(llave);
    public boolean insertar(SolServicioSalida ssObj, boolean esTransaccional) {
    Transaction txn = null;
    boolean resultado = false;
    int numIntentos = 0;
    if (solicitudPorEvento != null && ssObj != null)
    if (esTransaccional) {
    while (numIntentos < INTENTO_MAX_DEADLOCK && !resultado) {
    try {
    txn = repositorio.getEnvironment().beginTransaction(
    null, null);
    resultado = solicitudPorEvento.putNoOverwrite(txn, ssObj);
    txn.commit();
    } catch (LockConflictException le) {
    try {
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION, ColaSalidaConfig.class,
    "Error al bloquear campo en el repositorio "
    + le.getMessage());
    if (txn != null) {
    txn.abort();
    txn = null;
    numIntentos++;
    if (numIntentos >= INTENTO_MAX_DEADLOCK
    && obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION,
    ColaSalidaConfig.class,
    "Limite de intentos excedido. "
    + "Deteniendo la operacion.");
    } catch (DatabaseException ae) {
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION,
    ColaSalidaConfig.class,
    "aborto de la txn fallido: " + ae.getMessage());
    } catch (DatabaseException e) {
    try {
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION,
    ColaSalidaConfig.class,
    "Error durante ejecucion de transaccion "
    + e.getMessage());
    if (txn != null) {
    txn.abort();
    txn = null;
    } catch (DatabaseException ae) {
    if (obtenerRegistrador(
    Registradores.OPERACION).isInfoEnabled()) {
    registrarComoInfoEn(OPERACION,
    ColaSalidaConfig.class,
    "aborto de la txn fallido: "
    + ae.getMessage());
    } else {
    resultado = solicitudPorEvento.putNoOverwrite(ssObj);
    return resultado;
    public EntityCursor obtenerCursorEventos() {
    EntityCursor eventos = null;
    if (solicitudPorEvento != null) {
    eventos = solicitudPorEvento.entities();
    return eventos;
    public static void main (String args []) {
    BasicConfigurator.configure();
    Logger logger = Logger.getRootLogger();
    logger.setLevel(Level.INFO);
         try {
    org.banxico.dgobc.dsop.EITyS.BMcripto.BMcripto.setProvider("BC");
         } catch (Exception e) {
    e.printStackTrace();
    java.util.Properties propiedades = new java.util.Properties();
    System.setProperty("registro.cfg", "file:"
    + ColaSalida.class.getResource("/cfg/registro.cfg").getPath());
    try {
    propiedades.load(new java.io.FileInputStream("./cfg/registro.cfg"));
         } catch (java.io.IOException ex) {
    ex.printStackTrace();
         org.apache.log4j.PropertyConfigurator.configure(propiedades);
         registrarComoInfoEn(MONITOREO, ColaSalida.class,
         "Asistente registrador inicializado.");
    ColaSalidaConfig cfg = new ColaSalidaConfig(new java.io.File("./jedb"));
    ColaSalida colaSalida = new ColaSalida(cfg);
    Byte [] info = {1, 0, 1, 0};
    boolean resultado = false;
    resultado = colaSalida.insertar(
    new SolServicioSalida(
    new LlaveSolServicio("abcd"),
    Byte.valueOf((byte)0),
    info,
    new Integer(0), new Integer(0), new Integer(0),
    new Integer(0),
    new Long(0),
    Byte.valueOf((byte)1)),
    false);
    registrarParaDepurarEn(NO_MONITOREO, ColaSalidaConfig.class,
    "[Insercion 1]: " + resultado );
    System.out.println("[Insercion 1]: " + resultado);
    Edited by: AlanC. on 07.10.2010 18:00

    Hello Alan,
    Please post a full stack trace whenever you report a problem. Without a stack trace, I'm guessing that the exception is coming from the call below:
                        solicitudParaAcuse = repositorio.getSecondaryIndex(
                                solicitudPorEvento,
                                DatosSSSalidaAcuse.class,
                                "solicitudParaAcuse");Because the message is:
    Not a secondary key: org.banxico.dgobc.dsop.mav.foliado.servicio.salida.SolServicioSalida#solicitudParaAcuseThe entity class is SolServicioSalida:
    @Entity
    public class SolServicioSalida {
      @PrimaryKey
      private LlaveSolServicio llave;
      @SecondaryKey(relate = MANY_TO_ONE)
      private DatosSSSalidaAcuse llaveAcuse;
      private Byte noServicio;
      private Byte [] infoServ;
    }You're passing "solicitudParaAcuse" as the last parameter to getSecondaryIndex. This is supposed to be the field name of a field in the entity class, SolServicioSalida. But there is no such field. The only field tagged with @SecondaryKey is llaveAcuse. So don't you want to pass "llaveAcuse" as the last parameter?
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Composite key constraint in SSIS

    Hi All,
    I have created one SSIS package to move data from one table to another table in same database using oledb connection.Now I want to enforce composite key constraint while moving data as follows:
    Table A has following contents :                                                 
    Col1   col2  col3
    1         a        b
    2         c        d
    3         a        b
    So,while moving data, i want to verify the contents of col2 and col3(col2+col3) ie,composite key made of col2 and col3.In this case i want to move data of row 2 only and data of row 1 and 3 will go to error log file.
    I am trying to use lookup here but no luck yet. Can anybody help me to achieve this .
    Thanks in advance,
    Sanket 

    Hi Sanket, 
    I do agree with Visakh approach if table reside on same server, why go for the SSIS. But If you still want to do it, here are steps(It bit complex for simple operation like this, i didn't find
    any other approach).  I am using same table structure as mentioned above: 
    create table sampletest
     col1 int ,
     col2 varchar(10),
     col3 varchar(10)
    GO
    insert into sampletest
    values (1,'a','b'),(2,'c','d'),(3,'a','b')
    1.)   Load the
    Data from source with all columns.
    2.)   Place an Aggregate
    Task .Here is configuration:
    Column
    Operation
    Col1
    Max/Min
    Col2
    Group by
    Col3
    Group by
     (*)  - Output Alias (say cnt)
    Count All
    Figure 1: 
    3.)  Place a condition split. With expression
    (DT_I4)Cnt == 1
    2.)   
    Move case1 to destination table and other conditional split to error table.
    Full Diagram:
    Regards Harsh

  • Connect macbook to composite tv

    Hi there,
    I have a macbook (2009) model that I want to connect to a composite tv. I think the Apple Mini-DVI to Video Adapter will not work as it states on the mac site that "This adapter is not compatible with the 2.0GHz Intel Core 2 Duo white MacBook introduced in January 2009."
    Any ideas?
    Thanks

    Mort,
    The article only indicates the ability to output video via DVI and VGA. There is no mention for Composite.
    This article (for a late-2007 MacBook) does indicate compatibility for composite:
    http://support.apple.com/kb/sp12
    The OP may need a different solution, such as this:
    VGA to RCA converter box
    ~Lyssa

  • CR2008 connectivity issue with BOE Universes(sap and non sap universes)

    Hi Experts !!
    Recently we tried to build/connect to a Universe in Crystal Reports2008 via 'Make a new connection tab'.
    The universes are of SAP BW or non SAP Lying in BOE Servers and we are trying to build reports on them by conncting/utilizing the universes as a database for Crystal Reporting.
    Our issue is most of the time we are not able to connect to the Universes and the connectivity blows out by some 'communication Error' thing initially.
    While at some other points in time, the connectivity takes us to the Universe and we are able to select few characteristics and key figures from the Universe but the moment we go futher and try to run by pressing 'OK' button it blows out and say' LOGON FAILED'.
    Apparantly, it is an connectivity issue with BOE server and from the different blogs it looks like it is a known issue for long.
    The proposed issue resolution were like either CR2008 should be SP2 with BOE SP3 or there should be some additional .dll files defined in the paths in case of MSSQL database. None of this applies to us as we are on CR2008 with SP3 and going back to SP2 is probably not a viable option for us, and we are using Oracle as underlying database in this specific case.( i would like to tell you here that we are able to connect to Oracle Database directly though).
    We have raised a message with SAP and was just wondering if we do have some solution/workaround already available to this known issue in place please?
    Thanks&Regards.
    Edited by: AMIT GHILDYAL on Aug 1, 2011 2:41 PM
    Edited by: AMIT GHILDYAL on Aug 1, 2011 2:44 PM
    Edited by: AMIT GHILDYAL on Aug 1, 2011 3:14 PM

    Hi Amit,
    Moved to Universe Forum.
    If you have a case logged then no point posting here also, this is a public site and not a case management tool.
    Once you do get the solution from your case please post it here also to help others if they have the same problem.
    Thank you
    Don

  • 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

Maybe you are looking for