Cure Your Errors

Fix Windows Errors & Optimize Your System

Windows/Mac OS/Linux
Support Guide

Home

How to show custom error message in WebADI Excel template?

Hi,
I've  created a custom Web ADI integrator and associated it with a 'Procedure' based custom interface.
WebADI Interface API Returns is set to  "Error Message".
I'm using  raise_application_error(-20001, "Actual Error Message") for invalid rows,but custom error message from PL/SQL  is not populated on the excel template.
Instead it is showing "SQL exception occurred during PL/SQL upload".
Am I missing anything? How to show custom error message from Pl/SQL procedure to WebADI Excel template?
TIA
Narasimha

The custom API errors are visible in the BNE log but not on the Excel.
BNE Log=>
12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Exception while uploading to PL/SQL API.  Error Code: 20001, Message: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
ORA-06512: at line 1
12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Stack trace: java.sql.SQLException: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
ORA-06512: at line 1
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
  at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
  at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
  at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
  at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
  at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
  at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
  at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550)
  at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4710)
  at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
  at oracle.apps.bne.integrator.upload.BnePLSQLUpload.doUpload(BnePLSQLUpload.java:284)
  at oracle.apps.bne.integrator.upload.BneSAXUploader.processDeepestLevel(BneSAXUploader.java:2346)
  at oracle.apps.bne.integrator.upload.BneSAXUploader.startElement(BneSAXUploader.java:1182)
  at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:181)
  at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
  at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
  at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
  at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:234)
  at oracle.apps.bne.integrator.upload.BneUploader.processUpload(BneUploader.java:301)
  at oracle.apps.bne.integrator.upload.BneAbstractUploader.processUpload(BneAbstractUploader.java:114)
  at oracle.apps.bne.integrator.upload.async.BneAsyncUploadThread.run(BneAsyncUploadThread.java:140)
12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 WARNING        BneOracleWebAppsContext.getTimeZone CLIENT_TIMEZONE_ID has not been set
12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 ERROR          BneOracleWebAppsContext.getExtraJDBCConnection recieved the same connection as the base connection.  There may be transaction problems.
How to show the same error in the excel template?
Here is the package:
CREATE OR REPLACE PACKAGE BODY APPS.XXPO_COSTFACTS_WEBADI_PKG
AS
   PROCEDURE upload_data (
                          P_CONTAINER_ID IN VARCHAR2
                        , P_SAIL_DATE IN DATE
                        , P_PO_NO IN VARCHAR2                     
                         ) IS
    --declare
    lv_err_msg      VARCHAR2(240);
    lf_err_flag     NUMBER := 0;
    ln_temp         NUMBER;
    BEGIN
    --------------------- checking for mandatory parameters---------------------------
      IF (P_CONTAINER_ID IS NULL) THEN
         lf_err_flag := 1;
         lv_err_msg := lv_err_msg||'-'||'Please enter CONTAINER_ID - ';
      END IF;
      -------------Validation for Sail Date Format----------------------
      IF (P_SAIL_DATE IS NULL) THEN
         lf_err_flag := 1;
         lv_err_msg := lv_err_msg || ' ' || 'Enter Sail Date - ';
      ELSE
         BEGIN
            SELECT 1
              INTO ln_temp
              FROM DUAL
             WHERE P_SAIL_DATE =  TO_DATE (TO_CHAR (P_SAIL_DATE, 'DD-MON-YYYY'), 'DD-MM-YYYY');
         EXCEPTION
            WHEN NO_DATA_FOUND THEN
               lf_err_flag := 1;
               lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format';
            WHEN OTHERS THEN
               lf_err_flag := 1;
               lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format'|| SQLERRM;
         END;
      END IF;
      -------------Validation for PO_Number----------------------
      IF (P_PO_NO IS NULL) THEN
         lf_err_flag := 1;
         lv_err_msg := lv_err_msg || ' ' || 'Enter PO_NO - ';
      ELSE
         BEGIN
            SELECT count(1)
              INTO ln_temp
              FROM PO_HEADERS
             WHERE Attribute4 =  P_PO_NO;
         EXCEPTION
            WHEN NO_DATA_FOUND THEN
               lf_err_flag := 1;
               lv_err_msg := lv_err_msg || ' No Oracle PO for Biceps PO#'||P_PO_NO;
            WHEN OTHERS THEN
               lf_err_flag := 1;
               lv_err_msg := lv_err_msg || ' Error getting the Oracle PO for Bicpes PO#'||P_PO_NO||' Error-' || SQLERRM;
         END;
      END IF;
     -----------------------Insert Record----------------------------
     IF lv_err_msg is NULL THEN
     BEGIN
         INSERT
          INTO XXP2P_HW_COST_FACTORS_STG
                 CONTAINER_ID
                ,SAIL_DATE
                ,PO_NO
                , ERROR_FLAG
                , ERROR_MSG
               ,CREATED_BY
                ,CREATION_DATE
                ,LAST_UPDATED_BY
                ,LAST_UPDATE_DATE
                ,LAST_UPDATE_LOGIN              
            VALUES
                 P_CONTAINER_ID
                ,P_SAIL_DATE
                ,P_PO_NO              
                ,lf_err_flag
                ,lv_err_msg
              ,FND_GLOBAL.USER_ID
                , trunc (sysdate)
                ,FND_GLOBAL.USER_ID
                , trunc (sysdate)
                ,FND_GLOBAL.LOGIN_ID              
              --  commit;
              DBMS_OUTPUT.put_line
                '-' || 'After ap_invoices_interface'
        EXCEPTION
        WHEN OTHERS THEN
          ROLLBACK;
          lf_err_flag := 1;
          lv_err_msg  := lv_err_msg || ' ' || 'error loading CONTAINER_ID-' || P_CONTAINER_ID || SQLERRM;
          raise_application_error(-20001, lv_err_msg);
        END;
    ELSE
          raise_application_error(-20001, lv_err_msg);
    END IF;
  END upload_data;                        
