Question concerning java Serialization of a complex internal field variable.

Not everything in the J2SE implements serializable by default.  Say BufferedImage.
I have learned from an online artical that absolutely all fields to be serialized must
implement Serializable, including internal ("global") class fields,
a la
http://javarevisited.blogspot.com.au/2011/04/top-10-java-serialization-interview.html
(point 5).
However, for my purposes, I cannot re-implement (extend) and recompile every and any
java class I would want to serialize, eg. anything which is a "complex" sub field of
a conceptual class I do want to serialize, which doesn't occur on the java 1.6 list
of default serializable classes:
a la
http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html
and
"If member variables of a serializable object reference to a non-serializable object, the code will compile but a RumtimeException will be thrown."
Understanding there are implications for the java security model, is there anything to be done for these non-serializable-implementing class fields?
Is there a Serialization add on kit for Java or something?

Indeed, however, with a distinct lack of success with the instrumentation api, my request is dualfold now.
I do understand the restrictions explained here concerning more complex classes and the Serializable API.
I have found that there is an input line that needs to be submitted when running an Inustrumentation, premain Agent class.
However, I would have to avoid that by doing System.setProperty(a,b); appropriately.
Why won't the following just work, without any further supplied input parameters?
   import static java.lang.System.out;
   import java.io.PrintStream;
   import java.lang.instrument.Instrumentation;
   public class InstrumentationAgent
      private static volatile Instrumentation globalInstrumentation;
      public static void premain(String paramString, Instrumentation paramInstrumentation)
         System.out.println("premain...");
         globalInstrumentation = paramInstrumentation;
      public static void agentmain(String paramString, Instrumentation paramInstrumentation)
         System.out.println("agentmain...");
         globalInstrumentation = paramInstrumentation;
      public static void main(String ... args)
         out.println("!");
         String data = new String("data");
         long size = getObjectSize(data);
         out.println(size);
      public static long getObjectSize(Object paramObject)
         if (globalInstrumentation == null)
            throw new IllegalStateException("Agent not initialized.");
         return globalInstrumentation.getObjectSize(paramObject);
I am still curious as to how the DataFlavor approach I have outlined above.  Does it accomplish a shallow or deep conversion?  Are
there other limitations which restrict what's put to the underlying ByteOutputStream?
Why won't my agent class execute though, regardless?

