Persistenance for Java Objects Using Toplink

Hi All Happy New Year
I am trying the a tutorial in Jdeveloper 10.1.3.0.4 called
Provide Persistenance for Java Objects Using Toplink.
I have followed the instructions and get the following error.
com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
     at __Proxy1.persistEntity(Unknown Source)
     at acme.ejb.session.EmpSessionClient.main(EmpSessionClient.java:29)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.lang.NoSuchMethodException: acme.ejb.session.EmpSession.persistEntity(java.lang.Object)
The release notes mention TopLink POJO's Must Implement java.io.Serializable When Returned From a Session Bean's Remote Interface (4902787) When creating a session bean facade for TopLink POJO objects, you must implement java.io.Serializable for each of the TopLink POJO objects returned from the SessionBean facade through a remote interface. This is typically required when using ADF Swing, a EJB Sample Client, or when your EJB Session Bean resides on a separate application server from the client. You can also tell you you need to implement java.io.Serializable when you get the following exception:
com.evermind.reflect.UndeclaredExceptionTypeException:
/oracle.oc4j.rmi.OracleRemoteException/
at __Proxy1.[Your Class Name Here] (Unknown Source)
The workaround is to manually edit each POJO object to implement java.io.Serializable.
I have only one POJO which is declared as follows:
public class EmpInfo implements Serializable {
Can anybody help me understand what I need to do to get it to work?
Many Thanks in Advance

Hi,
can you send me your test scenario/project at anuj dot k dot jain at oracle dot com. I tried reproducing this but was unable to do so.
Thanks,
anuj dot k dot jain at oracle dot com

Similar Messages

  • Error Generating Java Objects using TopLink

