"key inappropriate for algorithm" error using BouncyCastle

Hi,
I am working on an email client application that sends encrypted emails.
For encryption i have followed the approach :
1) Generated a private/public key pair for RSA using OpenSSL.
2)Generated a certificate using OpenSSL which contains Private and public keys(RSA Keys).
3) Using BouncyCastle to prepare an encrypted MimeMessage instance using SMIMEEnvelopedGenerator like :
SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
gen.addKeyTransRecipient((X509Certificate) chain[0]);
msgbody = gen.generate(msgbody,SMIMEEnvelopedGenerator.RC2_CBC, 2048,"BC");
As the keys contained in the certificate are for RSA and the algorithm specified in the generate() method is "RC2_CBC", it throws an exception
java.io.IOException: org.bouncycastle.cms.CMSException: key inappropriate for algorithm.
     at org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator$ContentEncryptor.write(Unknown Source)
     at org.bouncycastle.mail.smime.handlers.PKCS7ContentHandler.writeTo(Unknown Source)
     at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
     at javax.activation.DataHandler.writeTo(DataHandler.java:295)
     at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1209)
     at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1614)
     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:537)
But i tried with all other algo options also and it gives the same error..
Requirement is asymmetric encryption of MimeMessage.
Kindly help me in case someone has faced/solved such a situation or correct me in case the approach is wrong
Thanks

Hi,
I am working on an email client application that sends encrypted emails.
For encryption i have followed the approach :
1) Generated a private/public key pair for RSA using OpenSSL.
2)Generated a certificate using OpenSSL which contains Private and public keys(RSA Keys).
3) Using BouncyCastle to prepare an encrypted MimeMessage instance using SMIMEEnvelopedGenerator like :
SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
gen.addKeyTransRecipient((X509Certificate) chain[0]);
msgbody = gen.generate(msgbody,SMIMEEnvelopedGenerator.RC2_CBC, 2048,"BC");
As the keys contained in the certificate are for RSA and the algorithm specified in the generate() method is "RC2_CBC", it throws an exception
java.io.IOException: org.bouncycastle.cms.CMSException: key inappropriate for algorithm.
     at org.bouncycastle.mail.smime.SMIMEEnvelopedGenerator$ContentEncryptor.write(Unknown Source)
     at org.bouncycastle.mail.smime.handlers.PKCS7ContentHandler.writeTo(Unknown Source)
     at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
     at javax.activation.DataHandler.writeTo(DataHandler.java:295)
     at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1209)
     at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1614)
     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:537)
But i tried with all other algo options also and it gives the same error..
Requirement is asymmetric encryption of MimeMessage.
Kindly help me in case someone has faced/solved such a situation or correct me in case the approach is wrong
Thanks