END XXPO_COSTFACTS_WEBADI_PKG;

Solution

1. Download & Run DLLEscort - Download Now

2. Click 'Start Scan' to analyze your System.

3. Click 'Fix Errors' and you're done!

 

Related Content

HZ_CUST_ACCOUNT_SITE_V2PUB.update_cust_site_use fails with no customer


Hyundai LCD monitor won't work with OS9


Hyphenation not working for Russian language


Hyphenation & text-align:justify in PDF's with CFDOCUMENT


Hypervisor: Create Standalone Real-Time Application (Error at deploying: File not found)


Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?


HyperTerminal sees a COM port but VISA does not


Hyperlinks, how can I zoom in on part of a page on a pdf.


Hyperlinks wont open .pdf  on local machine


Hyperlinks to XLS, DOC, and PDF files that are included in a .chm file work intermittently.


Hyperlinks to new window in CF Report Builder


Hyperlinks on master pages not working after distilling (InDesign CS4)


Hyperlinks not working properly in PDF, converted by Nuance PDF converter


Hyperlinks not working in PDF from ID


Hyperlinks not working in PDF created from Word


Hyperlinks not working in PDf created from Keynote '08


Hyperlinks not working in cc 2014


Hyperlinks not working in adobe acrobat 7.0 browser control type library 1.0


Hyperlinks not working correctly when converting word doc to Web Page, Filtered


Hyperlinks not saved correctly in PDF and Excel


Hello,
I have a Nokia N81 and I want to setup SIP on it, using my VoipBuster account.
I've successfully configured this account a thousand times on different systems, but it seems impossible to get it to work with my Nokia phone, even after following the HOWTOs everybody reported to work with their phones:
http://www.poromenos.org/node/74
http://forums.whirlpool.net.au/forum-replies-archive.cfm/751303.html
I am 200% sure that I've entered the details correctly and added the relevant profile in "Tools -> Settings -> Connection -> Internet Tel.", but when I go to "Tools -> Connectivity -> Internet Tel.", select my home network and try to connect, I get this error message: "Unable to connect to the connection network". And if I try to call a number via "Internet call", I get "Internet telephone service not available".
What may be going wrong? Does this /smartphone/ store error logs like operating systems do (they may help to find the problem)?
The other weird thing I've noticed is that the phone *always* overrides "Transport Type" to "Auto" in both the proxy and registrar sections. I've tried many times to set it to UDP, but it always sets it to "Auto".
Just in case: I can use this account with the software I have installed on my computer (from the same network) and my Nokia phone has no problem to access the Internet via my home network.
Thanks in advance.
Message Edited by gnarea on 15-Sep-2008 05:45 PM

Rusty with CoolEdit / Audtion 1.0. Newbie with CS6 trial.
I've got a lot of human speech tracks to clean up. Previously, I used the scripting capability of Audition 1.0 with the following "chain of effects":
Convert to mono + 22050 hz
Normalize to 90%
ClickFix plug-in
Noise reduction
Truncate long silences
Amplitude + Dynamics processing to "Level"
Re-normalize to 90%
Add 2 sec of silence at end
Output as 24kbps / 22050 .mp3
My understanding is that Audition CS6 stopped supporting "scripts" several versions back. Bummer. My speculation is that the equivalent can be accomplished with the "Effects Rack" + "Batch Process". Or not?
I'd appreciate a link to a tutorial or article that discusses "best practices" to accomplish the equivalent of "Scripts".

HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
by Steve Muench
Overview
BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
public void createDepartment(int id, String name, String loc) throws AppException
AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
Creating the Stateless Session Bean
We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
package com.example;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
public interface StatelessSampleEJB extends EJBObject {
  void createDepartment(int id, String name, String loc)
  throws RemoteException,AppException;
}Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
package com.example;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class StatelessSampleEJBBean implements SessionBean {
  public void ejbCreate(){}
  public void ejbActivate(){}
  public void ejbPassivate(){}
  public void ejbRemove(){}
  public void setSessionContext(SessionContext ctx){
  public void createDepartment(int id, String name, String loc) 
  throws AppException {
    // TODO: Implement method here
}We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
<ejb-jar>
   <enterprise-beans>
      <session>
         <description>Session Bean ( Stateless )</description>
         <display-name>StatelessSampleEJB</display-name>
         <ejb-name>StatelessSampleEJB</ejb-name>
         <home>com.example.StatelessSampleEJBHome</home>
         <remote>com.example.StatelessSampleEJB</remote>
         <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
      </session>
   </enterprise-beans>
</ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
<ejb-jar>
   <enterprise-beans>
      <session>
         <description>Session Bean ( Stateless )</description>
         <display-name>StatelessSampleEJB</display-name>
         <ejb-name>StatelessSampleEJB</ejb-name>
         <home>com.example.StatelessSampleEJBHome</home>
         <remote>com.example.StatelessSampleEJB</remote>
         <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
      </session>
   </enterprise-beans>
   <assembly-descriptor>
      <container-transaction>
         <method>
            <ejb-name>StatelessSampleEJB</ejb-name>
            <method-name>createDepartment</method-name>
            <method-params>
               <method-param>int</method-param>
               <method-param>java.lang.String</method-param>
               <method-param>java.lang.String</method-param>
            </method-params>
         </method>
         <trans-attribute>Required</trans-attribute>
      </container-transaction>
   </assembly-descriptor>
</ejb-jar>
Aggregating a BC4J Application Module
With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
// Place to hold onto the aggregated appmodule instance
transient private ApplicationModule _am  = null;
// Remember the SessionContext that the EJB container provides us
private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
// JNDI resource name for the J2EE datasource to use
private static final String DATASOURCE = "jdbc/OracleCoreDS";
// Fully-qualified BC4J application module name to aggregate
private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
public void ejbCreate() throws CreateException {
  try {
    // Setup a hashtable of environment parameters for JNDI initial context
    Hashtable env = new Hashtable();
    env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
    // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
    // Create an initial context, using this hashtable of environment params
    InitialContext ic = new InitialContext(env);
    // Lookup a home interface for the application module
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
    // Using the home, create the instance of the appmodule we'll use
    _am = home.create();
    // Register the BC4J factory to handle EJB container-managed transactions
    registerContainerManagedTransactionHandlerFactory();
  catch(Exception ex) {
     ex.printStackTrace();
    throw new CreateException(ex.getMessage());
}and ejbRemove() looks like this:
public void ejbRemove() {
  try {
    // Cleanup any appmodule resources before getting shutdown
    _am.remove();
  catch(JboException ex) { /* Ignore */ }
}The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
private void registerContainerManagedTransactionHandlerFactory() {
  SessionImpl session = (SessionImpl)_am.getSession();
  session.setTransactionHandlerFactory(
    new TransactionHandlerFactory() {
      public TransactionHandler  createTransactionHandler() {
        return new ContainerManagedTxnHandlerImpl();
      public JTATransactionHandler createJTATransactionHandler() {
        return new ContainerManagedTxnHandlerImpl();
}The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
public void createDepartment(int id, String name, String loc)
throws AppException {
  try {
    // Connect the AM to the datasource we want to use for the duration
    // of this single method call.
    _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
    // Use the "Departments" view object member of this AM
    ViewObject departments = _am.findViewObject("Departments");
    // Create a new row in this view object.
    Row newDept = departments.createRow();
    // Populate the attributes from the parameter arguments.
    newDept.setAttribute("Deptno", new Number(id));
    newDept.setAttribute("Dname", name);
    newDept.setAttribute("Loc", loc);
    // Add the new row to the view object's default rowset
    departments.insertRow(newDept);
    // Post all changes in the AM, but we don't commit them. The EJB
    // container managed transaction handles the commit.
    _am.getTransaction().postChanges();
  catch(JboException ex) {
    // To be good EJB Container-Managed Transaction "citizens" we have
    // to mark the transaction as needing a rollback if there are problems
    _ctx.setRollbackOnly();
    throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
  finally {
    try {
      // Disconnect the AM from the datasource we're using
      _am.getTransaction().disconnect();
    catch(Exception ex) { /* Ignore */ }
Building a Test Client
With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import com.example.StatelessSampleEJB;
import com.example.StatelessSampleEJBHome;
public class SampleStatelessSampleEJBClient {
  public static void main(String [] args) {
    SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
       new SampleStatelessSampleEJBClient();
    try {
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,
              "com.evermind.server.rmi.RMIInitialContextFactory");
      env.put(Context.SECURITY_PRINCIPAL, "admin");
      env.put(Context.SECURITY_CREDENTIALS, "welcome");
      env.put(Context.PROVIDER_URL,
              "ormi://localhost:23891/current-workspace-app");
      Context ctx = new InitialContext(env);
      StatelessSampleEJBHome statelessSampleEJBHome =
           (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
      StatelessSampleEJB statelessSampleEJB;
      // Use one of the create() methods below to create a new instance
      // statelessSampleEJB = statelessSampleEJBHome.create();
      // Call any of the Remote methods below to access the EJB
      // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
    catch(Throwable ex) {
      ex.printStackTrace();
}We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
// Use one of the create() methods below to create a new instance
statelessSampleEJB = statelessSampleEJBHome.create();
// Call any of the Remote methods below to access the EJB
statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
System.out.println("Created department 13");
statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
System.out.println("Created department 14");
try {
  // Try setting a department id that is too large!
  statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
catch (AppException ax) {
  System.err.println("AppException: "+ax.getMessage());
}Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
Created department 13
Created department 14
AppException: Error creating dept 23456
JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
Troubleshooting
One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
<data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="OracleDS"
    location="jdbc/OracleCoreDS"
    xa-location="jdbc/xa/OracleXADS"
    ejb-location="jdbc/OracleDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@localhost:1521:ORCL"
    inactivity-timeout="30"
/>This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
Conclusion
Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
Code Listing
The full code listing for the SampleStatelessEJB bean implementation class looks like this:
* StatelessSampleEJB
* Illustrates how to use an aggregated BC4J application module
* in local mode as part of the implementation of a stateless
* EJB session bean using container-managed transaction.
* HISTORY
* smuench/dmutreja 14-FEB-2002 Created
package com.example;
import oracle.jbo.*;
import oracle.jbo.server.*;
import javax.ejb.*;
import oracle.jbo.domain.Number;
import oracle.jbo.common.PropertyConstants;
import java.util.Hashtable;
import javax.naming.InitialContext;
import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
public class StatelessSampleEJBBean implements SessionBean {
  // JNDI resource name for the J2EE datasource to use
  private static final String DATASOURCE = "jdbc/OracleCoreDS";
  // Fully-qualified BC4J application module name to aggregate
  private static final String APPMODNAME = "com.example.hr.HRApp";
  // Place to hold onto the aggregated appmodule instance
  transient private ApplicationModule _am  = null;
  // Remember the SessionContext that the EJB container provides us
  private           SessionContext    _ctx = null;
  public void ejbCreate() throws CreateException {
    try {
      // Setup a hashtable of environment parameters for JNDI initial context
      Hashtable env = new Hashtable();
      env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
      env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
      env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
      // Create an initial context, using this hashtable of environment params
      InitialContext ic = new InitialContext(env);
      // Lookup a home interface for the application module
      ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
      // Using the home, create the instance of the appmodule we'll use
      _am = home.create();
      // Register the BC4J factory to handle EJB container-managed transactions
      registerContainerManagedTransactionHandlerFactory();
    catch(Exception ex) {
       ex.printStackTrace();
      throw new CreateException(ex.getMessage());
  public void ejbActivate(){}
  public void ejbPassivate(){}
  public void ejbRemove(){}
  public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
  public void createDepartment(int id, String name, String loc)
  throws AppException {
    try {
      // Connect the AM to the datasource we want to use for the duration
      // of this single method call.
      _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
      // Use the "Departments" view object member of this AM
      ViewObject departments = _am.findViewObject("Departments");
      // Create a new row in this view object.
      Row newDept = departments.createRow();
      // Populate the attributes from the parameter arguments.
      newDept.setAttribute("Deptno", new Number(id));
      newDept.setAttribute("Dname", name);
      newDept.setAttribute("Loc", loc);
      // Add the new row to the view object's default rowset
      departments.insertRow(newDept);
      // Post all changes in the AM, but we don't commit them. The EJB
      // container managed transaction handles the commit.
      _am.getTransaction().postChanges();
    catch(JboException ex) {
      // To be good EJB Container-Managed Transaction "citizens" we have
      // to mark the transaction as needing a rollback if there are problems
      _ctx.setRollbackOnly();
      throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
    finally {
      try {
        // Disconnect the AM from the datasource we're using
        _am.getTransaction().disconnect();
      catch(Exception ex) { /* Ignore */ }
  private void registerContainerManagedTransactionHandlerFactory() {
    SessionImpl session = (SessionImpl)_am.getSession();
    session.setTransactionHandlerFactory(
      new TransactionHandlerFactory() {
        public TransactionHandler createTransactionHandler() {
          return new ContainerManagedTxnHandlerImpl();
        public JTATransactionHandler createJTATransactionHandler() {
          return new ContainerManagedTxnHandlerImpl();

Until a few days ago, I didn't care about the SSH extension for PHP. I didn't have a use for it. Why should I care. Then I discovered that Wordpress' autoupdate feature wouldn't work without it (if you use SFTP, like I do). Oh. Maybe I need this thing.
Problem 1) It isn't installed by default by Apple.
Problem 2) All the online help says to use PECL to install it. Also not installed.
Problem 3) Everything else that could possibly go wrong.
So, I'm not guaranteeing this will work for you, or not destroy your server completely, but it worked for me. So...um...beware.
The end result we're looking for is a nice little ssh2.so extension for php to look at. Now, let's try to get there:
With all this talk of PECL, I decided to grab PEAR (which seems to no longer be a part of the OS) and install it. So I downloaded go-pear from: http://pear.php.net/go-pear and installed that.
The only thing you need to change is the install directory (/usr/local is what I used, I think).
Next comes the libssh libraries. These are required. Sadly, I could not install these from source. The reason? I received many errors about libz.dylib being of the wrong architecture. Weird, because I believe that came with the system. So it's Apple's fault if it's not i386 and 64bit. Darn.
So I did a crazy thing and installed it through a port. Well, I backed up all of my existing libssh and libssl files before I did anything. Then I used Macports to install recent versions of those into /opt/local/lib
Once that was done, I copied them over to /usr/local/lib and then crossed my fingers.
Get the source from: http://www.libssh2.org/ then configure it with:
+MACOSXDEPLOYMENTTARGET=10.6 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bindatload" ./configure --with-openssl+
make
+make install+
If that works, you're halfway done.
Download the latest PECL package for ssh2 from: http://pecl.php.net/package/ssh2
Go to the directory and do the following:
phpize
Now stop. There's a bug in php that prevents this from working properly. So we have to patch it. Yeah, I told you this process was ridiculous. Copy this: http://remi.fedorapeople.org/ssh2-php53.patch into a text file in that same ssh2 directory. Run:
+patch -p0 < patchfilename+
Now we can configure and make:
+MACOSXDEPLOYMENTTARGET=10.6 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bindatload" ./configure+
make
+make test+
+make install+
It should install a nice ssh2.so file somewhere in /usr/lib/php/extensions/
Now edit your /etc/php.ini file to include that directory for: extension_dir = /usr/lib/php/extensions/no-debug-non-zts-200xxxxxx
Also add the line: extension=ssh2.so in there somewhere.
Now restart apache:
+apachectl graceful+
And you're done. You might need to look at your phpinfo to make sure it's loaded, but Wordpress should now be happy. Hope this helps someone. Took me a few days to get it right and I may have forgotten all the steps. But this should work.
Message was edited by: Demonhood

In this tutorial, I will show you how to add startup and shutdown sounds with Openbox, a light-weight window manager. In theory, this should work with any window manager that uses a startup script (or, if you use the startx command, .xinitrc could be used for the same effect); however, I will be focusing on Openbox, so you will have to adapt these instructions for use with other window managers.
We'll start with a quick background story: I was in a "tweaking" mood a few days ago, and I figured I'd try to set up some startup and shutdown noises for use with Openbox. After a few minutes of messing around, I got it working. I searched to see if there were any tutorials like this, and since there weren't, I figured I would share my knowledge--that's what tutorials are for, right?
NOTE: I originally posted this on ubuntuforums.org; therefore, there may be some differences (I tried to fix most of them). Even though I did this on Arch originally, I wrote it targeted toward Ubuntu users. I didn't get much of a response--there must not have been too many Ubuntu/Openbox users looking for that. Please point out any inconsistencies, and I'll fix them as soon as possible.
Now that we have that out of the way, let's get started.
Step 1: Installing the necessary application(s).
First off, we will be using a commandline program called play. It is part of the sox package, so let's install that first (you likely have most of its dependancies already).
# pacman -S sox
If you'd like, you can cd to a directory with music in it and type play name-of-sound-file.extension to test that it is working. If you don't have any files to try it on, you can do this later after downloading your desired sound files in step 3.
I also have sudo set up; you will need to set this up to run the shutdown commands from a script as I have them. There is a section in the ArchWiki that will help in setting it up if you want. As for the commands with sudo in them, you can just run them in a root terminal.
In addition to that, I will be working with obmenu, a program for editing Openbox's menu from a GUI; however, it will work just as well to edit the menu by hand. I assume you already have a preferred method of editing your menu, but if you want to try obmenu, it's only a pacman command away:
# pacman -S obmenu
Step 2: Setting up shutdown privileges.
For this section, I will be adapting a section from a great guide written by urukrama here. We're going to be running a shutdown command from a script, so we need to have it set up to work without any interaction--in this case, that means removing the need for a password for the shutdown command.
To do this, type in the following command into the terminal:
sudo visudo
This will open up the sudoers file, which is used to specifiy user permissions for actions that require root priveleges. For those of you unfamiliar with Vim (I'm with you ), just press i on your keyboard to enter interactive mode, which allows you to edit the file. Then, enter the following line at the end of the file:
%wheel ALL=NOPASSWD:/sbin/shutdown
Then press escape to exit interactive mode. Lastly, type in :wq followed by pressing enter to save and exit. Now you can use the sudo shutdown command without entering a password.
Step 3: Getting the desired sound files.
Now we come to the fun part of the guide--finding the sounds that we want.
There are plenty of startup and shutdown noises floating around the web; I went to gnome- and kde-look to check out theirs (the same are available at both sites). Here's a link to the System Sounds section at gnome-look. You can look through and download the ones that interest you; once you have listened to a few and found one that you like, go on. Just for reference, I chose the Dream pack. It fits very nicely with my current setup and theme.
Step 4: Setting up the shutdown/startup scripts.
If you haven't already (in the last step), extract the sound files from the package that they downloaded in. Then, look through the files and find the startup and shutdown noises. For me, they were titled Dream Intro.ogg and shutdown.ogg, respectively. Move these files into their own folder. I chose ~/.startup--on my Arch install, it was empty. You may want to put it into a different folder/sub-folder, preferably somewhere in your home folder. You can now remove all the other sound files--hypothetically speaking, it probably wouldn't be too hard to get other sounds (such as minimize, maximize, etc., if provided in the sounds package you chose) working with Openbox, but that is beyond the scope of this tutorial. Now, go to the folder in which you placed the startup and shutdown noises. For simplicity's sake, we're going to place the scripts in this same folder.
We're going to be making two scripts here--one for reboot and one for shutdown. Open up your text editor of choice here and enter the following line (replacing the "/path/to/file.extension" with the path to your shutdown sound):
play /path/to/file.extension && sudo shutdown -r now
For me, it looked like this:
play ~/.startup/shutdown.ogg && sudo shutdown -r now
What this does is play the sound file specified and, once that is done, moves on to the reboot process (that's what && does). Save this as reboot.sh. Now make a new file, this time for the actual shutdown. It will be the same as the first except the shutdown command will now be sudo shutdown -h now. Here's what mine looks like:
play ~/.startup/shutdown.ogg && sudo shutdown -h now
Save that one as shutdown.sh. At this point, we have completed the scripts for both shutdown commands. Next, open up your Openbox autostart script (should be in /home/<user>/.config/openbox/autostart.sh, where <user> is your username) with the text editor of your choice. You probably already have a few different things in here; if not, it doesn't really matter. Just add the following line to your autostart file (as you can see, I used quotes around this one because this file had a space in its name--you'll want to do the same. You can also use a backslash before the space):
play "/home/<user>/.startup/Dream Intro.ogg"&
Make sure you keep the ampersand (&) in tact; otherwise, the script will wait until the sound is done playing before completing the rest of the processes. I recommend that you place the sound file at the beginning of the script so that it starts first--the way I have it set up, everything is ready to go by the time the login sound ends (sooner, actually). Now that we've come this far, we're almost done.
Step 5: Adding the shutdown options to the Openbox menu.
At this point, the login sound will be working; however, we still need to set up the shutdown sounds. To do this, we will add a section to the Openbox menu that runs the two scripts we made in the last step.
Either open up obmenu or use your preferred text editor and open up menu.xml (should be in ~/.config/openbox/menu.xml). As I said, we will be adding two items: one for rebooting and another for shutting down. In obmenu, you can add a new submenu wherever you want (I chose the bottom of the menu) and name it Power (or whatever else you'd like). The first we'll add is named Restart. For the execute line, add the following:
bash /path/to/reboot.sh
For me, this path is ~/.startup/reboot.sh. As for the second, name it Shut Down and for the execute command put the following:
bash /path/to/shutdown.sh
Again, for me this is ~/.startup/shutdown.sh. Here is what the section in my obmenu looks like:
As for the pure XML, here it is (I replaced my name with <user> ):
<item label="Restart">
<action name="Execute">
<execute>bash /home/<user>/.startup/reboot.sh</execute>
</action>
</item>
<item label="Shut Down">
<action name="Execute">
<execute>bash /home/<user>/.startup/shutdown.sh</execute>
</action>
</item>
With obmenu, just save it, and your menu will be refreshed. When hand-editing the menu.xml file, you have to remember to Reconfigure Openbox (it will be in your menu unless you've removed it).
And with that, you should have working startup and shutdown sounds. You can test it by right clicking on your desktop and selecting one of your new shutdown options. You should have a sound play followed by the normal shutdown routine. Then when your computer starts back up, you will have a pleasant noise after logging on.
I hope that helped you! Please point out any errors that you see, and I'll correct them as soon as possible.

The scenario...
I have a "headless" (no monitor or input peripherals) Arch Linux computer that is connected to a local network via a wireless adapter, and accessed from other computers via SSH.
Earlier today I accidentally broke its kernel so it did not boot anymore.
Idea: Temporarily connect a monitor to the computer, boot from a live CD (like the Arch Linux install CD), then chroot into the system and fix it.
Problem: I didn't have a compatible monitor at hand.
Idea: Log in to the live CD session from another computer via SSH.
Problem: The live CD can't auto-configure the headless computer's wireless connection, and setting it up manually while working "blind" would be a major hassle. A direct LAN connection to the router wasn't available either.
Idea: Connect directly with a laptop via an Ethernet cable, and then use SSH from the laptop => This solution worked for me!
If you find yourself in a similar situation, you can follow this tutorial which describes the solution that worked for me in detail...
You need:
a copy of the Arch Linux install CD (I used the 2013-05-01 version)
an Ethernet cable
a keyboard (might be dispensable, with additional preparation)
a functional Arch Linux laptop (or other computer within physical range)
Step 1) Prepare the live CD...
I used the plain Arch Linux install iso, burnt to CD.
By creating a carefully customized version of the live CD using Archiso, you might be able to eliminate the need for steps 2 and 4 - however that's not covered in this tutorial.
Step 2) Prepare the laptop...
The laptop needs to be configured in such a way, that the live CD's attempt to automatically establish an Ethernet connection with it will succeed:
a) IP address
In my case, the Laptop's wireless adapter had an IP address in the range 192.168.1.*, connecting it to the local network and Internet via the central router 192.168.1.1.
The Ethernet connection between the laptop and the headless computer becomes a separate mini-network, for which I decided to use IP addresses in the range 192.168.0.* (note the different third number). Specifically, I set the IP address of my laptop's Ethernet card to 192.168.0.1. You can do this by running the following as root (replace "eth0" with the name of your Ethernet interface):
ip link set eth0 up
ip addr add 192.168.0.1/24 dev eth0
b) IP forwarding (optional)
While we're at it, we might as well enable IP forwarding, so that the live CD session on the headless computer will be able to directly use the laptop's outgoing Internet connection (which will make it much more convenient to install/upgrade packages during the repair session). To enable this, run the following as root (replace "eth0" and "wlan0" with the names of your laptop's Ethernet and wireless interfaces, respectively):
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
c) DHCP
The live CD will assume there's a router on the other side of the Ethernet link, and ask for an IP address via DHCP. So all we need to do, is run a dhcp server on the Laptop that will answer this request. It's surprisingly easy: Just install the package dnsmasq, and put the following in the file /etc/dnsmasq.conf (again replacing "eth0" as appropriate):
interface=eth0
dhcp-range=192.168.0.2,192.168.0.2
By setting the start & end values of dhcp-range to the same IP address, we enforce that this specific IP address will be used by the live CD on the headless computer.
Then start the daemon by running the following as root:
systemctl start dnsmasq.service
Step 3) Connect everything and boot up the live CD...
Connect the laptop and the headless computer via the Ethernet cable.
Connect the external keyboard to the headless computer.
Then put the Arch Linux install CD into the headless computer's drive, and boot. Wait a minute or so to give the CD time to load its boot menu (you should hear the CD drive spin up and settle down again). Then hit ENTER on the connected keyboard, to activate the default menu choice (which will boot straight to a live Arch Linux session with root privileges).
You can check whether it booted up and successfully initialized the Ethernet connection, by ping'ing the IP address that was specified in step 2c) from the laptop:
ping -c3 192.168.0.2
Step 4) Start the SSH server...
Unfortunately, the Arch Linux install CD doesn't automatically start its SSH server, and also it uses a randomized root password. To make SSH connections possible, you will have to use the connected keyboard to type in some stuff "blindly" (but it's simple enough):
type "passwd" (without the quotes)
type in a new password of your choice
press ENTER
type in the same password again
press ENTER
type "systemctl start sshd" (without the quotes)
press ENTER
Step 5) Connect from the laptop via SSH...
Now you can open an SSH connection, by executing the following on the laptop (when it asks for the password, enter the one you chose in step 4):
ssh [email protected]
Step 6) Profit!
Within this SSH shell on the laptop, you can now do whatever you would usually do to fix an Arch Linux system from a live CD.
You'll probably want to chroot into your Arch root partition, which is very easy thanks to the arch-chroot tool that is included on the live CD (replace "/dev/sda3" with the name of the headless computer's root partition):
mount /dev/sda3 /mnt
arch-chroot /mnt
If you set up IP forwarding as described in step 2b), then Internet access should magically work in this shell without any further configuration, so you can freely use pacman etc. inside the chroot.
Enjoy!
Last edited by sas (2013-07-26 22:17:03)

Hi Experts!
Today our SAP R/3 sent the IDoc LOIPRO to non-SAP external system, called O2P.
Now, we would like to send this IDoc (LOIPRO) to XI, and the XI sends the IDoc to the non-SAP external system.
Then, our scenario will be:
Step 1. The IDoc LOIPRO is sent from SAP R/3 to XI
Step 2. Inside the XI, this message is routing and mapping to the
IDoc LOIPRO too.
Step 3. The XI sends the IDoc LOIPRO to the O2P (non-SAP external system).
Well, until Step 2, everything is OK.
But, we are having troubles to create an IDoc Adapter receiver to O2P (external system), because the O2P is a non-SAP system.
So, how can we create the communication channel IDoc Adapter, if the receiver isn't a R/3 system ?
All information will be welcome.
Thanks a lot,
Honorato

Follow this link to the thread under Boot Camp
http://discussions.apple.com/thread.jspa?threadID=2230472&tstart=0

This is easiest to do when you have another mouse already working with the system...
1. Install your bluetooth support and service packs for XP
2. Go to Bluetooth devices from your control panel or system tray
3. Connect the Magic Mouse and wait until the machine settles down.
4. Click Add..
5. Check my device is set up and ready to be found
6. Click Next
7. Click the device from the list - it should appear as the address of the mouse (looks like a Mac address)
8. Click Next
9. Don't use a passkey
10. Wait until the bubble appears saying to click here because a device is requesting your attention (or whatever it says)
11. Pass key is 0000
12. Click Next
13. Click Finish
14. Go back to Bluetooth devices
15. Click on the device from the list
16. Click Properties
17. Give the device a reasonable name (like Magic Mouse?)
18. Click Services tab
19. Check drivers for keyboard, mice, etc (HID)
20. Click Ok.
That should be it. This was not the first bluetooth device I added, so you may need additional steps to configure bluetooth to start with, but that it is out of the scope of this guide.
As you have probably read, the left and right mouse buttons work, but the touch features (such as scrolling) do not.
I suppose this should work in a VM system on OSX, if you have drivers to pass thru the machine's bluetooth functionality.
If you have followed this steps and can't get it to work, maybe Windows is too much for you and you should buy a Mac (I haven't tried it on my Air yet, but expect the process to be much easier than this.. but then again, I already love the Air touchpad, why would I spoil it with a mouse?)

Here is a small HOWTO for getting the lowest possible DPC latencies (<100 us) on bootcamped Macbooks Pro (late 2008):
Disclaimer: I did all tests on my late 2008 Macbook Pro Unibody 2.8 GHz model with NVidia chipset and graphic. Most of the following suggestions should apply to standard Macbook models and likely older generation as well.
First of all Intel Speedstep can lead to dropouts and higher DPC latencies on small load! Unfortunately all tools that are supposed to manually switch Speedstep off don't seem to run on the late Macbooks (Pro) while on OS X you can use "Coolbook".
Your only way to make sure your processor is clocked high enough and not dynamically switching is to put up a constant load (like running your DAW pretty hot or running Prime95 at "Idle/Lowest" process Priority in the background). I will keep investigating if I can find a tool to switch Speedstep off.
Most importantly (to get rid of really bad DPC latency spikes):
Kill the process "KBDMGR.EXE"!
That's Apple's driver for controlling brightness and keyboard lighting via the function keys and setting tap options for the trackpad. It seems to have broken multithreading!
You can also change the CPU affinity of KBDMGR.EXE to CPU1 (not CPU0!) which will help decreasing DPC Latencies alot, but there will still be Audio dropouts.
Here's a small toolkit I put together that allows you to conviniently enable/disable Apple's "Boot Camp" tray application (KBDMGR.EXE) via an icon link and/or keyboard shortcut. Optionally it will switch the function of the F-Keys automatically for you depending on whether Boot Camp is loaded or not.
Furthermore it automatically turns Boot Camp's CPU priority to "Idle" and CPU affinity to CPU1 in order to turn down the bug induced DPC Latencies and prevent dropouts with Windows sounds and Media Player playback. Professional Audio users will find that only turning off Boot Camp will allow low audio latency usage. Installation instructions are included in the README.TXT for your convinience.
Boot CampED download page
Direct Download:
Boot CampED.zip - 3.3 kb
Turn off the Broadcom 802.11N WLAN driver via Device-Manager or update to the latest drivers via Microsoft Update Catalog.
Like on OS X the Airport module can lead to audio dropouts. The DPC Latencies produced by the Broadcom driver are less regular than the KBDMGR thing, alot higher in value. Best thing is to try for your own needs.
Update:Meanwhile a new Broadcom drivers was published via Microsoft's Update Catalog named "Broadcom - Network - Broadcom 4322AG 802.11a/b/g/draft-n Wi-Fi Adapter " (4322 is the chip used). This one comes with both low DPC latencies and finally the ability to use the full rate upto 300 mbit/s. Go get it! For safety you might still want to turn WLAN off during critical audio work though.
Change the graphic-card driver to "Standard VGA Driver" via Device-Manager or use RIVATUNER to enforce a fixed clock-rate and performance mode.
Update:The dynamic clock-rate switching happening with NVidia drivers in order to save power and keep temperatures low leads to extreme DPC spikes for each switch and constantly high DPC latencies when it settles in low performance 2D mode. RIVATUNER's "Enforce Performance Mode" option can be used to set the card to a fixed clock-rate. I recommend using "Low Power 3D" for audio work.
User of XP might think that they don't need this, but be aware that on XP the NVidia driver keeps running at highest clock-rates in "Performance 3D Mode" all the time. Via RIVATUNER you can switch to "Low Power 3D".
Turn off the ACPI compliant Battery driver via Device-Manager
This driver polls the battery for its current load status and produces a small, single, short spike exactly every 15 seconds. In my own tests I found that it doesn't seem to affect low latency audio performance. Furthermore turning it off will remove monitoring of your current battery status. But if you are running on power-chord anyway and want to make absolutely sure you can turn it off.
All other devices don't add much if anything to DPC latencies, but can savely be turned off if you don't need them (like Nvidia LAN, Bluetooth, Onboard High Definition Audio).
Attention: Removing the Battery while the power chord is connected results in permanently reduced CPU clock (downto the lowest clock setting possible). According to Apple this is done to prevent overloading the power-supply during heavy load as it needs the assistance of the battery from time to time.