    Running online tutorial: Build a Web Application with ADF Faces and Oracle TopLink
    Generated errors when trying to build Java Objects From Table Wizard at step 9.
    [b]java.lang.NullPointerException
         at oracle.ideimpl.log.TabbedLogManager.getMsgPage(TabbedLogManager.java:101)
         at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1049)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
         at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
         at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
         at java.lang.Thread.run(Thread.java:595)
    Any help welcomed
    regards
    John

    Solved!!!
    I had installed JDeveloper 10g inside a directory that had a space in the directory name.

  • Write to java object using netui:select tag

    Hello,
    I am iterating through a hashmap of java objects using a netui-data:repeater.
    <netui-data:repeater dataSource="{pageFlow.MyHashMap}">
    <netui-data:repeaterItem>
    <netui-data:repeater dataSource= "{container.item.HashMapOfEmbeddedObjects}">
    <netui-data:repeaterItem>
    <netui:select dataSource= "{container.item.type}" optionsDataSource= "{container.item.typeChoices}" /> </td>
    <netui:select dataSource= "{container.item.default}"
    optionsDataSource= "{container.item.defaultChoices}" /> </td>
    </netui-data:repeaterItem>
    </netui-data:repeater>
    </netui-data:repeaterItem>
    </netui-data:repeater>
    The java object has a field "HashMapOfEmbeddedObjects" that is itself a hashmap of java objects. I want to be able to make a selection and have it be written to the
    "type" and "default" fields of the embedded objects, but dataSource="{container.item.default}" does not save the value of the selection.
    Is there anyway to use the netui:select tag to write to the field on a java object? Any help is greatly appreciated.

    I have done it in the past. The java object need not be actionForm. The following write-up I found in edocs will help you achieve this.
    Page Flow-Scoped Form Beans
    Page Flow-scoped Form Bean instances have the same life-cycle as the Controller file instance. They are created and destroyed when the Controller file instance is created and destroyed. This makes Page Flow-scoped Form Beans useful for storing data that has been accumulated across many different JSP pages.
    To create a Page Flow-scoped Form Bean instance, construct a public member variable of the Form Bean in the Controller file.
    public class myController extends PageFlowController
    public MyFormBean pageFlowScopedBean = new MyFormBean();
    Once you have created a Page Flow-scoped instance of a Form Bean, you can pass the instance to action methods by using the @action form="form_bean" annotation.
    public class myController extends PageFlowController
    public MyFormBean pageFlowScopedBean = new MyFormBean();
    * @jpf:action form="pageFlowScopedBean"
    * @jpf:forward name="success" path="displayData.jsp"
    protected Forward submit( MyFormBean form )
    return new Forward( "success" );
    Each time the submit() method is invoked, it is passed the same instance of the Form Bean, namely, pageFlowScopedBean, the instance that was created when the Controller file instance was created.
    For more info go to http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conReqScopedVsPageScopedBean.html
    Good luck.
    --SJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to instantiate a java object (using JNI)?(n'more)

    hey bschauwe, thanks for your last post, you were guessing but your 4th guess was right on the money of how id like to do it.
    "4. An alternative way to return data to java from C is to instantiate a java object (using JNI), then use JNI to call that object's setters, then return the object at the end of the C routine."
    I know now how to get the object's setters, I am just unsure how to instantiate a java object from the native C code using JNI. Also you said to returnt he object at the end of the c routine, that is just a good ol' return statement right? no other functions to release memory or anything are needed? So basically it would be something like:
    JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
      (JNIEnv *env, jobject thisObj)
            //instantiate the java object on retObj????
            //call setters with values from the c structures...
            //return retObj??? no other memory releasing needed?
    }Thanks again for all your help,
    Shane

    K sounds straight forward enough, the index in my book had nothing on <init> and I wasnt aware of the NewObject call. So my final (well for demonstration purposes) code should look something like:
    JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
      (JNIEnv *env, jobject thisObj)
         jclass clazz;
         jclass clazzTemp;
         jmethodID mid;
         jint val;
         jobject tempObj;
            //first instanciate the object
         clazz = (*env)->GetObjectClass(env, retObj);
         mid  = (*env)->GetMethodID(env, clazz, "<init>", "()V");     
            //Get Object
         tempObj = (*env)->NewObject(env, clazz, mid);
            //get Class reference to instantiated class
         clazzTemp = (*env)->GetObjectClass(env, tempObj);
            //Start calling setters to set the object up.
         mid = (*env)->GetMethodID(env, clazzTemp, "SetHeight", "(I)V");
         (*env)->CallVoidMethod(env,tempObj, mid, struct->myHeight);
            //set more members ...
            //return the object back to java with its members filled out.
            //before returning do I need to call (*env)->DeleteLocalRef(tempObj); ??
            return tempObj;
    }So is this how i do it for a function that is nativly defined as:
    public native JSources getJSourceData();?
    if this is right, then im cooking, and cannot thank you enough!
    -Shane

  • Generation of XML file from Java objects using castor

    I have the following java file(Customer.java).
    public class Customer
         private String ID;
         private FirstName firstName;
         private MiddleName middleName;
         private LastName lastName;
         private ArrayList address;
         public ArrayList getAddress() {
              return address;
         public void setAddress(ArrayList address) {
              this.address = address;
         public FirstName getFirstName() {
              return firstName;
         public void setFirstName(FirstName firstName) {
              this.firstName = firstName;
         public String getID() {
              return ID;
         public void setID(String id) {
              ID = id;
         public LastName getLastName() {
              return lastName;
         public void setLastName(LastName lastName) {
              this.lastName = lastName;
         public MiddleName getMiddleName() {
              return middleName;
         public void setMiddleName(MiddleName middleName) {
              this.middleName = middleName;
    Using castor i have created an xml file(customer.xml) which has the following format.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    - <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    </customer>
    I have used a mapping file to get this output.Is there a way where i can get the output xml in the following format without changing the Java object structure.If yes then please suggest how this can be done.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    </customer>
    <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    I mean the output xml file should have the address as a separate tag not withing the root tag customer.

    Hello,
    Castor's own discussion groups might be able to point you to the solution you're looking for (if this use case is possible using Castor).
    Oracle has its own object-to-XML mapping tool that is part of the TopLink product. It allows you to map existing objects to an existing XML Schema. This can be done visually using the TopLink Workbench, or programmatically using the TopLink APIs. TopLink OXM also supports the JAXB specification.
    Using TopLink OXM to get the desired XML result I would recommend the following. Map the Customer and Address classes to XML, but don't map the relationship between Customer and Address. Then make the calls to the marshaller something like the following:
    marshaller.marshal(aCustomer, System.out);
    for(int x=0; x<aCustomer.getAddress().size(); x++) {
         marshal(aCustomer.getAddress().get(x), System.out);
    Example - Using TopLink OXM to map an existing object model to an existing XML Schema:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/howto/ox/index.htm
    For more information on TopLink object-to-XML mapping:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/objectxml/index.html
    -Blaise

  • Question/issue regarding querying for uncommited objects in Toplink...

    Hi, was hoping to get some insight into this problem we are encoutering…
    We have this scenario were we are creating a folder hierarchy (using Toplink)
    1. a parent folder is created
    2. child elements are created (in the same transaction as step 1),
    3. we need to lookup the parent folder and assign it as the parent
    of these child elements
    4. end the transaction and commit all data
    In our system we control access to objects by appending a filter to the selection criteria, so we end up with SQL like this example
    (The t2 stuff is the authorization lookup part of the query.) ;
    SELECT t0.ID, t0.CLASS_NAME, t0.DESCRIPTION, t0.EDITABLE,
    t0.DATE_MODIFIED, t0.DATE_CREATED,
    t0.MODIFIED_BY, t0.ACL_ID, t0.NAME, t0.CREATED_BY,
    t0.TYPE_ID, t0.WKSP_ID, t1.ID, t1.LINK_SRC_PATH,
    t1.ABSOLUTE_PATH, t1.MIME_TYPE, t1.FSIZE,
    t1.CONTENT_PATH, t1.PARENT_ID
    FROM XDOOBJECT t0, ALL_OBJECT_PRIVILEGES t2,
    ARCHIVEOBJECT t1
    WHERE ((((t1.ABSOLUTE_PATH = '/favorites/twatson2')
    AND ((t1.ID = t2.xdoobject_id)
    AND ((t2.user_id = 'twatson2')
    AND (bitand(t2.privilege, 2) = 2))))
    AND (t1.ID = t0.ID))
    AND (t0.CLASS_NAME = 'oracle.xdo.server.repository.model.Archivable'))
    When creating new objects we also create the authorization lookup record (which is inserted into a different table.) I can see all the objects are registered in the UOW identity map.
    Basically, the issue is that this scenario all occurs in a single transaction and when querying for the newly created parent folder, if the authorization filter is appended to the query, the parent is not found. If I remove the authorization filter then the parent is found correctly. Or if I break this up into separate transactions and commit after each insert, then the parent is found correctly.
    I use the conformResultsInUnitOfWork attribute on the queries.
    This is related to an earlier thread I have in this discussion forum;
    Nested UnitOfWork and reading newly created objects...
    Thanks for any help you can provide,
    -Tim

    Hi Doug, we add the authorization filter directly in the application code as the query is getting set up.
    Here are some code examples; 1) the first is the code to create new object in the system, followed by 2) the code to create a new authorization lookup record (which also uses the first code to do the actual Toplink insert), then 3) an example of a read query where the authorization filter is appended to the Expression and after that 4) several helper methods.
    I hope this is of some use as it's difficult to show the complete flow in a simple example.
    1)
    // create new object example
    public Object DataAccess.createObject(....
    Object result = null;
    boolean inTx = true;
    UnitOfWork uow = null;
    try
    SessionContext sc = mScm.getCurrentSessionContext();
    uow = TLTransactionManager.getActiveTransaction(sc.getUserId());
    if (uow == null)
    Session session = TLSessionFactory.getSession();
    uow = session.acquireUnitOfWork();
    inTx = false;
    Object oclone = (Object) uow.registerObject(object);
    uow.assignSequenceNumbers();
    if (oclone instanceof BaseObject)
    BaseObject boclone = (BaseObject)oclone;
    Date now = new Date();
    boclone.setCreated(now);
    boclone.setModified(now);
    boclone.setModifiedBy(sc.getUserId());
    boclone.setCreatedBy(sc.getUserId());
    uow.printRegisteredObjects();
    uow.validateObjectSpace();
    if (inTx == false) uow.commit();
    //just temp, see above
    if (true == authorizer.requiresCheck(oclone))
    authorizer.grantPrivilege(oclone);
    result = oclone;
    2)
    // Authorizer.grantPrivilege method
    public void grantPrivilege(Object object) throws DataAccessException
    if (requiresCheck(object) == false)
    throw new DataAccessException(
    "Object does not implement Securable interface.");
    Securable so = (Securable)object;
    ModulePrivilege[] privs = so.getDefinedPrivileges();
    BigInteger pmask = new BigInteger("0");
    for (int i = 0; i < privs.length; i++)
    BigInteger pv = PrivilegeManagerFactory.getPrivilegeValue(privs);
    pmask = pmask.add(pv);
    SessionContext sc = mScm.getCurrentSessionContext();
    // the authorization lookup record
    ObjectUserPrivilege oup = new ObjectUserPrivilege();
    oup.setAclId(so.getAclId());
    oup.setPrivileges(pmask);
    oup.setUserId(sc.getUserId());
    oup.setXdoObjectId(so.getId());
    try
    // this recurses back to the code snippet from above
    mDataAccess.createObject(oup, this);
    catch (DataAccessException dae) {
    Object[] args = {dae.getClass().toString(), dae.getMessage()};
    logger.severe(MessageFormat.format(EXCEPTION_MESSAGE, args));
    throw new DataAccessException("Failed to grant object privilege.", dae);
    3)
    // example Query code
    Object object = null;
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression exp = eb.get(queryKeys[0]).equal(keyValues[0]);
    for (int i = 1; i < queryKeys.length; i++)
    exp = exp.and(eb.get(queryKeys[i]).equal(keyValues[i]));
    // check if need to add authorization filter
    if (authorizer.requiresCheck(domainClass) == true)
    // this is where the authorization filter is appended to query
    exp = exp.and(appendReadFilter());
    ReadObjectQuery query = new ReadObjectQuery(domainClass, exp);
    SessionContext sc = mScm.getCurrentSessionContext();
    if (TLTransactionManager.isInTransaction(sc.getUserId()))
    // part of a larger transaction scenario
    query.conformResultsInUnitOfWork();
    else
    // not part of a transaction
    query.refreshIdentityMapResult();
    query.cascadePrivateParts();
    Session session = getSession();
    object = session.executeQuery(query);
    4)
    // builds the authorzation filter
    private Expression appendReadFilter()
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression exp1 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("xdoobject_id");
    Expression exp2 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("user_id");
    Expression exp3 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("privilege");
    Vector args = new Vector();
    args.add(READ_PRIVILEGE_VALUE);
    Expression exp4 =
    exp3.getFunctionWithArguments("bitand",args).equal(READ_PRIVILEGE_VALUE);
    SessionContext sc = mScm.getCurrentSessionContext();
    return eb.get("ID").equal(exp1).and(exp2.equal(sc.getUserId()).and(exp4));
    // helper to get Toplink Session
    private Session getSession() throws DataAccessException
    SessionContext sc = mScm.getCurrentSessionContext();
    Session session = TLTransactionManager.getActiveTransaction(sc.getUserId());
    if (session == null)
    session = TLSessionFactory.getSession();
    return session;
    // method of TLTransactionManager, provides easy access to TLSession
    // which handles Toplink Sessions and is a singleton
    public static UnitOfWork getActiveTransaction(String userId)
    throws DataAccessException
    TLSession tls = TLSession.getInstance();
    return tls.getTransaction(userId);
    // the TLSession method, returns the active transaction (UOW)
    // or null if none
    public UnitOfWork getTransaction(String uid) {
    UnitOfWork uow = null;
    UowWrapper uw = (UowWrapper)mTransactions.get(uid);
    if (uw != null) {
    uow = uw.getUow();
    return uow;
    Thanks!
    -Tim

  • Which is better ? Toplink Java objects or Toplink Entities ?

    Hi
    We are planing to use Toplink JPA that comes with JDeveloper 11g preview release
    I have a question here!
    I would like to get clarified which is better to use :
    1. Toplink Java Objects from Tables ,
    2.Toplink Entities from Tables
    Could you suggest the best approach, and pros and cons of both the approaches?
    Thanking you ,
    Samba

    Samba,
    Ultimately both are using the same TopLink runtime. In the case of Entities you are using JPA and Java Objects you are using TopLink native API and metadata.
    Going forward I would recommend JPA with TopLink extensions as required.
    Doug

  • Displaying Complex Java Objects using netui

    I have a java object with the following structure.
    obj1
    int name;
    String ID;
    ArrayList obj2;//coniatns multiple obj2 objects
    obj2
    int name;
    String ID;
    ArrayList obj3; //coniatns multiple obj3 objects
    obj3
    int name;
    String ID;
    How and what netui tags can I use to display this kind of structure for obj1?
    I tried repeaters and it is not working for me.
    Also if I have a structure like this
    ArrayList obj4; //contains arrays's of multiple items.
    obj4
    String[] eventTime;
    String[] eventDate;
    How can I display this in a grid fashion using netui? The netui:gid tag only
    wirks with RowSet and I have an ArrayList?
    If I want to use simple jsp and not use netui tags what is the context for accessing
    my form that I have in my page flow from the jsp? e.g. if I have a form in my
    page flow called listForm which has gets and sets for
    String[] eventTime;
    String[] eventDate;
    what is the context I use in my jsp to print values of eventTime and eventDate
    in a grid like fashion without using nteui? I tried 'request' context but it
    does not work. In netui we can use actionForm or pageFlow etc but what about
    simple jsp context?
    Please reply soon. Thanks

    Try the <netui-data:getData> tag in the workshop documentation, It gives an example
    "Kush" <[email protected]> wrote:
    >
    I have a java object with the following structure.
    obj1
    int name;
    String ID;
    ArrayList obj2;//coniatns multiple obj2 objects
    obj2
    int name;
    String ID;
    ArrayList obj3; //coniatns multiple obj3 objects
    obj3
    int name;
    String ID;
    How and what netui tags can I use to display this kind of structure for
    obj1?
    I tried repeaters and it is not working for me.
    Also if I have a structure like this
    ArrayList obj4; //contains arrays's of multiple items.
    obj4
    String[] eventTime;
    String[] eventDate;
    How can I display this in a grid fashion using netui? The netui:gid
    tag only
    wirks with RowSet and I have an ArrayList?
    If I want to use simple jsp and not use netui tags what is the context
    for accessing
    my form that I have in my page flow from the jsp? e.g. if I have a form
    in my
    page flow called listForm which has gets and sets for
    String[] eventTime;
    String[] eventDate;
    what is the context I use in my jsp to print values of eventTime and
    eventDate
    in a grid like fashion without using nteui? I tried 'request' context
    but it
    does not work. In netui we can use actionForm or pageFlow etc but what
    about
    simple jsp context?
    Please reply soon. Thanks

  • How to reload class file for java objects in CF MX7

    I'm trying to create a simple java object for use in a CFML
    page. According to the topic "About ColdFusion and Java objects" in
    the CF developer's guide, I can compile my java module and put the
    .class file in the CFusionMX7/wwwroot/WEB-INF/classes directory and
    it'll be dynamically reloaded any time CF sees a new .class file
    there. But the dynamic reload isn't happening; I have to restart
    the CF server to get it to pick up a new version.
    I don't believe this directory is in the "general JVM
    classpath"; I don't find "classes" in the Java Class Path in the CF
    Administrator's System Information page. And I have all the caching
    options turned off on the "Server Settings > Caching" page, if
    that has any bearing on it.
    Are there any known issues around this dynamic reload
    capability, or maybe a more definitive way to make sure the
    WEB-INF/classes directory isn't in the classpath?
    Thanks,
    James

    Yes, I understand. But if I'm reading it correctly, what
    you're saying seems to contradict the documentation
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00001561.htm
    ColdFusion dynamically loads classes that are either .class
    files in the web_root/WEB-INF/classes directory or in JAR files in
    the web_root/WEB-INF/lib directory. ColdFusion checks the time
    stamp on the file when it creates an object that is defined in
    either directory, even when the class is already in memory. If the
    file that contains the class is newer than the class in memory,
    ColdFusion loads the class from that directory.
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_18228&sliceId=1
    Dynamic class reloading for Java servlets classes and
    forcfobject (sic) Java classes is disabled by default in
    ColdFusion MX. To enable dynamic class reloading, do the following:
    Also, I seem to recall that setting worked in a prior
    version. Though I would have to test it again on another machine to
    be certain.

  • Best way for Java objects to relate to DB tables

    When creating a Java app which relies on a backend DB, it is convenient (and necessary) to create Java classes which relate to the data in those tables. However with a normalised set of tables, should the Java classes relate purely to the tables, or the "view" of the un-normalised data?
    e.g. (rough example of what I mean)
    CREATE TABLE teams
    team_id INTEGER NOT NULL PRIMARY KEY,
    team_name CHAR(50)
    CREATE TABLE users
    user_id INTEGER NOT NULL PRIMARY KEY,
    user_name CHAR(50),
    team_id INTEGER REFERENCES teams(team_id)
    Now, the Java class for a user could have either have a variable (e.g. teamName) declared as an int (to fully reflect the table design) or a String (to represent the "view" of the data). I know that views can be used etc. and in this example that would be very easy � I am just using these simplified tables as an example.
    I have tried both and both have pitfalls. For instance, when getting the data from the database, it is very easy to create the object from the DB if it reflects the �view� of the data. However when it comes to updating the data in the DB, you need to do a lot of other work to find out what needs updating in which tables, because the actual raw data (as will be inserted/updated with SQL commands) is not available in the Java object.
    I hope this makes sense.
    Thanks.

    My question is what is the best way to write the classes that represent the DB data. As I said this is not EJB (that would handle the DB side of things anyway), as this is overkill for this particular situation. It was more of a general question anyway - should the class contain the actual data (e.g. should the user Class contain a String for the team name (e.g. Purchasing) or a link to the underlying DB id for Purchasing.
    In reality, I would create a Team class, but the same applies - should the Java Class ever contain any relationship to the underlying DB. I think not, but it seems inefficient to have to continually query the DB to find out information we already have.
    Apologies if I am not explaining this very well.

  • Reg XML generation from java objects using SAX 2.0

    i'm using java 1.6 and i've imported following class to generate XML from java objects
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    the following class has been imple her to create a Xml file and tag elements ,
    OutputFormat of = new OutputFormat("XML", "iso-8859-1", true);
    XMLSerializer serializer = new XMLSerializer(fos, of);
    ContentHandler hd = serializer.asContentHandler();
    hd.startDocument();
    everything works fine but i'm getting warrnin reg the serializer and outputformat
    warring is:
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    HOW CAN I AVOID DS WARRING PLZ HELP REG DS
    thanks ,
    with regards,
    Rajesh.S

    I've been having the same problem. Here is what i found:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476630]
    Hope that helps (or at least helps you feel better).

  • Sending Java object using E-Mail

    Dear Experts,
    In my application I am trying write java Object in a file. Then I have to attach that file with an E-Mail. In the receiver side I have to download the file and read the Java Object from file.
    The Problem is , when I am sending and receiving mail using outlook Express, My file is reduced by some Kbs(Example , I am sending 66kb but I am receiving only 64Kb).
    If any of you have some ideas to solve the above problem, please let me know.
    With Thanks
    Panneer

    Perhaps you are trying to send binary but e-mail must be in text or the data will get filtered/mangled.

  • Configuring Logon groups for JAVA instances using NWA method

    Hello,
    we have a BI dual System landscape ( CI ABAP+ JAVA plus 2 dialog instance ABAP+JAVA, based on NW04s. I have set up a Web Dispatcher to do a load balancing for JAVA instances. I configured the logon groups according this documentation using NWA (http://help.sap.com/saphelp_nw04/helpdata/en/45/3dbe11a82b6bf1e10000000a1553f6/content.htm).
    The following points are still quite unclear for me:
    1. according documentation I should specify the following profile parameters:
    [Define the special HTTP URLs, which SAP Web Dispatcher uses to send to the AS Java to retrieve the logon groups information]
    wdisp/J2EE/group_info_location = [?] /JavaEE/public/icf_info/icr_groups
    wdisp/J2EE/url_map_location = [?] /JavaEE/public/icf_info/icr_urlprefix
    Wich values should i take here actually? These one or /J2EE/icr_groups and /J2EE/icr_urlprefix ?
    2. Also I have to configure (in visual administrator) the GroupInfoRequest and UrlMapRequest properties of the HTTP Provider service running on server processes. They recommend to use /J2EE/icr_groups and /J2EE/icr_urlprefix. Should it be the same values as defined in those profile parameters?
    3. I have defined the instance IDs and exacte Alias in the groups definitions in nwa. Is it possible to proof somehow while using my URL http://<host>:<port>/TestApp~test/<application_resource> either im web dispatcher (traces?) or on a web site on which DI I actually land to be sure that my load balancing works properly and i don't land on my Central Instance?
    Thanks a lot in advance for your advices.
    best regards,
    Polina

    Understood, Install the web dispatcher and configre the ABAP Message Server Port and ms/http_port (T-CODE:SMMS). Test this link
    http://host:port/sap/public/icf_info/icr_groups
    and this would retrieve the list of ABAP (SMLG) cofigured groups.
    For java load balancing, icm of that host will send the incoming requests to JAVA Dispatcher. The load balancing happens on the basis of server nodes and can be found in the web dispatcher session dispatching table.
    There are no necessary parameters required for java load balancing except the number of server nodes you'll hookup to that dispatcher.
    There is an option called service based, where we configure the j2ee hosts to accept the connections for the services which are running but I haven't seen much customers using this option.
    Bottom line: No changes are required for java side and enable the "ext rfc" option for abap logon groups and rest will be taken care by Web Dispatcher.
    Use connection pooling and high timeouts to acheive the better througput and use the SSL termination on Web Disp.

  • Logon groups configuration for JAVA instances using NWA method

    Hello guys,
    we have a BI dual System landscape (CI ABAP+ JAVA plus 2 dialog instance ABAP+JAVA, based on NW04s. I have set up a Web Dispatcher to do a load balancing for JAVA instances. I configured the logon groups according this documentation using NWA (http://help.sap.com/saphelp_nw04/helpdata/en/45/3dbe11a82b6bf1e10000000a1553f6/content.htm).
    The following point is still quite unclear for me:
    I have defined the instance IDs (of DIs installed on linux servers) and exacte Alias in the logon groups definitions in NWA. Is it possible to proof somehow (while accessing my URL http://<host>:<port>/TestApp~test/<application_resource> ) either in web dispatcher ->Web Administration Interface(Application Server Monitor ?) or somewhere else on which Dialog Instance I actually land to be sure that my load balancing works properly and i don't land on my Central Instance?
    Thanks a lot in advance.
    best regards,
    Polina

    ok, I have understood what you ment in the first passage Thanks!
    When I put javascript:document.cookie in my Internet Explorer Address Bar i got the following information: 
    PortalAlias=portal; saplb_STD_JAVA=(sapt20p_T20_20)207175450; JSESSIONID=(sapt20p_T20_20)ID1892984750DB11747115157906231437End; saplb_test=(lx003207_T20_20)206509050; saplb_*=(lx003207_T20_20)206509050
    what does here saplb_STD_JAVA mean?
    you can use following URLs to access any particular Java Server node of any server.
    https://<host name>:<https port>/irj/portal;saplb_*=<Java serer node number> https://<host name>:<https port>/irj/portal;sapj2ee_irj=<Java server node number>
    What is the difference between saplb_* and sapj2ee_irj?
    Thanks in advance.
    regards,
    Polina

  • Refresh Java Objects From Toplink Map

    To add a many to many relationship to my toplink map, I added a field in my .java class like this:
        /**Map addressCollection <-> com.goyman.Akira.model.Address
             * @associates <{com.goyman.Akira.model.Address}>
        private List addressCollection;Then, the addressCollection map appeared in my toplink descriptor, I mapped it correctly, and now I want to know if I have to manualy write the accessor and collection management method (like addAddress...) or if something automated exists.
    Regards
    Kuon

    Relationships will be automatically managed for you by TopLink but you may want to write accessors and add/removeAddress to use these methods in your business logic.
    Hope this helps.
    Anuj

Maybe you are looking for