Vendor-ejb-jar.xml to orion-ejb-jar.xml, finder methods

Hello
I want to convert a inprise based EJB 1.1 application from inprise to OC4J. The inprise based finder methods are quite different from the syntax of orion-ejb-jar.xml, regarding the finder methods. Does anyone know if this can be done more easily. Using JDev 903_pre does not help much. I dont have access to JBuilder either. It seems I have to write all the finder methods once more and it takes days.
Any hints ?
Ana Maria

OC4J does not require all finder methods in the orion-ejb-jar.xml and it automatically generates all simple finder methods. The easiest thing to do is deploy the EJBs into OC4J and it will generate the finder methods in the $OC4J_HOME/j2ee/home/application-deployment/<application-name>/ejb-jar-name/ directory and then you can modify these per your requirement and package with your EJBs.
hope this helps
thanks
Debu

Similar Messages

  • Ejb-ql in finder method

    Hi all,
    I have a table which has no primary key then I made the complex primary key by 2 fields which are foriegn keys(Primary key in other tables or entity beans) , the problem is that whenever I write a finder method ,I face with an error telling these 2 fields are not cmp field .
    could you please guide me .In addition I need a finder method which gets 2 parameters (the 2 foriegn keys) then return the the raw.
    Not having known so much about reletionship in EJB ,please give me a sample code
    Cheers
    Pooyan

    What do you expect us to tell without even a small description of your problem (a stack trace or error message would have been helpful). Anyway, read here... you should find some sample code too.
    http://www.theserverside.com/books/masteringEJB/index.jsp

  • OC4J: EJB FREEZING IN FINDER METHOD

    I HAVE VARIOUS EJB BASED ON VIEWS, AND ALL EXCEPT ONE FREEZES WHEN I INVOQUE IT'S FINDER METHODS. I HAVE CHECKED EVERYTHING AND FOUND THE FOLLOWING MESSAGES:
    Thr[thread 5]-DriverManagerPooledConnection.close(): begin---this.nextConnectionNumber=1
    Thr[thread 5]-DriverManagerPooledConnection.close(): begin---this.closed=false
    AND IT LOOPS FOREVER WITH THE FOLLOWING MESSAGES:
    Thr[thread 5]-ApplicationServerTransaction.setRollbackOnly(message, Throwable_Obj): begin--message=timed out
    Thr[thread 5]-ApplicationServerTransaction.setRollbackOnly(message, Throwable_Obj): begin--Throwable_Obj=null
    Thr[thread 5]-ApplicationServerTransaction.setRollbackOnly(message, Throwable_Obj): end
    Erika.

    Hi Erika,
    It looks like you are running OC4J in "debug" mode. I don't know whether this will help you, but I have found that sometimes, running in debug mode can cause problems, but these problems will "disappear" when not running in debug mode. So have you tried running OC4J in "normal" (i.e. not debug) mode?
    Good Luck,
    Avi.

  • Finder-method in orion-ejb-jar.xml

    Hi,
    Is there a way to let jdeveloper 9.0.3 preview to automatically generate finder-method descriptors for us? When I was developing a cmp-based entity bean, although I defined the ejb-ql in ejb-jar.xml, JDeveloper still just generated the first orion-ejb-jar.xml shown below. In the first orion-ejb-jar.xml, there is no definition for any finder-method. I have to manually add my own definition to it, which is shown in the second orion-ejb-jar.xml. I know that the oc4j container will generate the finder-method after deployment, but in some situation it generated incorrect finder-method descriptors. One of such situation is the between query like "between ?1 and ?2". Anyway, if JDeveloper can generate the finder-method during development, then we can know whether the descriptor is correct or not before deployment, and we can make modifications before deploying it to oc4j server.
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
    <primkey-mapping>
    <cmp-field-mapping>
    <fields>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    </fields>
    </cmp-field-mapping>
    </primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    <cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping name="&lt;default-ejb-caller-role>" impliesAll="true"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
    <primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    </primkey-mapping>
    <cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
    <cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
    <cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
    <finder-method query="select * from books where $author like $1">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByAuthor</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    <finder-method query="select * from books where $title like $1">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByTitle</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    <finder-method query="$price between $1 and $2">
    <method>
    <ejb-name>BooksBean</ejb-name>
    <method-name>findByPriceRange</method-name>
    <method-params>
    <method-param>double</method-param>
    <method-param>double</method-param>
    </method-params>
    </method>
    </finder-method>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping impliesAll="true" name="&lt;default-ejb-caller-role>"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    Any one has any idea?
    Thanks,
    Jingzhi

    Jingzhi -- If you define the correct EJB-QL you should get the correct SQL generated for the finder. If that's not happening can you verify it against the OC4J v903 production release and see if it is still happening. I don't know if this helps with the JDeveloper problem specifically but if you don't need to create your own finders then that I hope should help.
    Thanks -- Jeff

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finder

    I'm trying to call an entity bean froma session bean i get the error :-
    7/02/27 14:35:25 javax.ejb.ObjectNotFoundException: Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finde
    [findByCustID].
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.EJBExceptionFactory.objectNotFound(EJBExceptionFactory.java:325)
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.finders.Finder.checkNullResult(Finder.java:224)
    My session bean looks like this :-
    public class HelloBean implements SessionBean
      public String helloWorld (String pzCustomerID) throws SQLException,RemoteException
         String lzRevenue=null;
         int liCustomerID=Integer.parseInt(pzCustomerID);
         try
              Context initial = new InitialContext();
              Object objref =   initial.lookup("SalesBean");
              SalesHome salesHome =(SalesHome) PortableRemoteObject.narrow(objref,SalesHome.class);
              Sales sales=salesHome.findByCustID(liCustomerID);
              lzRevenue=(String) sales.findByCustID(liCustomerID);
    My entity bean looks like this:-
    public class SalesBean implements EntityBean
      public String factPK;
      public int timeID;
      public int custID;
      public int locID;
      public int itemID;
      public int entityID;
      public String currency;
      public float qty;
      public float unitPrice;
      public float amount;
      public EntityContext context;
      private Connection con;
        private void makeConnection() {
            try {
                InitialContext ic = new InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup("jdbc/DSource");
                con = ds.getConnection();
            } catch (Exception ex) {
                throw new EJBException("Unable to connect to database. " +
                    ex.getMessage());
      public SalesBean()
      public String ejbFindByCustID(int custID) throws SQLException,RemoteException,FinderException
         makeConnection();
         PreparedStatement pstmt = con.prepareStatement("select sum(amount) from sales where cust_id= ? ");
         pstmt.setInt(1, custID);
         ResultSet rset = pstmt.executeQuery();
         if (!rset.next())
              throw new RemoteException("no records present" );
         return rset.getString(1);
      }My entity bean's home interface looks like this:-
    public interface SalesHome extends EJBHome
    public Sales create() throws RemoteException, CreateException;
    public Sales findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    My entity bean's remote interface looks like this:-
    public interface Sales extends EJBObject
         public String findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    my ejb-jar.xml looks like this:-
    <enterprise-beans>
    <session>
    <description>Hello Bean</description>
    <ejb-name>HelloBean</ejb-name>
    <home>myEjb.HelloHome</home>
    <remote>myEjb.HelloRemote</remote>
    <ejb-class>myEjb.HelloBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
         <entity>
              <ejb-name>SalesBean</ejb-name>
              <home>myEjb.SalesHome</home>
              <remote>myEjb.Sales</remote>
              <ejb-class>myEjb.SalesBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-field>
              <field-name>factPK</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>timeID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>custID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>locID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>itemID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>entityID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>currency</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>qty</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>unitPrice</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>amount</field-name>
         </cmp-field>
              <primkey-field>factPK</primkey-field>
              <resource-ref>
              <res-ref-name>jdbc/DSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
         </entity>
    </enterprise-beans>
    please help me out of this trouble.

    I'm trying to call an entity bean froma session bean i get the error :-
    7/02/27 14:35:25 javax.ejb.ObjectNotFoundException: Exception [EJB - 10008]: Cannot find bean of type [SalesBean] using finde
    [findByCustID].
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.EJBExceptionFactory.objectNotFound(EJBExceptionFactory.java:325)
    7/02/27 14:35:25       at oracle.toplink.internal.ejb.cmp.finders.Finder.checkNullResult(Finder.java:224)
    My session bean looks like this :-
    public class HelloBean implements SessionBean
      public String helloWorld (String pzCustomerID) throws SQLException,RemoteException
         String lzRevenue=null;
         int liCustomerID=Integer.parseInt(pzCustomerID);
         try
              Context initial = new InitialContext();
              Object objref =   initial.lookup("SalesBean");
              SalesHome salesHome =(SalesHome) PortableRemoteObject.narrow(objref,SalesHome.class);
              Sales sales=salesHome.findByCustID(liCustomerID);
              lzRevenue=(String) sales.findByCustID(liCustomerID);
    My entity bean looks like this:-
    public class SalesBean implements EntityBean
      public String factPK;
      public int timeID;
      public int custID;
      public int locID;
      public int itemID;
      public int entityID;
      public String currency;
      public float qty;
      public float unitPrice;
      public float amount;
      public EntityContext context;
      private Connection con;
        private void makeConnection() {
            try {
                InitialContext ic = new InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup("jdbc/DSource");
                con = ds.getConnection();
            } catch (Exception ex) {
                throw new EJBException("Unable to connect to database. " +
                    ex.getMessage());
      public SalesBean()
      public String ejbFindByCustID(int custID) throws SQLException,RemoteException,FinderException
         makeConnection();
         PreparedStatement pstmt = con.prepareStatement("select sum(amount) from sales where cust_id= ? ");
         pstmt.setInt(1, custID);
         ResultSet rset = pstmt.executeQuery();
         if (!rset.next())
              throw new RemoteException("no records present" );
         return rset.getString(1);
      }My entity bean's home interface looks like this:-
    public interface SalesHome extends EJBHome
    public Sales create() throws RemoteException, CreateException;
    public Sales findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    My entity bean's remote interface looks like this:-
    public interface Sales extends EJBObject
         public String findByCustID(int custID) throws SQLException,RemoteException,FinderException;
    my ejb-jar.xml looks like this:-
    <enterprise-beans>
    <session>
    <description>Hello Bean</description>
    <ejb-name>HelloBean</ejb-name>
    <home>myEjb.HelloHome</home>
    <remote>myEjb.HelloRemote</remote>
    <ejb-class>myEjb.HelloBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
         <entity>
              <ejb-name>SalesBean</ejb-name>
              <home>myEjb.SalesHome</home>
              <remote>myEjb.Sales</remote>
              <ejb-class>myEjb.SalesBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              <reentrant>False</reentrant>
              <cmp-field>
              <field-name>factPK</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>timeID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>custID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>locID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>itemID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>entityID</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>currency</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>qty</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>unitPrice</field-name>
         </cmp-field>
         <cmp-field>
              <field-name>amount</field-name>
         </cmp-field>
              <primkey-field>factPK</primkey-field>
              <resource-ref>
              <res-ref-name>jdbc/DSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
         </entity>
    </enterprise-beans>
    please help me out of this trouble.

  • EJB CMP finder methods

    The Oracle documents suggests that the following definition in the EJBHome is enough to create a finder method
    public Enumeration findByWhere(String where) throws RemoteException, FinderException;
    I get a java.lang.AbstractMethodError on the client when I try to call this - suggesting the the container is not implementing the method for me.
    I see no place in the oracle descriptor to define these finder methods.
    What is the deal with these ? How does one use CMP and Finder methods other than the standard "findByPrimaryKey(....)
    thanks
    null

    Hello,
    Let say you don't want to uyse the defualt finder methods, then you can write your own like:
    (in client servlet/JSP file etc..)
    emps = home.findByLast_name(request.getParameter("searchText")); //find by last name
    where:
    step 1) go to EJB class editor (under your main EJB directory)
    step 2) click on finder tab and click add, to add new finder methods
    step 3) (you can click help now to get more info on this..anyways) findBy<CMB field>
    would automatically check the "Managed by OC4j" check box, this means that you have matched a signature tag for finders (kind of like setXX and getXX if you are doing JavaBean...automatically done for you)
    step 4) else you can make one that is not up like findWildCard(String wildCard):
    i)by specifying the Method name to be: findWildCard
    ii)parameter (String type: wildCard)
    step 5) rebuild the EJB directory after you add this method
    step 6) use it in any of you client servlet/JSP as you would with the defualt findAll() methods etc..
    cheers,
    -Long
    [email protected]

  • [svn:bz-trunk] 17982: Bug: BLZ-564 - Some classes in flex-messaging-core. jar define main methods for debugging purposes.

    Revision: 17982
    Revision: 17982
    Author:   [email protected]
    Date:     2010-10-01 00:39:15 -0700 (Fri, 01 Oct 2010)
    Log Message:
    Bug: BLZ-564 - Some classes in flex-messaging-core.jar define main methods for debugging purposes. This creates an unintended entry point and the main methods should be removed.
    QA: No - just removed main methods
    Doc: No
    Checkintests: No - just removed main methods
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-564
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/services/messaging/selector/NumericValue.ja va
        blazeds/trunk/modules/core/src/flex/messaging/util/Base64.java
        blazeds/trunk/modules/core/src/flex/messaging/util/Hex.java
    Added Paths:
        blazeds/trunk/modules/core/test/src/flex/messaging/util/Basae64Test.java

  • Xml finder bugs

    This happened in WLI 7.0.2
    I wanted to post a generic xml when task became ready. I wanted to do this for
    each task in current and future templates that other people in my group will design.
    I had written the xml and it was in my local drive.
    I tried to use the xml finder functionality for adding the xml to publish into
    the repository. It imports but garbles up the xml into a binary string. Due to
    this the original contents of the xml are lost.
    I have tried all kinds of ways to get an xml imported into the repository but
    it does not work. looks like the XML finder has bugs and it does not work.
    Has anyone encountered this issue?
    Thanks
    puneet

    This happened in WLI 7.0.2
    I wanted to post a generic xml when task became ready. I wanted to do this for
    each task in current and future templates that other people in my group will design.
    I had written the xml and it was in my local drive.
    I tried to use the xml finder functionality for adding the xml to publish into
    the repository. It imports but garbles up the xml into a binary string. Due to
    this the original contents of the xml are lost.
    I have tried all kinds of ways to get an xml imported into the repository but
    it does not work. looks like the XML finder has bugs and it does not work.
    Has anyone encountered this issue?
    Thanks
    puneet

  • XML toString method not working as expected.

    Why is the XML.toString method inconsistant?
    var xml:XML = new XML( "<root/>" );
    var xml_withtext:XML = new XML( "<root>a</root>" );
    var xml_withchild:XML = new XML( "<root><child/></root>" );
    trace(xml.toString()); //traces "" (blank)
    trace(xml_withtext.toString()); //traces "a"
    trace(xml_withchild.toString()); //traces "<root><child/></root>"
    If the XML contains only a root node, toString prints nothing.  When it contains text, it prints the text.  That would make sense if toString was printing only the contents of the root node, but if the root node contains a child, it doesn't print "<child/>" as one would expect.  Instead, it suddenly includes the root node as well in the string.  That is inconsistant/unexpected.  For some reason, there is also a separate toXMLString method that consistantly prints the entire XML structure.  Was that some kind of patch since toString doesn't work in a consistant manner, instead opting to sometimes include the root node depending on whether it contains simple or complex content?

    Andrei1:
    1. No, it's not what it is.  No, there aren't hundreds of reasons/dependencies why more descriptive or intuitive conventions are not chosen. In this case, the reason (singular) is spelled out in the E4X spec, and it basically boils down to them naively thinking it would be easier for programmers if the node would just magically return text if that's all it contains.  In other words, they thought it would be simpler for a node to run specialized arbitrary logic to decide what to return, than it would for a programmer to explicitly select what they want by typing ".text".  I see no reason why XML.toString should return anything other than the underlying/original string of characters that originally represented the node in the first place.  If programmers wanted the child text of a node, they should call a method like "getTextContent".  Since an original, unaltered string of XML character had to exist in the first place in order to instantiate an XML object, anything that creates a new string based on arbitrary logic, for whatever reason, has no business existing within the toString method.  For classes that represent data that is not fundamentally a string, any string representation is by definition arbitrary and in that case they can override the universal (i.e. a member of every base Object) toString method.  But for classes that represent strings, toString should return the string they represent, unaltered.
    2.  An AS3 XML object IS an XML-type object, but the AS3 XML class is actually instantiated from String-type data or from  bytes that represent encoded String data (i.e. sequences of known  characters), because XML is very strictly and fundamentally a "markup language" which is essentially a format of a string of characters.  Its rules are based around characters, exact unicode character classes, and a logical ordering of those characters.  XML is logically and fundamentally the kind of data that a String class represents, text, so its converstion to a String instance should be straightforward.   As a string, a "toString" method for a node should return the original string representation of that node from the first character that is part of that XML node to the last character that is part of that node.  XML may contain data the represents anything, but XML itself is a string of characters.  Period.
    3.  There is a universal string method called toString and it's a member of the most basic class "Object" which all other classes inherit from.  Although the technical details are different in different object-oriented langauges, they all tend to have a method like that, whether we're talking about AS3, C#, Java, or JavaScript.  Calling toString on a String returns the string itself.  Calling toString on a class that represents a string, should return the string it represents; not some arbitrary tranformation of that string.  Calling toString on a class that doesn't represent a string, has no default string representation to return, and therefore any string returned is by definition arbitrary.
    4.
    In other words toString() does not return XML at all but an un-interpreted representation that is cast to String
    That's precisely what it DOESN'T do.  Instead of returning the original, un-interpretted representation of the string FROM WHICH THE NODE WAS CONSTRUCTED, it returns some arbitrarily interpretted represention.  It decides whether the XML string is interpretted as complex or simple content, and then it arbitrarily decides to include or not include the outermost tags representing the XML of that node.  The fact remains, the string representation PRECEDES the existance of the XML instance, so toString should not be performing arbitrary logic to construct a brand new string.
    In other languages datatype string can be a totally different animal.
    No, actually a string always refers to a secquence of characters.  Each of those character may contain one or more bytes, they may be contiguous in memory or not, they may be represented by arrays, linked lists, doubly-linked lists, etc. but their logical data is always a sequence of characters.  That is the same in every programming language, and is even codified in the Unicode standards which represents characters in hundreds of different written languages.
    5.
    Again, XML is not a string until application says so and XML in AS3 is not a String but a special object.
    XML is actually a string BEFORE the application says it is XML, since the XML is constructed FROM A STRING.  XML is a special object, which is constructed from, represents, and processes a string.
    I could very easily create a class named "AllCapsSentence" and like "XML", the class itself is not "String", but they logically represent a string of characters and any "toString" method on either of such classes should return the underlying string representation without mangling it.

  • Multi vendor JMS jar files

    Hi,
    I have both the J2EE 1.3 jar file and weblogic 6.1 jar file in my class path. I have a single process which I want to take messages from J2EE and put them to weblogic.
    This seems to work fine if the weblogic file is before J2EE but fails when the J2EE is picked up first. The J2EE implementation fails to write to the weblogic queue.
    Going forward I would hope that my process could communicate with multiple JMS implementations from various vendors. My concern is whether the classpath order will prevent this.
    Are there specifications covering this kind of multi vendor scenario ?
    Cheers
    Mairt

    I may have found the answer to my question in the
    following quote from the JMS FAQ on this site
    "The JMS specification does not require that one JMS
    provider be able to send messages directly to another
    provider."
    I assume this means if I need to communicate with
    multiple vendors JMS implementations, each of which
    requires that I include their jar file in my
    classpath, then I need a way of specifying which
    implementation to use at runtime.
    Hmmm....any ideas ?
    Cheers,
    MairtAssuming your existing providers have implemented JMS correctly there is no reason why you cannot use JNDI to resolve your name space conflicts. The Topic/Queue connection factory implementations will be what is stored in the directory and use the vendor specific factories and classes for client reconstruction.
    Regards,
    Paul

  • Unable to deploy EJB: unable to find EndPointFinder

    Hello.
    We are in a process of migrating applications from WL7 SP7 to WL 10.3
    JDK 1.4 to JDK 1.6
    EJB 2.1 remains same.
    When we try to connect to a third-party (SONIC) secured JMS infrastructure Topic. I have configured the credential mapper for that.
    When I deployed application in WL 10.3 I got following error
    Unable to deploy EJB: TLDBanMoveMDB from tbstotld.jar:
    unable to find EndPointFinder for ldap://emldev01.sbc.com:4299/t=jms,ou=2_0,ou=dst01,ou=telegence,ou=ld,o=billing'
    weblogic.application.ModuleException: Exception activating module: EJBModule(tbstotld.jar)
    Unable to deploy EJB: TLDBanMoveMDB from tbstotld.jar:
    unable to find EndPointFinder for ldap://emldev01.sbc.com:4299/t=jms,ou=2_0,ou=dst01,ou=telegence,ou=ld,o=billing
    at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:493)
    at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
    Following is my deployment descriptor.
    <weblogic-enterprise-bean>
    <ejb-name>TLDBanMoveMDB</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>30</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>cn=tldNotify</destination-jndi-name>
    <initial-context-factory>com.sun.jndi.ldap.LdapCtxFactory</initial-context-factory>
    <provider-url>ldap://emldev01.sbc.com:4299/t=jms,ou=2_0,ou=dst01,ou=telegence,ou=ld,o=billing</provider-url>
    <connection-factory-jndi-name>cn=embdev01TCF</connection-factory-jndi-name>
    <jms-client-id>M20413</jms-client-id>
    </message-driven-descriptor>
    </weblogic-enterprise-bean>
    I did some research and learned that Weblogic seems to confuse as to which initial context factory to use. See the posts as linked in here. Is this a bug in Weblogic?
    http://forums.oracle.com/forums/thread.jspa?threadID=873769
    http://objectmix.com/weblogic/537901-unable-find-endpointfinder.html
    Some folks are recommending using weblogic.ejbcgen, but all I have is deployment descriptors and not sure how do I handle this.
    If I create a foreign jndi provider, how do I replace the details in my weblogic-ejb-jar.xml?
    Please help.
    Thanks
    Hari.
    Edited by: rihem09 on Nov 10, 2009 6:55 PM

    Check out this page.
    http://objectmix.com/weblogic/537901-unable-find-endpointfinder.html
    글 수정: user6407983

  • [b]EJB unable to find my Home interface-javax.naming.NameNotFoundException[

    I am pretty new to J2ee so help me out with these basics
    I had deployed my application at college which worked exactly but when I deployed it at my home, it got deployed well but its returning a error message when create is called. Also i had used mssql for jdbc connection but haven't set the j2ee_classpath, pls help me how to find jdbc drivers .jar file. Does j2ee_classpath has anything to do with my error.All other paths are intact.
    Help me soon, i have to hurry up my proj...
    Advanced Thanks To Your Good Heart.
    - Suresh Kumar.R
    coding snippet -->****Down
         public AccountBean()
              try
                   Context ic=new InitialContext();
                   java.lang.Object objref=ic.lookup("java:comp/env/ejb/Account");
                   accountHome=(AcHome)PortableRemoteObject.narrow(objref,AcHome.class);
              catch(Exception re)
                   System.err.println("Couldn't locate Account Home");
                   re.printStackTrace();
              reset();
    ********Error :********
    Couldn't locate Account Home
    javax.naming.NameNotFoundException: Account not found
    <<no stack trace available>>ack trace available>>

    yes Everything you say is right in my prog. but it still does n't works.
    i haven't set my j2ee_classpath & does it have anything to do with my error.
    if so, where to find the drivers(MS-SQL) .jar file.
    Thank You for Your reply
    -Suresh Kumar.R

  • Java -jar application.jar not finding file?

    I have an application program that contains the
    following two lines of code:
    FileInputStream sf = new FileInputStream "CustomWorld.ini");
    settings.load(sf);
    and when I run it as:
    java application
    it runs fine but if I run it as:
    java -jar -classpath .;application.jar application.jar
    it can't find the "CustomWorld.ini" file. Why is that
    and how can I fix it?
    Many thanks for your help.
    PS: to create the jar file I used:
    jar -cvfm application.jar application.mf application.class CustomWorld.ini

    Once your CustomWorld.ini file is in the jar, you can no longer access it directly with a FileReader. JDK 1.1 included resource locators to java.lang.Class...
    URL url = application.class.getResource("/CustomWorld.ini");
    if (url != null) { // resource was found
       InputStream in = url.openStream();
       settings.load(in);
    } else {
       // fail gracefully or use defaults
    }Note that the CustomWorld.ini file will need to be in the classpath or the root folder of the jar file for this to work.
    Regards,
    -Troy

  • Vendor data to XML local file

    Hello all,
    I am looking for a way to create a background job able to generate or update regularly a xml (or csv or xls) local file containing all my vendors data. I think transaction MDM_CLNT_EXTR on object CREDITOR_EXTRACT can be a good start for this, but I can not generate a local file with this.... Do you have any idea to get to this result?
    Thanks a lot for your kind help,
    R.L.

    Hi,
    Using MDM_CLNT_EXTR you can not generate a local file. This extracts data from source system and sends to PI.  If you want local file then you can choose the following  options:
    1. Execute MDM_CLNT_EXTR. this will create an XML message and will try to send to PI using Proxy framework. Go to transaction SXMB_MONI in you system and download the XML message.
    2. Else, you can go to the transparent table for vendor data and can export it in an Excel file from the table.
    Note: If you have PI system in your landscape then You can also automate the process by configuring PI interface.
    Best Regards,
    Shiv

Maybe you are looking for