BC4J Application Using CMSDK

Hello Experts!
I am trying to develop a BC4J Struts application that will use the CMSDK for file upload and download only (no versioning), and to take advantage of Oracle Text Search.
Does anyone have insight into the steps necessary to integrate them both. A thin JDBC connection to the database storing the meta-data in one schema is used. My thought is to create a new connection to the IFSSYS schema after the meta-data commit, to upload PDF files to the document repository. Is this even doable without sacrificing CMSDK functionality?
Succinctly, I am using BC4J for meta-data entry, then create an iFS Session; use a modified upload.jsp from WSAII to upload the PDF to a predefined folder.
I am using JDev 10.1.2.2 against the 10.1.2 Oracle App Server.
Thanking you in advance for your professionalism and expertise shown in helping me with this.
v/r
Dave
David C. Freyer
ARSC Engineering
Elizabeth City, NC 27909
252-335-6831
[email protected]

I agree with Shay that using JDeveloper 10.1.3 is your best bet.
Section 13.6, "Creating an Input Form" in the ADF Developer's Guide for Forms/4GL Developers talks about doing what you need to (however, using the 10.1.3 version).
For previous versions of JDeveloper, the best bet is to study the ADF Toy Store Demo to find the pages that are doing what you want to accomplish.
the 9.0.5 version of that demo is at:
http://www.oracle.com/technology/products/jdev/collateral/papers/10g/adftoystore.html
The 10.1.2 version of that demo is at:
http://www.oracle.com/technology/products/jdev/tips/muench/adftoystore1012/index.html

