Encryt with a String

Hi all
This is the first time that I'm trying to use de cryto api, but my purpose is to encrip a object with a String of my, and then serialize it.
I've found the following example on the net:
try {
// Generate a temporary key. In practice, you would save this key.
// See also e464 Encrypting with DES Using a Pass Phrase.
SecretKey key = KeyGenerator.getInstance("DES").generateKey();
// Prepare the encrypter
Cipher ecipher = Cipher.getInstance("DES");
ecipher.init(Cipher.ENCRYPT_MODE, key);
// Seal (encrypt) the object
SealedObject so = new SealedObject(new MySecretClass(), ecipher);
// Get the algorithm used to seal the object
String algoName = so.getAlgorithm(); // DES
// Prepare the decrypter
Cipher dcipher = Cipher.getInstance("DES");
dcipher.init(Cipher.DECRYPT_MODE, key);
// Unseal (decrypt) the class
MySecretClass o = (MySecretClass)so.getObject(dcipher);
} catch (java.io.IOException e) {
} catch (ClassNotFoundException e) {
} catch (javax.crypto.IllegalBlockSizeException e) {
} catch (javax.crypto.BadPaddingException e) {
} catch (javax.crypto.NoSuchPaddingException e) {
} catch (java.security.NoSuchAlgorithmException e) {
} catch (java.security.InvalidKeyException e) {
But i like to use it with my own key (String object), anyone knows which changes need to be performed?

This is my standard DES example -
import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.*;
import sun.misc.*;
public class DESEncryptDataString
    static public class EncryptionException extends Exception
        private EncryptionException(String text, Exception chain)
            super(text, chain);
    public DESEncryptDataString(byte[] keyBytes, byte[] ivBytes, String characterEncoding) throws EncryptionException
        assert (keyBytes != null) && (keyBytes.length == 8);
        assert (ivBytes != null) && (ivBytes.length == 8);
        assert (characterEncoding != null);
        try
            SecretKey key1 = new SecretKeySpec(keyBytes, "DES");
            // To demonstrate that the least significant bit is the parity bit and can be ignored.
            keyBytes[0] ^=0x01;
            SecretKey key2 = new SecretKeySpec(keyBytes, "DES");
            IvParameterSpec iv = new IvParameterSpec(ivBytes);
            this.characterEncoding = characterEncoding;
            this.encryptCipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE");
            this.encryptCipher.init(javax.crypto.Cipher.ENCRYPT_MODE, key1, iv);
            this.decryptCipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE");
            this.decryptCipher.init(javax.crypto.Cipher.DECRYPT_MODE, key2, iv);
        catch (Exception e)
            throw new EncryptionException("Problem constucting " + this.getClass().getName(), e);
    synchronized public byte[] encrypt(String dataString) throws EncryptionException
        assert dataString != null;
        try
            byte[] dataStringBytes = dataString.getBytes(characterEncoding);
            byte[] encryptedDataStringBytes = encryptCipher.doFinal(dataStringBytes);
            return encryptedDataStringBytes;
        catch (Exception e)
            throw new EncryptionException("Problem encrypting string", e);
    synchronized public String decrypt(byte[] encryptedDataStringBytes) throws EncryptionException
        assert encryptedDataStringBytes != null;
        try
            byte[] dataStringBytes = this.decryptCipher.doFinal(encryptedDataStringBytes);
            String dataString = new String(dataStringBytes, characterEncoding);
            return dataString;
        catch (Exception e)
            throw new EncryptionException("Problem decrypting string", e);
    public static void main(String[] args)
        try
            // Make sure SUN are a valid provider
            Security.addProvider(new com.sun.crypto.provider.SunJCE());
            // The DES Key - any 8 bytes will do though beware of weak keys.
            // This could be read from a file.
            final byte[] keyBytes = "01234567".getBytes("ASCII");
            // IV For CBC mode
            // Again, could be read from a file.
            final byte[] IVBytes = "ABCDEFGH".getBytes("ASCII");
            // Data string encrypt agent that assumes the data string is only ASCII characters
            DESEncryptDataString dataStringEncryptAgent = new DESEncryptDataString(keyBytes, IVBytes, "UTF-8");
            // Get the data string to encrypt from the command line
            String dataString = (args.length == 0)? "The quick brown fox jumps over the lazy dog." : args[0];
            System.out.println("Data string ....................[" + dataString + "]");
            byte[] encryptedDataStringBytes = dataStringEncryptAgent.encrypt(dataString);
            BASE64Encoder base64Encoder = new BASE64Encoder();
            System.out.println("Encoded encrypted data string ..[" + base64Encoder.encode(encryptedDataStringBytes) + "]");
            String recoveredDataString = dataStringEncryptAgent.decrypt(encryptedDataStringBytes);
            System.out.println("Recovered data string ..........[" + recoveredDataString + "]");
        catch (Exception e)
            e.printStackTrace(System.out);
    private String characterEncoding;
    private Cipher encryptCipher;
    private Cipher decryptCipher;
}Please note, DO NOT TRY TO CONVERT THE ENCRYPTED DATA TO A STRING USING
String encryptedDataAsString = new String(encryptedDataStringBytes)
as not all bytes and byte sequences can be recovered from teh resulting String. The result depends on the encoding.
If you need a String representation then use Base64 or Hex encoding.

