Custom CipherInputStream fails at padding

Hi,
I have to write my own CipherInputStream. It works quite well (with AES) except for padding. Below is my CipherInputStream class. It fails when any decrypted block has 0x01 as the last byte of the block.
Please be aware that the source of the ciphered stream might invoke "doFinal" once in a while without closing streams. Thus, the CipherInputStream has to handle multiple "ciphered messages". Searching google provided me with plenty of examples while in every example, the assumption was that the creator of the ciphered stream invokes "doFinal" right before he closes the stream. Yet, I want to continue the stream after someone invoked "doFinal".
Here is the code.
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
public class CCipherInputStream extends InputStream {
     private Cipher m_Cipher;
     private InputStream m_Input;
     private boolean m_DoDecryption;
     private boolean m_IsClosed = false;
     private byte[] m_Buffer = null;
     private int m_EndOffset = -1;
     private int m_StartOffset = m_EndOffset;
     public boolean isDecrypting() { return m_DoDecryption; }
     private byte[] m_ReadFromCipher() throws IOException {
          byte[] inBuffer = (m_Cipher != null) ? new byte[Math.max(1, m_Cipher.getBlockSize())] : new byte[1];
          int pos = 0;
          int symbol = -1;
          while ((pos < inBuffer.length) && ((symbol = m_Input.read()) != -1)) { inBuffer[pos++] = (byte)(symbol & 0xFF); }
          byte[] result = m_Cipher.update(inBuffer, 0, pos);
          if (symbol == -1) { close(); }
          return (result == null) ? new byte[0] : result;
     private byte[] m_ReadDecrypting() throws IOException {
          byte[] Data = m_ReadFromCipher();
//          return m_Depadding(Data); /*
          return Data; //*/
     private byte[] m_Depadding(byte[] Data) {
          // Check (from the end of the result, if padding does exist)
          if ((Data.length > 0) && (Data[Data.length-1] > 0) && (Data[Data.length-1] <= m_Cipher.getBlockSize())) {
               // Padding likely
               int number = Data[Data.length-1];
               boolean isPadding = true;
               for (int counter = 0; counter < number; counter++) {
                    if (Data[Data.length-1-counter] != number) {
                         isPadding = false;
                         break;
               if (isPadding) {
                    byte[] newResult = new byte[Data.length - number];
                    System.arraycopy(Data, 0, newResult, 0, newResult.length);
                    return newResult;
               } else { return Data; }
          } else { return Data; }
     private void m_FinalizeCipher() {
          byte[] lastBytes;
          try {
               lastBytes = m_Cipher.doFinal();
               lastBytes = m_Depadding(lastBytes);
               byte[] newBuffer = new byte[m_Buffer.length + lastBytes.length];
               System.arraycopy(m_Buffer, 0, newBuffer, 0, m_Buffer.length);
               System.arraycopy(lastBytes, 0, newBuffer, m_Buffer.length, lastBytes.length);
               m_Buffer = newBuffer;
               m_EndOffset = m_Buffer.length;
          } catch (IllegalBlockSizeException e) {
          } catch (BadPaddingException e) {
     public CCipherInputStream(InputStream Input, SecretKey Key) throws IOException {
          m_Input = Input;
          try {
               m_Cipher = Cipher.getInstance(Key.getAlgorithm());
               m_Cipher.init(Cipher.DECRYPT_MODE, Key);
          } catch (InvalidKeyException Cause) { throw new IOException(Cause); }
          catch (NoSuchPaddingException Cause) { throw new IOException(Cause); }
          catch (NoSuchAlgorithmException Cause) { throw new IOException(Cause); }
          m_DoDecryption = true;
     public CCipherInputStream(InputStream Input) {
          m_Input = Input;
          m_DoDecryption = false;
          m_Cipher = null;
     public boolean isClosed() { return m_IsClosed; }
     public void setKey(SecretKey Key) throws IOException {
          try {
               m_Cipher = Cipher.getInstance(Key.getAlgorithm());
               m_Cipher.init(Cipher.DECRYPT_MODE, Key);
          } catch (NoSuchAlgorithmException Cause) { throw new IOException(Cause); }
          catch (NoSuchPaddingException Cause) { throw new IOException(Cause); }
          catch (InvalidKeyException Cause) { throw new IOException(Cause); }
          m_DoDecryption = true;
     public void disableDecryption() throws IOException {
          // TODO read last bytes from cipher
          // Disable encryption
          m_DoDecryption = false;
     @Override public int available() throws IOException {
          // If there is data in buffer, return number of remaining bytes in buffer
          if (m_StartOffset < m_EndOffset) { return m_EndOffset - m_StartOffset; }
          else {
               while (!m_IsClosed) {
                    if (m_DoDecryption) {
                         // Read encrypted data stream
                         m_Buffer = m_ReadDecrypting();
                         m_EndOffset = m_Buffer.length;
                    } else {
                         // Read plain data stream (single byte only)
                         byte[] buffer = new byte[1];
                         m_EndOffset = m_Input.read(buffer);
                         m_Buffer = new byte[m_EndOffset];
                         System.arraycopy(buffer, 0, m_Buffer, 0, m_EndOffset);
                    m_StartOffset = 0;
                    return m_EndOffset - m_StartOffset;
               return -1;
     @Override public int read() throws IOException {
          if (available() > 0) { return (m_Buffer[m_StartOffset++]); }
          else { return -1; }
     @Override public int read(byte[] Buffer) throws IOException { return read(Buffer, 0, Buffer.length); }
     @Override public int read(byte[] Buffer, int Offset, int Length) throws IOException {
          // If no data is requested, return immediately
          if (Length <= 0) { return 0; }
          // Check how much data is available
          int toRead = available();
          // If the stream is closed,
          if (toRead < 0) { return -1; }
          // If there is more data available than shall be read, shorten
          if (toRead > Length) { toRead = Length; }
          if (Buffer != null) {
               System.arraycopy(m_Buffer, m_StartOffset, Buffer, Offset, toRead);
               m_StartOffset += toRead;
               return toRead;
          } else { return 0; }
     @Override public long skip(long N) throws IOException {
          // If there is nothing to skip, do not skip
          if (N < 1) { return 0; }
          // Read number of bytes currently available for skipping
          long toSkip = available();
          // If the stream is closed, 0 bytes were skipped
          if (toSkip < 0) { return 0; }
          // If more bytes are available that to skip, limit
          if (toSkip > N) { toSkip = N; }
          // Actually doing the skip
          m_StartOffset += toSkip;
          // Return number of skipped bytes
          return toSkip;
     @Override public void close() throws IOException {
          m_IsClosed = true;
          m_FinalizeCipher();
          m_Input.close();
     @Override public boolean markSupported() { return false; }
}I also tried the OpenJDK 7 implementation, yet this would result in "Hello World55555" (eventually the 5 is 0x05) when encrypting "Hello World" using AES-128 .
Thanks for any hints.

Hi,
even after so many nights of messing around with the problem, one night of sleep can help.
As in my case only data became corrupted where the last byte of a cipher row (i.e. buffer[startindex, startindex + Cipher.getBlockSize]) was 0x01, I decided to implement a very trivial form of padding in the output stream as well. Just to share my experience, I have attached my output stream as well.
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
/** <p>Output stream that is capable to encrypt incoming data using a {@link
* Cipher} with {@link SecretKey}.</p>
* @author Bjoern Wuest, Germany
* @version 2011-09-02
public class CCipherOutputStream extends OutputStream {
     /** <p>The output stream to stream to.</p> */
     private OutputStream m_Output;
     /** <p>The cipher to use for encryption, if enabled.</p> */
     private Cipher m_Cipher;
     /** <p>Flag to indicate whether to use encryption or not.</p> */
     private boolean m_DoEncryption;
     /** <p>Create new output stream.</p>
      * <p>This output stream wraps the provided output stream and disables
      * encryption mode.</p>
      * @param Output The output stream to wrap.
     public CCipherOutputStream(OutputStream Output) {
          if (Output == null) { throw new NullPointerException("The underlying output stream cannot be the null object."); }
          m_Output = Output;
          // No cipher, no encryption
          m_Cipher = null;
          m_DoEncryption = false;
     /** <p>Create new output stream.</p>
      * <p>This output stream wraps the provided output stream and enables
      * encryption mode with the provided secret key.</p>
      * @param Output The output stream to wrap.
      * @param Key The key to use for encryption.
      * @throws IOException If this stream could not be initialized due to
      * problems with setting up the cipher.
      * @throws NoSuchAlgorithmException If the algorithm of the secret key is not supported.
      * @throws NoSuchPaddingException If the padding given in the secret key is not supported.
      * @throws InvalidKeyException If the key itself is invalid.
     public CCipherOutputStream(OutputStream Output, SecretKey Key) throws IOException {
          if (Output == null) { throw new NullPointerException("The underlying output stream cannot be the null object."); }
          m_Output = Output;
          // Generate cipher
          try {
               m_Cipher = Cipher.getInstance(Key.getAlgorithm());
               m_Cipher.init(Cipher.ENCRYPT_MODE, Key);
          } catch (NoSuchAlgorithmException Cause) { throw new IOException(Cause); }
          catch (NoSuchPaddingException Cause) { throw new IOException(Cause); }
          catch (InvalidKeyException Cause) { throw new IOException(Cause); }
          // Enable encryption mode
          m_DoEncryption = true;
     /** <p>Set new key for encryption and enables encryption.</p>
      * <p>Before encryption is enabled, buffered data is flushed.</p>
      * @param Key The key to use for encryption.
      * @throws IOException If flushing did not work or cipher could not be
      * initialized.
     public void setKey(SecretKey Key) throws IOException {
          // Flush what is in the stream
          flush();
          // Generate cipher
          try {
               m_Cipher = Cipher.getInstance(Key.getAlgorithm());
               m_Cipher.init(Cipher.ENCRYPT_MODE, Key);
          } catch (NoSuchAlgorithmException Cause) { throw new IOException(Cause); }
          catch (NoSuchPaddingException Cause) { throw new IOException(Cause); }
          catch (InvalidKeyException Cause) { throw new IOException(Cause); }
          // Enable encryption
          m_DoEncryption = true;
     /** <p>Disable encryption of this output stream.</p>
      * <p>All buffered data is flushed before encryption is disabled.</p>
      * @throws IOException If flushing of data failed.
     public void disableEncryption() throws IOException {
          // Flush what is in the stream
          flush();
          // Disable encryption
          m_DoEncryption = false;
     /** <p>Returns whether this stream is in encryption mode or not.</p>
      * @return {@code true} if this stream encrypts incoming data.
     public boolean isEncrypting() { return m_DoEncryption; }
     @Override public void write(int Data) throws IOException { write(new byte[]{(byte)Data}); }
     @Override public void write(byte[] Data) throws IOException { write(Data, 0, Data.length); }
     @Override public void write(byte[] Data, int Offset, int Length) throws IOException {
          if (m_DoEncryption) {
               // Copy data to write into a byte buffer
               ByteArrayInputStream bais = new ByteArrayInputStream(Data, Offset, Length);
               // Output buffer for encrypted data
               ByteArrayOutputStream baos = new ByteArrayOutputStream(((Length - Offset) / 15 + 1) * 16);
               // Process data
               int cipherBlockSize = m_Cipher.getBlockSize();
               byte[] buffer = new byte[cipherBlockSize];
               int bytesRead = 0;
               // As long as there is something left to process
               while ((bytesRead = bais.read(buffer, 0, buffer.length-1)) > 0) {
                    // Append padding
                    for (int i = m_Cipher.getBlockSize(); i > bytesRead; i--) { buffer[i-1] = (byte)(cipherBlockSize - bytesRead); }
                    // Write encoded buffer to output stream
                    baos.write(m_Cipher.update(buffer));
               // Write data to output stream
               m_Output.write(baos.toByteArray());
          } else { m_Output.write(Data, Offset, Length); }
     @Override public void flush() throws IOException {
          byte[] buffer = null;
          // If encryption is enabled, try to cipher what is remaining
          if (m_DoEncryption) {
               try { buffer = m_Cipher.doFinal(); }
               catch (IllegalBlockSizeException Reset) { buffer = null; }
               catch (BadPaddingException Reset) { buffer = null; }
          // If there is any data to write, do so
          if ((buffer != null) && (buffer.length > 0)) { m_Output.write(buffer); }
          // Flush underlying stream
          m_Output.flush();
     @Override public void close() throws IOException {
          flush();
          m_Output.close();
}

Similar Messages

  • Custom tag fails to under Tomcat 5.0.16

    I have just upgraded to Tomcat 5.0.16 from 4.1.x.
    Any JSP page that contains a custom tag fails to build; error message:
    org.apache.jasper.JasperException: /jsp/CustomReport.jsp(62,20) Unknown attribute type (String) for attribute name.
    The tags work under �Tomcat 4.x�. All other pages build and function correctly.
    Specs:
    Java 2 version: 1.4.2_03
    Tomcat 5.0.16 or Tomcat 4.1.x

    Try updating your web.xml to use the Servlet 2.4 schema. You will have to change your tld declarations to sit inside the new <jsp-config> tags but see if it works for Servlet 2.4. Could be a backwards compatible bug?
    Anthony

  • All custom tags fail in JBoss3.2.3/Tomcat 5.0.16 (works in Tomcat 4.x)

    All pages that contain a custom tag fail with the following exception: HTTP Status 500 -
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:153)
         uploadQS1_jsp._jspx_meth_strutshtml_hidden_0(uploadQS1_jsp.java:225)
         uploadQS1_jsp._jspService(uploadQS1_jsp.java:100)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    note The full stack trace of the root cause is available in the Tomcat logs.Even a simple <struts-html: hidden ... /> tag causes this exception. As long as the page has no custom tags, it is served fine. The same web-app works as expected in JBoss3.2.3/Tomcat4.x.
    It almost looks as if Tomcat is looking in a object pool for a custom tag object reference and when it fails to find one, throws a null-pointer instead of instantiating a new one to work with. (This is pure speculation on my part).
    Did the TLD's req's change, or the setup for Tomcat? It's not my tags, even Struts tags fail. Any ideas why my tags aren't "resolving"?

    Has anyone had any luck getting this to run or run into this problem? It fails even with a fresh JBoss install using tomcat 5.0.16.

  • Annotation-Processing Using Custom ClassLoader Fails

    Hi,
    I have the following problem concerning annotations.
    I am using Jaxb2 to marshal some classes and Jaxb relies heavily on processing annotation information contained in them.
    If I put the Jaxb JAR's directly in the classpath everything works fine.
    However, if I use a custom URLClassLoader to load all the Jaxb-related classes the annotation processing fails thus making Jaxb believe that the objects can't be marshaled.
    Note that the classes to marshal containing the annotations to read are loaded with a different ClassLoader which is higher in the hierarchy.
    I tracked down the problems to the class RuntimeInlineAnnotationReader of the Jaxb API which simply calls Class.getAnnotion(..).
    When searching for this bug I also found the bug report 5015623 which relates to this problem. But it is rather outdated, so I hope that there are some better solutions than just ignoring it.
    I wouldn't like having the Jaxb JARs on the global classpath 'cause they are used in only one class out of 100 and thats not worth the possible conflicts with other 3rd party libs.
    Best regards,
    beebop

    No problem, I will give you some details about my architecture.
    First of all I encapsulated the code which uses the Jaxb-API in one class, say Foo, which implements the interface FooInterface.
    Secondly I load the Foo class in another class, Bar, using my derivation of URLClassLoader, called MyClassLoader. Then I use the interface to marshal an object gen of type GenClass where GenClass was generated using xjc:
    class Bar {
      void method(URL[] urls, GenClass gen) {
        ClassLoader parent = Bar.class.getClassLoader();
        ClassLoader myCL = new MyClassLoader(urls,parent);
        Class clazz = myCL.loadClass("Foo");
        FooInterface foo = (FooInterface)clazz.newInstance();
        foo.marshal(gen);
    }So my class loader will be a child of the current class loader. The delegation model of class loading is reversed in MyClassLoader so that first the urls will be checked and then, if the class was not found, the parent class loader.
    Note that GenClass and its ObjectFactory which acutally contain the annotations Jaxb needs will be loaded by the current class loader, not my own. All classes of the Jaxb-API will be loaded by MyClassLoader. If I try to marshal gen, the annotations of the ObjectFactory corresponding to GenClass won't be readable causing the Class.getAnnotation(...) method called in the class RuntimeInlineAnnotationReader to return null.
    If I don't use my own class loader, say
    FooInterface foo = new Foo();everything works fine and the annotations of the ObjectFactory are loaded correctly.
    I observed the different behaviour by stepping through the classes and methods around JaxbContext.newInstance(...).
    MyClassLoader is not that different from URLClassLoader, only the loadClass method is overridden to change the delegation behaviour. Thats why I suspect an error in the annotations framework and not in my class loader but I may be mistaken.
    Best regards,
    beebop

  • Custom Login - Failed login

    We need to run some checks against our business rules at login
    time so I have written a custom login page which calls a custom
    procedure. The procedure determines how much access the user is
    entitled to and sets the users group memmbership accordingly.
    Finally I call the Portal login procedure with the username and
    password that the user provided:
    portal30.wwptl_login.login_url(USERNAME,
    PASSWORD,
    OK_URL,
    cancel_URL);
    This works ok if the user has typed in a valid username +
    password. But if the Portal login fails the user gets thrown to
    the Single Sign-On screen. If the user now fixes his typo and
    log in again he/she bypasses the whole custom login procedure...
    The only way I can think of right now is to change the Single
    Sign-On screen, which I know is possible. But that will apply to
    the whole Portal installation and we do need several different
    custom login's, similar to the one outlined above. So we would
    have to change the Single Sign-On screen just have some text
    telling the user to login using one of the official login pages.
    Not very nice - but a possible solution.
    It would be nice if you could specify a URL to the login
    procedure for the case of a failed login. Is this something that
    is being concidered for future versions of Portal?
    Hmmm.. in case a user bookmarks a page that is not public he/she
    will still be taken to the Single Sign-On page to login. Guess
    we have to change the Single Sign-On screen after all..
    Any other ideas?

    You should develop customized login page according to the
    specification provided in the SSO Server administrator guideHello
    Where can i find the SSO Server administrator guide ??
    Thanks
    ERIC

  • Custom Sql fails when using Date Parameter

    I need to do following using DB adapter
    select count(*) from some_table where creation_date >= #from_date and creation_date <= #to_date
    I used Custom sql options, but It did not asked for add params. so I added manually above params in the query. I am getting following query. I don't know how to get this working. i am on 10.1.3.
    Here I am getting from and to dates from a AQ message. AQ has from and to_date as date type elements. I am doing copy assign of these to SQL input params
    below is the error.
    <messages><input>
    <RecordCount_service_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    name="XI_RecordCount_serviceInput_msg"><XI_RecordCount_serviceInput xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/XI_RecordCount_service">
    <ns0:v_fromdate1 xmlns="" xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/XI_RecordCount_service">2008-01-01T00:00:00.000-06:00</ns0:v_fromdate1>
    <ns0:v_todate1 xmlns="" xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/XI_RecordCount_service">2008-01-31T00:00:00.000-06:00</ns0:v_todate1>
    <ns0:v_fromdate2 xmlns="" xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/XI_RecordCount_service">2008-01-01T00:00:00.000-06:00</ns0:v_fromdate2>
    <ns0:v_todate2 xmlns="" xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/XI_RecordCount_service">2008-01-31T00:00:00.000-06:00</ns0:v_todate2>
    </XI_RecordCount_serviceInput>
    </part></RecordCount_service_InputVariable></input><fault><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>1861</code>
    </part><part name="summary"><summary>file:/u01/app/oracle/product/10.1.3/bpm/bpel/domains/arun/tmp/.bpel_XI_P2EU_Allegro_Service_1.0_79d8666bc8efe5a375691e0a5f06e2e4.tmp/XI_RecordCount_service.wsdl [ XI_RecordCount_service_ptt::XI_RecordCount_service(XI_RecordCount_serviceInput_msg,XI_RecordCount_serviceOutput) ] - WSIF JCA Execute of operation 'XI_RecordCount_service' failed due to: Pure SQL Exception.
    Pure SQL Execute of select count(*) record_count FROM XI_TABLE WHERE ( (trunc(CREATION_DATE) >= ? AND TRUNC(CREATION_DATE) &lt;= ?) OR (trunc(last_update_date) >= ? AND TRUNC(last_update_date) &lt;= ?) ) failed. Caused by java.sql.SQLException: ORA-01861: literal does not match format string
    ; nested exception is:
         ORABPEL-11633
    Pure SQL Exception.
    Pure SQL Execute of select count(*) record_count FROM XI_TABLE WHERE ( (trunc(CREATION_DATE) >= ? AND TRUNC(CREATION_DATE) &lt;= ?) OR (trunc(last_update_date) >= ? AND TRUNC(last_update_date) &lt;= ?) ) failed. Caused by java.sql.SQLException: ORA-01861: literal does not match format string
    The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead.
    </summary>
    </part><part name="detail"><detail>ORA-01861: literal does not match format string
    </detail>
    </part></bindingFault></fault></messages>

    I think the database accepts only your database format' dd-mm-yyyy'.
    Try to define #from_date & #to_date as string and use to_date() in your custim sql statement.
    Marc

  • Essbase custom configuration failing in 11.1.1.3 on UNIX aix 5.3

    Hi all,
    My essbase is 11.1.1.3 and I am upgrading by uninstalling my existing 9.3.1.3 essbase server. My OS is IBM AIX 5.3 64 bit. My custom configuration is taking about 50 mins and failing. This is the following error message.
    (Aug 06, 2010, 05:34:20 PM), com.hyperion.essbase.config.EssbaseAgentTaskProcessor, ERROR, Maxl process has interrupted, exitCode = -1
    (Aug 06, 2010, 05:34:20 PM), com.hyperion.essbase.config.EssbaseAgentTaskProcessor, ERROR, Failed to execute EssbaseAgentTaskProcessor:
    java.lang.Exception: Maxl process has interrupted, exitCode = -1
    at com.hyperion.essbase.config.EssbaseAgentTaskProcessor.startEssbaseOnUnix(EssbaseAgentTaskProcessor.java:687)
    at com.hyperion.essbase.config.EssbaseAgentTaskProcessor.execute(EssbaseAgentTaskProcessor.java:378)
    at com.hyperion.cis.config.wizard.RunAllTasksWizardAction.executeCustomTask(RunAllTasksWizardAction.java:741)
    at com.hyperion.cis.config.wizard.RunAllTasksWizardAction.execute(RunAllTasksWizardAction.java:188)
    at com.installshield.wizard.RunnableWizardBeanContext.run(Unknown Source)
    can any one guide me on this? Thanks

    yum install should resolve the dependencies.
    Do you remember what all you installed using yum? (I can't remember all of them )
    When you launch the installer and then click on the one which shows cannot be installed it'll show you what all are needed for that component.
    Make a note of them and perform a yum install for each of them. What I did was i installed them and repeatedly launched installtool.sh till all dependencies were marked as passed.
    Regards
    Celvin
    http://www.orahyplabs.com

  • 11g GC DBAT Trusted Source Reconciliation with custom attributes fails

    Hi All,
    We are working on OIM 11g and we are using the GTC Database Tables connector to reconcile from an HR application that exposes the data in some views. When we add a custom attribute in User object (HR_ROLE_CODE) and map it in the connector the reconciliation fails with the following error:
    intUserKey_in = 1
    intBatchKey_in = 80
    strTargetTableName_in = RA_MERGERDEVDBEMPGTC46
    strRequiredAttributesList_in = RECON_USR_LOGIN,RECON_LASTNAME,RECON_STATUS
    strValidateAttributesList_in = RECON_USR_LOGIN,RECON_USR_EMAIL,RECON_ACT_KEY,RECON_USR_TYPE,RECON_USR_EMP_TYPE,RECON_USR_START_DATE,RECON_USR_END_DATE
    strOIMVldtAttributeColList_in = USR_LOGIN,USR_EMAIL,ACT_KEY,USR_TYPE,USR_EMP_TYPE,USR_START_DATE,USR_END_DATE
    strMatchingRule_in = (((USR.USR_LOGIN=RA_MERGERDEVDBEMPGTC46.RECON_USR_LOGIN)))
    strNoMatchFoundRule_in = Create User
    strUserMatchedRule_in = Establish Link
    strUsersMatchedRule_in = None
    intEventAssignUsrGrpKey_in = 0
    strmappedAttributesList_in = RECON_USR_LOGIN,RECON_ROLECODE,RECON_FATHERSNAME,RECON_LASTNAME,RECON_ACT_KEY,RECON_FIRSTNAME,RECON_USR_EMP_TYPE,RECON_USR_TYPE,RECON_USR_PASSWORD
    stroimAttributeTableColList_in = USR_LOGIN,HR_ROLE_CODE,USR_MIDDLE_NAME,USR_LAST_NAME,ACT_KEY,USR_FIRST_NAME,USR_EMP_TYPE,USR_TYPE,USR_PASSWORD
    strReconciliationType_in = User
    strReconMLSTableName_in = RA_MLS_MERGERDEVDBEMPGTC46
    strReconMLSColNames_in =
    strOimMLSColNames_in =
    strDefaultLocale_in = el
    strAllLocates_in = el
    intReturnCode_out = null
    strErrMsg_out = null
    SEVERE: Γενικό σφάλμα/πληροφορίες: {0}
    oracle.iam.platform.utils.SuperRuntimeException: -9: Attribute field (HR_ROLE_CODE) does not exist in table USR.
         at oracle.iam.reconciliation.dao.ReconActionDao.executeBulkUserMatchCRUD(ReconActionDao.java:697)
         at oracle.iam.reconciliation.impl.UserHandler.executeBulkCUD(UserHandler.java:568)
         at oracle.iam.reconciliation.impl.BaseEntityTypeHandler.process(BaseEntityTypeHandler.java:34)
         at oracle.iam.reconciliation.impl.ActionEngine.processBatch(ActionEngine.java:129)
         at oracle.iam.reconciliation.impl.ActionEngine.execute(ActionEngine.java:90)
         at oracle.iam.reconciliation.impl.ActionTask.execute(ActionTask.java:73)
         at oracle.iam.platform.async.impl.TaskExecutor.executeUnmanagedTask(TaskExecutor.java:100)
         at oracle.iam.platform.async.impl.TaskExecutor.execute(TaskExecutor.java:70)
         at oracle.iam.platform.async.messaging.MessageReceiver.onMessage(MessageReceiver.java:68)
         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.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy488.onMessage(Unknown Source)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:328)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
         at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3822)
         at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    The attribute exists in USR table with name: USR_UDF_HR_ROLE_CODE but the connector maps it as HR_ROLE_CODE (line: stroimAttributeTableColList_in = ....)
    Can anyone help on this?
    Thanks in advance,
    Kostas

    Thanks for the answer Rajiv,
    I tried to run the utility to download/upload a custom resource bundle but after the parameters that I provide the utility does nothing. It looks like it cannot find the specified path/file lathough i tried both windows and unix style.
    It does not display ay message of success or failure, also I do not know how can I verify that the bundle has been upload successfully.

  • Customizing the Collaboration Launch Pad

    Hi,
    Is there any way I can customize "My Contacts List" to  display another attribute of the user next to his name?
    If not then is there a way to build my own customized Collaboration Launch Pad or "My Contacts List"?
    Roaa

    Roaa,
    You can read this weblog:
    /people/robert.briese2/blog/2005/09/15/creating-contact-lists-juggling-with-ume-attributes-and-km-properties
    Patricio.

  • Custom Workflows Failing

    *All of our custom workflows are now failing. Here is the error from xgridagentd.log:*
    Mon Dec 8 13:12:07 podcast.sad60.k12.me.us xgridagentd[79] <Notice>: Notice: agent task "46517" failed for user "pcastuser" executable "/usr/bin/pcastaction" arguments (\n groupblog,\n "--basedir=/SFS/Recordings/0521FC29-30B0-4AD9-8853-27AF04E6F50E",\n "--server_url=http://podcast.sad60.k12.me.us/groups",\n "--group=msad60itsupport",\n "--username=pcastadmin",\n "--pcast_server=https://podcast.sad60.k12.me.us:8170/podcastproducer",\n "--otp=+lNHrfZAjw3d4BivCCSn0Q==",\n "--authorize=dsaltmarsh",\n "--title=testBlog",\n "--content_file=groupblog.html",\n "--enclosuredescription_file=ipod_publish_descriptionfile.yaml",\n "--enclosuredescription_file=audio_publish_descriptionfile.yaml",\n "--outfile"\n)
    *When I break this down into a single command and run it as pcastuser on the server, I get the following errors:*
    bash-3.2$ /usr/bin/pcastaction groupblog --basedir=/SFS/Recordings/ABC5A1F2-F6DC-4CFB-986E-9337C4E7DB5B --server_url=http://podcast.sad60.k12.me.us/groups --group=msad60itsupport --username=pcastadmin --pcast_server=https://podcast.sad60.k12.me.us:8170/podcastproducer --otp=5MSGLwPZxyg7mylRBAhVuw== --authorize=dsaltmarsh --title="Dec 8th Test" --content_file=groupblog.html --enclosuredescription_file=ipod_publish_descriptionfile.yaml --enclosuredescription_file=audio_publish_descriptionfile.yaml --outfile
    2008-12-08 12:57:37.905 ruby[43456:613] CFPreferences: user home directory at /Users/podadmin/99 is unavailable. User domains will be volatile.
    2008-12-08 12:57:38.179 ruby[43458:717] CFPreferences: user home directory at /SFS/Recordings/ABC5A1F2-F6DC-4CFB-986E-9337C4E7DB5B/99 is unavailable. User domains will be volatile.
    ERROR: could not get response for challenge
    bash-3.2$
    *Now, to fill in some gaps...* podadmin is the local user account logged in at the time of running the jobs. dsaltmarsh is the user specified in the workflow's user short name, and is the owner of the group called msad60itsupport.
    As for the errors, I'm not entirely sure why PcP is looking for a 99 directory inside the home folder. In my experience, a 99 directory is never a good thing.
    Please note, I get this error for all my custom workflows. However, my default workflows appear to be fine using the pcastadmin user via Podcast Capture.
    Any help is appreciated!

    Hello,
    I would turn on SWELS in Production until one of these cases occurs (10% is a lot so it wouldn't be for long) to be able to determine if it's the lack of event creation or not.
    Is there a start condition?
    regards
    Rick Bakker
    Hanabi Technology

  • RDS 2012 - Virtual desktop collection with powershell and custom answerfile fails on VDI deployment

    Hi Guys,
    I try to deploy a new virtual desktop collection with Win8 VDI's (pooled/managed) based on a custom answer file. Everything needs to automated so working with the server manager is not an option, that's why the answer file is needed.
    The lab environment is based on Windows Server 2012 and Win8 Enterprise only. So functional level etc. is off course Windows Server 2012.
    I Use the following command:
    New-RDVirtualDesktopCollection `
    -CollectionName "Pooled Managed Win8" `
    -Description "This collection contains Pooled and Managed Win 8 VDI machines." `
    -OU "VDI" `
    -ConnectionBroker "RDSCB01.lab.local" `
    -PooledManaged `
    -CustomSysprepUnattendFilePath "\\hyper02\_Unattend\OOBE-only.xml" `
    -VirtualDesktopAllocation @{"hyper02.lab.local"=3} `
    -VirtualDesktopNamePrefix "Pooled-Win8-" `
    -UserGroups "lab.local\domain users" `
    -MaxUserProfileDiskSizeGB 1 `
    -VirtualDesktopTemplateHostServer "hyper02.lab.local" `
    -VirtualDesktopTemplateName “_WIN8-Template” `
    -UserProfileDiskPath "\\hyper02.lab.local\_UserProfileDisks" `
    -StorageType LocalStorage `
    -LocalStoragePath "E:\_VDI" `
    -Force `
    -Debug
    $error[0]|format-list -force
    I tried multiple answer files, but even with this simple one it fails:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <InputLocale>en-US</InputLocale>
    <SystemLocale>en-US</SystemLocale>
    <UILanguage>en-US</UILanguage>
    <UILanguageFallback>en-US</UILanguageFallback>
    <UserLocale>nl-NL</UserLocale>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <UserAccounts>
    <AdministratorPassword>
    <Value>UABhAHMAcwB3AG8AcgBkACEAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcgBQAGEAcwBzAHcAbwByAGQA</Value>
    <PlainText>false</PlainText>
    </AdministratorPassword>
    <LocalAccounts>
    <LocalAccount wcm:action="add">
    <Password>
    <Value>UABhAHMAcwB3AG8AcgBkACEAUABhAHMAcwB3AG8AcgBkAA==</Value>
    <PlainText>false</PlainText>
    </Password>
    <Description>Admin</Description>
    <DisplayName>Admin</DisplayName>
    <Group>Administrators</Group>
    <Name>Admin</Name>
    </LocalAccount>
    </LocalAccounts>
    </UserAccounts>
    <OOBE>
    <HideEULAPage>true</HideEULAPage>
    <HideLocalAccountScreen>true</HideLocalAccountScreen>
    <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
    <NetworkLocation>Work</NetworkLocation>
    <ProtectYourPC>3</ProtectYourPC>
    <SkipMachineOOBE>true</SkipMachineOOBE>
    <SkipUserOOBE>true</SkipUserOOBE>
    </OOBE>
    </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/=%20software/iso&apos;s/lic/en_windows_8_enterprise_x64_dvd_917522/sources/install.wim#Windows 8 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    Everything goes fine, until is comes to the deployment of the VDI machines and the answer file is called. It fails with the following error:
    PS N:\> \\dc01\isos\New-VirtualDesktopCollection.ps1
    Unable to retrieve the details of the virtual desktop collection.
    + CategoryInfo : WriteError: (:) [Start-RDVMRollout], RDManagementException
    + FullyQualifiedErrorId : StartRDVirtualMachineRollout,Microsoft.RemoteDesktopServices.Management.Cmdlets.StartRDVirtualMachineRo
    lloutCommand
    + PSComputerName : localhost
    CollectionName Type Size PercentInUse
    Pooled Managed... PooledManaged 0 0
    writeErrorStream : True
    OriginInfo : localhost
    Exception : System.Management.Automation.RemoteException: Unable to retrieve the details of the virtual desktop
    collection.
    TargetObject :
    CategoryInfo : WriteError: (:) [Start-RDVMRollout], RDManagementException
    FullyQualifiedErrorId : StartRDVirtualMachineRollout,Microsoft.RemoteDesktopServices.Management.Cmdlets.StartRDVirtualMachineRolloutCo
    mmand
    ErrorDetails :
    InvocationInfo :
    ScriptStackTrace :
    PipelineIterationInfo : {}
    PSMessageDetails :
    Without the answer file parameter is runs perfectly, BUT the VDI machines get the OOBE.... That's not what we want off course....
    This link (http://support.microsoft.com/kb/2747656?wa=wsignin1.0) and other sources tell me that when i set the regkeys i can find a log in c:\windows\logs, but there is
    nothing. I looked on the management server and the connection broker.
    The only thing i could find in the event viewer was this:
    The XML input specified for the VM Provisioning job is not in a valid format. Error: 0xC00CEE03
    Input XML:
    <?xml version="1.0"?>
    <rdvp:RDVProvisioning xmlns:rdvp="http://www.microsoft.com/rdv/2010/05/">
    <rdvp:ProvisionPoolRequest><rdvp:Job>
    <rdvp:Action>Create</rdvp:Action>
    <rdvp:OnError>Stop</rdvp:OnError></rdvp:Job>
    <rdvp:Pool><rdvp:Name>Pooled_Managed_W</rdvp:Name>
    <rdvp:Type></rdvp:Type>
    <rdvp:VhdType>DiffDisk</rdvp:VhdType>
    <rdvp:SaveDelay></rdvp:SaveDelay>
    <rdvp:Version></rdvp:Version>
    <rdvp:MARK_HA>No</rdvp:MARK_HA></rdvp:Pool>
    <rdvp:Vm>
    <rdvp:BaseVmLocation>\\RDSCB01\RDVirtualDesktopTemplate\Pooled_Managed_W\IMGS\__3</rdvp:BaseVmLocation>
    <rdvp:LocalVmCreationPath>E:\_VDI</rdvp:LocalVmCreationPath>
    <rdvp:LocalGoldCachePath></rdvp:LocalGoldCachePath>
    <rdvp:SMBShare></rdvp:SMBShare>
    <rdvp:EnableVmStreaming>0</rdvp:EnableVmStreaming>
    <rdvp:RunVMsFromSMB>0</rdvp:RunVMsFromSMB>
    <rdvp:NamingPrefix>Pooled-Win8</rdvp:NamingPrefix>
    <rdvp:NamingStartIndex>1</rdvp:NamingStartIndex>
    <rdvp:Domain>lab.local</rdvp:Domain>
    <rdvp:OU>OU=VDI,OU=Computers,OU=Kamer 2101,DC=lab,DC=local</rdvp:OU>
    <rdvp:ProductKey></rdvp:ProductKey>
    <rdvp:UnattendXml>
    <![CDATA[<?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <OOBE>
    <HideEULAPage>true</HideEULAPage>
    <HideLocalAccountScreen>true</HideLocalAccountScreen>
    <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
    <NetworkLocation>Work</NetworkLocation>
    <ProtectYourPC>3</ProtectYourPC>
    <SkipMachineOOBE>true</SkipMachineOOBE>
    <SkipUserOOBE>true</SkipUserOOBE>
    </OOBE>
    </component>
    </settings>
    </unattend>]]>
    </rdvp:UnattendXml>
    </rdvp:Vm>
    <rdvp:HyperVHosts>
    <rdvp:HyperVHost>
    <rdvp:Name>hyper02.lab.local</rdvp:Name>
    <rdvp:NumberVms>3</rdvp:NumberVms>
    </rdvp:HyperVHost>
    </rdvp:HyperVHosts>
    </rdvp:ProvisionPoolRequest>
    </rdvp:RDVProvisioning>----------------------------------------------------------------------Log Name: Microsoft-Windows-TerminalServices-SessionBroker/Admin
    Source: TerminalServices-SessionBroker
    EventID: 1549
    Level: Error
    User: NETWORK SERVICE
    Task Category: MS VM Provisioning Plugin
    Computer: RDSCB01.lab.local
    I hope we can get this working, thanks in advance everybody!
    Regards,
    Bart

    Hi Bartsp34ks,
    I'm trying to make a powershell script like yours.
    But at some point I receive this error:
    System.Management.Automation.RemoteException: VM ASD-1: The data area passed to a system call is too small. (Exception from HRESULT: 0x8007007A)
    My Powershell script is:
    $CollectionName = Read-Host 'What Name should the Collection have?'
    $Description = Read-Host 'Type a description of the Collection'
    $OU = Read-Host 'In which OU should I put the Collection?'
    $ConnectionBroker = Read-Host 'What is the Connection Broker Name? (use FQDN)'
    $Sysprep = Read-Host 'Type the Unattend file location'
    $DesktopAllocation = Read-Host 'On which RD Virtualization Host server should I create the Collection?'
    $DesktopAllocationNR = Read-Host 'How many Virtual Desktop would you like?'
    $NamePrefix = Read-Host 'What is the Prefix Name?'
    $NameSuffix = Read-Host 'What is the Suffix Name?'
    $UserGroup = Read-Host 'Which User Group can use the Collection?'
    $UserProfile = Read-Host 'How big can the ProfileDisk be?'
    $TemplateServer = Read-Host 'What is the RD Host that has the Virtual Desktop Template? (use FQDN)'
    $TemplateName = Read-Host 'What is the Virtual Desktop Template Name?'
    $UserProfilePath = Read-Host 'What should be the User Profile Path?'
    $StorageType = Read-Host 'How should be stored?'
    $StoragePath = Read-Host 'Type the Path'
    New-RDVirtualDesktopCollection `
    -CollectionName $CollectionName `
    -Description $Description `
    -OU $OU `
    -ConnectionBroker $ConnectionBroker `
    -PooledManaged `
    -CustomSysprepUnattendFilePath $Sysprep `
    -VirtualDesktopAllocation @{$DesktopAllocation=$DesktopAllocationNR} `
    -VirtualDesktopNamePrefix $NamePrefix `
    -UserGroups $UserGroup `
    -MaxUserProfileDiskSizeGB $UserProfile `
    -VirtualDesktopTemplateHostServer $TemplateServer `
    -VirtualDesktopTemplateName $TemplateName `
    -UserProfileDiskPath $UserProfilePath `
    -StorageType LocalStorage `
    -LocalStoragePath $StoragePath `
    -Force `
    -Debug
    $error[0]|format-list -force
    Thanks for help

  • Custom ClassLoader - fails to load java/lang/Object

    I have created a custom class loader based substantially on Jim Farley's code in "Java Distributed Computing" pp 39-44.
    The code does get a URL connection, download the class file, but fails when it tries to load (re-load) java/lang/Object. My understanding is that the same (custom) class loader is also used to load dependent classes (needed by the class your are originally loading). I had assumed that this would be handled by the call to findSystemClass() I had assumed.
    Any help or direction is appreciated,
    Jeff.
    Here is the output:
    File=/tasks/Person.class
    Host=n01
    Trying to load:/tasks/Person
    Check system :/tasks/Person
    Not found in System:/tasks/Person
    Check stream:/tasks/Person
    Class file is 815 bytes.
    Available = 815
    RemoteClassLoader: Reading class from stream...
    RemoteClassLoader: Defining class...
    java.lang.ClassNotFoundException: Cannot find class definition:
    java.lang.NoClassDefFoundError: java/lang/Object
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:426)
         at RemoteClassLoader.readClass(RemoteClassLoader.java:83)
         at RemoteClassLoader.loadClass(RemoteClassLoader.java:139)
         at TestRemoteClassLoader.main(TestRemoteClassLoader.java:18)
    Class was not loaded.Here is the code:
    import java.lang.*;
    import java.net.*;
    import java.io.*;
    import java.util.Hashtable;
    public class RemoteClassLoader extends ClassLoader {
       URL classURL = null;
       InputStream classStream = null;
       java.lang.Object o = null;
       Hashtable classCache = new Hashtable();
       InputStream source = null;
       // Constructor
       public RemoteClassLoader()
       // Parse a class name from a class locator (URL, filename, etc.)
       protected String parseClassName(String classLoc)
          throws ClassNotFoundException
             String className = null;
             try { classURL = new URL(classLoc); }
             catch (MalformedURLException malex) {
                throw new ClassNotFoundException("Bad URL \"" + classLoc + "\"given: " + malex);
             System.out.println("File=" + classURL.getFile());
             System.out.println("Host=" + classURL.getHost());
             String filename = classURL.getFile();
             // Make sure this is a class file
             if (!filename.endsWith(".class"))
                throw new ClassNotFoundException("Non-class URL given.");
             else
                className = filename.substring(0,filename.lastIndexOf(".class"));
             return className;
       // Initialize the input stream from a class locator
       protected void initStream(String classLoc)
          throws IOException
             classStream = classURL.openStream();
       // Read a class from the input stream
       protected Class readClass(String classLoc, String className)
          throws IOException, ClassNotFoundException
             //See how large the class file is.
             URLConnection conn = classURL.openConnection();
             int classSize = conn.getContentLength();
             System.out.println("Class file is " + classSize + " bytes.");
             // Read the class bytecodes from the stream
             DataInputStream dataIn = new DataInputStream(classStream);
             int avail = dataIn.available();
             System.out.println("Available = " + avail);
             System.out.println("RemoteClassLoader: Reading class from stream...");
             byte[] classData = new byte[classSize];
             dataIn.readFully(classData);
             // Parse the class definition from the bytecodes
             Class c = null;
             System.out.println("RemoteClassLoader: Defining class...");
             try{ c = defineClass(null, classData, 0, classData.length); }
             catch (ClassFormatError cfex) {
                throw new ClassNotFoundException("Format error found in class data.");
             catch (NoClassDefFoundError clsdeferr) {
                clsdeferr.printStackTrace();           
                throw new ClassNotFoundException("Cannot find class definition:\n" + clsdeferr);
             return c;
       // load the class
       public Class loadClass(String classLoc, boolean resolve)
          throws ClassNotFoundException
             String className = parseClassName(classLoc);
             Class c;
             System.out.println("Trying to load:" + className);
             //maybe already loaded
             c = findLoadedClass(className);
             if (c!=null) {
                System.out.println("Already loaded.");
                return c;
             c = (Class) classCache.get(className);
             if (c!=null) {
                System.out.println("Class was loaded from cache...");
                return c;
             System.out.println("Check system :" + className);
             // Not in cache, try the system class...
             try {
                c = findSystemClass(className);
                if (c!=null) {
                   System.out.println("System class found...");
                   classCache.put(className, c);
                   return c;
             catch (ClassNotFoundException cnfex) {
                System.out.println("Not found in System:" + className);
                ; // keep looking
             System.out.println("Check stream:" + className);
             // Not in system either, so try to get from tthe stream
             try {initStream(classLoc); }
             catch (IOException ioe) {
                throw new ClassNotFoundException("Failed opening stream to URL.");
             // Read the class from the input stream
             try {c = readClass(classLoc, className); }
             catch (IOException ioe) {
                   throw new ClassNotFoundException("Failed reading class from stream: " + ioe);
             // Add the new class to the cache for the next reference.
             classCache.put(className, c);
             // Resovle the class, if requested
             if (resolve)
                resolveClass(c);
             return c;

    Never mind - I've figure it out.
    The problem is that the ClassLoader calls RemoteClassLoader.loadClass() to load in java.lang.Object, which is fine. But, my code tries to first create a URL from this, which fails, eventually throwing a NoClassDefFoundError.
    I have fixed it by delaying the call to parseName() until after checking loaded classes and system classes.

  • Best Buy/Shopki​ck Customer Service FAIL

    Over the past week, I made two major purchases in your store, totally more than $1400 in sales. I am a regular user of Shopkick and to say I'm frustrated is an understatement. 
    I purchased a computer on 4/19 for $900 from a knowledgable and helpful sales associate, but was not awarded the Shopkick points for this purchase, however. I contacted Shopkick who told me I needed to "return" the product to the store to have the points loaded onto my account. I did this on 4/23, and it still didn't work. I contacted SK again. They said they couldn't do anything if it wasn't run correctly through your store.
    I AGAIN drove the 1/2 hour to your store to get this straightened out. They reran it as an "exchange" because I couldn't return a return. Still, the points were not awarded. Now Shopkick is telling me that because the total on my exchange slip is showing $0, that they can't award me the points. They also indicated that it's Best Buy's fault that this is happening, which is even more frustrating. 
    I am at wit's end, because I'm owed over 2000 points on my shopkick account for this purchase, which is the equivalent of getting about a $10 gift card! I've now spent more than an hour and a half of driving, as well as time on the phone/email with your store and with Shopkick, to straighten this mess out. They said there is nothing more they can do, so I tried emailing Best Buy for help. Then YOUR customer service told me to drive BACK to the store to have them rering the purchase AGAIN! This is not only frustrating - it's INFURIATING! At this point, it's the principle of the issue -- you mean to tell me that NO ONE at either Shopkick or at Best Buy can help to make this right in some way without me having to waste more of my time??? Horrible, horrible customer service.
    Please help!

    Hello JennyLynn,
    I’m sure all you want is your Shopkick points, so it’s truly regrettable to hear you’ve been led around on this wild goose chase when trying to resolve this on your own. I can imagine how confusing this would be, and I apologize for any frustration this may have caused.
    As you may be aware, in order to receive points, your Shopkick account must be attached to your purchase at the register. After reviewing the original purchase from 4/19 using the email address attached to your forum profile, it seems your account wasn’t attached. This could explain why Shopkick referred you back to us to return the purchase and re-ring it in order to receive the points. However, as we merely did an even exchange and not a return and repurchase, the total purchase price appears as $0.00. As such, Shopkick wouldn’t recognize the purchase, and this could explain why there weren’t any points awarded.
    As I realize this experience has been far from ideal, I’ve sent you a private message to discuss the options we may have available to us at this time. In order to read this message, please log into the forum and click on the envelope icon in the upper right-hand corner of the page.
    Thank you for posting,
    Alex|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Sharepoint 2013 (Danish): Deploying site from a custom template fails with error "Duplicate content type"

    I cannot create a site-template in my own language (danish) and deploy a site based on the template.
    I created a template from a "fresh" SharePoint project site with no tampering.
    When trying to deploy a new site based on the templat I get the following error:
    In Danish:
    Beklager, men noget gik galt
    Det blev fundet et navn på en dubletindholdstype "billede".
    Tekniske oplysninger
    Fejlfinding af problemer med Microsoft SharePoint Foundation.
    Korrelations-id: 96646c9c-3213-a088-c6c4-537b0815313c
    Dato og klokkeslæt: 21-06-2014 10:23:36
    In English:
    Sorry, something went wrong
    A duplicate content type name "billede" was found.
    Technical Details
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 0b656c9c-52ee-a088-c6c4-5132070e3c4e
    Date and Time: 21-06-2014 10:31:35

    Need details from ULS logs about Correlation ID: 0b656c9c-52ee-a088-c6c4-5132070e3c4e
    Check below:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/e955e737-e12e-4afa-b446-bb6e0f05e9b1/duplicated-content-type-error-creating-a-sharepoint-2010-site-from-a-custom-site-template?forum=sharepointgeneralprevious
    http://aramacciotti.wordpress.com/2012/04/04/the-case-of-the-duplicated-contenttype/
    http://community.office365.com/en-us/f/154/t/69416.aspx
    If this helped you resolve your issue, please mark it Answered

  • Custom classloader fails when using Java Web Start

    Hope you can help me with a problem that is driving me nuts. I have implemented my own classloader to support plugins. This classloader works as follows:
    1. The classloader is configured to access a plugin components jar file downloaded by jws.
    2. The plugin components jar file contains other jar files which contains the actual plugin code to be loaded using my own classloader.
    3. Upon initialization - my classloader extracts all jar files contained in the plugin components jar file into temporary files.
    4. These temporary files are used by my classloader when defining plugin classes.
    The classloader works fine when not using java web start. Then I launch the application using java web start with security policy in .jnlp file set to:
    <security>
    <all-permissions/>
    </security>
    After a while (it was able to load some of the classes) it fails with the following stack-trace:
    Regards,
    Terje
    java.security.AccessControlException: access denied (java.io.FilePermission C:\DOCUME~1\TEOES\LOCALS~1\Temp\activity61102.jar read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.util.zip.ZipFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at my.plugin.ActivityClassLoader.getJarFileEntry(ActivityClassLoader.java:258)
         at my.plugin.ActivityClassLoader.search(ActivityClassLoader.java:244)
         at my.plugin.ActivityClassLoader.loadClass(ActivityClassLoader.java:99)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Does anyone have source code for implementing a simple class loader that can be used with Java Web Start (preferrably with all jar files to be used by the classloader wrapped into a jar file)

    If you implement your own classloader, and then still run with a SecurityManager installed, then your ClossLoader is responsible for asigning the permissions to the code it loads.
    You need your ClassLoader to extend SecureClassLoader, and implement the method :
    SecureClassLoader.getPermissions(CodeSource cs) to return the PermissionCollection you want.
    /Andy

Maybe you are looking for