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.

Similar Messages

  • 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?

  • Custom OIM java client not working

    Hi all,
    I am trying to execute a custom OIM java client in my server. The java file just has the code to connect to the OIM server and it is failing at the line
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    The basic content of the java file OIMTry.java is given below:
    env.put("java.security.auth.login.config", "/u01/apps/resetpwd/config/auth.conf");
    env.put("java.security.policy", "/u01/apps/resetpwd/config/xl.policy");
    env.put("XL.HomeDir", "/u01/apps/resetpwd");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    env = config.getAllSettings();
    I have set the OIM related jar files in classpath in .bash_profile and able to echo the classpath as well.
    However, the file is executing perfectly in Eclipse tool but not from command prompt.The file is getting compiled properly at command prompt.
    I have tried various options of executing the java file as shown below.
    java -Djava.security.manager -DXL.HomeDir=/u01/apps/oim_server/xellerate -Djava.security.policy=/u01/apps/oim_server/xellerate/config/xl.policy -Djava.security.auth.login.config=/u01/apps/oim_server/xellerate/config/auth.conf -Djava.naming.provider.url=jnp://oim_server_host:12401/ OIMTry
    java -Dclasspath=/u01/apps/resetpwd/lib/xlUtils.jar:/u01/apps/resetpwd/lib/xlAPI.jar:/u01/apps/resetpwd/lib/xlCrypto.jar OIMTry
    The error we are getting is given below:
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: com.thortech.xl.util.config.ConfigurationClient
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
    at JvResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at OIMTry.main(java.lang.String[]) (Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javax.crypto.Cipher not found in [file:/u01/apps/resetpwd/lib/activation.jar, file:/u01/apps/resetpwd/lib/ojdbc14.jar, file:/u01/apps/resetpwd/lib/XLCustomClient.ear, file:/u01/apps/resetpwd/lib/commons-beanutils.jar, file:/u01/apps/resetpwd/lib/oscache.jar, file:/u01/apps/resetpwd/lib/xlDataObjectBeans.jar, file:/u01/apps/resetpwd/lib/commons-collections.jar, file:/u01/apps/resetpwd/lib/sax.jar, file:/u01/apps/resetpwd/lib/xlDataObjects.jar, file:/u01/apps/resetpwd/lib/commons-dbcp-1.2.1.jar, file:/u01/apps/resetpwd/lib/wlXLSecurityProviders.jar, file:/u01/apps/resetpwd/lib/xlDDM.jar, file:/u01/apps/resetpwd/lib/commons-digester.jar, file:/u01/apps/resetpwd/lib/xalan.jar, file:/u01/apps/resetpwd/lib/xlGenConnector.jar, file:/u01/apps/resetpwd/lib/commons-logging.jar, file:/u01/apps/resetpwd/lib/XellerateClient.jar, file:/u01/apps/resetpwd/lib/xlGenericUtils.jar, file:/u01/apps/resetpwd/lib/commons-pool-1.2.jar, file:/u01/apps/resetpwd/lib/xercesImpl.jar, file:/u01/apps/resetpwd/lib/xliGCProviders.jar, file:/u01/apps/resetpwd/lib/commons-validator.jar, file:/u01/apps/resetpwd/lib/xerces.jar, file:/u01/apps/resetpwd/lib/xlInputPreprocessor.jar, file:/u01/apps/resetpwd/lib/crimson.jar, file:/u01/apps/resetpwd/lib/XIMDD.jar, file:/u01/apps/resetpwd/lib/xlInstaller.jar, file:/u01/apps/resetpwd/lib/csv.jar, file:/u01/apps/resetpwd/lib/XL10SecurityProviders.jar, file:/u01/apps/resetpwd/lib/xlLogger.jar, file:/u01/apps/resetpwd/lib/dom.jar, file:/u01/apps/resetpwd/lib/xlAdapterUtilities.jar, file:/u01/apps/resetpwd/lib/xlRemoteManager.jar, file:/u01/apps/resetpwd/lib/ejb.jar, file:/u01/apps/resetpwd/lib/xlAPI.jar, file:/u01/apps/resetpwd/lib/xlRequestPreview.jar, file:/u01/apps/resetpwd/lib/jakarta-oro-2.0.8.jar, file:/u01/apps/resetpwd/lib/xlAttestation.jar, file:/u01/apps/resetpwd/lib/xlSampleApp.jar, file:/u01/apps/resetpwd/lib/javagroups-all.jar, file:/u01/apps/resetpwd/lib/xlAuditor.jar, file:/u01/apps/resetpwd/lib/xlScheduler.jar, file:/u01/apps/resetpwd/lib/jaxp-api.jar, file:/u01/apps/resetpwd/lib/xlAuthentication.jar, file:/u01/apps/resetpwd/lib/xlUtils.jar, file:/u01/apps/resetpwd/lib/jhall.jar, file:/u01/apps/resetpwd/lib/xlBackOfficeBeans.jar, file:/u01/apps/resetpwd/lib/xlVO.jar, file:/u01/apps/resetpwd/lib/log4j-1.2.8.jar, file:/u01/apps/resetpwd/lib/xlBackofficeClient.jar, file:/u01/apps/resetpwd/lib/xlWebClient.jar, file:/u01/apps/resetpwd/lib/mail.jar, file:/u01/apps/resetpwd/lib/xlCache.jar, file:/u01/apps/resetpwd/lib/xlWSCustomClient.jar, file:/u01/apps/resetpwd/lib/oc4jclient.jar, file:/u01/apps/resetpwd/lib/xlCrypto.jar, file:/u01/apps/resetpwd/lib/xml-apis.jar, file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/]
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
    at JvFindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at JvBytecodeVerifier.type.compatible(_Jv_BytecodeVerifier.type&, JvBytecodeVerifier) (/usr/lib/libgcj.so.5.0.0)
    at JvBytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
    at JvVerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
    at JvPrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at JvWaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    ...3 more
    Please let me know if I have to set something else in the environment to get rid of this error.
    Thanks,
    Mahendra.

    Hi,
    We were unable to create tcUtilityFactory instance when the env variables are set using the hashmap.
    Instead it is working when we set using System.setProperty() as shown below:
    System.setProperty("XL.HomeDir", "/u01/apps/OIMPwdReset");
    System.setProperty("java.security.policy", "/u01/apps/OIMPwdReset/config/xl.policy");//server or client
    System.setProperty("java.security.auth.login.config", "/u01/apps/OIMPwdReset/config/auth.conf");//server or client
    Hope this helps other guys..
    -Mahendra.

  • Help on custom actionscript component

    Hi All,
    I need to create a dynamic form which has multiple pages each
    page will be displayed in separate tabs and has individual
    controls. On submit of a a button i need to trace the data entered
    in the controls for each Tab. The numer of Tabs and controls will
    vary depending on criteria (reading from an XML).
    Sample xml data below -
    <Tab tabid="App_Form_01_Tab_02" name="Tab 2"
    label="Product Information" taborder="2">
    <Section sectionid="App_Form_01_Tab_02_Sec_01"
    name="Contract" orderontab="1">
    <Attrtype name="SingleLineofText" defval="This is single
    line text" maxchar="35" maxlines="1" inputtype="TextInput"
    attrlabel="Attribute 1"></Attrtype>
    <Attrtype name="MultipleLinesofText" defval="This is
    multi line text" maxchar="" maxlines="4" inputtype="TextArea"
    attrlabel="Attribute 2"></Attrtype>
    </Section>
    </Tab>
    <Tab tabid="App_Form_01_Tab_03" name="Tab 2" label="New
    Tab" taborder="3">
    <Section sectionid="App_Form_01_Tab_02_Sec_01"
    name="Contract" orderontab="1">
    <Attrtype name="SingleLineofText" defval="This is single
    line text" maxchar="35" maxlines="1" inputtype="TextInput"
    attrlabel="Attribute 1"></Attrtype>
    </Section>
    </Tab>
    I tried developing the above UI by creating custom
    actionscript components by extending existing UI components such as
    TabNavigator/VBox and added children at each stage until I reached
    the actual form control info using which I am creating the
    controls.
    So the child creation is following -
    MyTabnavigator->MySectionTabs(VBox)->MySections(VBox)->MySectionAttributes(HBox)->TextInp ut
    I have instantiated the MyTabNavigator comp from the mxml
    using <MyTabNavigator/> tag. This is displaing the dynamic
    form the way I need but now I have to access the text value entered
    into the TextInput. I tried to access the TextInput from a method
    written within a script block in the main application mxml. I am
    not able to do that.
    Could anyone please advise me on this.
    Test Link -
    http://dev.eforceglobal.com/test/paromita/bin/TestActionscriptComps.html
    (this also has the sample view source code)
    Am I doing this the wrong way?
    Please help.
    Regards,
    Paromita.

    Since you're using a scrollpane you should simply limit the dimensions of the visible part (JViewPort).
    yourScrollPane.getViewport().setPreferredSize(.......);

  • Using JAXB 2.0 as the Java Serializer for WSIF bindings

    Hello All:
    I am trying to invoke a Java Class from a BPEL process (using native WSIF Java Binding) using JAXB 2.0 as the Java Serializer. However it seems that Oracle already has an older verion of JAXB on the classpath which results in an exception during the serialization (could not find jaxb.properties in the package ...). Can you guys tell me how to pick up the newer version of the JAXB library. I have added the required jar files as a shared library. How can the classloading behaviour be altered to accomodate this?
    Does 10.1.3.4 take care of this? I have 10.1.3.3 currently

    Hi,
    Did you ever solve this issue? I'm having the same problem with toplink and hibernate jars....
    Regards,
    Zaloa

  • Custom ActionScript Component icon in Design View

    Hi,
    I have created a custom ActionScript component in Flex. I have added the Icon metadata tag before the class definition:
        [IconFile("expandable-panel.png")]   
        public class ExpandablePanel extends TitleWindow
    However, though the path to the image is correct, the icon for the custom component does not show up in Design View.
    Any idea ?
    Thanks.
    Best regards,
    Karl Sigiscar.

    Not very helpful. My question is more where should the icon be placed or what kind of extra configuration is required so that Flex Builder / Flash Builder can find it in Design view.
    Yeah, yeah, I'm in the wrong forum. Doh.

  • Captivate or custom ActionScript to create Quiz?

    I need to create a Quiz, and after testing out Captivate I've
    determined it cannot handle the complexity. I'm thinking custom
    ActionScript programming will be required, but since I really only
    spent an hour trying out Captivate, I want to run this by some of
    you advanced users and see if I'm overlooking something.
    Example:
    Question: Which of the following are kinds of apples?
    a. McIntosh
    b. Gala
    c. Golden Delicious
    d. Orange
    a, b and c are all correct, d is incorrect. It appears that
    Captivate will allow me to set this up as a multiple choice quiz
    with multiple answers, and that I can designate a, b and c as the
    correct answer and d as incorrect. But it appears that it requires
    that all three correct options are selected to branch to a "correct
    answer" slide, and that any other combination will trigger an
    incorrect answer.
    What I need is to be able to give the user feedback based on
    several different combinations of answers. If they choose a and b
    but not c, I need to be able to take them to SLide X, and if they
    choose c but not a and b I need to take them to SLide Y, and if
    they choose just a but also choose d I need to take them to Slide
    Z, and on and on.
    My assumption upon evaluation is that this is beyond the
    scope of what Captivate can provide. I feel it requires custom
    programming. Does anyone know if there's something I'm missing?
    Some feature I haven't thought of?
    Thanks in advance,
    Sean McAuliffe
    [email protected]

    If you are using AS2, there are quiz templates in Flash that
    you can use. But they are very limited as to the functionality. For
    what you are looking to do (branching based on different user
    inputs), you will not be able to use the bulit in Flash components.
    To see what I mean, open Flash, and on that main start page where
    you can choose the type of file to create, click on the "More..."
    folder and then Quiz.
    Open one of those to see what I mean. There are a bunch of
    components that are available to use. But there is the whole issue
    of reporting it to the LMS, Captivate does all that stuff for you,
    I'm not sure how to go about doing that in Flash without using the
    built in quiz functions. But if you don't have to report to an LMS,
    you can code it pretty easily.
    If you need more clarification let me know!
    HTH
    Doug

  • Default to Java Serialization in case Pof Serialization not defined

    Is this possible to do, i.e. essentially if for a certain class Pof serialization is not defined, use the Java serialization instead?
    Or to turn it around, is it possible to define pof serialization only for certain classes in a distributed cache and use Java serialization for the rest?

    Hi,
    the problem for this is that Java serialization is not aware of POF (or for that matter even ExternalizableLite), so if you have a Java-serialized class which has a member which is supposed to be POF-serializable, it in fact will not be serialized with POF, because Java serialization will not delegate to POF.
    So it is very hard to mix the two together. You can do it for top-level objects by providing a special PofSerializer instance for the non-POF class which serializes to byte array and you write the byte array as a POF attribute, but it is not possible for POF-aware objects contained within a non-POF aware object to be POF serialized.
    Also, if you attempt to do this, then you can kiss goodbye to platform independence. You must use Java on both ends and have all the libraries which the classes used in the state want to pull in.
    Best regards,
    Robert

  • Calling Custom XSLT java class from BPEL in SOA Suite 11g

    Hi All,
    Morning...need some help with this issue...we are currently on SOA Suite 11g (11.1.1.4) version.
    Earlier while we were on SOA Suite version 10g (10.1.3.3) we were calling the custom java classes from the xsl mapping for complex transformation and for this we were placing the .class file as .jar file at the location mentioned here $OC4J_HOME/j2ee/home/applib directory and then mentioning the namespace as http://www.oracle.com/XSL/Transform/java/{$classname$} in the XSLT mapping file.
    Now in SOA Suite 11g if we need to retain similar functionality for external custom java calls could someone please help us where do we need to put the .jar file now ..
    exactly at which directory location/path and on which instance/server (application server instance or middle tier instance ) we need to put this .jar file
    Currently we are stuck and need some help with this.
    With thanks & Regards

    Hi Eric & Anuj,
    Thanks for replying , sorry for checking on this now...
    here at this path /opt101/app/oracle/SOAD/SOA11gR1/fmw/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1
    we got the ora.soa.ext.jar file and extracted it to get the MANIFEST.mf file ..have mentioned below.
    Now if we need to link our custom .jar file named customfunctions.jar so we need to mention it as below is this correct :
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 17.0-b17 (Sun Microsystems Inc.)
    Implementation-Vendor: Oracle
    Implementation-Title: Oracle SOA EXT
    Implementation-Version: 11.1.1
    Product-Name: Oracle SOA EXT
    Product-Version: 11.1.1.4.0
    Specification-Version: 11.1.1
    Extension-Name: oracle.soa.ext
    Class-Path: classes/
    Class-Path:customfunctions.jar classes/ -- is this the way to mention (means we need to add this additional line or we need to add to the existing line at Class-Path: classes/)
    2.
    Eric the Alternative method mentioned in your update :
    Open a command prompt and change the current directory to the oracle.soa.ext_11.1.1 directory ,
    then execute the build.xml file in the oracle.soa.ext_11.1.1 folder using Ant
    Now could someone please guide us regards this ANT means how does it work and its relation to the build.xml file and how do we check whether we have ANT utility available or not..
    not much conversant with this ANT hence asking here..would lookout for your reply
    thank you

  • Java serialization is slow in Solaris 10

    Hi,
    I'm think to migrate from Linux to Solaris 10, because of the better support for Java any many other things, but in the first test the java web application, we get a too slower response in Solaris, with a time of 03 minutes and 12 seconds for one transaction, but this same transaction using Linux on same hardware and database the transaction concludes in 4 seconds, I think that this maybe a misconfiguration on Solaris.
    In this application, all transaction are via JavaBean serialization over HTTP using an Applet that serializes/deserializes objects to a Servlet, seeing the tcp trace of http requests, after the server receives this requests, we get a pattern of 15 seconds to reply for every request.
    Then, maybe a mistake of TCP configuration in Solaris? or Java Applet Serialization to Servlet is slow in Solaris?
    Exists a best way to install Solaris for better performance with Java?
    Thanks for any help or ideas
    Cl�vis

    I obtained a T1000 on the 60 day try and buy with solaris 10. I've installed my java application on it. On start up the first thing the application does is de-serialize a huge java object.
    On my laptop (winXP single drive) this takes about 40 seconds.
    On the T1000 (single drive c0t0d0 <SUN80G cyl 65533 alt 2 hd 16 sec 149) it takes about 12 minutes. The application is identical.
    The java version on my laptop is 1.5.0_6
    The java version on my T1000 is 1.5.0_10
    I've doubled check to make sure the read and write cache is enabled on the disk.
    This is a major problem for me. Any ideas? The T1000 is doing nothing else. It is 100% idle before I start the java application.
    My application runs loads of threads and so I was hoping to get excellent performance which I haven't tested yet. However with a start up time of 12 minutes this is a no go straight away.
    I understand it is more to do with the disc and solaris 10, but can anyone explain to me why my laptop should be so much faster?>

  • Serializing XML Documents(not Java Serialization)

    Hi,
    Iam looking for a class that can serialize the XML documents.
    Heres the problem in detail:
    - I need to create an XML String from scratch taking data from a database.
    - I created the XML Document adding the childs and attributes.
    - I need an XML string from the document. Iam not exactly sure how to do this. But Apache Xerces package provides an XMLSerializer class where we can convert the document into a string.
    Is there any functionality provided. If so where can i find it.
    Thanks,
    -Rao

    Not sure if this is a bug or not (filing one just in case it is) but the following program demonstrates that with 2.0.2.9 the internal subset is serialized correctly if the document was parsed with validationMode set to true. If set to false only the entities show up in the internal subset.
    package xmlbugs;
    import java.io.*;
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    public class TestSerializeLocalSubset {
    private static final String xml =
    "<?xml version='1.0' encoding='UTF-8'?>"+
    "<!DOCTYPE bar ["+
    "<!ENTITY bar 'baz'>"+
    "<!ELEMENT foo EMPTY >"+
    "<!ELEMENT bar (foo) >"+
    "]>"+
    "<bar><foo/></bar>";
    public static void main(String[] a_ ) throws Exception {
    System.out.println("Test with parser in validation mode = false");
    DOMParser d = new DOMParser();
    d.setPreserveWhitespace(false);
    d.setValidationMode(false);
    d.parse( new StringReader(xml));
    Document x = d.getDocument();
    XMLDocument xx = (XMLDocument) x;
    xx.print(System.out);
    System.out.println("Test with parser in validation mode = true");
    DOMParser d2 = new DOMParser();
    d2.setPreserveWhitespace(false);
    d2.setValidationMode(true);
    d2.parse( new StringReader(xml));
    x = d2.getDocument();
    xx = (XMLDocument) x;
    xx.print(System.out);
    }

  • How to define a customized MessageFactory.java?

    Hello,
    I want create my own MessageFactory.java class instead of using the existing JSF one. Is there anyway I could define this class somewhere in configuration file (like struts-config.xml for MessageResourcesFactory) and use it directly?
    Thank you in advance
    Peter

    So you want a custom set of error messages? You can do that by setting the message bundle in the faces-config.xml. Note that a resource bundle need not be a set of properties files but may be a class extending ResourceBundle.
    Note that it is not usually good practice to try to swap out internal details of a particular implementation. Such a solution will be fragile as private classes are not guaranteed to remain stable.

  • Custom PWS (Java) against Oracle

    We are planning on developing a custom PWS in Java against an Oracle database (Peoplesoft).
    We will be deploying Websphere App Server 5.1 with EDK 5.1 (Java) on the remote (portlet/web service) server on the Windows platform.
    Is there any peference/recommendation as to which JDBC driver(Data Direct driver, type etc.) , I should use to access the Oracle database from teh custom PWS? Does anyone forsee any issues with this platform and/or Oracle database access on the remote application server.
    I'd appreciate any JDBC driver specification recommendation and any other insights into this.
    Thanks and regards.
    Vanita
    Staples

    Try this (refers to assignment service, but I believe classpath is the same):
    32.3.2.3 How to Deploy a Custom Assignment ServiceTo deploy a custom assignment service:
    1.Use one of the following methods to make an assignment service implementation class and its related classes available in the class path of Oracle BPEL Process Manager:
    ◦Load your classes in SCA-INF/classes directly or SCA-INF/lib as a JAR.
    ◦Change the Oracle BPEL Process Manager shared library to include your JAR files.
    Note:
    ◦You cannot create different versions of the assignment service for use in different BPEL processes unless you change package names or class names.
    ◦Java classes and JAR files in the suitcase are not available in the class path and therefore cannot be used as a deployment model for the assignment service.
    ◦The steps must be repeated for each node in a cluster.
    Excerpt is from:
    http://docs.tpu.ru/docs/oracle/en/owl/E14571_01/integration.1111/e10224/bp_workflow.htm#BACHEFDH

  • Customer component java.lang.OutOfMemoryError: Java heap space

    I have a custom component, the tag class is
    public class CalendarTag extends UIComponentELTag {
        private static final Logger log = Logger.getLogger(CalendarTag.class);
        @Override
        public String getComponentType() {
            return "HtmlCalendar";
        @Override
        public String getRendererType() {
            return "Calendar";
        @Override
        public void release() {
            super.release();
            this.pattern = null;
            this.year = null;
            this.month = null;
            this.firstDayOfWeek = null;
        @Override
        protected void setProperties(UIComponent component) {
            super.setProperties(component);
            CalendarComponent comp = (CalendarComponent) component;
            if (pattern != null) {
                comp.setValueExpression("pattern", pattern);
            if (year != null) {
                comp.setValueExpression("year", year);
    //        if (month != null) {
    //            component.setValueExpression("month", month);
    //        if (firstDayOfWeek != null) {
    //            component.setValueExpression("firstDayOfWeek", firstDayOfWeek);
        protected ValueExpression pattern;
         * Get the value of pattern
         * @return the value of pattern
        public ValueExpression getPattern() {
            return pattern;
         * Set the value of pattern
         * @param pattern new value of pattern
        public void setPattern(ValueExpression pattern) {
            this.pattern = pattern;
        protected ValueExpression year;
         * Get the value of year
         * @return the value of year
        public ValueExpression getYear() {
            return year;
         * Set the value of year
         * @param year new value of year
        public void setYear(ValueExpression year) {
            this.year = year;
        protected ValueExpression month;
         * Get the value of month
         * @return the value of month
        public ValueExpression getMonth() {
            return month;
         * Set the value of month
         * @param month new value of month
        public void setMonth(ValueExpression month) {
            this.month = month;
        protected ValueExpression firstDayOfWeek;
         * Get the value of firstDayOfWeek
         * @return the value of firstDayOfWeek
        public ValueExpression getFirstDayOfWeek() {
            return firstDayOfWeek;
         * Set the value of firstDayOfWeek
         * @param firstDayOfWeek new value of firstDayOfWeek
        public void setFirstDayOfWeek(ValueExpression firstDayOfWeek) {
            this.firstDayOfWeek = firstDayOfWeek;
    public class CalendarComponent extends UICommand {
        private static final Logger log = Logger.getLogger(CalendarComponent.class);
        public CalendarComponent() {
            super();
            setRendererType("Calendar");
        @Override
        public String getFamily() {
            return "Calendar";
        @Override
        public void encodeBegin(FacesContext context) throws IOException {
            log.debug("encodeBegin");
            super.encodeBegin(context);
        @Override
        public void encodeChildren(FacesContext context) throws IOException {
            log.debug("encodeChildren");
        protected String calendarType;
         * Get the value of calendarType
         * @return the value of calendarType
        public String getCalendarType() {
            if(calendarType != null) {
                return calendarType;
            ValueExpression ve = getValueExpression("pattern");
            if(ve != null) {
                if(!ve.isLiteralText()) {
                    return (String) ve.getValue(FacesContext.getCurrentInstance().getELContext());
                } else {
                    return ve.getExpressionString();
            } else {
                return (String) getAttributes().get("pattern");
         * Set the value of calendarType
         * @param calendarType new value of calendarType
        public void setCalendarType(String calendarType) {
            this.calendarType = calendarType;
        public int getYear() {
            ValueExpression ve = getValueExpression("year");
            if(ve != null) {
                if(!ve.isLiteralText()) {
                    return ((Integer) ve.getValue(FacesContext.getCurrentInstance().getELContext())).intValue();
                } else {
                    log.debug("a=" + ve.getExpressionString());
                    return 2009;//(Integer.getInteger(ve.getExpressionString())).intValue();
            } else {
                log.debug("size=" + this.getAttributes().size());
                log.debug("year=" + this.getAttributes().get("year"));
                return 2009;//((Integer) getAttributes().get("year")).intValue();
    //        return 2009;
    }Some code has been omitted.
    where I use this component, I got the following exception
    {font:&#65325;&#65331; &#65328;&#12468;&#12471;&#12483;&#12463;, monospace}{size:2}Caused by: java.lang.OutOfMemoryError: Java heap space
    From the log, I found {size}{font}this.getAttributes().get("year") is called recursively. But I don't know why, can anyone help me?

    the log is added to find my stackover problem,
    I am new to JSF, can you point out why it will call it recursively. thank you very much
    public int getYear() {
            ValueExpression ve = getValueExpression("year");
            if(ve != null) {
                if(!ve.isLiteralText()) {
                    return ((Integer) ve.getValue(FacesContext.getCurrentInstance().getELContext())).intValue();
                } else {
                    log.debug("a=" + ve.getExpressionString());
                    return (Integer.getInteger(ve.getExpressionString())).intValue();   /// here is the problem
            } else {
                return ((Integer) getAttributes().get("year")).intValue();
        }

  • Generation of custom syncbo java classes does not work.

    Hello
    we created some new syncbo's for MAM 3.0 in the middleware and download it's correspond meRepMeta.xml.
    Now i will generate in the NetWeaver Developer Studio the manager and syncbo classes for our new custom syncbo's. I had create a new SmartSync-Project and deliver the meRepMeta.xml file, edit the package and some other things and start the project creation process. But after this, i have only an simple MI project with web.xml, meRepMeta.xml and so on, but no generated, custom syncbo's. In the documentation i couldn't find a detailed description for the generation of syncbo java classes.
    Can anybody help me, what i do wrong.
    Tanks a lot.
    Greetings
    Andreas

    Hi Kai,
    Just note these points..
    1)Smart Sync MI Applications (JSP Runtime) generated using SP 09v of Developer Studio is MCD specific.It is generating MCD specific files.This architecture makes the applications too complex during migration.
    2)In SP 09v applications, the developers don't have to code in Smart Sync API level as most of the codes are generated by default.
    3)Applications in SP 09v of Developer Studio is following the exact MVC Architecture(We can see the seperation of models, views and controllers here).
    4)Corresponding to the mapped fields (in SyncBo level), in the BO Wrapper classes we can see implementations of corresponding getter() and setter(..) methods.The names of this methods are totally dependent upon the names of fields mapped.So if there is change in the names of fields , in the case of already generated projects , we have to explicitly rename the getter() and setter(..) methods appropriately inorder to make the changes to take effect.
    5)For adding new JSP pages, we have to add references in many files(*.view). (we have to explicitly create the corresponding controller class file , map the relationship between the controller and the corresponding JSP file).
    refer this blog also..
    /people/kishor.gopinathan/blog/2006/05/29/smart-sync-application-development-using-sp-09v-of-developer-studio
    <<
    have to write the acces classes, mentioned in the MDK, manually for every new SyncBO I want to use?
    >>
         For that , we can write a generic method in such a way that , we only have to pass the syncbo name as the parameter for that method, so that it would retrieve the records corresponding to the syncbo given.
       Since the getter nd setter method names are closely related to the names of the mapped fields, this would create problems when we change the names of fields used in the table parameter or import parameter of the BAPI Wrapper used for syncbo creation.
    So using SP 11 , we can create generic applications, which can be migrated using the higher versions of NWD Studio. I think , SAP might not change this infrastructure anymore..
      Regards,
      Kishor Gopinathan

Maybe you are looking for