Similar Messages

  • Can I use Oralce9i database to depoly BC4J without using Ora9ias

    Oralce9i database has so many components help you develop application, for example JSP,SERVLET,I want to know when I need oracle9ias for developing,in what case I only need oracle9i database for developing including its components?

    Hi,
    BC4J applications uses EJBs internally and starting from Oracle9i Release 2 Database EJBs are going to be desupported from database. EJBs can only be deployed in OC4J component of Oracle9iAS. Hence you need Oracle9iAS for deploying BC4J applications.If you want to work around it, write your code for Java Stored Procedures and EJBs.
    It is very easy to wrap the EJB Framework around Java Stored Procedures. For design patterns it is even better, to
    think in two Frameworks!
    regards
    Debu Panda
    Oracle
    Oralce9i database has so many components help you develop application, for example JSP,SERVLET,I want to know when I need oracle9ias for developing,in what case I only need oracle9i database for developing including its components?
    Hey this won't change, because Oracle will support XML to stay firm against Microsoft .net.
    We won't loose all the nice things!!!
    Volker.

  • TIME ZONE for BC4J application

    How set correct time for BC4J application? TIME ZONE must the the same as in Windows set. In windows it set to GMT+03:00 but all BC4J applications uses GMT+01:00.

    see this thread:
    Strange Behaviour for Time Stamp With Local Time Zone

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    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();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • Custom OCS application using BC4J

    I am using the APIs for Workspaces to write an application we can use to migrate data (using BC4J) from a custom application into Workspaces. According to the documentation, any application using these APIs must run on the server, yet there is no ability to create a new OC4J on the server.
    What is the correct way for me to do this? Can I write an application which uses BC4J and deploy it to tha OCS tier?
    Thanks.

    Hi,
    Please check out this link-
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/78/9852b1c06b11d4ad310000e83539c3/frameset.htm
    Regards,
    Lekha.

  • Is it possible to use cmsdk as stanalone application.

    Is it possible to use cmsdk as stanalone application.

    You can shut down the middle tier CMSDK instance and still access the CMSDK repository using the OC4J Container provided by JDeveloper. You can write a desktop Swing program that will do the same thing.
    However, given that this works, it implies that each stand-alone user has a direct connection to the database as there is no middle tier to pool database connections. So 500 users connected with stand-alone application would require 500 database connections.
    You also will lose any agents, servers, S_Tie classes, and other server side tools. You'll not have SMB, NFS, WebDAV, etc. as these are all provided by the middle tier. You also will have no administrator.
    You'll also probably be in a license violation unless you have the CMSDK running somewhere in an AS Standard Edition license.
    But it does seem to work fine, otherwise.
    Mark

  • Building Offline Mobile Web Applications Using BC4J: A Tutorial

    i try "building Offline Mobile Web Applications Using BC4J: A Tutorial":according with
    http://download-uk.oracle.com/docs/cd/B14156_01/doc/B13788/html/nvbc4jtu.htm
    I've problem on step:13.3 Packaging the JSP Application,in the next step on :6
    Under the Snapshots section, click "Import...". You can now connect to the Oracle Database by providing the following values in the "Connect to Database" dialog.
    Table 13-8 lists values that you must specify in the Connect to Database dialog.
    i enter jdbc:oracle:thin:@192.168.100.10:1521:mag,
    where mag is sid.And Ok,writing Error:similar...
    make sure jdbc driver...in the classpath.
    Thanks.

    You could turn on debugging for your EJB's. Add the following tag to your OC4J start options:
    -Dejb.debug=true.
    Please also check the following logs:
    - $OH\application-deployments\<appName>\OC4J_Namedefault_island_1\application.log
    - the opmn logs for your OC4J instance
    Furthermore you can add some Sys.out statements to your code to see where the problem lies.
    Hope this helps.
    Deepak

  • Tutorial for Building Mobile Web Applications Using ADF/BC4J-problem

    This is the tutorial for:
    Develop a offline, Web-based Disconnected Mobile application
    Trying to create an offline mobile application using jdeveloper & oracle lite. I want to be able to update the home database after using the application in a disconnected fashion. I do not have a web site, nor is that a feasible option.
    Jdeveloper 10.1.3.4 which should be OK as it is higher than the release specified in the tutorial.
    webtogo
    oraclie lite 10
    oracle 10.
    I have tried to follow the tutorial completely and I can not get this to connect from webtogo. It runs fine in the jdeveloper usising the container. I created the war file, did the wtg packaging process, opened the mobile manager and published the application & granted access to user 'john'. The samples provided work fine. The new application appears on the webscreen after installing web 0c4j. When I click on it, the address toolbar shows:
    http://localhost/webtogo/bc4jtutorial/faces/CustomerOrders.jsp
    When it installed mobile client, it installed the CustomerOrders.jsp into:
    E:\mobileclient\mobile_client_oc4j\j2ee\mobileclient\applications\mobileclient\bc4jtutorial
    an example of the samples that work shows
    http://localhost/webtogo/sample6/list
    in the browser address line.
    Which looks like it's really
    E:\mobileclient\mobile_client_oc4j\j2ee\mobileclient\applications\mobileclient\samples\sample6
    on the file system
    Any one have any ideas? I'll take another solution if someone has found one. However, i am not a great java programmer so thought jdeveloper was great to create forms and access the database.
    Theo Korol
    [email protected]

    Hi,
    selecting a session bean, this option shows for me in 11.1.2. Make sure that - by accident - you don't select the local or remote interface class
    Frank

  • Oracle 10g Lite with ADF/BC4J Application(Offline access in Mobile )

    Hi All,
    We have the following requirement from one of our client.
    Customer Company has R12 Apps instance(which is having 10g Database APPSDB). The users will come in the morning
    and connect to the System(NEWSYSTEM) to download their daily worksheet(resides in APPSDB) to their Mobile Devices
    (Windows XP - http://www.keenzo.com/zoom.asp?zoom=3830134) and then disconnect from the system. The download of data
    should start after login into their Mobile Device Custom Application So that only their worksheet will be downloaded
    to their Mobile Device DB.
    Then they will goto their fields and review their daily worksheet in the Mobile Device application(NEW APPLICATION)
    in offline mode. And update in the application with their findings, which should be stored in the Mobile Device database(MOBILEDB).
    In the evening the uses will come and connect to the system(NEWSYSTEM) and login into their Mobile Application and
    start the upload process, then the updated data from their Mobile Database will be uploaded into APPSDB via the NEWSYSTEM.
    I checked the links, http://www.oracle.com/technology/products/lite/index.html and http://lite.us.oracle.com and I have
    got some understanding about Oracle 10g Lite. For the above requirement we are proposing the NEWSYSTEM as Oracle 10g Lite Server
    and the NEW APPLICATION as ADF/BC4J which can run in their Mobile Devices(work offline and then sync with DB).
    I have the following questions.
    1) The above proposing system is feasible?
    2) Can we develop the Mobile Application using ADF/BC4J and using that we would like to
    control the sync process from our custom application.(so that only their worksheet will come to their Mobile Device DB)
    3) If I want to have the above system,
    a) I should have Oracle 10g Lite server installed(im Unix or Windows)
    b) I should have Oracle 10g Lite client installed in a Windows PC/Laptop
    c) To get my custom application in My Mobile Device, first I have to deploy the application
    in Oracle 10g server using Oracle Mobile Server. Then I have to connect my Mobile Device to the Oracle 10g Lite server,
    and deploy the application in my Mobile Device using Oracle Mobile Manager.
    4) I would like to do a POC before start the project.
    What are all the installations I have to do in my Laptop.(Consider I am installing Oracle 10g Lite server/client, Mobile Manager in my Laptop)
    I am new to Oracle 10g Lite, correct me if any of my understanding is wrong.
    If you have any comments in the approach please add it.
    Thanks in advance.
    With Regards,
    Kali.

    1) The above proposing system is feasible?
    perfecly feasible, and actually a reasonably standard use of oracle lite
    2) Can we develop the Mobile Application using ADF/BC4J and using that we would like to
    control the sync process from our custom application.(so that only their worksheet will come to their Mobile Device DB)
    Actually two different questions here. The application code that runs on the client device can be written in any thing that will run on that type of device, and is capable of using the APIs to connect to the local database, and the other functionality like synchronisation. From the forum there look to be VB, C, java users out there (an i even believe if you wanted to, you could use forms). Main decision regarding the Platform for the application code development tends to be whatever you have the skills in.
    In terms of the sync process only downloading a particular users worksheet, this would be defined when you define the snapshots of the database tables you want to download, rather than the sync login process itself.
    For example - you have a table WORKSHEETS on the server that you want to download, it has a column EMP_NO which is the employee identifier. You would define the selection for the snapshot as
    select * from WORKSHEETS where EMP_NO=:emp_no (note the bind variable)
    when you then add users to the oracle lite application (actually the database), then you will have a parameter called EMP_NO to define with the employee number for that particular user, and this will be used automatically as the bind variable in the download.
    NOTE subsetting in this way does not need to be direct, for example things like
    select * from TASKS where id in (select task_id from user_tasks where emp_no=:emp_no) is perfectly valid
    NOTE when reading the forum and documentation, be careful of the word application. There are actually two different things to be developed, both normally called 'application'
    Within oracle lite you create an application with publication items, scripts, sequences etc. and then subscribe your users to this application. The application in this context is actually the database and synchronisation management ONLY (you can include files and code for download)
    The second application is your runtime code that has a user interface, functionality, processing and validation. This is written in some development platform, and accesses the database created above for select, insert, update etc.
    3) If I want to have the above system,
    a) I should have Oracle 10g Lite server installed(im Unix or Windows)
    YES this goes on the app server and installs a repository schema MOBILEADMIN within your database
    b) I should have Oracle 10g Lite client installed in a Windows PC/Laptop
    YES - once the server is set up, this is downloaded and set up by accessing the <server url>/webtogo/setup
    c) To get my custom application in My Mobile Device, first I have to deploy the application in Oracle 10g server using Oracle Mobile Server. Then I have to connect my Mobile Device to the Oracle 10g Lite server,
    and deploy the application in my Mobile Device using Oracle Mobile Manager.
    steps in outline are
    1) install server
    2) develop the oracle lite application (ie: database) and publish this to the mobile server (can use the development kit or java APIs for these two steps
    3) add a user with the relevant subsetting parameters
    4) set up oracle lite win32 client on the laptop from the server download
    5) synchronise using the msync utility on the client to create the databases and odbc entries
    6) develop your application code using the client database
    7) during development, then changes to database structure would be via changes and re-publish of the oracle lite application, followed by a sync to update the client database
    8) once all development is complete, the runtime application code can be bundled up into the oracle lite application if you want, and then the initial sync for live users will download the database and application code.
    4) I would like to do a POC before start the project.
    What are all the installations I have to do in my Laptop.(Consider I am installing Oracle 10g Lite server/client, Mobile Manager in my Laptop)
    You can set up a standalone server on the laptop, but better to do this on a development app server so you can use the main server development database as the data souce for the snapshot definitions (pretty easy install). there are conflicts if you try and put the oracle lite client and the mobile development kit on the same machine, but if you are familiar with java, the API development is fairly straightforward to use (i have developed applications in this, and i know only the basics of java) you do not need the MDK
    Basic for a POC i would say is to
    1) set up mobile server on development
    2) define a simple oracle ite application on two server tables. one has select * from table, and the other has select * from table where .... including bind variable. at this stage use complete refresh as the mode for simplicity
    3) publish the application, create user and define the subsetting variable
    4) set up mobile client and synchronise user. use the msql utility to interrogate the database and check the content, and do some updates 9standards SQL syntax)
    5) create simple appliaction code to conect to and read the database on the client
    6) do a sync after the updates above and check they appear in the server
    The above should be reasonably quick and proves
    a) ability to define the data you want to be sent to the users
    b) ability to create an app to manage the database running on the client device in you preferred software platform
    c) data download and upload
    after this basic POC, you can extend into defining fast refreshes to improve the efficiency of the sync process, managing the MGP process, developing a more comprehensive database and application etc. If you have complex joins between server table, you may also want to look at creating views to denormalise data and use these as the basis for the snapshots

  • BUG: Can't create BC4J Application Module Configurations

    Hello,
    I'm using JDev 9.0.3.1 with Win2K and WinXP. There seems to be a bug in the BC4J Application Module Configuration Manager:
    It seems to be impossible to create a new BC4J Application Module Configuration with the Configuration Manager of a BC4J Application Module. I can copy an existing AM configuration, but I can not rename it. Clicking on the OK Button in the Configuration Manager simply does nothing.
    A work around seems to be to open bc4j.xcfg in any text editor, copy an AppModuleConfig element, save xcfg, in JDev remove the project form the workspace, readd it to the workspace (some caching issue of jdev?). Then the new AM config is there and can be modified.
    In JDev 9.0.3 the Config Manager seems to work fine.
    Regards
    Stefan

    The bug is mentioned in metalink bug 2849146.

  • Thread-Safe BC4J Application

    Hello,
    I have an BC4J-based application, based on BC4J9.0.2. I'm considering to upgrade my BC4J library to upper version to make my application more thread-safe.
    How can I make thread-safe application using BC4J? Is there any specific Rule?
    Thank you.

    Hi,
    Its hard to define a single rule since it depends upon how each application is using threads. I have included some thoughts about the most common scenarios for web clients below:
    The BC4J client wizards (datatags, struts, JClient) will help you generate threadsafe applications. The general rule when writing a web client is to ensure that each "user", as represented by an HttpSession instance, has their own ApplicationModule instance. Using the ApplicationModule datatag or the BC4J/Struts framework will guarantee this.
    Beyond this it may also be necessary to coordinate multiple concurrent requests from a single client (imagine a user pounding on the browser refresh button). One approach for solving this problem is to synchronize requests on some sort of session context. The ApplicationModule tag supports a latching mode (see the lock attribute) which performs this by synchronizing access to the SessionCookie (cached in session, used to acquire ApplicationModule instance). Support for latching will also be available in Struts in the 9.0.3.3 and later timeframe.
    Hope this helps,

  • Can BC4J be used with Hypersonic SQL?

    Has anyone been sucessful using BC4J applications with Hypersonic SQL? If so, which versions of each.
    Thanks in anticition,
    Paul Bandler

    No. Use SQLXML instead on a SQL Server.

  • Deploying BC4J application: the right choice

    We have developed three applications (A, B, C):
    - A is a BC4J application
    - B is a JSP application accessing A
    - C is a Java GUI client accessing A
    We want A and B to run in the same web server, so we would have chosen LOCAL deployment for application A.
    The problem is with application C that will run remotely on individual client machines.
    The questions are:
    1. Can application C access application A deployed on the server using BC4J LOCAL deployment?
    2. If not (as I think), what kind of deployment (EJB/Corba) and platform (Application Server/Oracle Database Server) should be chosen for my scenario to give better performance?
    Any help would be very appreciated.
    Thanks in advance.
    Michele
    null

    Hi Michele,
    the official solution for your problem would be:
    Deploy A as EJB session bean or Java CORBA object to an appropriate server.
    Let B and C connect to the common business logic tier.
    But:
    Currently (JDeveloper 3.2.3) an EJB deployment of BC4J apps to OC4J isn't supported, so: If you want to use Oracle9i AS, you have to deploy to the EJB/CORBA Server implemented in the Oracle Database. We tried to do this and had lots and lots of problems, mainly performance problems. If you ask me: Don't do that!
    We tested the deployment to Borland Visibroker and got it work after a while, and your little example worked quite good. So probably you could ask for experiences with other App Servers.
    If you can wait, try to test EJB Session Bean Deployment to OC4J. I saw some demos on the Oracle OpenWorld in Berlin/Germany and it seems to have a quite better performance and stability. But: This will be supported by JDeveloper9i, what should be available as beta release end of this month, and production at the end of this year. So probably you can't wait that long.
    Sorry, but that's the way it is...
    To Raghu/JDev Team: Any better advice?
    Regards
    Stefan
    null

  • 90 seconds to start bc4j application

    Its taking over 90 seconds for our bc4j application to start. It takes 30 seconds to display the 8 rows in the child table when a new master row is selected.
    The master table has 28,000 rows, the child table as 250,000 rows. IE 8 child rows per parent row.
    It appears that its loading all the records. Is there a way to fetch the child records when the master record is selected?
    Is the architeture of bc4j explained in the documentation some where (and I missed it)?
    How I know what types of applications bc4j is not appropriate for?
    How so I know what options I have to improve the preformance to an acceptable level? Is it documented somewhere?

    You find some notes on designing applications on this board that indicate setting a default query like " 1=0 " so that it will avoid even touching an index on startup... ( The Find Panel may not work anymore, since it appears to tack on the 1=0 check(3.1)... and don't due this to details in a master-detail relationship...or LOVs... but I brought startup down from 3+ minutes to about 40 seconds... )
    ...then writing a custom "find" that sets the specific "WHERE" for the rowset:
    public static void findRMA ( String val ) {
    CRRData.setQueryCondition("ReturnHeader.RMA_Number = '"+ val + "'");
    CRRData.executeQuery();
    ... there are lots of ways to skin this cat... but it's a design issue on how the tools are used by the programmer.
    Good Luck
    null

  • Build Automation for ADF Application using Jenkins CI

    Hi
    I am trying to implement automated builds( creating .ear file) and deployments for ADF Applications using Jenkins. I am using Ant Build Scritps using OJDEPLOY on Jenkins.
    but the build scripts does not create .ear file at the path mention in the outputfile parameter.
    Please help. Thanks,
    Below is my build script and ojdeploy status log.
    <?xml version="1.0" encoding="windows-1252" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Jul 10, 2013 12:26:00 PM-->
    <project name="OrganisationApproval" default="all" basedir=".">
      <property file="build.properties"/>
      <path id="library.SOA.Designtime"/>
      <path id="library.SOA.Runtime"/>
      <path id="library.BPEL.Runtime"/>
      <path id="library.Mediator.Runtime"/>
      <path id="library.MDS.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.mds_11.1.1/mdsrt.jar"/>
      </path>
      <path id="library.BC4J.Service.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc-share.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/commonj.sdo_2.1.0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.web-common_11.1.1.jar"/>
      </path>
      <path id="library.TopLink">
        <pathelement location="{oracle.middleware}/modules/com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/modules/com.bea.core.antlr.runtime_2.7.7.jar"/>
        <pathelement location="{oracle.middleware}/modules/javax.persistence_1.0.0.0_2-0-0.jar"/>
      </path>
      <path id="library.Oracle.Rules"/>
      <path id="classpath">
        <path refid="library.SOA.Designtime"/>
        <path refid="library.SOA.Runtime"/>
        <path refid="library.BPEL.Runtime"/>
        <path refid="library.Mediator.Runtime"/>
        <path refid="library.MDS.Runtime"/>
        <path refid="library.BC4J.Service.Runtime"/>
        <path refid="library.TopLink"/>
        <path refid="library.Oracle.Rules"/>
      </path>
      <target name="init">
        <tstamp/>
        <mkdir dir="${output.dir}"/>
      </target>
      <target name="all" description="Build the project"
              depends="deploy,compile,copy"/>
      <target name="clean" description="Clean the project">
        <delete includeemptydirs="true" quiet="true">
          <fileset dir="${output.dir}" includes="**/*"/>
        </delete>
      </target>
      <target name="deploy" description="Deploy JDeveloper profiles"
              depends="init,compile">
        <taskdef name="ojdeploy"
                 classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask"
                 uri="oraclelib:OJDeployAntTask"
                 classpath="${oracle.jdeveloper.ant.library}"/>
        <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
                      executable="${oracle.jdeveloper.ojdeploy.path}"
                      ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
                      ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
          <ora:deploy>
            <ora:parameter name="workspace"
                           value="${oracle.jdeveloper.workspace.path}"/>
            <ora:parameter name="project"
                           value="${oracle.jdeveloper.project.name}"/>
            <ora:parameter name="profile"
                           value="${oracle.jdeveloper.deploy.profile.name}"/>
            <ora:parameter name="nocompile" value="true"/>
            <ora:parameter name="outputfile"
                           value="${oracle.jdeveloper.deploy.outputfile}"/>
          </ora:deploy>
        </ora:ojdeploy>
      </target>
      <target name="compile" description="Compile Java source files" depends="init">
        <javac destdir="${output.dir}" classpathref="classpath"
               debug="${javac.debug}" nowarn="${javac.nowarn}"
               deprecation="${javac.deprecation}" encoding="UTF-8" source="1.6"
               target="1.6">
          <src path="/u02/jenkins/Portal/OrganisationApprovalApp/Dev/SCA-INF/src"/>
        </javac>
      </target>
      <target name="copy" description="Copy files to output directory"
              depends="init">
        <patternset id="copy.patterns">
          <include name="**/*.gif"/>
          <include name="**/*.jpg"/>
          <include name="**/*.jpeg"/>
          <include name="**/*.png"/>
          <include name="**/*.properties"/>
          <include name="**/*.xml"/>
          <include name="**/*.ejx"/>
          <include name="**/*.xcfg"/>
          <include name="**/*.cpx"/>
          <include name="**/*.dcx"/>
          <include name="**/*.sva"/>
          <include name="**/*.wsdl"/>
          <include name="**/*.ini"/>
          <include name="**/*.tld"/>
          <include name="**/*.tag"/>
          <include name="**/*.xlf"/>
          <include name="**/*.xsl"/>
          <include name="**/*.xsd"/>
          <include name="**/*.exm"/>
          <include name="**/*.xml"/>
        </patternset>
        <copy todir="${output.dir}">
          <fileset dir="/u02/jenkins/Portal/OrganisationApprovalApp/Dev/SCA-INF/src">
            <patternset refid="copy.patterns"/>
          </fileset>
          <fileset dir="/u02/jenkins/Portal/OrganisationApprovalApp/Dev/SCA-INF/src">
            <patternset refid="copy.patterns"/>
          </fileset>
        </copy>
      </target>
    </project>
    =====================================================================================
    <?xml version="1.0"?>
    <ojdeploy-log>
      <exception msg="null">
      <![CDATA[
      java.lang.NullPointerException
      at oracle.jdevimpl.deploy.DeployScriptEngine.createExpandedDeployTasks(DeployScriptEngine.java:180)
      at oracle.jdevimpl.deploy.DeployScriptEngine.access$000(DeployScriptEngine.java:54)
      at oracle.jdevimpl.deploy.DeployScriptEngine$TaskIterator.hasNext(DeployScriptEngine.java:533)
      at oracle.jdevimpl.deploy.DeployRunner.runCommand(DeployRunner.java:58)
      at oracle.ideimpl.Main.start(Main.java:192)
      at oracle.ideimpl.Main.main(Main.java:146)
      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:597)
      at oracle.ide.boot.PCLMain.callMain(PCLMain.java:62)
      at oracle.ide.boot.PCLMain.main(PCLMain.java:54)
      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:597)
      at oracle.classloader.util.MainClass.invoke(MainClass.java:128)
      at oracle.ide.boot.IdeLauncher.bootClassLoadersAndMain(IdeLauncher.java:189)
      at oracle.ide.boot.IdeLauncher.launchImpl(IdeLauncher.java:89)
      at oracle.ide.boot.IdeLauncher.launch(IdeLauncher.java:65)
      at oracle.ide.boot.IdeLauncher.main(IdeLauncher.java:54)
      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:597)
      at oracle.ide.boot.Launcher.invokeMain(Launcher.java:713)
      at oracle.ide.boot.Launcher.launchImpl(Launcher.java:115)
      at oracle.ide.boot.Launcher.launch(Launcher.java:68)
      at oracle.ide.boot.Launcher.main(Launcher.java:57)
      ]]>
      </exception>
      <summary>
        <start-time>2013-07-10 14:47:29 SAST</start-time>
        <end-time>2013-07-10 14:47:29 SAST</end-time>
        <total-tasks>0</total-tasks>
        <failures>0</failures>
        <status exitcode="1">FAILED</status>
      </summary>
    </ojdeploy-log>

    Have you tried to call ojdeploy directly instead of using the ojdeploy task?
    I remember that the ant task has had some bugs. You can use the exec task and execute ojdeploy directly. Then you don't even need to include the path elements as you use the jdev project which includes all the information.
    ojdeploy.executable=path_to_your_jdev_installation/jdev/bin/ojdeploy.exe
        <target name="ojdeploy" description="execute ojdeploy">
                <exec executable="${ojdeploy.executable}" dir="."
                    output="${log.filename}" failonerror="true">
                    <arg value="-buildfile"/>
                    <arg value="${build.filename}"/>
                </exec>
        </target>
    Timo

Maybe you are looking for