Similar Messages

  • SharePoint 2013 List View with query string filter stops working after editing view from browser

    I have created one list definition in which I have added one list view which will filter data from query string paramater
    So when I am creating list from my list definition, view with query string filter is working fine.
    But when I am modifying view from UI(I am not changing any thing , just opening "Modify View" page and then click on "Save" button), view gets stop working means it's not filtering data based on query string
    Any suggestion what I am missing?
    Below is my list view schema
    <View BaseViewID="11" Type="HTML" TabularView="FALSE" WebPartZoneID="Main" DisplayName="$Resources:OIPLBScoreCard,viewFilterTasksByTarget;" MobileView="True" MobileDefaultView="False" Url="FilteredTasks.aspx" SetupPath="pages\viewpage.aspx" DefaultView="FALSE" ImageUrl="/_layouts/15/images/issuelst.png?rev=23">
    <Toolbar Type="Standard" />
    <ParameterBindings>
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    <ParameterBinding Name="TargetId" Location="QueryString(TargetId)" />
    </ParameterBindings>
    <JSLink>hierarchytaskslist.js</JSLink>
    <XslLink Default="TRUE">main.xsl</XslLink>
    <JSLink>clienttemplates.js</JSLink>
    <RowLimit Paged="TRUE">100</RowLimit>
    <ViewFields>
    <FieldRef Name="Body"></FieldRef>
    <FieldRef Name="Title"></FieldRef>
    <FieldRef Name="StartDate"></FieldRef>
    <FieldRef Name="DueDate"></FieldRef>
    </ViewFields>
    <ViewData>
    <FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete"></FieldRef>
    <FieldRef Name="DueDate" Type="TimelineDueDate"></FieldRef>
    </ViewData>
    <Query>
    <Where>
    <Eq>
    <FieldRef Name="oipscTargetLookup" LookupId="TRUE"/>
    <Value Type="Lookup">{TargetId}</Value>
    </Eq>
    </Where>
    </Query>
    </View>
    I have one lookup field from "Target List" in my source list and I want to filter data based on that lookup field.

    Hi JayJT,
    The Miscellaneous is located in the contact list that you used for the connection.
    So , you need to edit the page, then edit the contact list that you used, in the web part properties of the contact list, you will find Miscellaneous, then expand it and select ‘Server Render’ .
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Sling mapping issue with Query String

    For a button component, URL behaves differently with query string. Please let me know the sling mapping example for query string.
    Button component behavior across env:-
    Working Scenario:-
    - In Author edit mode, URL pointing to "/content/<websitelink>"
    - In Author preview mode shows URL "<host>:<port>/content/<websitelink>.html"
    - In Publisher mode shows URL, "<host>:<port>/<websitelink>", we do not want "/content" before website link so it is fine.
    Failure Scenario with query string:-
    - In Author edit mode URL pointing to "/content/<websitelink>?username=han"
    - In Author preview mode with URL "<host>:<port>/content/<websitelink>?username=han"
    - In Publisher mode, <host>:<port>/content/<websitelink>?username=han - Here we see the content, which is not acceptable in our scenario.
    Please let me know the mapping changes when we have a URL with query string.

    1) I assume you configure as per the rules mentioned in http://sling.apache.org/site/mappings-for-resource-resolution.html --> 'Mapping Entry Specification' under /etc/map. Based on the configuration in /etc/map and the website that we publish, it translates and shows all the applicable combination in the Felix console http://<host>:<port>/system/console/jcrresolver.
    2) How does Adobe CQ 5.4 resolve the right mapping, if we have multiple map folder like below in /etc directory with the same website with different rules.
    etc/map --> http --> <website> with property sling:match, sling:internalRedirect
    etc/map.publish --> http --> <website> with property sling:match, sling:internalRedirect
    etc/map.publish-stag --> http --> <website> with property sling:match, sling:internalRedirect
    Kindly clarify.

  • How to replace a particular striing with another string in jtextpane

    how to get replace a particular string with another string of a jtextpane without taking the text in a variable using getText() method .

    Thanks for your answer,
    "relevant object" means for you datasources, transfer rules and transformations ?
    With the grouping option "Save for system copy" I can't take easily all datasources, and others objects
    Will I have to pick all object one by one ?
    What would be the adjustement in table RSLOGSYSMAP ? For the moment it's empty.
    Regards
    Guillaume P.

  • Problem with output string to command

    hey i have no idea why this aint working
    its a simple output string to command.
    what it is supposed to do is make a new directory given by the input string
    e.g. mkdir /home/luke/dep
    thanks for the help
    //methods input save files
         saveFile = JOptionPane.showInputDialog("Save Files To : ");
         //method command for saving files
         //Stream to write file
         FileOutputStream fout;          
         try { Process myProcess = Runtime.getRuntime().exec("mkdir" + saveFile );
          InputStreamReader myIStreamReader = new InputStreamReader(myProcess.getInputStream());
          fout = new FileOutputStream ("file.txt");
          while ((ch = myIStreamReader.read()) != -1) { new PrintStream(fout).print((char)ch); } }
              catch (IOException anIOException) { System.out.println(anIOException); }

    What you fail to understand is that "aint working" and "Problem with output string to command" tells us absolutely squat about what your problem is. This is the same as saying to the doctor "I'm sick" and expecting him to cure you. As mentioned by Enceph you need to provide details. Do you get error messages? If so post the entire error and indicate the line of code it occurs on. Do you get incorrect output? Then post what output you get, what output you expect. The more effort you put into your question the more effort others will put in their replies. So until you can manage to execute a little common sense then the only responses you will get will be flames. Now is your tiny little brain able to comprehend that?

  • Comparing string delimited by semicolon in a column with another string

    Hi
    I have requirement like comparing a column which contains the string delimited by semi colon with a string delimited by semicolon. i.e. comparing the multiple values with multiple values.for this purpose i am using the following code
    select ams.application_id,it_mgmt_chain
    FROM tb_ams038_application ams,THE
    (SELECT CAST
    (Appmgmt_Str_To_Table
    (NVL (ams.it_mgmt_chain,
    ) AS appmgmt_tabletype_string
    FROM DUAL
    AND (COLUMN_VALUE IN ( SELECT COLUMN_VALUE
    FROM THE
    (SELECT CAST
    (Appmgmt_Str_To_Table
    (nvl(NVL (replace('1234;8383;83939;93939',',',';'),
    ams.it_mgmt_chain
    ) AS appmgmt_tabletype_string
    FROM DUAL
    here in the above it_mgmt_chain has the string containing numbers seperated by semi colon. and the Appmgmt_Str_To_Table function used to split the string and return it in the form of list. and appmgmt_tabletype_string is a varray which is created for spliting and storing purpose.
    Can anyone please suggest the best way to do this task as the above code is giving a performance issue.

    This example uses a "|" not a semicolon but it leverages the REGEXP_SUBSTR, SUBSTR, LENGTH to perform a parsing action.
    http://blog.mclaughlinsoftware.com/plsql-programming/a-result-cache-function-returning-a-collection/
    You may wish to remove the "THE" and replace it with "TABLE" too. Good luck.

  • File uri with query string can't be propagated by desktop.browse()

    I have been trying to show some help pages using the following command:
    java.awt.Desktop.getDesktop().browse( helpURI);
    while the helpURI.toString() prints out the following:
    file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html
    But when the getDesktop().browse() API is executed it will only propagate the uri-path and not the query string.
    So the browser shows the following url as a result of the browse() call:
    C:\Share\Code\phoenix\Install\REDIST\Help_Files\en\wwhelp\wwhimpl\js\html\wwhelp.htm
    But if I manually copy the string "file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html" to the internet explorer it works fine.
    So can somebody give me any guidance on how I can propagate the file uri with query string through the browse() API or is there a better API for that?
    Sibon.

    The "cmd /S /C" suggestion didn't seem to work. I don't think the problem is in java but how the command line parameter needs to be added from msdos shell to "iexplore.exe"
    When from the command line I enter the following command:
    iexplore.exe file:///C:/Share/Code/phoenix/Install/REDIST/Help_Files/en/wwhelp/wwhimpl/js/html/wwhelp.htm?context=BD&href=Chapter%202%20-%20Configuration.1.14.html
    I get the same result as invoking from java Desktop API --- it truncates everything from question mark. I tried palying around with double quotes, single quotes, escaping and nothing seem to work.
    Any ideas?

  • SelectMany checkbox value-binded with HashMap String,ArrayList

    Hello,
    Someone can help me please?
    Im trying to create a page with a lot of HtmlSelectManyCheckbox, and i need to value-bind then to the same Object in my BackingBean.
    First i attemped to bind all HtmlSelectManyCheckbox with a single ArrayList, but only the last SelectMany had their values inserted on the ArrayList...
    So, now im trying to bind all the HtmlSelectManyCheckbox with a HashMap<String,ArrayList>, because i would have just one object and for each entry I would have the checkboxes that were cheked in a single HtmlSelectManyCheckbox.
    Now my question: there is a way to make this work?
    my code example
    Backing bean
    private HashMap<String, ArrayList> respostaMatrizCheck = new HashMap<String, ArrayList>();
         public HashMap<String, ArrayList> getRespostaMatrizCheck() {
              return respostaMatrizCheck;
         public void setRespostaMatrizCheck(HashMap<String, ArrayList> respostaMatrizCheck) {
              this.respostaMatrizCheck = respostaMatrizCheck;and the bindings
    <h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['1'] }">
    <h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['2'] }">And the error message given when i tryed this is the following:
    javax.servlet.ServletException: ValueBinding for UISelectMany must be of type List or Array
    Any help would be welcome.
    Thanks,
    Ferry

    Has anybody solved a problem like this? I am facing the same problem and no response helped me so far.
    Here is the web code:
    <h:selectManyCheckbox value="#{processor.languages.languages1}">
         <f:converter converterId="languageConverter" />
         <f:selectItems value="#{categoryController.allLanguagesAsSelectItems}" />
    </h:selectManyCheckbox>My backing bean "processor" looks like this:
         public Map<String, List<MyObject>> getLanguages() {
              return languagesMap;
         }(The backing bean has no "setLanguages()-method" since I did not need any with Map<String, String> for example.)
    The converter I use creates a "MyObject" instance in its "getAsObject" conversion method.
    I think everything should be okay then but the exception I get after submitting the page is:
    java.lang.IllegalArgumentException: ValueBinding for UISelectMany must be of type List or Array
         org.apache.myfaces.shared_impl.renderkit._SharedRendererUtils.getConvertedUISelectManyValue(_SharedRendererUtils.java:191)
         org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedUISelectManyValue(RendererUtils.java:630)
         org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.getConvertedValue(HtmlCheckboxRendererBase.java:308)
         javax.faces.component.UISelectMany.getConvertedValue(UISelectMany.java:308)
         javax.faces.component.UIInput.validate(UIInput.java:350)
    .....Edited by: rapthor on Oct 31, 2007 6:39 AM

  • Replacing a special character in a string with another string

    Hi
    I need to replace a special character in a string with another string.
    Say there is a string -  "abc's def's are alphabets"
    and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
    "abc&apos&s def&apos&s are alphabets" .
    Kindly let me know how this requirement can be met.
    Regards
    Sukumari

    REPLACE
    Syntax Forms
    Pattern-based replacement
    1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
    pattern
              IN [section_of] dobj WITH new
              [IN {BYTE|CHARACTER} MODE]
              [{RESPECTING|IGNORING} CASE]
              [REPLACEMENT COUNT rcnt]
              { {[REPLACEMENT OFFSET roff]
                 [REPLACEMENT LENGTH rlen]}
              | [RESULTS result_tab|result_wa] }.
    Position-based replacement
    2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                      [IN {BYTE|CHARACTER} MODE].
    Effect
    This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
    When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
    In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
    System fields
    sy-subrc Meaning
    0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
    2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
    4 The subsequence in sub_string was not found in dobj in the pattern-based search.
    8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
    Note
    These forms of the statement REPLACE replace the following obsolete form:
    REPLACE sub_string WITH
    Syntax
    REPLACE sub_string WITH new INTO dobj
            [IN {BYTE|CHARACTER} MODE]
            [LENGTH len].
    Extras:
    1. ... IN {BYTE|CHARACTER} MODE
    2. ... LENGTH len
    Effect
    This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
    The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
    During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
    System Fields
    sy-subrc Meaning
    0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
    4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
    Note
    This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
    Addition 1
    ... IN {BYTE|CHARACTER} MODE
    Effect
    The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
    Addition 2
    ... LENGTH len
    Effect
    If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
    If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
    Example
    After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
    DATA:   text1      TYPE string       VALUE 'I know you know',
            text2(18)  TYPE c LENGTH 18  VALUE 'I know you know',
            sub_string TYPE string       VALUE 'know',
            new        TYPE string       VALUE 'should know that'.
    REPLACE sub_string WITH new INTO text1.
    REPLACE sub_string WITH new INTO text2.

  • Crystal 2011 linking table with a String and a Number

    Hello,
    I am able to retrieve the data I want with the following  SQL Query in SQL: If I try to create it in Crystal 2011 APPLRUNN is a string and CNTBTCH is a number. Is there a way I can link these two fields if one is a string and the other is a number ?
    SELECT   
    ENADV.APPLRUNN, ENPBD.CNTBTCH,
    ENPBD.DOCNBR
    FROM       
    ENADV INNER JOIN
    ENPBD ON ENADV.APPLRUNN = ENPBD.CNTBTCH
    Thanks,
    Debbie

    Hi Debbie,
    You cannot linking  table with a string and a number. I have given a example query:
    SELECT   
    ENADV.APPLRUNN, ENPBD.CNTBTCH,
    ENPBD.DOCNBR
    FROM       
    ENADV INNER JOIN
    ENPBD ON
    ENADV.APPLRUNN = ENPBD.APPLRUNN  or ENADV.CNTBTCH = ENPBD.CNTBTCH
    I modify last sentense because one table primary key is equal to another table Foreign key i.e
    one table ID field = another table ID field or one table NAME field = another table Name field.
    Please understand my intenction and check linking fields in tables.
    Thanks,
    DJ

  • WCS#2009.10.20.11.20.34: No matching users were found with search string ..

    Hi,
    I setup my webcenter spaces using OID. I used the console application to setup OIDAuthenticator. I can see OID users and groups in the console application. I can also login to webcenter spaces using any of the OID user. But when I try to create a page in webcenter spaces I get error
    WCS#2009.10.20.11.20.34: No matching users were found with search string ..
    Also, when I try to change permission grants for a given page in webcenter spaces using 'Set Page Access' I cannot search for any of the OID users.
    I have modified my jps-config.xml to add
         <property name="username.attr" value="uid"/>
    <property name="user.login.attr" value="uid"/>
    inside the 'idstore.ldap' serverInstance as mentioned in the document. But stilll it does not work.
    Can anybody help me..
    I see the following error in my WLS_Spaces-diagnostic.log
    [2009-10-20T11:20:34.203-05:00] [WLS_Spaces] [ERROR] [] [oracle.webcenter.webcenterapp] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: executive] [ecid: 0000IHmjzSbFg4WFLzyGOA1ArTye00000E,0] [APP: webcenter] WCS#2009.10.20.11.20.34: No matching users were found with search string executive
    [2009-10-20T11:20:34.203-05:00] [WLS_Spaces] [ERROR] [] [oracle.webcenter.webcenterapp] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: executive] [ecid: 0000IHmjzSbFg4WFLzyGOA1ArTye00000E,0] [APP: webcenter] [[
    oracle.webcenter.webcenterapp.security.WCSecurityException: No matching users were found with search string executive
         at oracle.webcenter.webcenterapp.model.security.WebCenterSecurityUtils.getPrincipal(WebCenterSecurityUtils.java:494)
         at oracle.webcenter.webcenterapp.model.security.WebCenterSecurityUtils.getUserPrincipal(WebCenterSecurityUtils.java:377)
         at oracle.webcenter.webcenterapp.internal.view.shell.WebCenterPagesManagerImpl._grantCustomPermission(WebCenterPagesManagerImpl.java:650)
         at oracle.webcenter.webcenterapp.internal.view.shell.WebCenterPagesManagerImpl.createPersonalPage(WebCenterPagesManagerImpl.java:582)
         at oracle.webcenter.webcenterapp.internal.view.backing.BoilerplateBean._createPage(BoilerplateBean.java:818)
         at oracle.webcenter.webcenterapp.internal.view.backing.BoilerplateBean.clickCreatePageFromWizard(BoilerplateBean.java:947)
         at oracle.webcenter.webcenterapp.internal.view.backing.BoilerplateBean.clickCreatePageFromWizard(BoilerplateBean.java:929)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1282)
         at oracle.adf.view.rich.component.UIXDialog.broadcast(UIXDialog.java:81)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:145)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:145)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:87)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:87)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:298)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:91)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:81)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:787)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:280)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.webcenterapp.internal.view.webapp.WebCenterShellPageRedirectionFilter.doFilter(WebCenterShellPageRedirectionFilter.java:210)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.webcenterapp.internal.view.webapp.WebCenterShellFilter.doFilter(WebCenterShellFilter.java:603)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.view.page.editor.webapp.WebCenterComposerFilter.doFilter(WebCenterComposerFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.webcenterapp.internal.view.webapp.WebCenterLocaleWrapperFilter.processFilters(WebCenterLocaleWrapperFilter.java:256)
         at oracle.webcenter.webcenterapp.internal.view.webapp.WebCenterLocaleWrapperFilter.doFilter(WebCenterLocaleWrapperFilter.java:228)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.security.idm.ObjectNotFoundException: No User found matching the criteria
         at oracle.security.idm.providers.stdldap.util.DirectSearchResponse.initSearch(DirectSearchResponse.java:171)
         at oracle.security.idm.providers.stdldap.util.NonPagedSearchResponse.<init>(NonPagedSearchResponse.java:52)
         at oracle.security.idm.providers.stdldap.util.NonPagedSearchResponse.<init>(NonPagedSearchResponse.java:43)
         at oracle.security.idm.providers.stdldap.util.LDAPRealm.searchUsers(LDAPRealm.java:480)
         at oracle.security.idm.providers.stdldap.LDIdentityStore.search(LDIdentityStore.java:265)
         at oracle.security.idm.providers.stdldap.LDIdentityStore.searchUsers(LDIdentityStore.java:358)
         at oracle.webcenter.framework.service.Utility.getUserFromUserName(Utility.java:571)
         at oracle.webcenter.webcenterapp.model.security.WebCenterSecurityUtils.searchUser(WebCenterSecurityUtils.java:315)
         at oracle.webcenter.webcenterapp.model.security.WebCenterSecurityUtils.getPrincipal(WebCenterSecurityUtils.java:486)

    I have run dead smack into this issue using AD also. Is there a solution? I have tried all of the options for the following settings which seem to control the look up process:
    <property name="username.attr" value="cn"/>
    <property name="user.login.attr" value="sAMAcountName"/>.
    For me, this issue rears its ugly head when attempting to add a role to an AD user. I can enter the login name in the find user box, click the find button, and the user is found. I select the user, pick the role, click "Add Member(s)", and then bam "No matching users were found with search string <login user>" message.
    Based on my analysis of the problem, my guess would be that the look up process, which works, differs from the role assignment process in source of data and/or the key-field used to find a match.
    Any help would be greatly appreciated.
    Thanks In Advance.

  • Good practice to initalize all instance variables with type String to emptr

    Is it a good practice to initalize all instance variables with
    type String to emptry string?
    #1 approach:
    public class A
    { private String name = "";
    private String address ="";
    //etc...
    rather than
    #2 approach:
    public class A
    { private String name;
    private String address;
    //etc...
    When I read Java books, the examples don't usually do #1 approach.
    The problem is if we don't initialize to empty string, when we call
    the getter method of that instance variable, it will return null.
    Please advise. Thanks!!

    Please advise. Thanks!!It depends on your coding style. If you can avoid lots of checks for null Strings in the rest of the code then why not initialize to "".
    You have the same situation when a method returns an array. If you under circumstances return a null array reference then you have to always check for this special case, but if you return a zero length array instead you have no special case. All loops will just run 0 iterations and everything will work fine.
    So in general I guess the return of zero objects instead of null references really boils down to whether it simplicates the rest of your code by removing lots of extra checks for the special null case. This usage is especially favourable in the zero length array case. See Effective Java by Bloch, item 27.

  • How to filter by attributes with type Strings

    The documentation is not really detailed about setting attributes with type Strings. I assume I've to type each string value in a new line in the set attributes dialog box. This works fine and my XML looks like this<br /><br /><para CMS = "prodA prodB"><br /><br />having set the two string values "prodA" and "prodB".<br /><br />But how to filter these attributes? The filter CMS="prodA" shows my paragraph correctly, but CMS="prodB" does not show this paragraph as it should. Filters seem to match only the first of the set of string values.<br /><br />I would like to show this paragraph in two document versions for these two products prodA and prodB.<br /><br />Framemaker 8.0.3<br /><br />Tilman

    Tilman,
    this is something that AFAIK is not supported by FrameMaker's own attribute based filtering.
    But, without changing your documents, if you install the *free* ABCM (Attribute-based condition management) plug-in from weststreet consulting, you will succeed. Be sure to read the tutorial!
    http://weststreetconsulting.com/
    - Michael

  • Comparing Collection object with a string

    Hi everyone,
    There is my problem: I have a program that generate all possible combinations of a certain number of letters for example: -ABC- will gives A, B, C, AB, AC, BC, ABC. Everything is fine at this point. But then the user can input a string like "AB" and I have to tell him if this string is contained in the generated set. My set is in a Collection, but when I used : LetterCombination.Contains(TextString), it returns always false. Even if I know that the string is contained in the set.
    Here is the code to generate the set:
    public class Recursion
         Collection LetterCombination;
    /*String Letters is the letters which I have to generate the combination, and
    the LetterNumber is the number of letters contained in my string.*/
         public Recursion(Set ItemLetters, String Letters, int LetterNumbers)
              ItemLetters = new TreeSet();
    String[] Token = Letters.split(" ");
    /*Adding the letters in the TreeSet*/
    for (int i = 0; i < LetterNumbers; i++)
         ItemLetters.add(Token);
    LetterCombination = BuildLetterSet(ItemLetters);
    private Collection BuildLetterSet(Set ItemLetters)
    Set NotUsedYet = new TreeSet();
    Set thisPowerSet = new TreeSet();
    Collection Letterresult = new ArrayList();
    NotUsedYet.addAll(ItemLetters);
    BuildByRecursion(NotUsedYet, thisPowerSet, Letterresult);
    return Letterresult;
    private void BuildByRecursion(Set notUsedYet, Set thisPowerSet, Collection result)
    if(notUsedYet.isEmpty())
    if(!thisPowerSet.isEmpty())
    Set copy = new TreeSet();
    copy.addAll(thisPowerSet);
    result.add(copy);
    return;
    Object item = notUsedYet.iterator().next();
    notUsedYet.remove(item);
    BuildByRecursion(notUsedYet, thisPowerSet, result);
    thisPowerSet.add(item);
    BuildByRecursion(notUsedYet, thisPowerSet, result);
    thisPowerSet.remove(item);
    notUsedYet.add(item);
    And if I print out the LetterCombination collection, it gives me:
    [C]
    [B, C]
    [A]
    [A, C]
    [A, B]
    [A, B, C]
    Which are the good combination needed. But I really don't understand how to compare this collection with the string entered by the user.
    I'm really lost. can somebody help me! Thanks in advance...

    You don't show where you call this constructor, or what your arguments are:
    public Recursion(Set ItemLetters, String Letters, int LetterNumbers)
       ItemLetters = new TreeSet();
       String[] Token = Letters.split(" ");
       /*Adding the letters in the TreeSet*/
       for (int i = 0; i < LetterNumbers; i++)
          ItemLetters.add(Token[ i ]);
       LetterCombination = BuildLetterSet(ItemLetters);
    }But, the constructor doesn't make sense, anyway. itemLetters is immediately set to a new TreeSet, so whatever you passed in (if anything) for the first argument is unchanged by the constructor (and the new TreeSet is lost when you finish the constructor). Also, you split your input Letters on space, but rely on LetterNumbers for the length of the split array (which may or may not be accurate). Why not do a 'for' loop testing for "i < Token.length", and eliminate LetterNumbers parameter? Your input for the second parameter to this constructor would have to be "A B C D" (some letters delimited by spaces). Your constructor only needs one parameter--that String.
    The capitalization of your variables doesn't follow standard coding conventions. Your code is hard to read without the "code" formatting tags (see "Formatting Tips"/ [ code ] button above message posting box).

  • AutoPopulating a field with a string plus value from another field

    Hi: I have a table with two fields
    create table LINKREQUEST (
    requestid int primary key,
    INCIDENT_NUMBER varchar2(16),
    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTID. Can someone help.
    TIA
    Ravi

    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTIDSomething like this?:
    SQL> create table linkrequest (
    requestid int primary key,
    incident_number varchar2(16)
    Table created.
    SQL> create sequence linkrequest_seq
    Sequence created.
    SQL> create or replace trigger linkrequest_trg before insert on linkrequest
    for each row
    begin
    select linkrequest_seq.nextval,
            case when :new.incident_number = 'INC' then 'INC' || linkrequest_seq.nextval else :new.incident_number end
       into :new.requestid, :new.incident_number from dual;
    end;
    Trigger created.
    SQL> insert into  linkrequest (incident_number) values ('XY')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('VW')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> select * from linkrequest
    REQUESTID INCIDENT_NUMBER
             1 XY             
             2 INC2           
             3 VW             
             4 INC4           
    4 rows selected.

Maybe you are looking for

  • Freecom hard drive no longer recognised by Time Machine

    I have a 1TB Freecom Hard drive which has worked fine for nearly 3 years. It has suddenly stooped working, no drops or knocks. It doesn't show up on disc utility. I've tried other USB cables and plugged it into another macbook. Not picked up. I can f

  • Java 1.4 not found in Linux Mandrake 8.2

    I installed the java1.4 rpm file. When I run java -version it gives me version 1.1 originally bundled with mandrake 8.2. This is my /etc/profile file: # /etc/profile -- Mode: shell-script -- # (c) MandrakeSoft, Chmouel Boudjnah <[email protected]> #

  • Best elevated laptop stand for 15" MBP ??

    I need an elevated stand for my MBP. Which one are you using and what are the pros and cons?

  • Pagination changes result in master objects moving

    Whenever my pagination changes, either from documents in my book starting on an even page, or by inserting a page the objects set in my master pages move (generally toward the gutter). I can reapply the master page as a fix and select the option of u

  • Took backup of data files and controlfile but not archive file db is 11g xe

    took backup of data files and controlfile but not redo file db is 11g xe r2..was trying complete shut backup,..missed redo.. anyway to restore the db back.. I had failed to backup redo log file.. db was shut...properly any info highly appreciated. ch