MapViewer Bean Feature Selection

I have written a java applet that uses the Mapviewer bean to set up and render a map based on Oracle spatial data. So far, so good. I have written tools to Zoom in, Zoom out, Pan etc etc. I now need to extend this as follows:
1. Given the primary key of a feature (or set of features), I need the mapviewer to be able to highlight those features in the map (using some specified highlight color) and to zoom to the relevant extent.
2. I need to be able to allow the user to select a rectangle on the map (using a rubberband tool that I already have in place) and have the mapviewer highlight all the features within the rectangle and also return the primary keys for all features found using a spatial query.
The java applet needs to be thin. It will be running on slow networks so it can't be downloading large amounts of data.
Having read the documentation, you need to set the themes to clickable before you can highlight them. This then means that the features are downloaded to the client - presumably ending up with large amounts of network traffic.
Is there any way we can achieve what we need as described above?

Please post here. The dev team will collect and track them internally. Or if you are a customer you can always go to metalink.oracle.com and post over there. The product id for mapviewer is 1215.
thanks,
LJ

Similar Messages

  • MapViewer Bean Feature Requests & Bug Tracking?

    Hi-
    I'm wondering where I should post feature req's and bugs for the MapViewer bean. Is there a place where these things are tracked?

    Please post here. The dev team will collect and track them internally. Or if you are a customer you can always go to metalink.oracle.com and post over there. The product id for mapviewer is 1215.
    thanks,
    LJ

  • OracleAS MapViewer Bean

    Hello,
    I'm using the OracleAS MapViewer Bean in my JSP application. As said in the use guide, this Bean is used for all maps created during the current session. But for me, it's a problem because when I close a first map (with addPointFeature, addWMSMapTheme and addJDBCTheme functions) and want to create a second one (with the same functions but with another data), information of the firsts is always there.
    Does anyone know how to put the scope of the Bean to page and not still to session?
    (As in the tag
    <jsp:usebean
    id="BeanName"
    class="com.XXX.class"
    scope="page">
    </jsp:usebean>
    Thanks in advance.

    The API has methods (such as deleteAllThemes, removeAllPointFeatures) to clean your current request. You can use these methods before creating the second map.

  • 2008 R2 upgrade to SQL 2012 validation error - No Features Selected

    I need a work-around for a known bug.  Some features of Server 2008 R2 Enterprise install an instance of SQL Server.  I'm attempting to upgrade the in-place instance to SQL 2012 Express.  After selecting 'Upgrade', it returns this error:
    Upgrade to SQL Server 2012
    There are validation errors on this page.  Click OK to close this dialog box.  Review errors at the bottom of the setup page, then provide valid parameters or click Help for more information.
    There are no features selected for upgrade.
    In researching, I find this is a known problem in which the hotfix is available in a cumulative update.  The 2419 build updates the released 2100 build.  My problem now is that applying the cumulative update requires that SQL 2012 already be installed.
    What is the correct procedure for upgrading the in-place SQL instance to 2012 SQL Express?
    Beware of unmoderated moderators in the Expression Web forums.

    One of us is confused.... likely me.  The SQL currently installed is the built-in SQL of Windows Server 2008 R2 Enterprise.  It is not SQL Enterprise.  I understand it to be a limited variation called SSEE, SQL Server Embedded Edition. 
    I believe the installation of this variation can be triggered by installing IIS or WSUS.  The instance name is Microsoft##SSEE.
    Nevertheless, there must be a proper way to install SQL 2012 Express, migrate, and uninstall the Windows Internal Database SQL 2005.  Where can I find the correct procedure for upgrading the in-place SQL instance to 2012 SQL Express?
    Hi backup,
    According to your description, I recommend you install SQL Server 2012 Express directly. Before installing, you should note the
    hardware and software requirements, for example, you need to download and install Microsoft .Net Framework 3.5 SP1 and Windows Installer 4.5.
    There is a process of installing SQL Server 2012 Express, you can review it.
    http://www.jsinh.in/2012/09/install-sql-server-2012-express-step-by-step/
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Where do I find *the* mapviewer bean

    I have been reading this forum and I see people talk about "the" mapviewer bean, I would like to use this bean in my forms, but I can't seem to find it.
    Should I write my own Bean around the MapViewer class?

    the class oracle.lbs.mapclient.MapViewer class is the 'bean'. It's got everything you need to talk to Mapviewer from your Web app.
    this class is packaged inside the mvclient.jar file, which is located in your deployed/unpacked MapViewer directory, under $OC4J_HOME/j2ee/home/applications/mapviewer/web/WEB-INF/lib.
    thanks

  • Bounding Theme With Mapviewer Bean

    Hello
    I using the MapViewer Bean to render a map in Oracle Forms. I can successfully show the map and use addJDBCTheme to add a dynamic theme. I am now trying to zoom in/out on the map so the image returned shows all items in the dynamic theme. Does anyone no how to do this using the bean?
    TIS Chris

    Hi Joao
    Thanks for the reply.
    Although I have read about this procedure in some MapViewer documentation I am unable to get to it through the MapViewer java class - I am writing a bean that utilises this class and this method does not appear to to be in this class. Do you know of any other way a can access it?
    Thanks
    Chris

  • How to make validation in Bean and select value from another table

    I want to know how to select data from table in backing bean according to primary key i have
    the problem is that
    i have a table Employee_Salary contains Employee ids and their salary
    Empoloyee_Salary table
         Employee_ID      Number
         Employee_salary Number
    And Another table Called Employees
    Employees table
         Employee_ID     Number
         IsManager Varchar2 its value is [*Yes or NO*]
    and other columns that i don't care about this table
    i have on a jsff page an <af:table> this table is editable this is the Empoloyee_Salary table
    *i want to check before save or after insert if this employee is Manager [from Employees tabke(yes or no)] the salary*
    cannot be less that 100
    i want to know how to make this how to select the value from employees table according to the id i have in the employee_salary table how to make this and make this validation
    i have to select IsManager from Employees Table to see if this manager or no
    i want to know how to make this in a bean
    i use jdeveloper 11g
    and my project is ADF Fusion project
    and the page that have the Emplpyee_Salary table is JSFF
    thanks in advance

    You might want to write this code in a validator on the entity object if it should apply from every screen.
    If you want to access view objects from a backing bean the basics are here: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcservices.htm#sthref918

  • MapViewer Bean Bug in 9.0.4 Release Version

    Hi-
    In the recently released 9.0.4, the getCenter() method of oracle.lbs.mapclient.MapViewer returns null after this sequence:
    setBox();
    run();
    getCenter(); //returns null
    This is a show stopper for upgrading, since we always display the map size and center on the maps we generate.
    Any suggestions? Has anyone else seen this?
    Thanks,
    Eric Everman
    USGS

    Thanks for the reply.
    I see that the getBox() docs do mention that it will return null if no box is set - getCenter() docs should be updated to note this.
    In terms of ease of use, however, wouldn't it be useful to have both getCenter and getBox return real values after a map has been generated? These values are known (or can be calculated). If they aren't calculated in the bean then I have to put the logic and code in my JSP page or MapViewer subclass.
    The only time these values may not be known is in this case:
    setCenter();
    getBox(); //box unknown until request is made
    run();
    getBox(); //box is known
    Just trying to keep things simple - thanks for listening!
    Eric Everman

  • Change of Jtable feature select in 1.5?

    I have a JTable Object, with 12 columns and 32 rows.
    when the user want to populate the first eight rows there is no problem, they begin ant the rown 0 column 0, But when the user want to capture only from the 9 to 16 row, they select those range, but until the version 1.4.2, the cursos was positioned in the first row&colum selected.
    But after jdk 1.5.x, the cursor focus focus is in the last row&column selected..
    How can I make that the first position select get the focus in the JTable?
    In other worksheet have this feature, fouc son the first colun&row selected.
    why Java change it?
    Please help me out.

    The problem is not how to select an interval.
    The problem is the position of the cursor when finalizing the selection of an interval.
    In the versions prior at the 1.5 was positioned at the beginning of the selection and not to end.
    But since version 1.5, the focus on the table have the last position selected.
    Look the excel feature or another worksheet, and the focus always is the first cell selected.
    Thnaks

  • Jdbc bean errorpage - select - update

    i got a problem getting the errorhandling from a bean- i would like to open an errorpage from the bean when the executeupdate function fails - maybe due to an allready existing value
    if i move thedb access into a normal jsp i can declare a
    <%@page errorPage="errorpage.jsp" %>
    but how can i manage that within the bean ? - or should i put all the code into a jsp without trying to fit into the mvc modell ?
    import java.sql.* ;
    public class DbBean {
       private Connection con;
       private Statement st;
       private ResultSet rs;
       private Statement statement;
       public DbBean() {
         try {
           Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           con = DriverManager.getConnection("jdbc:odbc:konten");
         catch (Exception e) {
           System.out.println("Fehler bei Verbindung zur Datenbank");
       public ResultSet get(String query) {
         try {
           st = con.createStatement();
           rs = st.executeQuery(query);
         catch (Exception e) {
           System.out.println("Fehler bei Datenbankabfrage" + e.getMessage());
         return rs;
       public void insertData(String query) {
         try {
           st = con.createStatement();
           st.executeUpdate(query);
         catch (SQLException sqle) {
           System.err.println(sqle.getMessage() + " !! Fehler beim InsertVersuch !!");
         catch (Exception e) {
           System.out.println("Fehler bei Datenbankupdateversuch" + e.getMessage());

    Well in order for the error page to come up, you have to give the jsp page an exception.
    Right now you are just catching the exception, printing a message, and continuing as normal.
    You will probably want to rethrow the exception so that it trickles down to the jsp where it can explode into a glorious error page.
    Cheers,
    evnafets

  • Another little feature - select and copying text

    Another anoying piece of functionality is the way the cut and paste is handled.
    If you're in a text converation for example and someone says can you send me so and so's number/email etc then fair enough you jump into contacts find the person and their information is then there for you to see.  Why cant you just click on the info you want and copy the info?  No you have to go into EDIT mode, then hold your finger on the item for the right bar to appear. 
    Ok, no worries here, however after clicking say select all the right bar then diasapears !  Why?  Logic dictates you've selected the data for a reason.  Allow the right hand bar to stay open unless you say otherwise.
    First of all though, allow the select to take place with no need to edit the contact.
    Yes you can add a .vcf - however people are dumb and dont know what to do with such a file and also you you need to know the persons info your sending is happy for you to send all contact info about them etc.
    Small things to make the OS even better :-)

    I don't understand.. Once highlight, just touch and copy the number on the right hand pop up.
    It could be overall easier, yes.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Mapviewer SVG and Theme Selection

    Im trying to highlight a line by clicking on the line. Im using the svg feature. Here is the xml request im using:
    <?xml version="1.0" standalone="yes"?>
    <map_request
    title="Oracle LBS MAP"
    basemap="demo_map"
    datasource = "mvdemo"
    width="640"
    height="480"
    bgcolor="#a6cae0"
    antialiase="false"
    format="SVG_STREAM">
    <themes>
    <theme name="theme1" selectable_in_svg="true" >
    <jdbc_query
    spatial_column="geom" jdbc_srid="8265"
    render_style="transparent_color"
    label_column="destination" label_style="t.street name"
    datasource="mvdemo" key_column="origin">SELECT geom, origin, destination FROM flight_geometry WHERE origin ='PHX' and destination ='SDF'
    </jdbc_query>
    </theme>
    </themes>
    </map request>
    The map is generated a line is displayed however, when I click on the line nothing happens. I set the key column and the selectable in svg attribute. Now when I look at the map, save the svg source to a different file and manually manipulate the featureselect variable in the svg javascript code, view the svg map and click on it it turns red. What is the correlation between the featureselect variable and mapviewer??? Am I not setting a parameter somewhere?? Any help would be appreciated.
    Thanks,
    Mo

    I do not think the feature selection function is available on line features; it is only supported for Area and Point features. we will support linear feature selection/tool-tip functions in the next release.
    A possible workaround is to identify a mid-point on the line feature, and place a marker on that mid-point feature. you can then select that point feature and display any information that might be associated with the underlying line.

  • 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?

  • GetLiveFeatureAttrs() in MapViewer returns data for wrong coordinates

    Hi forum
    I am trying to build a small Java application to fetch and display data from MapViewer. I have a set of predefined themes and want to add a query theme, from which I can fetch further information through live features. From reading the docs, to my best understanding, the procedure to do so is this:
    1. Define a query theme with attributes and make it "clickable", and use the "raw" image format. GEOLOC is the sdo_geometry column, the rest are for the live features.
      String sqlQuery = "SELECT gravstedsnavn, nummer, areal, geoloc FROM gravsteder3 s where s.dblink in (" + retline + ")";
      mv.addJDBCTheme("bssys", "QUERY_DATA",  sqlQuery, "geoloc", "8307", null, null, null, true);
      String[] boundingThemes = { "QUERY_DATA" };
      mv.setClickable(true, "QUERY_DATA");
      mv.setImageFormat(MapViewer.FORMAT_RAW_COMPRESSED);
      mv.setBoundingThemes(boundingThemes, 0.05, true);2. I use a JPanel to render the map image, for which I want a tooltip to show the live feature given the mouse coordinate, when the mouse moves around the JPanel (mapDisplay being the JPanel):
    private void mapDisplay_mouseMoved(MouseEvent e) {
      Insets is = ((JPanel)e.getComponent()).getInsets();
      int x = e.getX() - is.left, y = e.getY() - is.top;
      mapImage = mi.getMapUrl("5", x, y, mapURL);
    }getMapUrl does the following to display the live features in a tooltiptext on the JPanel:
        String[][] test = null;
        try  {
          test = mv.getLiveFeatureAttrs(x,y,0);
        } catch (NullPointerException ex)  {
          System.out.println("No information available");
        if ((test.length == 0) || (test == null)) {
          jp.setToolTipText(null);
        } else {
          String gravstedsnavn = "";
          String gravstedsnr = "";
          String areal = "";
          if (test != null) {
            for (int i = 0; i < test.length; i++) {
              for (int j = 0; j < test.length; j++) {
    if (j == 0) {
    gravstedsnavn = test[i][j];
    if (j == 1) {
    gravstedsnr = test[i][j];
    if (j == 2) {
    areal = test[i][j];
    jp.setToolTipText("<html>Gravstedsnavn: " + gravstedsnavn + "<br>Nummer: " + gravstedsnr + "<br>Areal: " + areal +"</html>");
    This code works - the only problem is, that the attributes returned from the getLiveFeatureAttrs() function returns values from a completely different coordinate from the map than expected. I believe, that its my mouseMoved event, which causes the problem - but I havent figured out the way to pass the right mouse coordinates to getLiveFeatureAttrs().
    Does someone have a working live features example, and can anyone eventually see, what the problem with my code is?
    Thanks in advance.

    Hello Joao
    I have setup a public MapViewer server and modified your code slightly, so it can run against my server. The code should return a single rectangular polygon, and if you try moving your mouse around in the JFrame, the live features are available where they shouldn't be, ie outside the marked rectangle, so something is still not working right... Could you do me the favor to try to compile and run this code? My testsite testbooking.brandsoft.dk should be publicly viewable. Could it have something to do with the value of the SRID?
    package oracle.forms.fbean;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Insets;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import oracle.lbs.mapclient.MapViewer;
    public class livefeature extends JFrame
      static Image img = null;  //global image buffer
      static Insets is = null;  //insets inside a frame.
      final static int mapWidth = 640;
      final static int mapHeight = 480;
      MapViewer mv = null;
      private class myMouseListener implements MouseMotionListener
        public void mouseDragged(MouseEvent e) {
          public void mouseMoved(MouseEvent e) {
                int x = e.getX() - is.left;
                int y = e.getY() - is.top;
               String[][] test = mv.getLiveFeatureAttrs(x,y,0);
               if ((test.length == 0) || (test == null)) {
                 System.out.println("No livefeatures found");
               } else {
                 String gravstedsnavn = "";
                 String gravstedsnr = "";
                 String areal = "";
                 if (test != null) {
                   for (int i = 0; i < test.length; i++) {
                     for (int j = 0; j < test.length; j++) {
    if (j == 0) {
    gravstedsnavn = test[i][j];
    if (j == 1) {
    gravstedsnr = test[i][j];
    if (j == 2) {
    areal = test[i][j];
    System.out.println("<html>Gravstedsnavn: " + gravstedsnavn + "<br>Nummer: " + gravstedsnr + "<br>Areal: " + areal +"</html>");
    public livefeature()
    setTitle("MapViewer: Live Feature");
    setVisible(true);
    is = getInsets();
    System.out.println("Insets: " + is);
    setSize(mapWidth+is.left+is.right, mapHeight+is.top+is.bottom);
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    this.addMouseMotionListener(new myMouseListener());
    public void paint(Graphics g)
    if(img==null)
    drawGeometries(g);
    //draws the image to the screen
    if(img!=null)
    g.drawImage(img, is.left, is.top,
    img.getWidth(null), img.getHeight(null), null);
    public void drawGeometries(Graphics g)
    mv = new MapViewer("http://testbooking.brandsoft.dk/mapviewer/omserver");
    mv.setDeviceSize(new Dimension(mapWidth,mapHeight));
    mv.setAntiAliasing(true);
    mv.setDataSourceName("bssys");
    String sqlQuery = "SELECT s.gravgaardsnavn, s.gravnr, s.areal, s.geoloc FROM gravsteder3 s where s.dblink in (30200020)";
    mv.addJDBCTheme("bssys", "QUERY_DATA", sqlQuery, "geoloc", "0", "BSSYS:ROED_MARKERING", null, "BSSYS:SORT_TEKST", true);
    String[] boundingThemes = { "QUERY_DATA" };
    mv.addJDBCTheme("bssys", "QUERY_DATA_1", sqlQuery, "geoloc", "0", "BSSYS:ROED_MARKERING", null, "BSSYS:SORT_TEKST", true);
    mv.setClickable(true, "QUERY_DATA_1");
    mv.setImageFormat(MapViewer.FORMAT_RAW_COMPRESSED);
    mv.setBoundingThemes(boundingThemes, 0.05, true);
    try
    mv.run();
    img = mv.getGeneratedMapImage();
    repaint();
    } catch(Exception e)
    System.out.println("Error while rendering theme.");
    e.printStackTrace();
    public static void main(String[] args)
    new livefeature();

  • JDeveloper gets slow with a lot of managed beans declared in faces-config

    Hello,
    I have an application with a lot of managed-beans (in fact, hundreds of backing beans). When I open the visual designer, it takes a long time to render the page, and after it gets very slow. Even the source view gets slow. When I remove some parts of these managed beans, JDeveloper back to normality.
    The problem is that the JDeveloper is so slow that I just can not do anything in JSPs.
    Anyone have any idea?
    I am very grateful for any help.
    Thanks.
    Edited by: gutogarcia on 22/01/2010 09:33

    ThDn,
    You can avoid adding unnecessary getters and setters of UI components in backing bean by selecting the option "Do not automatically expose UI Components in a Managed Bean" option when creating the Page.
    The nice thing is that in JDev 11g and in latest version of JDev 10g this option is selected by default when creating new pages.
    However in older JDev 10g versions the default was "Expose UI Components to a Managed Bean" so if developer did not change it during page creation it is possible that there would have been lots of unnecessary getters and setters in the backing bean.
    Luiz,
    As you say that this was fine in TP4 it could be that in newer JDev version there might have been added some new feature that caused this slowness.
    When you remove unnecessary getters/setters from you backing beans, you will have to modify the JSPs and remove the bindings from the UI components as well.
    Thanks
    Mitesh

Maybe you are looking for

  • How to Divert the changes to cdhdr table instead of dbtablog?

    Hai everybody. I am new to this forum. i got a job in abap recently. The below is my requirement.I want solution for this one. Anybody plz help me. I am having ztransaction. The change logs already were captured in DBTABLOG for table ZWPRFRUND (in tr

  • ICloud Server error will not let me sign out

    (this is on an iPhone 6) So Recently I created a new Apple ID because I'd forgotten my security questions. For about three months, I still had that ID signed in on my iCloud, which wasn't a big deal for me as I rarely back up via iCloud. However, whe

  • Report component output

    After choosing sum on a column - Is there a way to get rid of the "Page sum" on the output and show "Total sum " only? Then is there a way to change "Total sum" to "Total" ?

  • Trouble downloading Itunes 6

    After reading other posts I found that the problem I am having is the same as others. Itunes 6 seems to have a bug in it that after the download Itunes will not open. I have been slaving at this computer trying to fix this problem but NOTHING will wo

  • Java Error at Step 4 on Windows XP

    Hi, I have installed oracle 9i application server and oracle database on same machine with OS Windows XP. When ever I try to a create form for my application, I get java error at step4. Please help me. Thanks in advance Syed