Similar Messages

  • Newbie question concerning java chat

    Hi everyone,
    I'm going to program at chat-service in java at school. Since I'm still rather new at this game, I was wondering if anyone knew any good tutorials to start with. I'm also very interested in recommendations as to which java techniques would be best.
    My initial thoughts on the project are:
    1) it's going to be controlled by a central server (using servlets and JSP).
    2) I wish to overcome problems concerning firewalls etc.
    3) I took a peek in the book "Java Servlet Programming". It said that there were 3 possible implementations: HTTP, Sockets and RMI. I wonder if there are any other possibilities? JMS for instance?
    4) I wish to implement the service in such a way, that different users can approach the service differently (eg. user A with HTTP, and user B with RMI). this should be completely transparent. But is that possible?
    Well, thats basically all. I hope someone have some tips or experiences to share. I doubt that I'm the first (or the last) one embarking on a project like this.

    I've found some links in previous posts.
    http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat_p.html
    And the section on "Java Shared Data Toolkit"

  • Essential question concerning java.policy file

    I have been searching this forum for an answer to this question:
    Is there a way to run a signed applet on an intranet (via the Plugin) with out having to go around to each user's workstation and change their java.policy file?
    So far, I have seen this question asked several times but with no concrete answer.
    Thanks for any help!

    You can create your own Policy implementation as shown in the following link :
    http://www.javageeks.com/Papers/JavaPolicy/index.html
    This has some drawbacks.
    I overcame your problem by writing my own Security Manager.

  • Question concerning java...

    Java applets will not work on my adminstrator account. I read on another post to try and see if java works when I create another account - it does. My question is how do I get java to work on my original account? Any help would be greatly appreciated.

    Welcome to Apple Discussions
    Make sure the 4 web content boxes are checked in your Safari Preferences>Security panel.
    If they are checked, then reapply the 10.4.8 combo update. "Repair permissions" via Disk Utility in your Utilities folder. Sometimes, reapplying the combo update rectifies problem files affecting the OS performance.
    Post back

  • Customizing ActionScript - Java serialization?

    Hi,
    I wonder how to customize what ActionScript class is serialized to what Java object, overriding BlazeDS's defaults.
    I have a Java class where I would like an ActionScript ArrayCollection to serialize to a custom class.
    To illustrate, normally I might have a class on the server like this:
    public MyClass {
    public void updateRecords(java.util.List[Widget]) {...}
    When this is invoked from a remote Flex client, passing an ArrayCollection as the method parameter, BlazeDS serializes that ArrayCollection into a Java List, and everything works fine.
    Suppose, however, that I have the above method signature defined in the following way:
    public MyClass {
    public void updateRecords(MyCustomCollection[Widget]) {... }
    In that situation, I'd like to be able to specify a custom serializer that takes an ActionScript ArrayCollection and serializes it into MyCustomCollection. In fact, what I'd really like to do is to use this serializer every time a Java class' interface contains MyCustomCollection.
    I looked into flex.messaging.io.TypeMarshaller, but couldn't quite figure out how to use it for that purpose. 
    Thanks,
    -- Frank

    >
    How Java Serialization works internally which algorithm it uses to serialize/deserailaize the objects?
    >
    See the Java Object Serialization Specification
    http://docs.oracle.com/javase/6/docs/platform/serialization/spec/protocol.html
    And are you aware that you have never marked a single one of your 119 previous questions as answered?
    Total Questions: 119 (119 unresolved)
    Are all of those questions really unanswered? Or have you just forgotten to mark them ANSWERED.
    Please begin revisiting your large number of previous posts and marking them ANSWERED as appropriate. This is important for several reasons. First because forum volunteers need to focus on unanswered questions - it wastes their time to read thru threads and respond to posts that have actually already been answered since the original poster isn't even going to pay attention to any new replies. That time could have been better spent helping users that have REAL unanswered questions on the forum.
    Second, when someone like yourself has large numbers of unanswered questions it basically sends a signal to the volunteers that the person posting the question may not even be reading or responding to the replies the volunteers may make. This leads some volunteers to decide to not even bother responding - why should they spend their time trying to help someone who won't even acknowledge the help that they get?
    Third, other people that have the same problem you had find your posts but never see them answered. So they never know if the information provided by the volunteers solved your problem or not. When you mark your questions answered it helps others with the same problem.
    Thanks.

  • Dreamweaver cs6 suite development questions/concerns

    Hello,
    I am new a new creative cloud subscriber. I have past experience with programming a java environments and SQL. I am new to HTML5/CSS3 and have read a book on the subject to understand the design concepts in effort to find a good environment to develop mobile applications. I like what I see using fireworks to create HTML5/CSS3 to create code for more complex objects/elements.
    Additionally, watched all the videos and am ready to roll up my sleeves and get started. As I have watched the videos and goggled allot of forums regarding DM CS6 and web applications I have a few questions and concerns. I will preface this with the understanding that this involves new features/ technologies and will suffer some growing pains.
    Questions/ Concerns:
    1) Fluid Grid Layout tool:
    Can I create a mobile application with this tool that will work on both tablets and smart phones (not desktops) compiling  a single optimized site using the phone gap tool; or do I have to create 2 separate site and compile?
    2) Phone Gap
    I have read that there are allot of issues with compiling applications. Even watching the adobe road show video, they could not get it to work (yikes).I have also read that I phone product code need to be compiled using xcode(tools); needed to have an apple subscription (which I have access to) What are the known issues compiling mobile applications for the different device platforms?
    3) Sever-Side Mobile Applications
    a) As I understand it, this cannot be accomplished with this environment without a web service that     communicates to the server-side scripting/ Database server.
    b) Reading about local storage, what are the limitations and how do they effect mobile applications if there is more complex scripting and large record sets?
    C) Are there ways to create user/ security roles (I would imagine the integrity issues with security would be staggering)?
    4) Responsiveness
    I have played around DM, I have noticed it crashing and being very sluggish. I know its not memory or processing issues as I have read several posts on the topic.
    It seems that adobe is making it easier to design and develop within one product/suite. These tools seem very powerful. The direction makes sense as I like elements of both development and design. I am concerned that I will hit walls and want to avoid banging my head. I am still new to this environment and the mistakes may be mine. With that being said, do you think Adobe will get these issues resolved out and have a great environment and development model.
    Thanks in advance for the light anyone can shed on these subjects as I am eager to get started (but a bit worried).
    Erich

    Hi
    To add to Davids reply -
    Item 3:
    Are you talking about apps. or web pages on mobile devices, (they are not the same thing)?
    If web pages then the server/database side is no different to a normal web page which does require a server supporting these. As for local storage, (works whilst off-line) this is normally done via javascript and a local database, but I would not use this feature for anything too complicated as the database is stored on the users computer/device, and only 'communicates' with your server/database when the user is once again on-line and connected to your web page.
    As for item 3.c. - Doing this for off-line use is a complete waste of time, as the user has access to any encryption code and the database entry's, which they can then use when on-line again. A simpler solution would be to require just the users credentials and store this locally, (still not ideal, but at least all the users DB is not downloaded).
    Regarding item 4. Some users have reported problems, but for me personally 99.9% of them I have not experienced with the release version of CS6, and performance issues for me all vanished when I upgraded my PC to an i7 processor with 16Gb memory, an extreme solution for many I admit, but your computers speed and memory will have a dramatic effect on the user experience.
    PZ

  • Java.lang.NoSuchMethodError: weblogic.ejb20.internal.EntityEJBObject_Activa

    We have Weblogic 8.1 SP2. The application has several entity beans. I just upgraded it from SP2 to SP3 and when I try to use these ejb's I am getting the following exception:
    Root cause of ServletException.
    java.lang.NoSuchMethodError: weblogic.ejb20.internal.EntityEJBObject_Activatable.preInvoke(Lweblogic/ejb20/
    internal/MethodDescriptor;Lweblogic/security/service/ContextHandler;)Lweblogic/ejb20/interfaces/InvocationWrapper;
    Note that these ejb's worked fine in SP2.
    Now, just to test, I redeployed some of these ejb's and then these redeployed ejb's worked fine.
    My question is, is it required to redeploy all ejb's to upgrade from SP2 to SP3?
    Thanks.

    redeploying the beans had the upgraded server recompile them which (probably), updated any internal references to methods. I don't quite understand one can run the beans that were compiled on SP2, on an upgraded SP3 server without having deployed (and therefore recompiled) them on the upgraded SP3 server.

  • Might go for T400/500- Many questions concerning Think Vantage

    Hi,
    I am deciding on my first IBM, a T400 or T500
    I have a few questions concerning the Think Vantage Function:
    a) Does the recovery DVD set back the hard drive partitions to factory settings?
    b) Does the Think Vantage function set back the hard drive partitions to factory settings?
    This means the original size of the partitions, when they have been changed manually.
    c) Does Think Vantage work with a self buyed Windows Vista?
    d) Does Think Vantage work unter Windows XP
    e) Does Think Vantage need drivers/ anything else to work or is it entirly working on the hardware side, so no software/ windows is needed
    f)Will Think Vantage work under Windows 7 in a T400/500
    g) How was the past situation? Did a under Windows XP working Think Vantage also work on Vista / have there been drivers delivered, when needed, for the new OS
    h) Is it possible to set up a new OS (like Vista Ultimate) and then backup it up on a external hard drive and later recover from this?
    What do I want to achieve?
    I want to recover the factory settings at all times, this means partition size, number of partitions etc. and Windows Vista Business. Then I want to install Vista Ultimate do my settings and backing it up to an external drive or whatever and then recover from that all 3 Months. In the end I should be able to set back factory settings with the earliest/ first backup from Windows Business; Furthermore I might want to install Windows 7 sometimes.
    Thank you for your help! Kind regards
    Message Edited by Schwenker on 11-23-2008 08:23 AM

    Hello,
    I would recommend Acronis to do this job. Here is a link at thinkpad-forum.de.
    You´ll  get Acronis for free if you buy a PCWelt.
    Your answers:
    A. yes
    B: yes
    C: yes
    D: yes
    E: No, windows is needed and if it´s XP than MS NET 2.0 also.
    F: yes, when windows 7 is out, than Thinkvantage will work then, on Server 2008 it seems to work.
    G:Thinkvantage work in Vista and XP environment.
    H: yes, you can backup it on a extern hdd and later recover the R&R Image to the internal disc.
    What do I want to achieve?
    I would recommend Acronis to do this job. Here is a link at thinkpad-forum.de.
    You´ll  get Acronis for free, if you buy a PCWelt.
    here are some interesting benchmark with first versions of Windows 7 and XP.
    Windows 7 unmasked
    Perceptions becomes reality
    Message Edited by Agotthelf on 23-11-2008 10:23 PM
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Question about Java's HttpServer: Threading? Backlog?

    Hello,
    I have two questions about Java's HttpServer (com.sun.net.httpserver). From the JavaDoc:
    >
    Management of threads can be done external to this object by providing a Executor object. If none is provided a default implementation is used.
    >
    How can I get information about the default implementation in 1.6.0_13? Do you know the behavior? From my observations, the default implementation uses no Threads, meaning every request is handled in the same Thread, this results in handling the requests to the HttpServer one after another.
    Is this right?
    The second question is about this, also from the JavaDoc:
    >
    When binding to an address and port number, the application can also specify an integer backlog parameter. This represents the maximum number of incoming TCP connections which the system will queue internally. [...]
    >
    When setting the backlog to -1, it uses the systems default backlog. How can I determine the systems default backlog? Can some lines of Java code reveal it (there is no getBeacklog() method)? Or is it up to the Operating System (we use Redhat Linux)?
    Thanks a lot for your help!
    Regards,
    Timo

    How can I determine the systems default backlog?You can't. There is no API for that even at the C level.
    Can some lines of Java code reveal itNo.
    Or is it up to the Operating System (we use Redhat Linux)?Yes. Linux provides a large default. It seems to be at least 50 on most platforms. This is not something you should be worrying about.

  • Java.io.NotSerializableException: weblogic.ejb20.internal.EntityEJBContextImpl

    Hi,
    We are currently in the process of moving from Weblogic 6.1 SP5 and
    Toplink 3.6.3 to Weblogic 8.1 SP2 and Toplink 9.0.4 and during some test
    I have seen a "scaring" stack trace. It seems that, for some reason, a
    thing that "uses to work" failed with a very strange error. I tried to
    reproduce it but without any success. Besides asking if anybody knows
    what could have caused this error I would like to know what the "not
    serializable" object is. Is it the EntityEJBContext?
    <12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
    weblogic.kernel.Default]:Exception:
    javax.transaction.TransactionRolledbackException at getXML
    javax.transaction.TransactionRolledbackException: EJB Exception: :
    java.io.NotSerializableException:
    weblogic.ejb20.internal.EntityEJBContextImpl
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at
    weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
    at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
    at
    weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
    at
    app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
    Source)
    In case it could share some light in the case I will explain a bit what
    does the process intended to do:
    The general idea is that, given some data (managed with Toplink's 9.0.4
    CMP) we take a XML "snapshot" of them (via a custom OBJ2XML class that
    has been working for ages without any problem) and "publish" it via JMS
    in order to perform asyncronous actions with it. I'm sure this is a,
    more than usual, scenario for a lot of folks.
    As it seems looking at the stack at some point during some internal
    object serialization it fails and rollbacks all the process. The object
    being serialized by our side only contains four attributes: a
    java.math.BigDecimal for it's primary key, a java.util.Date for
    timestamp locking and two simple java.lang.String's
    Although I'm pretty sure the problem should not be with the entity bean
    itself but with an internal Weblogic op (is it trying to serialize the
    EntityBeanContext as stated after the java.io.NotSerializableException
    message?
    Any help with this would be greatly appreciated as I have no clue how
    this happened and I'm also unable to reproduce it (I'm also sure if I
    managed to trigger it testing the application alone it will rise many
    more times that could be admited if we move to production).
    I would like to point also that currently until we have some more time
    to fix it we are using "remote" entity bean, I mean even if we are alway
    s calling them within the container they are not deployed with "local"
    interfaces yet (although AFAIK Weblogic should avoid RMI calls on them
    being co-located with the session beans).
    Regards.
    Ignacio.
    P.S. here is the full stack dump
    <12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
    weblogic.kernel.Default]:Exception:
    javax.transaction.TransactionRolledbackException at getXML
    javax.transaction.TransactionRolledbackException: EJB Exception: :
    java.io.NotSerializableException:
    weblogic.ejb20.internal.EntityEJBContextImpl
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at
    weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
    at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
    at
    weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
    at
    app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
    Source)
    at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
    at
    app.data.module.ModuleBean_1v2h9c_EOImpl.EJB2DOM(ModuleBean_1v2h9c_EOImpl.java:3954)
    at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
    at app.data.general.GeneralBean.getXML(GeneralBean.java:1024)
    at app.data.general.GeneralBean.getXML(GeneralBean.java:1002)
    at
    app.data.module.ModuleBean_nw294k_EOImpl.getXML(ModuleBean_nw294k_EOImpl.java:3138)
    at app.biz.common.Publisher.performPublication(Publisher.java:1644)
    at app.biz.common.Publisher.launchPublisher(Publisher.java:1580)
    at app.biz.module.ModuleDAO.update(ModuleDAO.java)
    at
    app.biz.module.ModuleDAO_jcgreo_EOImpl.update(ModuleDAO_jcgreo_EOImpl.java:100)
    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:324)
    at app.core.util.Proxy.execute(Proxy.java:583)
    at app.core.servlet.BaseServlet.execute(BaseServlet.java:440)
    at
    app.user.servlet.common.BaseServlet.accessSessionBean(BaseServlet.java:279)
    at
    app.user.servlet.common.BaseServlet.buildResponse(BaseServlet.java:132)
    at app.core.servlet.BaseServlet.doGet(BaseServlet.java:116)
    at app.core.servlet.BaseServlet.doPost(BaseServlet.java:154)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >

    Ignacio,
    6.1 used pass-by-reference by default, so parameters to beans were
    passed by reference.
    It's very likely that you are getting this error because in 8.1 this default
    was turned off. This causes serialization of parameters by default and
    that's why your code that worked started failing - you just did not know
    that you were passing non-serializable objects around.
    To fix this you could either turn on the pass-by-reference explicitly and/or
    find out where your code is passing non-serializable objects. This is a useful
    exercise anyways.
    Hope this helps.
    Regards,
    Slava Imeshev
    "Ignacio G. Dupont" <[email protected]> wrote in message news:41b8c93f@mail...
    Hi,
    We are currently in the process of moving from Weblogic 6.1 SP5 and
    Toplink 3.6.3 to Weblogic 8.1 SP2 and Toplink 9.0.4 and during some test
    I have seen a "scaring" stack trace. It seems that, for some reason, a
    thing that "uses to work" failed with a very strange error. I tried to
    reproduce it but without any success. Besides asking if anybody knows
    what could have caused this error I would like to know what the "not
    serializable" object is. Is it the EntityEJBContext?
    <12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
    weblogic.kernel.Default]:Exception:
    javax.transaction.TransactionRolledbackException at getXML
    javax.transaction.TransactionRolledbackException: EJB Exception: :
    java.io.NotSerializableException:
    weblogic.ejb20.internal.EntityEJBContextImpl
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at
    weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
    at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
    at
    weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
    at
    app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
    Source)
    In case it could share some light in the case I will explain a bit what
    does the process intended to do:
    The general idea is that, given some data (managed with Toplink's 9.0.4
    CMP) we take a XML "snapshot" of them (via a custom OBJ2XML class that
    has been working for ages without any problem) and "publish" it via JMS
    in order to perform asyncronous actions with it. I'm sure this is a,
    more than usual, scenario for a lot of folks.
    As it seems looking at the stack at some point during some internal
    object serialization it fails and rollbacks all the process. The object
    being serialized by our side only contains four attributes: a
    java.math.BigDecimal for it's primary key, a java.util.Date for
    timestamp locking and two simple java.lang.String's
    Although I'm pretty sure the problem should not be with the entity bean
    itself but with an internal Weblogic op (is it trying to serialize the
    EntityBeanContext as stated after the java.io.NotSerializableException
    message?
    Any help with this would be greatly appreciated as I have no clue how
    this happened and I'm also unable to reproduce it (I'm also sure if I
    managed to trigger it testing the application alone it will rise many
    more times that could be admited if we move to production).
    I would like to point also that currently until we have some more time
    to fix it we are using "remote" entity bean, I mean even if we are alway
    s calling them within the container they are not deployed with "local"
    interfaces yet (although AFAIK Weblogic should avoid RMI calls on them
    being co-located with the session beans).
    Regards.
    Ignacio.
    P.S. here is the full stack dump
    <12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
    weblogic.kernel.Default]:Exception:
    javax.transaction.TransactionRolledbackException at getXML
    javax.transaction.TransactionRolledbackException: EJB Exception: :
    java.io.NotSerializableException:
    weblogic.ejb20.internal.EntityEJBContextImpl
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at
    weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
    at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
    at
    weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
    at
    app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
    Source)
    at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
    at
    app.data.module.ModuleBean_1v2h9c_EOImpl.EJB2DOM(ModuleBean_1v2h9c_EOImpl.java:3954)
    at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
    at app.data.general.GeneralBean.getXML(GeneralBean.java:1024)
    at app.data.general.GeneralBean.getXML(GeneralBean.java:1002)
    at
    app.data.module.ModuleBean_nw294k_EOImpl.getXML(ModuleBean_nw294k_EOImpl.java:3138)
    at app.biz.common.Publisher.performPublication(Publisher.java:1644)
    at app.biz.common.Publisher.launchPublisher(Publisher.java:1580)
    at app.biz.module.ModuleDAO.update(ModuleDAO.java)
    at
    app.biz.module.ModuleDAO_jcgreo_EOImpl.update(ModuleDAO_jcgreo_EOImpl.java:100)
    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:324)
    at app.core.util.Proxy.execute(Proxy.java:583)
    at app.core.servlet.BaseServlet.execute(BaseServlet.java:440)
    at
    app.user.servlet.common.BaseServlet.accessSessionBean(BaseServlet.java:279)
    at
    app.user.servlet.common.BaseServlet.buildResponse(BaseServlet.java:132)
    at app.core.servlet.BaseServlet.doGet(BaseServlet.java:116)
    at app.core.servlet.BaseServlet.doPost(BaseServlet.java:154)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >

  • Three questions about Java and Ftp

    Hello, i've the following questions about Java and Ftp:
    1- .netrc file is in $HOME directory but i can't access to this directory from java code. The following line producesan Exception (directory doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");
    2- .netrc file must have the following permissions: -rw- --- --- but when i create the .netrc file the following permissions are on default: -rw- r-- r--, how can i change this permissions? (In java code, i can't use chmod.....)
    3- Are there any way to pass parameters to a .netrc file? If i get to do this i needn't change the permissions because i can't modify or create/destroy this file.
    Thanks in advanced!!!
    Kike

    1- .netrc file is in $HOME directory but i can't
    access to this directory from java code. The
    following line producesan Exception (directory
    doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");$HOME would have to be replaced by a shell, I don't
    think you can use it as part of a legal path.
    Instead, use System.getProperty("user.home");
    Ok, thanks
    2- .netrc file must have the followingpermissions:
    -rw- --- --- but when i create the .netrc file the
    following permissions are on default: -rw- r--r--,
    how can i change this permissions? (In java code,i
    can't use chmod.....)Yes, you can: Runtime.exec("chmod ...");
    I need to use estrictly the .netrc with -rw- --- --- permissions
    Yes, i can use Runtime.exec ("chmod ..."); but i don't like very much this solution because is a slow solution, am i right?
    3- Are there any way to pass parameters to a.netrc
    file? If i get to do this i needn't change the
    permissions because i can't modify orcreate/destroy
    this file.I don't think so. Why do you need the .netrc file in
    Java at all? Writing a GUI frontend?I want to use automatic ftp in a java program and FTP server, the files and path are not always the same, so i can:
    - modify .netrc (for me is the complex option)
    - destroy and create a new .netrc (is easier but i have permissions problem)
    - use .netrc with parameters but i haven't found any help about it
    Thanks for your prompt reply!!!!
    Kike

  • Nub question concerning threads.

    I recently completed my first Comp Sci. class in Java and have decided to try to continue learning on my own. I am now trying to make a pong game, using a turorial. Unforunately my course did not cover threads in any way, shape, or form. I am able to get the beginning of the program to work (code posted below) and have no problems with it; however, I do have a few questions concerning what certain elements of the code do.
    1. Can someone please give a definition of a Thread in "Dummy" speach? I've looked up definitions and I can't seem to really grasp what they are and what they are used for.
    2. In my program there are two lines (32 & 79) where the thread priority is changed. Can someone explain what that means and how it affects my applet?
    import java.applet.*;
    import java.awt.*;
    public class BallApplet extends Applet implements Runnable
         //Declare variables to change posistion
         int x_pos = 10;
         int y_pos = 100;
         int radius = 20;
         boolean rWall = false,
         //The second image of the ball
         private Image dbImage;
         private Graphics dbg;
         public void init() {}
         public void start()
              Thread th = new Thread(this);
              th.start();
         public void stop() {}
         public void destroy() {}
         public void run ()
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              while(true)
                   while (rWall == false )
                        if (x_pos == 700)
                             rWall = true;
                        else
                             x_pos= x_pos + 5;
                             // repaint the applet
                             repaint();
                             try
                                  // Stop thread for 20 milliseconds
                                 Thread.sleep (20);
                             catch (InterruptedException ex)
                                 // do nothing
                             // set ThreadPriority to maximum value
                             Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
                   while (rWall == true)
                        if (x_pos == 0)
                             rWall = false;
                             lWall = true;
                        x_pos = x_pos - 5;
                        repaint();
                        try
                             Thread.sleep(20);
                        catch (InterruptedException ex)
                        Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         public void update(Graphics g)
              //initialize buffer
              if (dbImage == null)
                   dbImage = createImage(this.getSize().width,this.getSize().height);
                   dbg = dbImage.getGraphics();
              //clear screen in background
              dbg.setColor (getBackground());
              dbg.fillRect (0, 0,this.getSize().width,this.getSize().height);
              //draw elements in background
              dbg.setColor (getForeground());
              paint(dbg);
              //draw image on screen
              g.drawImage(dbImage,0,0,this);
         public void paint (Graphics g)
              g.setColor (Color.red);
              g.fillOval(x_pos - radius,y_pos - radius,2*radius,2*radius);
    }Thanks for any help, it is greatly appreciated.

    Questie,
    Please control yourself. Please.??
    As the program runs it is one thread. (You canthink
    of each thread as an independent program if youlike.
    This is not 100% accurate but close enough that
    it
    might help you understand)
    It will only confuse the OP
    You are a flat out wrong for a number of reasons.
    1) You seemed to miss the part where I did say that a
    doubling in peformance is fictious and is dependent
    on a number of factors.As i was telling that would only confuse the OP.Its better to be 100% precise when you explain to an OP
    2) You don't understand how a multi-process OS works
    in the least.Assumptions as usual
    3) You don't understand how processors work in the
    least.Well,what was i saying?
    2 and 3 are important because your point about
    context switching is not valid. First of all because
    this happens anyway because your program is not the
    only thing running the processor. Second because of
    the first point each thread gets a timeslice, you may
    with multiple threads each get a timeslice and these
    slices may (and often do) add up to more total time
    then the first got by itself.When you consider a solution to a problem the average and the worst case has more weightage than the best case.You are taking the best case assumption here-"because ofthe first point each thread
    gets a timeslice, you may with multiple threads each
    get a timeslice and these slices may (and often do)
    add up to more total time then the first got by itself".Now dont stop whining that you werent.Never take the best case always coz its the average and worst case which checks if the system festers to a condition beyond rectification
    For example (these numbers are fictional but I am
    trying to explain it so don't go off all half-cocked
    again please)
    Program with one thread. Each thread gets 100 cycles
    per second.
    Program with four threads. Each thread gets 50 cycles
    per second.
    The second program will finish in half the time as
    the first. Because even though each thread is slower
    as a whole the program is getting twice the cycles
    of the processor as before. You are taking the best case again and moreover its the cpu scheduling algo which decides the time slice and not you sitting on the CPU.I have a vague feeling that you have an idea that you are sitting on the CPU deciding the Time Slice.
    You need to understand something important here. Alot
    of the time when you are doing things in a program,
    and this doesn't just apply to IO here, you don't
    have to use the processor for each step. There is
    some shifting around of things to get them ready to
    be executed by the processor. A more advanced
    representation of this is to be found with
    Hyperthreading. Hyperthreading processors (single
    core) are of course single core but they act as if
    they were multi-core (multi processes) because while
    only one process is actually executing at one time
    the others are pipelined in such a way to make sure
    that the executing core of the processor has the
    least amount of idle time possible.Digression
    So that means on a basic processor each time you add
    2 numbers it takes 5 steps. And the processor core is
    idle 80% of the time.
    From where did you get that 80%?Stop coming up with your own numberes.This is no number game
    So for example while some data is being placed in the
    outbox new data is also being collected and is at
    step 2 already. In this model while we are still on a
    single core the core is now idle only 60% of the time[b]From where did you get 60% now
    So yes threading is very useful for IO and other
    operations that may block your program but they have
    more use than just that. Parallel execution can and
    will have some performance advantages (if designed
    properly) even on a single core processor without
    hyperthreading. In a well written multithreaded
    program when you add hyperthreading and multiple
    cores or multiple processors to the mix then you
    really have something.I never said it wont.Read properly what i have posted.I told dont take the best case always.You need to consider that too but the other two carries more weightage
    Please don't feel you ever have to post to correct me
    again thanks.^^
    Get ride of this self conceited attitude.Even if you have it dont make it public.Its not that you are always right cotton.I am not saying that you are wrong.If you have read my first reply i mentioned that i knew that you gave that example just to make the OP understand.The problem with that is that if the OP is unable to fathom out what you mean he is going to misconstrue whatever you have said and that propogates

  • I have a MacBook Pro running 10.6.8 model 7.1; need to upgrade to Mavericks.  My question concerns 3 software apps:  Reunion 10, Quicken 2007, Appleworks 6.2.9.  Any recommendations?

    I have a MacBook Pro model 7.1 running 10.6.8; need to upgrade to Mavericks...question concerns 3 software apps:  Reunion 10, Quicken 2007, Appleworks 6.2.9 (word processing docs).  Any recommendations?

    Quicken Essentials is universally loathed on this forum.  Quicken 2007 updated for Lion, Mt. Lion and Mavericks for $15 is the way to go:
    http://quicken.intuit.com/personal-finance-software/quicken-2007-osx-lion.jsp
    Appleworks 6:
    Partition your hard drive or add an external drive and install Snow Leopard and use the "dual-boot" method to run Appleworks; and/or
    Install Snow Leopard Server (available by telephone order only from the Apple Store 1.800.MYAPPLE [1.800.692.7753]; part number - MC588Z/A) into Parallels and run Appleworks (and most other PowerPC apps) concurrently with Mavericks:
                                  [click on image to enlarge]
    Review Roger Wilmut's excellent series of articles, Abandoning Appleworks:
    http://www.wilmut.webspace.virginmedia.com/notes/aw/page1.html

  • Good afternoon ladies and gentlemen!   My question concerns the impossibility to open RAW-files directly from the program Adobe Bridge. At the moment when you open a RAW-file from Adobe Bridge by double-clicking, RAW-file is opened only in Photoshop. In t

    Good afternoon ladies and gentlemen!
    My question concerns the impossibility to open RAW-files directly from the program Adobe Bridge. At the moment when you open a RAW-file from Adobe Bridge by double-clicking, RAW-file is opened only in Photoshop. In the settings Adobe Bridge - in "open RAW-files by double-clicking in Adobe Camera Raw» box is checked. When you try any changes in the settings Adobe Bridge system displays a message:
    Bridge's parent application is not active. Bridge requires that a qualifying product has been launched at least once to enable this feature.
    The entire line of Adobe products on my computer updated to the latest updates. Previously, a family of products Adobe Photoshop on your computer is not set. Computer - PC, Windows 7 Enterprises.

    <moved from Adobe Creative Cloud to Bridge General Discussion>

  • Master iPad configurator question concerning cart syncing with different versions of iPads.

    I have a question concerning configurator syncing.Can the master iPad be a different version of iPad than the other synced iPads? For instance can iPad 2 be the master iPad to a group of iPad Air's? The iPad 2 has some fewer capabilities than the Air, would some settings or restrictions be left off of the iPad Airs if they were set up this way?  Thanks.

    There is no such thing as 'master iPad'.  If you're using Configurator or Profile Manager control of the setup is done from a Macintosh.

Maybe you are looking for