Ejb ACL updating

Hey folks,
I'm wondering how ejb security properties are updated at runtime.
I've defined security-roles and principals in the weblogic-ejb-jar
descriptor and assigned roles in the ejb-jar descriptor. This much
is working fine. Using the console I can add the principals to
the default Realm but I can't add new role/groups to the ejb method
acl. Is this do able? If so can it be done with the console.
Thanks,
all help is greatly appreciated
Geordie

Geordie,
Today, this is done by modifying the deployment descriptor and
redeploying the bean. I think there are plans to make this better in a
future release.
Geordie wrote:
Hey folks,
I'm wondering how ejb security properties are updated at runtime.
I've defined security-roles and principals in the weblogic-ejb-jar
descriptor and assigned roles in the ejb-jar descriptor. This much
is working fine. Using the console I can add the principals to
the default Realm but I can't add new role/groups to the ejb method
acl. Is this do able? If so can it be done with the console.
Thanks,
all help is greatly appreciated
Geordie--
Tom Mitchell
[email protected]
Very Current Stoneham, MA Weather
http://www.tom.org

Similar Messages

  • EJB ACLs and permissions, help needed urgently

    Hello,
    I am using WL6.1. I need to use weblogic.security.acl.Security.checkPermission
    to check if a user has permission to acess an EJB method. I know one can call
    the method and check the exception to see yes or no. But that requires knowing
    the method signature (parameters and return types etc.).
    I read the documentation and here is what I got:
    ACLs and permissions for WebLogic EJBs differ from ACLs and permissions for other
    kinds of WebLogic Server resources in the following ways:
    1. EJB ACLs are configured in the access control properties of the EJB's deployment
    descriptor.
    2. Permissions are granted on individual methods of a bean; there are no predefined
    permissions.
    3. Permissions on EJBs are granted to Roles, which map to groups in WebLogic Server.
    So if I read it correctly:
    1. One does not need to use WL console to configure EJB ACLs? If otherwise, how
    do we do it?. There is no documentation for it.
    2. What is the ACLName to use when I call the method weblogic.security.acl.Security.checkPermission(java.security.Principal
    principal, java.lang.String aclName,
    java.security.acl.Permission permission,
    char sep)?
    I tried with JNDI name and EJB name and nothing seems to work.
    Can anyone help me out?
    Thanks.
    Ling Wang

    It all depends on where do you want to keep your ACLs and the rest of security.
    Simplest will be fileRealm, but it has limited capability (10k ACLs I recall).
    You do not heed console to set it up. Here is an excert from ACL file:
    acl.read.OT_INTEGRATIONOBJREF=everyone
    acl.read.OT_ORGTRANSPORT=OrgAdmin,AppAdmin
    acl.read.OT_ORGUNITOFMEASURE=OrgAdmin,AppAdmin
    # from nonWorkflowEvents.template
    acl.execute.ET_QUERY=everyone
    acl.execute.ET_BATCH=everyone
    read/execute is action. Caps keep resource (name). On the right hand is a list
    of roles. The security call will be lokking like:
    boolean result = Security.hasPermission("ET_BATCH",
    new PermissionImpl("read"), '.');
    It does not throw, just returns a boolean.
    Now, this is all about programmatic security. If you are up to declarative, you
    need to assign role names to method names in deployment descriptor of your bean
    and map them to actual roles.
    Also you may have problems while asking security question about another principal
    (nto the one currently logged in). Not that it does not work -- just needs caution.
    Hope it helps.
    "Ling Wang" <[email protected]> wrote:
    >
    Hello,
    I am using WL6.1. I need to use weblogic.security.acl.Security.checkPermission
    to check if a user has permission to acess an EJB method. I know one
    can call
    the method and check the exception to see yes or no. But that requires
    knowing
    the method signature (parameters and return types etc.).
    I read the documentation and here is what I got:
    ACLs and permissions for WebLogic EJBs differ from ACLs and permissions
    for other
    kinds of WebLogic Server resources in the following ways:
    1. EJB ACLs are configured in the access control properties of the EJB's
    deployment
    descriptor.
    2. Permissions are granted on individual methods of a bean; there are
    no predefined
    permissions.
    3. Permissions on EJBs are granted to Roles, which map to groups in WebLogic
    Server.
    So if I read it correctly:
    1. One does not need to use WL console to configure EJB ACLs? If otherwise,
    how
    do we do it?. There is no documentation for it.
    2. What is the ACLName to use when I call the method weblogic.security.acl.Security.checkPermission(java.security.Principal
    principal, java.lang.String aclName,
    java.security.acl.Permission permission,
    char sep)?
    I tried with JNDI name and EJB name and nothing seems to work.
    Can anyone help me out?
    Thanks.
    Ling Wang

  • EJB Error updating table

    I am getting Error while updating a table ..the error message is
    JBO-29000: Unexpected exception caught javax.ejb.EJBException, msg=Transaction was rolled back. java.lang.NullPointerException; nested exception is java.lang.NullPointerException.
    Transaction was rolled back: java.lang.NullPointerException; nested exception is java.lang.NullPointerException.
    I have a CMP for a table. This beans use Data Transfer Objects also to retain the session values. To update the Database and also to fetch the value.
    When updating from the form DTO gets updated..but not the actual table.
    Can somebody let me know why and how to fix this
    Thanks in advance

    Transaction was rolled back: java.lang.NullPointerException
    Is a value added for a NOT NULL column null?

  • Stateless EJB 3: update / query on same ejb-method get wrong results

    I have a JavaEE application using EJB3 Stateless and DAOs with JDBC statements, simple transfer objects for data.
    The EJB business method update some questionnaire structure, after that query on database for new questionnaire (need for get autogenerated ID's on subelements: questions, sections, ...), the ejb-method code look like:
    public Questionnaire modifyQuestionnaire(Questionnaire questionnaire) {
       QuestionnaireDAO dao = getQuestionnaireDAO();        
        // Update questionnaire info
       dao.modifyQuestionnaire(questionnaire);
       // Get new info
       Questionnaire newQuestionnaire = dao.getQuestionnaireById(questionnaire.getId());
       return newQuestionnaire;
    }The problem is: when invoke "getQuestionnaireById" method on DAO at this time, I get old information ... seems as if UPDATE operations executes on DAO not has been flushed.
    After EJB method finish, the information is up to date on physical database, and after that I query the questionnaire using the same DAO "getQuestionnaireById" method, and all is up to date ! ...
    When I'm wrong?, I'm using default transaction (required) on ejb, I get the JDBC connection from a DataSource using JNDI lookup to a Container managed connection pool, I close all connection and JDBC resources ... mmm I'm using "executeBatch" for updates/inserts.
    My system:
    AppServer: SJSAS PE 9
    Database: Postgresql 8.1
    JDBC Driver: 8.2dev Build 503
    O.S.: Linux Ubuntu Dapper Drake
    Thanks any help ! .. please.
    null

    There seem a Postgresql JDBC driver problem, I change datasourceclassname from
    org.postgresql.ds.PGSimpleDataSource to org.postgresql.xa.PGXADataSource (of course, resource type: javax.sql.XADataSource) and work fine.

  • EJB Hotel Update for EJB1.1

    It would be real nice for OTN to post a complete update for the EJB Hotel Application updated for Oracle 8.1.7 and EJB 1.1 specs with XML deployment descriptors and all.
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by MM:
    It would be real nice for OTN to post a complete update for the EJB Hotel Application updated for Oracle 8.1.7 and EJB 1.1 specs with XML deployment descriptors and all.
    Thanks<HR></BLOCKQUOTE>
    Thanks for the request. I'll pass it along. The team has several projects slated already, so no promises right now.
    Regards,
    -rh
    null

  • WSDL ACL update is controled by?...What's causing the timeout?

    I am doing some small tests.
    - drop localhost.xml
    - register localhost (allow all *)
    - check wsdl call ("OK")
    - drop localhost.xml
    - register localhost (disallow via for instance 192.* --> server / network is in 10.* domain)
    - check wsdl call ("Not OK" --> ORA-24247 -- which is the expected result)
    - drop localhost.xml
    - register localhost (allow all *)
    - check wsdl call ("Not OK" --> ORA-24247 -- which is the expected result)
    While hitting "/" multiple times after 1/2 min or so the check wsdl is OK again.
    I am using two sessions
    - SYS using SQLPlus on localhost to change the entries for "localhost.xml"
    -"MARK" user account that uses SQL*Plus via a TNS connection on my client
    test is based on Testing Protocol Server  WSDL functionality ("Testing Protocol Server WSDL functionality")
    There is a timeout before I can access the oraws service again? Whats causing this?

    === SQLPlus session SYS ===
    BEGIN   DBMS_NETWORK_ACL_ADMIN.DROP_ACL(acl => 'localhost.xml'); end;
    commit;
    begin
      dbms_network_acl_admin.create_acl('localhost.xml', 'Description here', 'MARK', true, 'connect');
      dbms_network_acl_admin.assign_acl('localhost.xml', '*');
    end;
    COMMIT
    alter system register
    /=== SQL Plus Session "Mark" ===
    SQL> select  httpuritype( :url ).getXML() from dual
      2  /
    HTTPURITYPE(:URL).GETXML()
    <definitions name="SQUARE"
        targetNamespace="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:tns="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
         elementFormDefault="qualified">
          <xsd:element name="SQUAREInput">
            <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="PARM-NUMBER-INOUT" type="xsd:double"/>
                </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
          <xsd:element name="SQUAREOutput">
            <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="PARM" type="xsd:double"/>
                </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
       </xsd:schema>
      </types>
      <message name="SQUAREInputMessage">
        <part name="parameters" element="tns:SQUAREInput"/>
      </message>
      <message name="SQUAREOutputMessage">
        <part name="parameters" element="tns:SQUAREOutput"/>
      </message>
      <portType name="SQUAREPortType">
      <operation name="SQUARE">
          <input message="tns:SQUAREInputMessage"/>
          <output message="tns:SQUAREOutputMessage"/>
        </operation>
      </portType>
      <binding name="SQUAREBinding"
               type="tns:SQUAREPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="SQUARE">
          <soap:operation
    soapAction="SQUARE"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="SQUAREService">
        <documentation>Oracle Web Service</documentation>
        <port name="SQUAREPort" binding="tns:SQUAREBinding">
           <soap:address
                 location="http://10.252.252.102:8080/orawsv/MARK/SQUARE"/>
         </port>
      </service>
    </definitions>
    1 row selected.==== SQLPlus session SYS ====
    BEGIN   DBMS_NETWORK_ACL_ADMIN.DROP_ACL(acl => 'localhost.xml'); end;
    commit;
    begin
      dbms_network_acl_admin.create_acl('localhost.xml', 'Description here', 'MARK', true, 'connect');
      dbms_network_acl_admin.assign_acl('localhost.xml', '192.*');
    end;
    COMMIT
    alter system register
    /==== SQLPlus session "MARK" ====
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected=== SQLPlus session "SYS" ===
    BEGIN   DBMS_NETWORK_ACL_ADMIN.DROP_ACL(acl => 'localhost.xml'); end;
    commit;
    begin
      dbms_network_acl_admin.create_acl('localhost.xml', 'Description here', 'MARK', true, 'connect');
      dbms_network_acl_admin.assign_acl('localhost.xml', '*');
    end;
    COMMIT
    alter system register
    /=== SQLPlus session "MARK" ===
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL>
    SQL> /
    ERROR:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1674
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.HTTPURITYPE", line 34
    ORA-06512: at "SYS.HTTPURITYPE", line 97
    no rows selected
    SQL> /
    HTTPURITYPE(:URL).GETXML()
    <definitions name="SQUARE"
        targetNamespace="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:tns="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/MARK/SQUARE"
         elementFormDefault="qualified">
          <xsd:element name="SQUAREInput">
            <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="PARM-NUMBER-INOUT" type="xsd:double"/>
                </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
          <xsd:element name="SQUAREOutput">
            <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="PARM" type="xsd:double"/>
                </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
       </xsd:schema>
      </types>
      <message name="SQUAREInputMessage">
        <part name="parameters" element="tns:SQUAREInput"/>
      </message>
      <message name="SQUAREOutputMessage">
        <part name="parameters" element="tns:SQUAREOutput"/>
      </message>
      <portType name="SQUAREPortType">
      <operation name="SQUARE">
          <input message="tns:SQUAREInputMessage"/>
          <output message="tns:SQUAREOutputMessage"/>
        </operation>
      </portType>
      <binding name="SQUAREBinding"
               type="tns:SQUAREPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="SQUARE">
          <soap:operation
    soapAction="SQUARE"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="SQUAREService">
        <documentation>Oracle Web Service</documentation>
        <port name="SQUAREPort" binding="tns:SQUAREBinding">
           <soap:address
                 location="http://10.252.252.102:8080/orawsv/MARK/SQUARE"/>
         </port>
      </service>
    </definitions>
    1 row selected.Message was edited by:
    Marco Gralike

  • Updating variable no. of records in a DB from JSP

    I have a page generated dynamically (by querying the DB). This page lists all the vehicles which are to be approved. The list has a column of Applcation nos., another column of the proposed Registration nos. and a check box against each row (each row has an application no and a registration no). Depending on which applications have been OKayed (which is done by checking the check box), the Database is to be updated on hitting the "submit" button. How can I do that as the no of rows selected (records) can be different each time. Also is it better to update the Databse directly from the jsp page (if it can be done) or is it better to use an EJB to do this (the jsp calls an EJB which updates the Database), in which case how is it done?
    I am a beginner so please help me out.
    Thanks & buy

    I will try to help you, but in fact I'm a newbie too (1 months of experience).
    First you'd better create an EJB that will run your statment on your server instead of your client (you will earn time).
    Otherweise you can use a resultset with an update method according to your variable type. If you choose this way be careful to set up an JDBC 2.0
    Hope this help
    STF

  • Status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException:

    Hi,
    I'm stuck on this problem since 10 days now. Please Please help.
    I'm using Jboss 4.0.5GA and ejb 2.0 While executing the last query after running the ejbStore() of the bean, it breaks,
    The error is below :
    Executing SQL: UPDATE arinpchg SET modified_date=?, doc_num=?, printing_status=? WHERE trx_num=?
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#modifiedDate] param: i=1, type=TIMESTAMP, value=2007-11-29 15:52:53.14
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#docNum] param: i=2, type=VARCHAR, value=INV297217
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#printingStatus] param: i=3, type=INTEGER, value=1
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#trxNum] param: i=4, type=VARCHAR, value=ARTRX395716
    2007-11-29 15:52:55,734 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract au.com.cams.cims.ar.data.PendingChargeResponse au.com.cams.cims.business.ejb.PendingChargeManager.processPendingCharges(au.com.cams.cims.ar.data.PendingChargeRequest,au.com.cams.cims.core.data.DUser) throws au.com.cams.cims.core.util.StoredProcedureFailedException,au.com.cams.cims.core.util.UpdateFailedException,java.rmi.RemoteException, causedBy:
    org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=MEL-LAP-XP-66/59, BranchQual=, localId=59] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=au.com.cams.cims.ar.data.ChargePK@839418b6)
    at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
         at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
         at org.jboss.ejb.Container.invoke(Container.java:954)
         at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
         at $Proxy508.processPendingCharges(Unknown Source)
         at au.com.cams.cims.ar.cmd.PendingChargeManagerCmdBean.doProcessPendingCharges(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at au.com.cams.cims.core.cmd.AbstractCmdBean.execute(Unknown Source)
         at au.com.cams.cims.core.sys.CIMSCommandBeanManager.doCommandBeanExecute(Unknown Source)
         at au.com.cams.cims.core.sys.CIMSCommandBeanManager.execute(Unknown Source)
         at au.com.singtech.saf.MainServlet.doPost(Unknown Source)
         at au.com.singtech.saf.MainServlet.doGet(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=au.com.cams.cims.ar.data.ChargePK@839418b6
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:169)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:666)
         at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:428)
         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:273)
         at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:756)
         at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:149)
         at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:295)
         at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:345)
         at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
         at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
         at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
    My entityBean:
    * Copyright 2000 by Sing Technologies Pty. Ltd.,
    * Level 11, 269 Wickham Street, Fortitude Valley, Qld 4006, Australia
    * All rights reserved.
    * This software is the confidential and proprietary information
    * of Sing Technologies Pty. Ltd. ("Confidential Information"). You
    * shall not disclose such Confidential Information and shall use
    * it only in accordance with the terms of the license agreement
    * you entered into with Sing Technologies.
    package au.com.cams.cims.ar.ejb;
    import java.sql.*;
    import javax.ejb.*;
    import au.com.cams.cims.ar.data.*;
    import au.com.cams.cims.core.data.*;
    import au.com.cams.cims.core.util.*;
    import au.com.cams.cims.core.ejb.*;
    import au.com.cams.cims.core.app.*;
    import org.apache.log4j.*;
    import javax.naming.*;
    import javax.rmi.*;
    import java.util.*;
    import java.rmi.RemoteException;
    * @stereotype EntityBean
    * @persistence Container
    * @homeInterface au.com.cams.cims.ar.ejb.ChargeHome
    * @remoteInterface au.com.cams.cims.ar.ejb.Charge
    * @primaryKey au.com.cams.cims.ar.ejb.ChargePK
    public class ChargeBean implements EntityBean {
         static private Logger log = Logger.getLogger(ChargeBean.class.getName());
    private static final String datasource = "java:ds/cims";
    private static final String chargeLineRef = "java:comp/env/ejb/au.com.cams.cims.ar.ejb.ChargeLineHome";
    // Used by the isModified extension
    private transient boolean isDirty;
    public boolean isModified() {
    return isDirty;
    /** @field Key VARCHAR(20) CIMSSchema.dbo.arinpchg.trx_num */
    public String trxNum;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.apply_to_num */
    public String applyToNum;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.terms_code */
    public String termsCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.fin_chg_code */
    public String finChgCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_code */
    public String shippingCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.posting_code */
    public String postingCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.tax_code */
    public String taxCode;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.aging_date */
    public Timestamp agingDate;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.due_date */
    public Timestamp dueDate;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.gross_amount */
    public Double grossAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_amount */
    public Double taxAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_included_amount */
    public Double taxIncludedAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.freight_amount */
    public Double freightAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_on_freight_amount */
    public Double taxOnFreightAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.net_amount */
    public Double netAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.paid_amount */
    public Double paidAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.due_amount */
    public Double dueAmount;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.trx_type */
    public Integer trxType;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.doc_num */
    public String docNum;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.doc_date */
    public Timestamp docDate;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.apply_date */
    public Timestamp applyDate;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.debtor_num */
    public String debtorNum;
    /** @field INTEGER(10) CIMSSchema.dbo.arinppyt.trx_status */
    public Integer trxStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinppyt.approval_status */
    public Integer approvalStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.printing_status */
    public Integer printingStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.posting_status */
    public Integer postingStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.hold_status */
    public Integer holdStatus;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.hold_reason */
    public String holdReason;
    /** @field VARCHAR(2000) CIMSSchema.dbo.arinpchg.notes */
    public String notes;
    /** @field VARCHAR(200) CIMSSchema.dbo.arinpchg.message */
    public String message;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.next_sequence_id */
    public Integer nextSequenceId;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_addressee */
    public String billingAddressee;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_job_position */
    public String billingJobPosition;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr1 */
    public String billingAddr1;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr2 */
    public String billingAddr2;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr3 */
    public String billingAddr3;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_locality */
    public String billingLocality;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_state */
    public String billingState;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_postcode */
    public String billingPostcode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_country */
    public String billingCountry;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_home */
    public String billingPhoneHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_business */
    public String billingPhoneBusiness;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_mobile */
    public String billingPhoneMobile;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_car */
    public String billingPhoneCar;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_fax_home */
    public String billingFaxHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_fax_business */
    public String billingFaxBusiness;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_email */
    public String billingEmail;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_email2 */
    public String billingEmail2;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_website */
    public String billingWebsite;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_addressee */
    public String shippingAddressee;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_job_position */
    public String shippingJobPosition;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr1 */
    public String shippingAddr1;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr2 */
    public String shippingAddr2;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr3 */
    public String shippingAddr3;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_locality */
    public String shippingLocality;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_state */
    public String shippingState;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_postcode */
    public String shippingPostcode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_country */
    public String shippingCountry;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_home */
    public String shippingPhoneHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_business */
    public String shippingPhoneBusiness;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_mobile */
    public String shippingPhoneMobile;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_car */
    public String shippingPhoneCar;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_fax_home */
    public String shippingFaxHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_fax_business */
    public String shippingFaxBusiness;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_email */
    public String shippingEmail;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_email2 */
    public String shippingEmail2;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_website */
    public String shippingWebsite;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.created_date */
    public Timestamp createdDate;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.created_by */
    public String createdBy;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.modified_date */
    public Timestamp modifiedDate;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.modified_by */
    public String modifiedBy;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.print_job_num *//*
    public String printJobNum;*/
    * The container assigned reference to the entity
    private EntityContext context;
    * Sets the context of the bean
    * @param ec
    public void setEntityContext(EntityContext ec) {
    context = ec;
    // to do: code goes here.
    * Clears the context of the bean
    public void unsetEntityContext() {
    this.context = null;
    // to do: code goes here.
    * This method is called when the container picks this entity object
    * and assigns it to a specific entity object. Insert code here to
    * acquire any additional resources that it needs when it is in the
    * ready state.
    public void ejbActivate() {
    * This method is called when the container diassociates the bean
    * from the entity object identity and puts the instance back into
    * the pool of available instances. Insert code to release any
    * resources that should not be held while the instance is in the
    * pool.
    public void ejbPassivate() {
    * The container invokes this method on the bean whenever it
    * becomes necessary to synchronize the bean's state with the
    * state in the database. This method is called after the container
    * has loaded the bean's state from the database.
    public void ejbLoad() {
              System.out.println("#### VJ: ChargeBean.ejbLoad()");
    * The container invokes this method on the bean whenever it
    * becomes necessary to synchronize the state in the database
    * with the state of the bean. This method is called before the
    * container extracts the fields and writes them into the database.
    public void ejbStore() {
              System.out.println("#### VJ: ChargeBean.ejbStore()");
    this.isDirty = false;
    updateTotals();
              System.out.println("#### VJ: ChargeBean.context.getPrimaryKey(): " + context.getPrimaryKey().toString());
              System.out.println("#### VJ: ChargeBean.trxNum: " + trxNum);
    * The container invokes this method in response to a client-invoked
    * remove request. Insert code to implement any actions before the
    * bean is removed from the database.
    public void ejbRemove() throws RemoveException {
    public ChargePK ejbCreate(DCharge charge, DUser user)
    throws CreateException {
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser)");
    Connection con = null;
    ChargePK key = new ChargePK();
    if (charge == null)
    throw new CreateException("charge cannot be null");
    if (user == null)
    throw new CreateException("user cannot be null");
    try {
    // set the pk
    con = DatabaseUtilities.getConnection(log, datasource);
    this.trxNum = AppJDBCHelper.getNextTrxNum(con);
    key.trxNum = this.trxNum;
    // set other attributes
    setAttributes(charge);
    // set mod history
    this.createdDate = new Timestamp(new java.util.Date().getTime());
    this.createdBy = user.getUsername();
    this.modifiedDate = new Timestamp(new java.util.Date().getTime());
    this.modifiedBy = user.getUsername();
    } catch (GetNextIdFailedException gnife) {
    log.error("ejbCreate", gnife);
    throw new CreateException(gnife.getMessage());
    } catch (NullPointerException ex1) {
    ex1.printStackTrace();
    log.warn("ejbCreate(): " + ex1);
    throw new CreateException("ejbCreate(): " + ex1);
    } finally {
    if (con != null) DatabaseUtilities.close(con, log, "ejbCreate()");
         //System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) context.getPrimaryKey(): " + context.getPrimaryKey().toString());
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (ChargeBean) trxNum: " + trxNum);
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (ChargePK) key.trxNum: " + key.trxNum);
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (DCharge): " + charge.getTrxNum());
    return (key);
    * The container invokes this method after invoking the ejbCreate
    * method with the same arguments.
    * @param charge
    * @param user
    public void ejbPostCreate(DCharge charge, DUser user) {
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser)");
    updateTotals();
    isDirty = false;
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) context.getPrimaryKey(): " + context.getPrimaryKey().toString());
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) (ChargeBean) trxNum: " + trxNum);
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) (DCharge): " + charge.getTrxNum());
    * @exception ReadFailedException
    * @return
    public DCharge getDetails()
    throws ReadFailedException {
    DCharge charge = new DCharge();
    try {
    updateTotals();
    charge.setTrxNum(this.trxNum);
    getAttributes(charge);
    DModificationHistory history = new DModificationHistory();
    history.setCreatedDate(this.createdDate);
    history.setCreatedBy(this.createdBy);
    history.setModifiedDate(this.modifiedDate);
    history.setModifiedBy(this.modifiedBy);
    charge.setModificationHistory(history);
    } catch (InvalidDataException ex1) {
    log.warn("getDetails(): " + ex1);
    throw new ReadFailedException("getDetails(): " + ex1.toString());
    } catch (NullPointerException ex2) {
    log.warn("getDetails(): " + ex2);
    throw new ReadFailedException("getDetails(): " + ex2.toString());
    return (charge);
    * @exception ReadFailedException
    * @return
    public DCharge getAllDetails()
    throws ReadFailedException {
    DCharge charge = null;
    try {
    // get non dependant object data
    charge = getDetails();
    // declare and init search home ejbs
    Context ctx = new InitialContext();
    // used for searching
    ChargePK chargePK = new ChargePK();
    chargePK.trxNum = this.trxNum;
                   System.out.println("#### VJ: ChargeBean.getAllDetails() chargePK.trxNum(): " + chargePK.trxNum);
                   System.out.println("#### VJ: ChargeBean.getAllDetails() charge.getTrxNum(): " + charge.getTrxNum());
    // load the charge line items
    try {
    Object obj = ctx.lookup("java:comp/env/ejb/au.com.cams.cims.ar.ejb.ChargeLineSearchHome");
    ChargeLineSearchHome chargeLineSearchHome = (ChargeLineSearchHome) PortableRemoteObject.narrow(obj, ChargeLineSearchHome.class);
    ChargeLineSearch chargeLineSearch = chargeLineSearchHome.create();
    System.out.println("ChargePK: " + chargePK.trxNum);
    charge.setLineItems(chargeLineSearch.searchByCharge(chargePK));
    } catch (NamingException ne) {
    log.warn("getAllDetails(): couldn't lookup ChargeLineSearchHome " + ne.toString());
    } catch (InvalidDataException ide) {
    log.warn("getAllDetails(): couldn't set ChargeLineSearchHome " + ide.toString());
    } catch (SearchFailedException sfe) {
    log.warn("getAllDetails(): search failed " + sfe.toString());
    } catch (CreateException ce) {
    log.warn("getAllDetails(): couldn't create ChargeLineSearchHome " + ce.toString());
    } catch (RemoteException re) {
    log.warn("getAllDetails(): " + re.toString());
    } catch (NamingException ex) {
    log.warn("getAllDetails(): couldn't get an initial context " + ex.toString());
    throw new ReadFailedException("getAllDetails(): " + ex.toString());
    return charge;
    * @param charge
    * @param user
    * @exception UpdateFailedException
    public void setDetails(DCharge charge, DUser user)
    throws UpdateFailedException {
              System.out.println("#### VJ: ChargeBean.setDetails(DCharge, DUser)");
    try {
    // set other attributes
    setAttributes(charge);
    updateTotals();
    // set mod history
    this.modifiedDate = new Timestamp(new java.util.Date().getTime());
    this.modifiedBy = user.getUsername();
    } catch (NullPointerException ex1) {
    log.warn("setDetails(): " + ex1);
    throw new UpdateFailedException("setDetails(): " + ex1.toString());
    * Increments the next sequenceId and returns the current sequenceId (before incrememt)
    * @exception java.rmi.RemoteException
    * @exception UpdateFailedException
    public Integer incNextSequenceId()
    throws UpdateFailedException {
    Integer nextId = null;
    try {
    int current = this.nextSequenceId.intValue();
    // make a copy of the existing id
    nextId = new Integer(current);
    // now inc it
    this.nextSequenceId = new Integer(++current);
    } catch (EJBException e) {
    log.error("incNextSequenceId(): couldn't inc next sequenceId: " + e.toString());
    throw new UpdateFailedException(e.getMessage());
    return nextId;
    * Used by setDetails, ejbCreate.
    * @param member
    protected void setAttributes(DCharge charge) {
              System.out.println("#### VJ: ChargeBean.setAttributes(DCharge)");
         this.isDirty = true;
    ARTransactionManager mgr = null;
    try {
    Context ctx = new InitialContext();
    Object obj = ctx.lookup("java:comp/env/ejb/au.com.cams.cims.ar.ejb.ARTransactionManagerHome");
    ARTransactionManagerHome mgrHome = (ARTransactionManagerHome) PortableRemoteObject.narrow(obj, ARTransactionManagerHome.class);
    mgr = mgrHome.create();
    } catch (NamingException ne) {
    log.warn("setAttributes(): couldn't lookup ARTransactionManagerHome " + ne.toString());
    throw new EJBException(ne.toString());
    } catch (CreateException ce) {
    log.warn("setAttributes(): couldn't create ARTransactionManagerHome " + ce.toString());
    throw new EJBException(ce.toString());
    } catch (RemoteException ex) {
    log.error(ex.toString());
    throw new EJBException(ex.toString());
    try {
    TaxCode tc = mgr.getTaxCode(charge.getTaxCode());
    TaxAmounts amounts = ARUtilities.calculateTax(charge.getFreightAmount(), tc);
    this.taxOnFreightAmount = new Double(amounts.getAmountTax().doubleValue() - amounts.getAmountTaxIncluded().doubleValue());
    } catch (ReadFailedException rfe) {
    log.error("ReadFailedException reading tax code : " + charge.getTaxCode(), rfe);
    throw new EJBException(rfe.toString());
    } catch (RecordNotFoundException rnfe) {
    log.error("RecordNotFoundException reading tax code : " + charge.getTaxCode(), rnfe);
    throw new EJBException(rnfe.toString());
    } catch (RemoteException ex) {
    log.error(ex.toString());
    throw new EJBException(ex.toString());
              System.out.println("#### VJ: ChargeBean.setAttributes(DCharge) prior setters");
    this.applyToNum = charge.getApplyToNum();
    this.termsCode = charge.getTermsCode();
    this.finChgCode = charge.getFinanceChargeCode();
    this.shippingCode = charge.getShippingCode();
    this.postingCode = charge.getPostingCode();
    this.taxCode = charge.getTaxCode();
    this.agingDate = new Timestamp(charge.getAgingDate().getTime());
    this.dueDate = new Timestamp(charge.getDueDate().getTime());
    this.grossAmount = charge.getGrossAmount();
    this.taxAmount = charge.getTaxAmount();
    this.taxIncludedAmount = charge.getTaxIncludedAmount();
    this.freightAmount = charge.getFreightAmount();
    this.netAmount = charge.getNetAmount();
    this.paidAmount = charge.getPaidAmount();
    this.dueAmount = charge.getDueAmount();
    this.trxType = charge.getTrxType();
    this.docNum = charge.getDocNum();
    this.docDate = new Timestamp(charge.getDocDate().getTime());
    this.applyDate = new Timestamp(charge.getApplyDate().getTime());
    this.debtorNum = charge.getDebtorNum();
    this.trxStatus = charge.getTrxStatus();
    this.approvalStatus = charge.getApprovalStatus();
    this.printingStatus = charge.getPrintingStatus();
    this.postingStatus = charge.getPostingStatus();
    this.holdStatus = charge.getHoldStatus();
    this.holdReason = charge.getHoldReason();
    this.notes = charge.getNotes();
    this.message = charge.getMessage();
    this.nextSequenceId = charge.getNextSequenceId();
    DAddress billingAddress = charge.getBillingAddress();
    if (billingAddress != null) {
    this.billingAddressee = billingAddress.getAddressee();
    this.billingJobPosition = billingAddress.getPosition();
    this.billingAddr1 = billingAddress.getAddress1();
    this.billing

    I've solved this problem using JDBC.
    Thanks
    Smile
    Message was edited by:
    nsqsmile

  • Use EJBs in Webdynpro

    Dear All,
    We have the following scenareio to be achieved,
    Use Database of the WAS Java engine and table creation using NWDS. - this can be done using data dictionary
    Use EJBs Data Updation - we have created a EJB project. One ear project which can be deployed to j2ee engine.
    In webdynpro we can able to create a java bean model. But when try execute this applicaiton, it leads to null pointer exception.
    Any idea what could be the reason for this.
    Thanks,

    Thanks for your immediate reply.
    Sharing reference: sap.com/QuickCarRentalEar.
    Finished with warnings: development component 'Frames'/'local'/'LOKAL'/'0.2008.06.12.18.12.16'/'0':Caught exception during application startup from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Error occurred while starting application local/Frames and wait. Reason: Clusterwide exception: server ID 13390350:com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to prepare application ''local/Frames'' for startup. Reason=Clusterwide exception: Failed to start application ''local/Frames'': The referenced application ''sap.com/QucikCarRentalEar' can''t be started. Check the causing exception for details. Hint: Is the referenced application deployed correctly on the server?
    Any inputs?...
    Can any one throw some lights on internally how this webdynpro calls ejb and process completes.
    Thanks..

  • EJB -- events

    Hello gurus,
    I am not to sure what the standard pattern for event handling in a EJB context include.
    What I want is for diffent clients to recieve notification when some field in the database/ejb gets updated.
    Is this ususally done in the ejbCreate method?
    The different cmp fields are abstract so I dont see how to intercept the setting and getting of those.
    Maybe I need to use Message Driven Beans or something similar?
    Any ideas or pointers toward common practise and patterns are very welcome :)
    Thank you all!
    :)esper

    Maybe I need to use Message Driven Beans or something
    similar?Yes.

  • How to achive multi-line editing (CRUD) with a table-UI on a ejb-model

    Hello community,
    i'm working on an prototype. we want to migrate an existing web-application to nw 7.1 with web-dynpro as ui-technology. the old application often uses javascript-/ajax- driven table-grid-controls. this table controls allowed editing the data in it. the conrol "records" every action. for example which rows were deleted, which were updated and which were appended.
    when the user has finished editing, he simply clicks a save-button. the table-grid control then sends the changes via ajax-calls to the server.
    now i want the achive such behavior in web-dynpro (7.1)
    for getting the data to be edited, i wrote an ejb and created an ejb-model in web-dynpro. so viewing the data works fine so far. the view-controller with the table-ui-element is bound to the view-controllers context, which is mapped to the context-controller to which again a model-object is bound, which retrieves the data from the ejb.
    inserting, updating and deleting single rows with a detail-view-controller also works, using additional context nodes (again mapped to addtional model-classes for crudp.
    but i know want to have all rows and cells to be editable. the user should be able to insert, update and delete in that table without neccessarily using a detail-view-controller.
    how would you achive this? holding every creates, update, deletes in single nodes? and when clicking a button to fire the save action to go to that nodes and apply that action? Or would you create an addtional flag-attribute in the node that shows what was done with that row? after pressing save also iterating the nodes, checking for the flag and doing the appropriate actions (but this maybee is performance critical when having a lot of rows)?
    any ideas how to achieve multiple crud-operations on a context-node, viewed with a table-ui-element would be welcome.
    regards
    Matthias

    Matthias,
    Let's address your questions one by one.
    1. You can make the table cells editable by chosing 'InputField' as TableCellEditor.
    2. Since you have bound your table to 'View Context' and 'View Context' to 'Component Context', all changes made by you in table will be visible in Component Context after every round-trip to server.
    3. To modify the data in 'backend', you need to modify your 'Save' method to check for every changed element and modify the data only if element was changed by user. To see if the element has been changed by user, use [IWDNodeElement.isChangedByClient()|https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDNodeElement.html] method. This method returns true if element was changed by user - this is what you need.
    To learn more about WD Table UI element, you may want to see [this link|http://help.sap.com/saphelp_nw70/helpdata/en/eb/220a415a47f06fe10000000a1550b0/frameset.htm].   
    Hope this helps.
    Vishwas.

  • Two EJBS in a single transaction

              Hi,
              I have one ejb(ejb no.1) calling another ejb (ejb no.2) and few other methods
              having database updation.
              If any of the method gives an exception then the database changes done by ejb
              no.2 does not roll back. Why is this happening ..?
              This is a container managed transaction and have 'Required' transaction isolatin
              level. I don't have any setrollbackonly as the transaction is started at ejb no.1
              level.
              Can anyone answer my question.
              Can anybody help me about putting
              

    Are you using a TXDatasource to get your dbms connection??
              Are both ejb's updating the same dbms same connection pool.
              If container managed ejb 2 would need to call setrollback only if you
              want it to roll back and also setrollback on ejb1.
              So something like
              ejb1 - makes dbms calls all ok
              calls ejb2 ejb2 has error
              call setrollback only in ejb2
              throw exception
              If both are on the same tx then both should rollback. I suspect you
              are not using a tx datasource.
              usha wrote:
              > Hi,
              > I have one ejb(ejb no.1) calling another ejb (ejb no.2) and few other methods
              > having database updation.
              > If any of the method gives an exception then the database changes done by ejb
              > no.2 does not roll back. Why is this happening ..?
              > This is a container managed transaction and have 'Required' transaction isolatin
              > level. I don't have any setrollbackonly as the transaction is started at ejb no.1
              > level.
              >
              > Can anyone answer my question.
              > Can anybody help me about putting
              

  • Document EJB

    Hi,
    I am trying to modify a document objects property value. I am using the reference
    document managemnt system that comes with WLPS. The new value does not get written
    to the database, however when i call the same document object from a jsp it gives
    me the new value? This means that its caching the values somewhere? The documentation
    for the Document interface states
    "The reference implementation document management system included in the PersonalizationServer
    does not support creation or modification of Documents via the EJB interfaces.
    However, other implementations might." Does this mean that i cannot call setProperty
    to update the wlcs_document_metadate table. If thats the case why does it change
    the value in memory?
    Please help!
    Thanks
    --Kapil

    Whats more interesting is that if i make the following call
    DocumentManager.getContent(search,true) i do not get the cached values. This returns
    FastDocumentImp which is not a remote object but reflects current database values
    even changes made to the database directly i.e w/o using the EJB's!
    However if i make this call
    DocumentManager().getContent(search,false) i get the document remote interface
    and this returns cached values! What is even more surprising is that if i make
    a database change directly i.e w/o using the EJB , the update is not reflected
    in the Document remote object.
    Any information on this behavior will help me understand the underlying design
    and make better use of the caching etc. Are there any settings that i can play
    with for the reference document management system with regard to caching!
    Thanks,
    --Kapil
    "kapil khanna" <[email protected]> wrote:
    >
    Hi,
    I am trying to modify a document objects property value. I am using the
    reference
    document managemnt system that comes with WLPS. The new value does not
    get written
    to the database, however when i call the same document object from a
    jsp it gives
    me the new value? This means that its caching the values somewhere? The
    documentation
    for the Document interface states
    "The reference implementation document management system included in
    the PersonalizationServer
    does not support creation or modification of Documents via the EJB interfaces.
    However, other implementations might." Does this mean that i cannot call
    setProperty
    to update the wlcs_document_metadate table. If thats the case why does
    it change
    the value in memory?
    Please help!
    Thanks
    --Kapil

  • ACL or VLAN Mappings

    Good afternoon,
    We have several VLANs and would like to restrict traffic on some of them.
    For one VLAN, lets say vlan 140 we would it to drop all packets except for traffic going to / from 172.30.0.49. Is this possible? If so how? Also, would users be able to obtain DHCP / DNS queries if this rule was in place?
    Just like to get an understanding on how this can be done on our core using either ACL or vlan mappings.
    Regards,
    Mark

    Yes, the main advantages are performance and usability.
    With ACLs each document can have different security settings.
    As for performance, if you enter a query like "what document can a user read?" it requires to check all ACLs (not sure if it is still true, but I think in earlier versions ACLs were implemented as comma-separated strings, so this query was quite costly). With accounts, or security groups, the logic is much closer to relational database, so even though the queries require few OUTER JOINs, in the end they are much faster.
    As for usability, imagine a scenario like "I want to replace a person X with a person Y" - with accounts you do it in one place, with ACLs I do not know (not sure if there is anything like "mass ACL update" available).
    Note that "a large number of WLS group" should be auto-generated, ideally, in cooperation with an IDM solution.
    In general, I'd recommend ACLs only for very specific situations - namely, if security settings change during items lifetime (in 10g, they were a part of a component called Collaboration Manager, and it meant that a user might be granted access to an item only for the sake of a workflow, which is something you cannot do with accounts/security groups - or to be precise, you cannot do it easily).
    I have also heard, with no further details, that recently ACLs were redesigned, so some statements above might become obsolete.

  • Update OID within a Transaction

    I have data in an Oracle Internet Directory that I am managing from a J2EE application running under OC4J. This same application also manages data in an Oracle Database. I would like to be able to write code (preferable an EJB) that updates data in both locations atomically. Does anyone have a good suggestion for how to do this?
    Thanks in advance
    Chris Sargent
    [email protected]

    repost -- anyone?

Maybe you are looking for

  • GTX Titan in After Effects & Premiere CS6

    GTX Titan Superclocked now running in OS X 10.8.3 using the latest NVIDIA Web Driver (313.01.01f03) and CUDA Driver Version 5.0.59. I've modified both the "cuda_supported_cards.txt" file for Premiere Pro CS6 (6.0.2) and the "raytracer_supported_cards

  • Adobe flash 9

    I have vista (ba humbug) and can not get abobe flash 9 to install..I can't even find the install now button to push..there is no support at all for this..if it is going to be required to use on all of these websites then they need to make it much eas

  • Change Initial Page of E 6.0 SP14

    Hello, we want to change the initial page of the EP 6.0 SP14 (http://<host>:50100/irj/portal). We want to change the image, disable the "Register now", I mean the anomymous user, and the disable the support page. How can we d this? Is there I iview o

  • Whenever my new iMac updates or is shutdown, I lose all the Bookmarks that I've created in Safari are gone.  Anyone know how to prevent this?

    Several times now I have created a Bookmark list in Safari but everytime the iMac updates the software, or I shut the computer down, I lose all the Bookmarks.  Only the pre-installed Bookmarks remain.  Does anyone know how to keep this from happening

  • Deploying TitleQueries EJB

    I get the following error: Verifying Deployment Descriptor...oracle.aurora.server.tools.sess_iiop.ToolsException: The declared method does not exist in either the Home or Remote interface: public void setConnection(java.sql.Connection) throws java.la