OID and binding java serialized object

Hi there,
How are you doing? I am trying to bind a serialized java object to a name in Oracle Internet Diectory (oid) using JNDI.
it gives me an errror.
"OperationNotSupported LDAPA error 53: Unwilling to perform:
I have directory manager 2.1.1 and JNDI 1.2.1
I arrpeciate any clue and/or help
Thanks
null

Hello:
Although OID supports calls from JNDI, the JNDI schema for storing JAVA serialized objects is not yet a standard part of the OID schema. This is easy to remedy. Go to javasoft.sun.com and download the JNDI schema for java serialized objects and load the attributes and objectclasses into OID from the ldif files provided at this web site. . Make sure the attributes are loaded before the objectclasses.
Once this schema is loaded this problem should go away
Use the ldapmodify command line tool to add the schema items from the ldif file.
Let me know if you need further assistance setting this up. A future version of OID will contain these schema items standard.
Thanks,
Jay
null

Similar Messages

  • Make java.sql.Blob object from java serialized object

    I have an ImageIcon which I get from an applet. It gets passed to a servlet. Now, I want to turn the ImageIcon into a blob object so that I can insert it into a database (as/400). How do I do that?

    Hi there,
    NORMALLY this is a 2-step process:
    1.) Convert the ImageIcon into a byte-array
    2.) Write the byte-array into the database/blob
    For step 1 (this code is 'freehand'):
    =====================================
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.write(myImageIcon);
    oos.close();
    byte[] data = bos.getBytes();
    For step 2:
    ============
    This is often database specific, but normally you select a column of a record for update, get the blob-object from the resultset and start writing bytes to it.
    BUTTTTTTTT Consider this alternate approach: Assuming the image that is being sent is always small in size, you may simply chose to base-64 encode it and store the resultant string in a varchar column. When you read it back, base-64 decode it. Although the encoding/decoding may appear to be an overhead, I'll bet you it's much faster than blob-level access, both for reads and writes. It's also portable (code-wise) and you can update images through a simple UPDATE statement. In fact, if your database supports it, you could even have a default value for the column (a default image)...

  • Encrytiong serialized object and seald object

    Hello,
    At the moment I'm writing some code using serialized object stream encrytion. But lately I dicovered sth like sealed objects. My question is what is the difference between creating a SealedObject and then writting it to a stream and encrypting the serialized object as a stream?
    1. What is the purpose for SealedObject regarding the possibility of encrypting serialized objects with streams?
    2. Are there any differences in use of those two ways of securing objects?*
    Thanks for Your replies in advance
    DT

    Read it but not shure wht exactly do U mean. It doesn't ansewer mys questions: of what is the reason for usinf sealedobject where we can encrypt the object with the CipherInputStream (which I have posted as question 1 in the 1st post) and what are the differences in idea of use meaning where should we use CipherInputStream and where Seald object?

  • Continuously send serialized objects from servlet

    Hi,
    I'm trying to write a servlet that, once activated, will continuously send objects back to a thread in the client. I'm hoping someone can point me in the right direction. This code works fine if you take out the while(true){...} loops.
    After doing a bit more research, I discovered the OutputObjectStream should be .reset() in order to reset the object map. I tried doing this before the .flush() with no success. The servlet continues to spew out objects, but the client side doesn't even see the first one, hanging on the in = DataInputStream(connection.getInputStream()) line.
    Servlet code:
    public class testStream extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    int[] somedata = new int [1];
    somedata [0] = 1000;
    String contentType =
    "application/x-java-serialized-object";
    response.setContentType(contentType);
    ObjectOutputStream out =
    new ObjectOutputStream(response.getOutputStream());
    while (true) {
    try {
    out.writeObject(somedata );
    System.out.println("Sent " + somedata [0]);
    somedata [0]++;
    } catch(Exception ie) {}
    out.flush();
    Thread.yield();
    out.close(); // unreachable if while loop in place
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    Applet side code:
    * <P>
    * Taken from Core Servlets and JavaServer Pages
    * from Prentice Hall and Sun Microsystems Press,
    * http://www.coreservlets.com/.
    * � 2000 Marty Hall; may be freely used or adapted.
    public class testStream implements Runnable {
    private boolean isDone = false;
    private URL dataURL;
    public testStream(String urlSuffix, URL currentPage) {
    try {
    // Only the URL suffix need be supplied, since
    // the rest of the URL is derived from the current page.
    String protocol = currentPage.getProtocol();
    String host = currentPage.getHost();
    int port = currentPage.getPort();
    dataURL = new URL(protocol, host, port, urlSuffix);
    Thread imageRetriever = new Thread(this);
    imageRetriever.start();
    } catch(MalformedURLException mfe) {
    System.err.println("Bad URL");
    isDone = true;
    public void run() {
    try {
    retrieveImage();
    } catch(IOException ioe) {
    isDone = true; // will never get hit
    public boolean isDone() { // meaningless now with infinite loop
    return(isDone);
    private void retrieveImage() throws IOException {
    URLConnection connection = dataURL.openConnection();
    connection.setUseCaches(false);
    connection.setDoInput(true);
    connection.setDefaultUseCaches (false);
    connection.setRequestProperty("Content-Type", "application/x-java-serialized-object");
    ObjectInputStream in = null;
    try {
    in = new ObjectInputStream(connection.getInputStream());
    } catch (Exception pe) { System.err.println(pe); }
    while (true) {
    // loop forever requesting data
    try {
    // The return type of readObject is Object, so
    // I need a typecast to the actual type.
    int[] someData = (int[]) in.readObject();
    System.err.println(someData[0]);
    } catch(ClassNotFoundException cnfe) {
    System.err.println("received NULL");
    Thread.yield();

    try this: move out.flush() upwards directly after the out.writeObject().
    robert

  • Creating a converter for old serialized objects

    Hi,
    I have an application, which writes class objects to file, and then reads the class objects from file when the application is started up.
    Now the problem is, that if i create/modify/etc fields in the class, then all my data is lost (i.e., i cant read the data in when the application starts)....
    Now the docs state that a field can be added, and an old serialized object will still be recoverable...well for some reason this only works when it wants....i have tried several times, and its not a guarenteed thing....
    So i was wondering, is there any way to create an application, which can grab an old serialized version of an object (i.e. class), have a copy of the old class, and the new class, and somehow cast the old to the new...or something of that sort?
    thanks a lot!

    This might be of some help:
    http://www.onjava.com/pub/a/onjava/excerpt/JavaRMI_10/?page=5

  • Mapping xsd:anyType element to Java.lang.Object

    Hi,
    I am using JAXB to parse a xml and in the XSD we have one element which is of the anyType and returns java.lang.object from JAXB generated classes. The issue is that when the node contains string and we type cast the returned object to string every thing runs fine but when the element contains embeded xml then the object returned can not be type cast to string.
    code snippet:
    *<xsd:element name="SignatureDefinition" type="xsd:anyType" />*
    and the xml I am parsing contains:
    *<SignatureDefinition>
    <a>name</a>
    <b> job</b>
    </SignatureDefinition>*
    That is the element contains a object which is a well formed xml.
    Can any one guide or provide me the pointers.
    Thanks
    Regards,
    Devesh

    Hello Devesh,
    The "SignatureDefinition" portion of the XML document should be unmarshalled as a DOM Element.
    File file = new File("any.xml");
    Root root = (Root) jaxbContext.createUnmarshaller().unmarshal(file);
    Element element = (Element) root.getSignatureDefinition();
    System.out.println(element.getTextContent());
    If "SignatureDefintion" is the root of the XML document, you should get a JAXBElement wrapping a DOM Element.
    File file = new File("any.xml");
    JAXBElement<Element> root = (JAXBElement<Element>) jaxbContext.createUnmarshaller().unmarshal(file);
    System.out.println(root.getValue().getTextContent());
    -Blaise

  • MXML binding creating activation-object which seems to be memory leak

    We are profiling our application trying to cut down some memory leaks and I have some loitering objects that are puzzling me.  I have searched on the internet and have seen others with similar issues, but thought I'd post here to see if I am on the right track and if anything can be done about it.  In our _bindingsSetup method that is generated from the MXML:
        private function _ManageFavoritesDialogBulb_bindingsSetup():Array
            var result:Array = [];
            var binding:Binding;
            binding = new mx.binding.Binding(this,
                function():Class
                    return (ManageFavoritesDialogView);
                function(_sourceFunctionReturnValue:Class):void
                    _ManageFavoritesDialogBulb_View1.className = _sourceFunctionReturnValue;
                "_ManageFavoritesDialogBulb_View1.className");
            result[0] = binding;
            // ... more bindings
    While profiling the app, we have a more than a handful of GC roots that say result and binding are activation objects that are causing a whole bunch of stuff to be held onto.  Is this accurate?  If so, is there anything we can do about it other than not using MXML?
    Irv

    Thanks for the quick replies.  I went to your blog and watched the presentation you had on profiling (very nice), but my application is still having a memory leak I am having trouble locating.  We have found many and have cleaned them up, but this scenario is proving pesky.  I have a very simple scenario I am working with now.  I use a PopupManager and put a component in it.  I then tell the popupManager to removePopup.  For some reason, my component is being held onto (and all the references it is holding onto).  I am using Flex 3.5 but using FlashBuilder to profile.  It tells me on my component there are 0 paths to the GC root, and I have clicked on most of the items found in loitering (this is a create and destroy scenario) and they all say 0 paths.  Do you know of any known issues with PopupManager that I should be looking for?  The only thing showing a path to GC root are some of the bindings and activation objects.  (I am hoping it is not them as you pointed out)  I assume when it says 0 paths to GC root it means there are only circular references keeping it around correct?
    Thanks for any advice.
    Irv

  • Creating and Binding View Objects dynamically : Oracle Jdeveloper 11g

    Hello,
    We are trying to create and bind view objects dynamically to adf data visualization components.
    The view object is a result of multiple tables.
    We are using Oracle JDeveloper 11g Technical Preview. ( can't upgrade to TP2 or TP3 now).
    We have found this : http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html on our search for the same.
    The sample application however, is in 10g , hence required migration.
    Also, it was a standalone application with the TestClient.java having a main() method.
    Our requirement is for Web Application; we use Adf+jsf .
    Guidance of any sort is very much appreciated.
    Thanks in advance.
    -Anil Golla

    Hi,
    there also exist a forum for JDeveloper 11: JDeveloper and OC4J 11g Technology Preview
    What you are trying todo is not trivial because you need to not only dynamically create the VO, you would also dynamically need to create the binding meta data for it (assuming you use ADF). Not sure if the API to modify the binding is public, so posting it on the JDeveloper 11 forum bears a glimpse of hope for an answer
    In JDeveloper 10.1.3 you can't do this
    Frank

  • Java.io.StreamCorruptedException: InputStream does not contain a serialized object

              I have an applet which calls a JSP to write data object to the db and then the
              JSP sends back the updated data object. The writing part is ok but the response
              is giving the following error. The data object is in a separate class which implements
              Serialized.
              Here's the code in the applet calling the JSP and the response from the JSP
              URL server = null;
              String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
              try
              server = new URL(urlConnectionString);
              catch(MalformedURLException e)
              System.out.println("URL exception: " + e );
              // send request
              ObjectInputStream response = null;
              Object result = null;
              try
              URLConnection conn = server.openConnection();
              conn.setDoOutput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "application/octet-stream");
              ObjectOutputStream request = new ObjectOutputStream(new
              BufferedOutputStream(conn.getOutputStream()));
              request.writeObject((Object)dvo);
              request.flush();
              request.close();
              // get the result input stream
              response = new ObjectInputStream(new BufferedInputStream
              (conn.getInputStream()));
              // read response back from the server
              result = response.readObject();
              if( result!=null && (result instanceof DataVO))
              dvo = (DataVO)result;
              String vo = dvo.printDataVO();
              System.out.println("*DataVO*\n"+vo);
              else
              System.out.println("not an instanceof DataVO");
              catch(IOException ignored)
              System.out.println("Error in DataVO response");
              ignored.printStackTrace();
              Here's the code in the JSP sending the response back to the applet. The 'dvo'
              object is the object which is serialized and has gets and sets for the diff. data
              elements. When I print the 'dvo' before writing the object to outputStream it
              prints the correct values for the data element.
              // send response
              response.setStatus(HttpServletResponse.SC_OK);
              ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
              (response.getOutputStream()));
              outputStream.writeObject(dvo);
              outputStream.flush();
              ERROR is as follows:
              Error in DataVO response
              java.io.StreamCorruptedException: InputStream does not contain a serialized object
              at java/io/ObjectInputStream.readStreamHeader
              at java/io/ObjectInputStream.<init>
              What am I doing wrong?. Please respond soon. The applet is run on IIS and the
              JSP in on weblogic 6.1. I'm not sure if that makes any difference.
              

              I have an applet which calls a JSP to write data object to the db and then the
              JSP sends back the updated data object. The writing part is ok but the response
              is giving the following error. The data object is in a separate class which implements
              Serialized.
              Here's the code in the applet calling the JSP and the response from the JSP
              URL server = null;
              String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
              try
              server = new URL(urlConnectionString);
              catch(MalformedURLException e)
              System.out.println("URL exception: " + e );
              // send request
              ObjectInputStream response = null;
              Object result = null;
              try
              URLConnection conn = server.openConnection();
              conn.setDoOutput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "application/octet-stream");
              ObjectOutputStream request = new ObjectOutputStream(new
              BufferedOutputStream(conn.getOutputStream()));
              request.writeObject((Object)dvo);
              request.flush();
              request.close();
              // get the result input stream
              response = new ObjectInputStream(new BufferedInputStream
              (conn.getInputStream()));
              // read response back from the server
              result = response.readObject();
              if( result!=null && (result instanceof DataVO))
              dvo = (DataVO)result;
              String vo = dvo.printDataVO();
              System.out.println("*DataVO*\n"+vo);
              else
              System.out.println("not an instanceof DataVO");
              catch(IOException ignored)
              System.out.println("Error in DataVO response");
              ignored.printStackTrace();
              Here's the code in the JSP sending the response back to the applet. The 'dvo'
              object is the object which is serialized and has gets and sets for the diff. data
              elements. When I print the 'dvo' before writing the object to outputStream it
              prints the correct values for the data element.
              // send response
              response.setStatus(HttpServletResponse.SC_OK);
              ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
              (response.getOutputStream()));
              outputStream.writeObject(dvo);
              outputStream.flush();
              ERROR is as follows:
              Error in DataVO response
              java.io.StreamCorruptedException: InputStream does not contain a serialized object
              at java/io/ObjectInputStream.readStreamHeader
              at java/io/ObjectInputStream.<init>
              What am I doing wrong?. Please respond soon. The applet is run on IIS and the
              JSP in on weblogic 6.1. I'm not sure if that makes any difference.
              

  • Saving and loading serialized objects (StreamCorruptedException)

    Hello,
    I am relatively new to Serialization (coming to that, a bit new to Java too) and I am having a problem with the following:
    I am saving a number of serialized objects (all of the same class) in a file using the following way (the method is called multiple times to save a list of TeamMember objects):
    Note: TeamMember is a custom class.
    public void addTeamMember(TeamMember p) {
                outputStream = new ObjectOutputStream( new FileOutputStream( "team.dat", true ) );
                outputStream.writeObject( p );
                outputStream.flush();
                outputStream.close();
                outputStream = null;
    }Then I'm trying to retrieve the objects from the file and display them. The method used is the following (it will loop through the file until found or it throws an EOFException. Is using the EOFException good practice to search through the entire file?):
    public TeamMember getTeamMember(String id) {
            TeamMember currentMember = null;
            try {
                boolean found = false;           
                inputStream = new ObjectInputStream( new FileInputStream( "team.dat" ) );
                while ( !found ) {
                    currentMember = (TeamMember)inputStream.readObject();
                    if ( currentMember.getId().equals( id ) )
                        found = true;
                } // end while
                closeInputFile();
                return currentMember;
            } // end try
            catch ( EOFException e ) { // end of file reached
                closeInputFile();           
                return null;
            } // end catch
            catch ( IOException e ) {
                closeInputFile();
                System.err.println( e.getMessage() );
                return null;
            } // end catch
        }Now as a test, I am adding 3 members with IDs 1, 2 and 3 respectively. Then I am calling getTeamMember three times with the different IDs. With ID "1", it works fine. When I give it ID 2, it gives an IOException with message "StreamCorruptedException: invalid type code: AC".
    While tracing the program, I've seen that it always gives me that error when reading past the first object saved in the file.
    Am I saving the objects in a wrong way, or reading them is done incorrectly?
    Any help is much appreciated.
    I hope I was clear enough, and that I posted in the correct forum.
    Thanks in advance.
    Andrew.

    If that is so, might you hint me for a work around?
    I want to append objects in a single file, then be able to find and read an object from the file.
    Thanks again.
    Andrew

  • Serialized Objects and Servlets

    I'm having a lot of trouble accessing a serialized object and displaying it in a servlet. I get the following exception:
    java.io.StreamCorruptedException: Type code out of range, is -84
    Can anyone help me out here?

    OK... here's some of the code I'm using...
    public Object readObject()
    throws IOException, ClassNotFoundException
              oin = new ObjectInputStream(fin);
              Object obj = oin.readObject();
              oin.close();
              return obj;
    public void writeObject(Object data)
    throws IOException
              oout = new ObjectOutputStream(fout);
              oout.writeObject(data);
              oout.close();
    Essentially, my servlet creates and instance of an ObjectManager class. This ObjectManager then tries to execute the readObject method above.
    The whole process comes to a grinding halt at this point:
    Object obj = oin.readObject();
    I think this problem has to do with the way that I'm trying to access the file to which I have serialized my object. The problem is that I can't think of any other way to do it. Here's how I am currently referencing the file that holds my serialized object:
    File theFile = new File("Serialized.dat");
    FileInputStream fin = new FileInputStream(theFile);
    I've never attempted anything like this before and I suspect I'm way off in my approach. I really appreciate your willingness to help me out.

  • OID/Linux and Netsacpe Java SDK don't play nice

    Here's a brief description of the problem. We are developing with the Netscape LDAP SDK for Java connecting to OID on Linux and deploying on Solaris. The problem I'm discussing here doesn't happen on Solaris. All access to the LDAP server is being funelled through one connection (please don't ask, I didn't design it).
    Lets call an add, modify, delete or read an "action," for the sake of convenience. When an ldapjdk.jar client connects to an OID server, it can perform 32764 "actions." On the 32765th, it blocks forever waiting for OID server to return. Ok, the obvious solution is to implement a timeout and try again. Did that and it doesn't work. Ok, lets try dropping the connection at a watermark (say 30000 actions) and establishing a new one. Nope, still doesn't work. At the 32765 actions per client machine mark, it blocks forever.
    Dumping the threads on the client side gives us something like the following:
    main:
    [1] java.lang.Object.wait (native method)
    [2] java.lang.Object.wait (Object.java:424)
    [3] netscape.ldap.LDAPMessageQueue.waitForMessage (LDAPMessageQueue.java:179)
    [4] netscape.ldap.LDAPMessageQueue.nextMessage (LDAPMessageQueue.java:101)
    [5] netscape.ldap.LDAPSearchListener.nextMessage (LDAPSearchListener.java:86)
    [6] netscape.ldap.LDAPConnection.search (LDAPConnection.java:2584)
    [7] netscape.ldap.LDAPConnection.read (LDAPConnection.java:2104)
    [8] netscape.ldap.LDAPConnection.read (LDAPConnection.java:2098)
    [9] ReadLockTest.run_test (ReadLockTest.java:96)
    [10] ReadLockTest.run (ReadLockTest.java:49)
    [11] ReadLockTest.main (ReadLockTest.java:25)
    LDAPConnThread chakotay:389:
    [1] java.net.SocketInputStream.socketRead (native method)
    [2] java.net.SocketInputStream.read (SocketInputStream.java:90)
    [3] java.io.BufferedInputStream.fill (BufferedInputStream.java:190)
    [4] java.io.BufferedInputStream.read (BufferedInputStream.java:208)
    [5] netscape.ldap.ber.stream.BERElement.getElement (BERElement.java:101)
    [6] netscape.ldap.LDAPConnThread.run (LDAPConnThread.java:420)
    Not much help there. I turned on all debugging on the OID server and got massive amounts of data back (and the server slowed to a crawl. :-] ). They all show the choke happening after gsldfb_FetchBaseObjs, and before leaving gslfcfdRefreshRootDSE. The last request (the 32765th) has started, but
    never completes. I can provide parts of the logs on request.
    Has anyone else encountered this problem?
    Thanks.
    Glenn McAllister
    SOMA Networks, Inc.

    Hello Glen:
    I have not seen this before. Sounds like you have done a thorough job troubleshooting this and this may be a bug. If you are able, I would like you to file a trouble report at our Oracle Support web site:
    http://www.oracle.com/support/metalink/index.html
    Thanks,
    Jay
    null

  • Example of Serialized objects and non-Serialized objects

    Hi,
    Can you please tell me some of eample of Serialized objects and nonserialized objects in java and j2ee.
    Thanks
    alex.

    sravan123 wrote:
    Serialised objects are File ,all Collection classes , subclasses of Throwable and subclasses of Number.
    Non-Serialised objects are Connection,DataSourrce,Resultset , Thread and MathYou forgot to log in as another user before answering your own question incorrectly for reasons I'm currently unable to fathom

  • ABAP proxy object and JAVA proxy objects

    can anyone explain whether ABAP proxy object and JAVA proxy objects can communicate with each others?
    if yes then how???

    JCO connectors would be able to do the trick here i guess
    regards
    krishna

  • Problem with serialized objects and JWS

    My JWS launched application fails when loading a serialized object that has been instatiated from a class not contained in the signed jar-file. Does anyone know why this happens and if there is some workaround for the problem?

    Where is the class contained then?

Maybe you are looking for

  • Installation problem on windows 2000

    Hi, Please help! I've been tring to install oracle on windows 2000 machine unsuccessfully. the setup program aborted without error message. I've tried many versions of oracle database, 8.1.7 all editions, 8.1.6ee, 9iAS. the only message error I got w

  • SSL CertGen & Private key import errors - 7.0

    I am trying to install weblogic generated ssl certificate and because the private key needs to be encrypted with a password, i am loading this in a new JDK keystore and trying to configure WL. I am running utils.CertGen from weblogic 7.0 sp3 on XP. X

  • Yahoo! Mail no longer loads emails and the ads are missing after having cleared Firefox's cookies, history, and cache.

    Ironically, I made this support account just to ask this question and had to go to IE to verify. Anyway, Yahoo! Mail use to work almost flawlessly before a couple days ago. Basically, the page loads like normal when I have a good connection except th

  • Multiple MIDI tracks to one instrument?

    The plugin is Ultrabeat. I like putting the kick onto one MIDI track the snare into another MIDI track, hats on another, etc.... Problem is, all of the MIDI tracks that route to the Ultrabeat are the actual instrument track that has the plugin insert

  • Guest Wireless Tunnelling - DHCP Issue

    Hi, I'm attempting to implement Guest Anchor tunnelling between two WLC's but I've run into an odd issue I cannot find a clear answer to. We have two 5508 WLC's, both Running 7.4.100.0. The Guest Anchor Controller obviously resides in a DMZ, it's fun