Similar Messages

  • [svn:fx-trunk] 5408: Fix for - Compiler error using Reparent in a Halo Navigator.

    Revision: 5408
    Author: [email protected]
    Date: 2009-03-18 20:57:19 -0700 (Wed, 18 Mar 2009)
    Log Message:
    Fix for - Compiler error using Reparent in a Halo Navigator.
    QE Notes: None.
    Doc Notes: None.
    Reviewer: Paul, please review.
    Bugs: SDK-20099
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-20099
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a

  • No registered window for:w0 error using Jdev 11.1.2.4.0

    Hi,
    We are using JDev 11.1.2.4.0 version. We have created an ADF application and deployed it to weblogic server 10.3.5.0.
    When we run the application in IE 9 "No registered window for:w0" error appears in the logs. But for IE8 there is no such error. For mozilla 13 also there is no such error in the logs. Any pointers to it.

    Hi,
    I think you will have to run this through customer support (if you have a support contract) because I don't remember a discussion about such a problem here on OTN. May be mistaken though. The error sounds like a failure in the ADF Faces windowing manager
    Frank

  • Error 1603 - key invalid for use in specified stat...

    cannot use skype, cannot re-install Skype
    get: error 1603
    and window stating: key invalid for use in specified state
    Skype was working fine up to yesterday (Sept 15 2014)

    ruwim escribió:
    Try to uninstall Windows Security update KB2918614.
    http://community.skype.com/t5/Windows-desktop-client/Error-Key-not-valid-for-use-in-specified-state/​...
    I personally whould not recommend that, because uninstalling the update KB2918614 places the Windows Installer service back to its original design, but also leaves it vulnerable to the reported security issue https://technet.microsoft.com/library/security/MS1​4-049
    more info about this here: http://windowsitpro.com/security/bug-or-feature-kb​2918614-alters-windows-installer-behavior
    so, the right way to solve this this, is fixing user credentials and permissions, that could be corrupted by a virus.
    1 - Reset File Permissions: http://www.tweaking.com/content/page/reset_file_pe​rmissions.html
    2 - Reset Registry Permissions: http://www.tweaking.com/content/page/reset_registr​y_permissions.html
    3 - Repair MSI (Windows Installer): http://www.tweaking.com/content/page/repair_msi_wi​ndows_installer.html
    after that, you can try uninstall KB2918614 and then install KB2918614 again from Windows Update in Control Panel.

  • Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.

    html,body{padding:0;margin:0;font-family:Verdana,Geneva,sans-serif;background:#fff;}html{font-size:100%}body{font-size:.75em;line-height:1.5;padding-top:1px;margin-top:-1px;}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0
    0 1em;padding:0 .2em}.t-marker{display:none;}.t-paste-container{;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}a{color:#00a}code, pre{font-size:1.23em}
    I get this message on two different machines installing SQL2014 developer edition, a Windows 7 and a Windows 8 machine. Both machines have SQL2005 through SQL2012 developer machines installed and working great. I have tried uninstalling all SQL2014 stuff and
    installing again making sure I was running as an Administrator to no avail. 
    How do I look at sys.key_encryptionswhen the server will not start to finish installation?
    The links in the log only provide the  "We're Sorry" message.
    This is the first error dialog info
    TITLE: Microsoft SQL Server 2014 Setup
    The following error has occurred:
    Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
    For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%25400x4BDAF9BA%25401306%254026
    The SQL Server error log has the message in the title.
    2014-04-04 17:02:17.49 Server      Microsoft SQL Server 2014 - 12.0.2000.8 (X64) 
     Feb 20 2014 20:04:26 
     Copyright (c) Microsoft Corporation
     Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    2014-04-04 17:02:17.49 Server      UTC adjustment: -4:00
    2014-04-04 17:02:17.49 Server      (c) Microsoft Corporation.
    2014-04-04 17:02:17.49 Server      All rights reserved.
    2014-04-04 17:02:17.49 Server      Serverprocess ID is 9236.
    2014-04-04 17:02:17.49 Server      System Manufacturer: 'Hewlett-Packard', System Model: 'HP EliteBook8760w'.
    2014-04-04 17:02:17.49 Server      Authentication mode is MIXED.
    2014-04-04 17:02:17.49 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Log\ERRORLOG'.
    2014-04-04 17:02:17.49 Server      The service account is 'NT Service\MSSQL$SQL2014'. This is an informational message; no user action is required.
    2014-04-04 17:02:17.49 Server      Registry startup parameters: 
      -d C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\master.mdf
      -e C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Log\ERRORLOG
      -l C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\mastlog.ldf
    2014-04-04 17:02:17.49 Server      Command Line Startup Parameters:
      -s "SQL2014"
      -m "SqlSetup"
      -Q
      -q "SQL_Latin1_General_CP1_CI_AS"
      -T 4022
      -T 4010
      -T 3659
      -T 3610
      -T 8015
    2014-04-04 17:02:17.79 Server      SQL Server detected 1 sockets with 4 cores per socket and 8 logical processors per socket, 8 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message;
    no user action is required.
    2014-04-04 17:02:17.79 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-04-04 17:02:17.79 Server      Detected 8142 MB of RAM. This is an informational message; no user action is required.
    2014-04-04 17:02:17.80 Server      Using conventional memory in the memory manager.
    2014-04-04 17:02:17.92 Server      Default collation: SQL_Latin1_General_CP1_CI_AS (us_english1033)
    2014-04-04 17:02:17.95 Server      Perfmoncounters for resource governor pools and groups failed to initialize and are disabled.
    2014-04-04 17:02:17.96 Server      Query Store settings initialized with enabled = 1, 
    2014-04-04 17:02:17.97 Server      The maximum number of dedicated administrator connections for this instance is '1'
    2014-04-04 17:02:17.97 Server      This instance of SQL Server last reported using a process ID of 8760 at 4/4/2014 5:02:08 PM (local) 4/4/2014 9:02:08 PM (UTC). This is an informational message only; no user action is required.
    2014-04-04 17:02:17.97 Server      Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message
    only. No user action is required.
    2014-04-04 17:02:17.97 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    2014-04-04 17:02:18.00 Server      Database Mirroring Transport is disabled in the endpoint configuration.
    2014-04-04 17:02:18.00 spid7s      Warning ******************
    2014-04-04 17:02:18.00 spid7s      SQL Server started in single-user mode. This an informational message only. No user action is required.
    2014-04-04 17:02:18.01 spid7s      Starting up database 'master'.
    2014-04-04 17:02:18.02 Server      Software Usage Metrics is disabled.
    2014-04-04 17:02:18.07 Server      CLR version v4.0.30319 loaded.
    2014-04-04 17:02:18.11 spid7s      8 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
    2014-04-04 17:02:18.24 spid7s      0 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
    2014-04-04 17:02:18.25 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
    2014-04-04 17:02:18.26 Server      Common language runtime (CLR) functionality initialized using CLR version v4.0.30319 from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\.
    2014-04-04 17:02:18.34 spid7s      Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.
    2014-04-04 17:02:18.40 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    2014-04-04 17:02:18.40 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
    2014-04-04 17:02:18.44 spid7s      SQL Trace ID 1 was started by login "sa".
    2014-04-04 17:02:18.44 spid7s      Server name is 'TOMGROSZKO-HP\SQL2014'. This is an informational message only. No user action is required.
    2014-04-04 17:02:18.46 spid16s     Error: 17190, Severity: 16, State: 1.
    2014-04-04 17:02:18.46 spid16s     Initializing the FallBackcertificate failed with error code: 1, state: 20, error number: 0.
    2014-04-04 17:02:18.46 spid16s     Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
    2014-04-04 17:02:18.46 spid16s     Error: 17182, Severity: 16, State: 1.
    2014-04-04 17:02:18.46 spid16s     TDSSNIClientinitialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property. 
    2014-04-04 17:02:18.46 spid16s     Error: 17182, Severity: 16, State: 1.
    2014-04-04 17:02:18.46 spid16s     TDSSNIClientinitialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property. 
    2014-04-04 17:02:18.46 spid16s     Error: 17826, Severity: 18, State: 3.
    2014-04-04 17:02:18.46 spid16s     Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
    2014-04-04 17:02:18.46 spid16s     Error: 17120, Severity: 16, State: 1.
    2014-04-04 17:02:18.46 spid16s     SQL Server could not spawn FRunCommunicationsManagerthread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
    And a copy of the install log.
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2061893606
      Start time:                    2014-04-04 16:23:39
      End time:                      2014-04-04 17:06:25
      Requested action:              Install
    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for RS:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for DQ:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Machine Properties:
      Machine name:                  TOMGROSZKO-HP
      Machine processor count:       8
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered  Configured
      SQL Server 2005      SQL2005              MSSQL.1                        Database Engine Services            
        1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005      SQL2005              MSSQL.1                        SQL Server Replication              
        1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005      SQL2005              MSSQL.1                        Full-Text and Semantic Extractions for Search 1033      
              Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005      SQL2005              MSSQL.1                        SharedTools                
                 1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005      SQL2005              MSSQL.2                        Analysis Services              
             1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005      SQL2005              MSSQL.3                        Reporting Services - Native            
     1033                 Developer Edition (64-bit) 9.00.1399.06    No         Yes       
      SQL Server 2005                                                          DTS        
                                 1033                 Developer Edition (64-bit) 9.4.5069        No        
    Yes       
      SQL Server 2005                                                          Tools        
                               1033                 Developer Edition (64-bit) 9.4.5069        No         Yes
      SQL Server 2005                                                          ToolsClient      
                           1033                 Developer Edition (64-bit) 9.4.5069        No         Yes    
      SQL Server 2005                                                          ToolsClient\Connectivity  
                  1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005                                                          ToolsDocument      
                         1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005                                                          ToolsDocument\BOL    
                       1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005                                                          ToolsDocument\Samples    
                   1033                 Developer Edition (64-bit) 9.4.5069        No         Yes       
      SQL Server 2005                                                          NS          
                                1033                 Developer Edition (64-bit) 9.4.5069        No         Yes
      SQL Server 2008 R2   SQL2008R2            MSSQL10_50.SQL2008R2           Database Engine Services                 1033          
          Developer Edition    10.51.2550.0    No         Yes       
      SQL Server 2008 R2   SQL2008R2            MSSQL10_50.SQL2008R2           SQL Server Replication                   1033        
            Developer Edition    10.51.2550.0    No         Yes       
      SQL Server 2008 R2   SQL2008R2            MSSQL10_50.SQL2008R2           Full-Text and Semantic Extractions for Search 1033                 Developer
    Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2   SQL2008R2            MSAS10_50.SQL2008R2            Analysis Services                        1033  
                  Developer Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2   SQL2008R2            MSRS10_50.SQL2008R2            Reporting Services - Native              1033          
          Developer Edition    10.51.2550.0    No         Yes       
      SQL Server 2008 R2                                                       Management Tools - Basic      
              1033                 Developer Edition    10.51.2550.0    No         Yes       
      SQL Server 2008 R2                                                       Management Tools - Complete    
             1033                 Developer Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2                                                       Client Tools Connectivity      
             1033                 Developer Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2                                                       Client Tools Backwards Compatibility  
      1033                 Developer Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2                                                       Client Tools SDK        
                    1033                 Developer Edition    10.51.2500.0    No         Yes       
      SQL Server 2008 R2                                                       Integration Services      
                  1033                 Developer Edition    10.51.2550.0    No         Yes       
      SQL Server 2012      SQL2012              MSSQL11.SQL2012                Database Engine Services                 1033  
                  Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012      SQL2012              MSSQL11.SQL2012                SQL Server Replication                   1033
                    Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012      SQL2012              MSSQL11.SQL2012                Full-Text and Semantic Extractions for Search 1033            
        Developer Edition    11.1.3000.0     No         Yes       
      SQL Server 2012      SQL2012              MSSQL11.SQL2012                Data Quality Services                    1033
                    Developer Edition    11.1.3000.0     No         Yes       
      SQL Server 2012      SQL2012              MSAS11.SQL2012                 Analysis Services                    
       1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012      SQL2012              MSRS11.SQL2012                 Reporting Services - Native              1033  
                  Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          Management Tools - Basic  
                  1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          Management Tools - Complete  
               1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          Client Tools Connectivity  
                 1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          Client Tools Backwards Compatibility
        1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          Client Tools SDK      
                      1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          BIDS        
                                1033                 Developer Edition    11.1.3128.0     No         Yes  
      SQL Server 2012                                                          SQL Server Data Tools - Business
    Intelligence for Visual Studio 2012 1033                                      11.1.3402.0     No         Yes       
      SQL Server 2012                                                          Integration Services    
                    1033                 Developer Edition    11.1.3128.0     No         Yes       
      SQL Server 2012                                                          LocalDB        
                             1033                 Express Edition      11.1.3128.0     No         Yes    
      SQL Server 2012                                                          Master Data Services    
                    1033                 Developer Edition    11.1.3000.0     No         Yes       
    Package properties:
      Description:                   Microsoft SQL Server 2014 
      ProductName:                   SQL Server 2014
      Type:                          RTM
      Version:                       12
      SPLevel:                       0
      Installation location:         C:\Downloads\SQL2014\SQL\x64\setup\
      Installation edition:          Developer
    Product Update Status:
      None discovered.
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 NT Service\SQLAgent$SQL2014
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   C:\SQLData\MSSQL\SQL2014\Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   C:\Program Files\Microsoft SQL Server\MSAS12.SQL2014\OLAP\Config
      ASDATADIR:                     C:\SQLData\MSSQL\SQL2014\OLAP
      ASLOGDIR:                      C:\SQLData\MSSQL\SQL2014\OLAP
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  NT Service\MSOLAP$SQL2014
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            TomGroszko-HP\Tom Groszko
      ASTEMPDIR:                     C:\SQLData\MSSQL\SQL2014\OLAP
      BROWSERSVCSTARTUPTYPE:         Automatic
      CLTCTLRNAME:                   <empty>
      CLTRESULTDIR:                  <empty>
      CLTSTARTUPTYPE:                0
      CLTSVCACCOUNT:                 <empty>
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 <empty>
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20140404_162339\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               0
      CTLRSVCACCOUNT:                <empty>
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     <empty>
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                true
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP, RS_SHPWFE, DQC, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, MDS
      FILESTREAMLEVEL:               3
      FILESTREAMSHARENAME:           SQL2014
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher$SQL2014
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  true
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              c:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           c:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    SQL2014
      INSTANCENAME:                  SQL2014
      ISSVCACCOUNT:                  NT Service\MsDtsServer120
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          <empty>
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              SharePointFilesOnlyMode
      RSSVCACCOUNT:                  NT Service\ReportServer$SQL2014
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  SQL
      SQLBACKUPDIR:                  C:\SQLData\MSSQL\SQL2014\Backup
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 NT Service\MSSQL$SQL2014
      SQLSVCPASSWORD:                <empty>
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           TomGroszko-HP\Tom Groszko
      SQLTEMPDBDIR:                  C:\SQLData\MSSQL\SQL2014\Engine
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  C:\SQLData\MSSQL\SQL2014\Engine
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  true
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      USEMICROSOFTUPDATE:            false
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20140404_162339\ConfigurationFile.ini
    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Passed
      Feature:                       Client Tools Connectivity
      Status:                        Passed
      Feature:                       Client Tools SDK
      Status:                        Passed
      Feature:                       Client Tools Backwards Compatibility
      Status:                        Passed
      Feature:                       Management Tools - Basic
      Status:                        Passed
      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Data Quality Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Master Data Services
      Status:                        Passed
      Feature:                       Integration Services
      Status:                        Passed
      Feature:                       Data Quality Client
      Status:                        Passed
      Feature:                       Analysis Services
      Status:                        Passed
      Feature:                       Reporting Services - SharePoint
      Status:                        Passed
      Feature:                       Reporting Services Add-in for SharePoint Products
      Status:                        Passed
      Feature:                       Documentation Components
      Status:                        Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20140404_162339\SystemConfigurationCheck_Report.htm
    Any suggestions for what step to take next will be appreciated.
    Thanks
    Tom G.

    Hi Tom,
    Sorry for the delay. We can exclude the media factor since you were able to install it on VM with this media.
    If I understand correctly, Shanky said “Abve message can also appear due to corrupt profile so deleteting old profile and creating new one and using this to install would also help.Make sure you always RK on setup.exe and select run as administrator” which
    means your user account may be corrupted rather than the Virtual account. You can create a new Windows user account and use it to log into the system. Then, re-try the installation.
    Additional information:
    http://windows.microsoft.com/en-us/windows/create-user-account#create-user-account=windows-8
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Error installing Office 2013 on Server 2012 R2 RDS - Error 25004: the product key you entered cannot be used on this machine

    Hi there,
    I really hope someone can help me as I am tearing my hair out trying to get this resolved!
    I am working on a Server 2012 R2 server with RDS running. Before it was turned into a RDS server it had a copy of Office 2010 running as a trial to see would it work for the accounting package that is running for users via Remote Desktop. Trial worked ok
    so it was converted into a RDS server. Now, as its a RDS it needs to run Office under a volume licence, which I have. However when trying to install I get the message: "Error 25004: the product key you entered cannot be used on this machine. this is most
    likely due to previous Office 2013 trials being installed on the system."
    In summary I have tried everything I can think of and find to remove all traces of the old Office from the machine but still this message persists. I have run the Fix It For Me uninstall from MS and it cannot find any Office installed. i have manually searched
    through all of the Windows directories including Program Files and AppData and removed all traces of Office from there, I have searched the registry and removed all I can find from there.
    Where or what file does the installer look at to see that a previous version was installed? 
    I cannot scrub this machine which I would have done long ago because there is another SQL Server based application running on it.
    Really really appreciate anyone that can help me on this,
    Thanks

    Hi,
    I have definitely heard your frustration, and I’ll try my best to help you.
    Since Office 2010 installed on it before, you need to remove Office 2010 completely.
    KB about this error:
    http://support2.microsoft.com/kb/2792178
    A similar issue is addressed here. Although this method is based on Office 2010, but we can have a try:
    http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Q_28475448.html
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Office 2013 Technet installation Error 25004. The product key you entered cannot be used on this machine. (System error: - 1073422314)

    I am receiving an error when attempting to install
    Microsoft Office Professional Plus 2013 which I downloaded from the TechNet site.  At the end of the installation process I receive the following message: 
    "Error 25004. The product key you entered cannot be used on this machine. This is most likely due to previous Office 2013 trials being installed. (System error:
    -1073422314)"
    I have never installed a trial or Beta of any Office product on this machine.   However, I have installed Office 2007 Ultimate and Office 2010 Professional Plus.  All of these are 32bit versions downloaded from TechNet site.  In addition,
    prior to this error I had attempted unsuccessfully to install the 64bit version of Office 2013 as well as standalone versions of Visio Professional 2013 x64 and Project professional 2013 x64.   All three of these installations failed due to previous
    installation of 32bit Office software, so I have downloaded the 32 bit versions but not yet tried to install, other than Office 2013. 
    I used the Custom upgrade option during the attempted install of Office 2013, specifying "keep all prior versions".
    Note that all the above was done on a new machine.  The specific purpose was to test co-existence of multiple versions of OFFICE (2007, 2010, 2013) to facilitate user training and migration.
    I have tried uninstalling via Control Panel, and performed some of the steps for manual removal, however did not do all of them since 1) They are quite lengthy and 2) Some of them seem to involve removing ALL prior versions of Office, which I do not want
    to do; the earlier versions are working properly and I do not want to have to uninstall them.  Just want to uninstall and reinstall Office 2013.   Also tried running  O15CTRREMOVE.diagcab which indicated that it could not find a problem,
    but did not seem to remove anything. 
    I have read about ten recommended TechNet articles, which recommend everything from running a FIXIt tool, uninstalling all OFFICE software, and reformatting the whole machine.  Most of these involve System error -1073418209 rather than -1073422314 (which
    is the code that I am getting).   Other than that the problem sounds the same.  This seems to be a problem with key management and copy protection in these products, dating back to 2010.  Dozens of IT professionals have tried the solutions
    and vented their frustration since other than the full format, the other solutions work only sporadically, if at all.  Some of these people had been working with trial or beta software, but many who encountered this problem had not.  As
    noted above, none of my software was a trail version.    I do not want to uninstall all the OFFICE versions, particularly if it as likely as not will not resolve the issue.   (I am also getting paranoid to the extent of fearing that
    after uninstalling everything I might not be able to reinstall any version).  I think what we need here is a definitive fix from Microsoft, though I am not too hopeful, in view of the lack of response to all the other technicians who have been struggling
    with this for at least the past three years. 
    If anyone is aware of a solution which works consistently, I would appreciate it.  Reformatting however is not an option.  Detailed instructions for completely uninstalling Office 2013 (ONLY 2013) might be helpful.  I would be willing to uninstall
    all versions, but only as a last resort, and only if there is some assurance that this will actual solve the problem (for many others it did not seem to do so).
    Thanks
    PS: Probably doesn't matter, but I am running this on Windows 7 Pro w/SP1, 64 bit edition.

    Tony,
    Thanks for your reply.   I do in fact have three versions of Office installed on this machine, 2007 2010 and (hopefully) 2013.  I have on previous occasions installed 2007 and 2010 on a single machine, but this is my first attempt to install
    2013.   
    According to TechNet article  office.microsoft.com/en-us/support/install-and-use-multiple-versions-of-office-on-the-same-pc-HA103981695.aspx (Install
    and use multiple versions of Office on the same PC) it is possible to install
    Office 2003 2007 2010 and 2013 on a single system, provided they are installed in the sequence indicated.  It is noted that some problems may occur, notably involving file associations, but there is no
    mention of any activation key issues.   
    As stated in my original request, the software which I have installed is NOT a trail version.   I did NOT obtain it from the evalcenter, but from
    https://technet.microsoft.com/en-US/subscriptions/securedownloads/hh442904.  
    The above is a full retail version.    The files which I downloaded are:
    en_office_ultimate_2007_united_states_x86_dvd_480625.iso
    en_office_professional_plus_2010_x86_515486.exe
    en_office_professional_plus_2013_x86_dvd_1123673.iso
    I know that the error message says that the problem is commonly caused by attempting to install trial software more than once, but that is not the case.  Several other people have reported this same problem, sometimes involving trial software but not
    in every case.    My own opinion is that this is a software bug involving key management and copy protection. 
    Many people have reported on TechNet that the problem was NOT resolved even after uninstalling all Office software.  While there is a chance I might get lucky, I really would like a solution which has a better chance for success.
    By any chance, does the error code 1073422314
    provide any further insight into this issue?
    Thanks again for your help.  However, further assistance is needed to resolve this issue.
    PS: Sorry the font sizes are so mixed up, I haven't quite figured out how to control the formatting when I paste

  • Key store problem using bouncycastle

    Hey guys, i'm writing pseudo PGP encryption code using bouncycastle provider. Now everything works great when i start my project from NETBeans 6.8, but when i build .jar file,execute it and try to create a key store i get following message : "java.io.IOException: Error initialising store of key store : java.security.NoSuchProviderException: JCE cannot authenticate the provider BC" . Does anyone knows what might be the problem?

    Vaskea wrote:
    Hey guys, i'm writing pseudo PGP encryption code using bouncycastle provider. Now everything works great when i start my project from NETBeans 6.8, but when i build .jar file,execute it and try to create a key store i get following message : "java.io.IOException: Error initialising store of key store : java.security.NoSuchProviderException: JCE cannot authenticate the provider BC" . Does anyone knows what might be the problem?You probably have not included the BC JCE jar in your classpath!

  • FRM-40735 Error when trying to add an employee as key member for a project

    FRM-40735: ON Insert trigger raised unhandled exception ORA-06502 in PAXPREPR when trying to add an employee as key member for a project
    Tried generating FND log messages to see if it shows any error messages but it didn't show any specific error.

    Error ORA-06502 says PL/SQL: numeric or value error.
    The Error could be in the data already exist in the system for key members. If this Project was created using APIs, there are possibilities that some other character( i.e. next line chracter ) got entered in the column value which Form "PAXPREPR" is not able to fetch or update.
    You can query the key member data from back-end to check if any data corruption is there. you may require data-fix to correct that.
    AB

  • Key invalid in messgae error (BouncyCastle Encryption)

    I am trying to use bouncycastle to encrypt some data but am getting a "key invalid in message" error whenever I run it. My question is: what the hell could this mean? what could i be doing wrong. I get a feeling it's not a code issue, so what could it be?
    This is the actual place it falls over at:
    CMSEnvelopedData envData = envGenerator.generate( new CMSProcessableByteArray(signed),CMSEnvelopedDataGenerator.DES_EDE3_CBC, 192,"BC" );
    Please help. I am officially confused.

    I have the same exception but with an other problem. I want to read an encrypted mail.
    KeyStore    ks = KeyStore.getInstance("PKCS12", "BC");
                ks.load(new FileInputStream("/coucou.pfx"), "azerty".toCharArray());
                Enumeration e = ks.aliases();
                String      keyAlias = null;
                while (e.hasMoreElements())
                    String  alias = (String)e.nextElement();
                    if (ks.isKeyEntry(alias))
                        keyAlias = alias;
                X509Certificate cert = (X509Certificate)ks.getCertificate(keyAlias);
                RecipientId     recId = new RecipientId();
                recId.setSerialNumber(cert.getSerialNumber());
                recId.setIssuer(cert.getIssuerX500Principal().getEncoded());
                SMIMEEnveloped       m = new SMIMEEnveloped(msg);
                RecipientInformationStore   recipients = m.getRecipientInfos();
                RecipientInformation        recipient = recipients.get(recId);
                Iterator iterator = recipients.getRecipients().iterator();
                while(iterator.hasNext())
                     RecipientInformation temp = (RecipientInformation)iterator.next();
                     if(temp!=null)
                          recipient = temp;
                MimeBodyPart        res = SMIMEUtil.toMimeBodyPart(recipient.getContent(ks.getKey(keyAlias, null), "BC"));
                System.out.println(res.getContent());The message "Key invalid in message error " appears at the line :
    MimeBodyPart        res = SMIMEUtil.toMimeBodyPart(recipient.getContent(ks.getKey(keyAlias, null), "BC"));Please help !

  • Error for  COM routine using application program (return code 40069)

    Hi,
    In our planning book, sometimes, when we change a value and save, we are getting a pop up with the message "Error for  COM routine using application program (return code 40069)". When we click ok, the value in that cell is reset to the previous value.
    I initially thought this is due to duplicate CVCs and ran the consistency checks, /SAPAPO/TS_LCM_CONS_CHECK and /SAPAPO/TS_PSTRU_CONS_CHECK. I found few and corrected them. Now even after correcting them, I am still getting this COM error.
    I could not find any SAP notes on this.
    I switched on the SQL trace in ST05 and executed the same operation to get the COM error.
    I noticed this part of the trace that is unusual and I am guessing that is what the system is doing when I get the error.
    Can somebody please explain me the meaning of this attached trace?
    http://spreadsheets.google.com/pub?key=pMjKR_3qLaxblBDDPfRt6cw
    what does the SIM_SIMSESSION_CONTROL do?
    Does CALL USER.SAPTS_AGGMULT_TIMESERIES  mean there are duplicate time series?
    Thanks.

    I may not be technical person but may be the following thread on SIMSESSION may help.
    SIM Session
    ST05 trace only gives DB level traces. It would not give you traces of things happening in Live Cache since there are stored DB procedures that are called for LC activity.
    Did you do OSS search on "return code 40069" ? CHeck OSS note 863244. See if it is applicable.

  • "Error for COM routine using application program (return code 1028514-)"

    Hello Experts,
    We have one issue in SAP SAP SCM 5.10.
    When we are accessing the SNP Planing book, Now a days every often we are getting kicked out of the Planning book
    with the error message "Error for COM routine using application program (return code 1028514-)"
    How to rectify this,..Please advice /suggest
    Regards,
    Ramesh

    Sorry, I copy the content as below:
    Error -28514
    Version Not Found
    You attempted to access an OMS version, the liveCache infrastructure to store a Simulation Version, which does not exist (any longer).
    On a productive system this error should only occur in exceptional situations because liveCache checks whether the simulation exists beforehand and returns an Error 17831 if this is not the case.
    Reasons (=exceptional situation) for an error -28514 are:
    a transactional simulation (Simulation Version) is older than liveCache parameter MaxRetentionTime (default: 8 hours). In this case, the OMS version (more precisely: the corresponding consistent view) can be deleted (asynchronously) by liveCache and an error -28514 will occur if the application tries to use the transactional simulation again.
    a transactional simulation (Simulation Version) is older than liveCache parameter MinRetentionTime (default: 1 hour) and the data area usage exceeds 90%. In this case, the OMS version (more precisely: the corresponding consistent view) can be deleted (asynchronously) by liveCache and an error -28514 will occur if the application tries to use the simulation again.
    If liveCache deletes an OMS version due to one of the reasons above, a corresponding notice can be found in liveCache's knlmsg file (cyclically overwritten!).
    Error -28833
    Error -28833 ("Consistent view has been cancelled") occurs instead of an error -28514, if the an OMS version is deleted while a parallel liveCache call is still using this OMS version.
    Malfunction Test
    If this error occurs during LCAPPS internal malfunction tests, it indicates that the preceeding provoked exception has not been handled correctly. During the handling of the provoked exception the OMS version is dropped automatically. As the malfunction test program catches the exception which would normally lead to a shortdump, it either has to recreate the current simulation in liveCache or to ensure that it is not used any more.
    Error 17831 does not occur in this situation, because the keyed object representing the simulation (OMS version) is not deleted along with the version and can therefore still be accessed.
    Best Regards,
    Ada

  • Error for COM routine using application program (return code 40.301)

    Hi All,
    We are loading data in the DP book interactviely and then trying to Execute the Update Quantity button. The error message given is "Error for COM routine using application program (return code 40.301)".
    We are on APO 5.0 and have the highest Support Pack of SAPKY50011.
    I have searched in the SAP notes and one note 1050350 talks about a similar issue however the corrections mentioned are already there in our system and there the desired SP is SAPKY50010.
    Can anyone tell what could be the reason for such error and how to resolve the same.
    Thanks
    Harsh

    Hi Senthil / Vijaya,
    Thanks for your prompt response.
    Well first responding to Senthil
    - Issue is not reproducable in Dev or Q systems.
    - How to check the application logs during the time of errors
    - Yes I have checked system locks they are clear
    - We have run OM 17 and TS consistency checks but still the error persists.
    I will go through the notes refered by you and see if it is of help.
    Vijaya
    - Yes you are Correct that for the related keyfigures the tick "No Negative stocks is there" also the tick for Fixed Values is also there. But the concern is that it was running fine earlier with the same settings.
    To give you more inputs perhaps this is being run with the Sales Order History and the key figure which is in consideration is a Sales Override.If it is the negative values that are causing the problem they how can we avoid that figures?
    Looking forward from hearing from you guys
    Thanks,
    Harsh

  • Error for COM routine using application program (Return Code 40301)

    Hi Experts,
    Currently we are working on SCM 5.1 version.
    We are facing one issue. When we are trying to save one particular KF the system through below error
    "Error for COM routine using application program (Return Code 40301)"
    But when we save other KFs then data save successfully.
    This may be resolve by running consitancy check but if the inconsistancy is the issue then it should impact all the KFs.
    Can anyone help me to find the correct reason & solution?
    Thanks & Regards
    Sujay

    Dear Sujay Joshi ,
    The COM ERROR 40.301 means that the key figure became negative although this is not permitted.
    You need to check the setting of the key figure in your planning area and ensure that you have setup the respective key figure(s) accordingly (not allow negative values).
    If you believe that the negative value is not correct you have to reinitialize the planning area, after correcting the same. Please do a backup of the planning area before reinitializing.
    Please refer to the following SDN Thread for more information about the COM ERROR 40.301.
    How to allow or not allow negative values in key figures for SNP
    Check Note 944254. Also check the KF for Sales history or Statistical Fcst. where the tick negative values not allowed should be there. Sometimes calulation of the Praportional factors also causes te negative values getting calculated for certain KF. You will have to do thorough research to ascertain where from the negative value are coming into the KF.To start with reading the note that I have mentione above.
    I hope this helps.
    Regards,
    Tibor

  • Binding for table produces list for other tables using foreign key and crea

    Using
    software Jdev 11G, WLS 11G, Oracle DB 11G, Windows Vista platform
    technology EJB 3.0, jspx, backing beans, session bean
    I cannot create a namedquery on my secondary table. The method for the column uses the entity object rather than the name and value of the column.
    For instance,
    (Coketruck) table has inventory records(Products) table
    Coketruck has one to many to the Products table
    Products has a many to one to the Coketruck
    I need to return the products from the product table based on the CokeTruck but I cannot create a namedQuery because the method in the Product table is an entity object type instead of a long that I can use to look up all the products based off the column truck_id.
    This is what I was expecting…
    Private Long truckId;
    public Long getTruckId() {
    return truckId;
    public void setTruckId (Long truckId) {
    this. truckId = truckId;
    Instead this is what I have…
    @ManyToOne
    @JoinColumn(name = "TRUCK_ID")
    private Coketruck coketruck;
    this. coketruck = coketruck
    public Coketruck getCoketruck() {
    return coketruck;
    public void set Coketruck (Coketruck coketruck) {
    this. coketruck = coketruck;
    How do I do a query on the Product table to return all the products that are in the coketruck?
    If I do the following it expects for me to pass the Entity Object which I cannot use as search criteria for my find method.
    @NamedQuery(name = "Products.findById", query = "select o from Products o where o.truckId = :truckId")
    On a different note but the same song…
    I noticed that when I look at my Session Bean Data Contols that the coketruck already has a list of the products. I have created a jsp page with a backing bean and have been able to use the namedquery on the coketruck entity to retrieve the productList. Unfortunately I need to sort the products by type and was also not able to find where to perform the work to be able to iterate through the productList to get my desired display. Therefore I started looking at doing another namedquery that would only retrieve the product_type ordering by the truckId.
    Seems I have come full circle… I don’t care what method I have to use to get the info back.
    Any help is greatly appreciated!

    user9005175 wrote:
    Hi!
    I work on an application wich uses a shopping cart stored in a database. The shopping cart uses two tables:
    CART: Holds information common for one shopping cart: the user it is connected to etc.
    - Primary key: CART_ID
    CART_ROW: One row in the cart, e.g. one new product to buy.
    - Primary key: ROW_ID
    - Foreign key: CART_ROW.CART_ID references CART.CART_ID
    From the code the rows in the cart are collected per cart, as is modelled by the foreign key. There exists one more relationship, which we use in the code, but which is not modelled by a foreign key in the database. One row can be dependent on another row, which makes the other row a parent.
    CART_ROW has a column PARENT_ID which references CART_ROW.ROW_ID.
    Should we add a foreign key for PARENT_ID? Or are there any questions to consider when it is a foreign key to the same table?
    I suggest to add foreign key it wont harm the performance (except while on insert when there would be validation for the foreign key). But it would prevent users to insert wrong/corrupt data either through code or directly by loggin in the database.
    A while ago we added indexes, both on ROW_ID and on PARENT_ID. Could the index on PARENT_ID have been harmful, since there is no foreign key?
    Index on parent_id would only be harmful if you do not make use of index after creating it (i.e. there is no query which make use of this index).
    And if you decide to have a foreign key on parent_id then I suggest to have index too on parent_id as it would be helpful atleast when you delete any record in this table.
    Best regards!

Maybe you are looking for

  • Transfer of Credit from one Vendor to another Vendor

    Dear Freinds, Can I transfer credit of one vendor to another vendor ? eg I have entered vendor inv thru fb60 & posted as well  , say for vendor "A", further I want to transfer the amount payable to vendor "A" to some other vendor say vendor "B" <u><b

  • Printing to PDF from existing PDFs and other MS programs for Mac

    I just purchased Adobe PDF Pack software online because it said it is required if you want the print to PDF function to work from an existing PDF, word or excel, ppt file. Now I don't see that functionality. Am I missing something or was this softwar

  • Hanging problem

    My Nokia asha 200 is hanging very frequently and gets switched off automatically and does not switch on by pressing the power button.Every times it happens I have to remove the battery & then the phone starts and after 5-10 min it again hangs. Also I

  • HttpServlet not found?

    Hi, I get an NoClassDefFoundError, when I try to access a servlet. I compiled it with "javac -cp /home/tomcat/j2ee/lib/j2ee.jar:/home/tomcat/mysql MyServlet.java". this displays no error. But I can't access the servlet. it shows me that: exception ja

  • Credit Block Problem for Orders

    Hello We have created a Z sales order type (ZPS) which has been giving us some issues. Whenever we get a credit block scenario, even after the release of the order in vkm3 , the credit block stays. We found that after releasing the order in vkm3, it