1 2 Previous Next 16 Replies Latest reply: Jul 19, 2012 6:54 AM by 903595 RSS

    Reading message texts from database?

    915091
      Hello,
      i'm working with the JDeveloper version 11.1.1.6.0 and i'm trying to get the texts for error messages from a database table. Is there a way to dot his?
      These messages also have placeholders like {1}, {2}, ... to replace the entries with some values at runtime.

      Thanks for your replies.
        • 1. Re: Reading message texts from database?
          Timo Hahn
          The normal messages are organized in resource bundles (key value string pairs). You can build resource bundle by reading these key value pairs from the db and store them as resource bundle.

          Timo
          • 2. Re: Reading message texts from database?
            915091
            Timo Hahn wrote:
            The normal messages are organized in resource bundles (key value string pairs). You can build resource bundle by reading these key value pairs from the db and store them as resource bundle.

            Timo
            Should the bundle be implemented in the model project or the view controller project?

            If i do it in the model project, what's the best way to access the database connection?
            • 3. Re: Reading message texts from database?
              Timo Hahn
              The model is the right place to do this. As you are in an application module you can acres three table via an vo just as you do with any other vo.
              Timo
              • 4. Re: Reading message texts from database?
                915091
                Timo Hahn wrote:
                The model is the right place to do this. As you are in an application module you can acres three table via an vo just as you do with any other vo.
                Timo
                I don't get this 100%. Why i'm in an applciation module? I think i have to extend the CheckedListResourcebundle or ListResourceBundle? And how do i exactly access the am from there?
                • 5. Re: Reading message texts from database?
                  Timo Hahn
                  Well, the messages are implemented as list bundles, but this doesn't mean that you can't read from the db.
                  If you put this into the model layer, assuming that you use adfbc, this means that you have an application module which you can use to access the db.
                  One way to do this is to overwrite the getMessage method and if it is the first time the method is called you init the resource bundle.

                  Timo
                  • 6. Re: Reading message texts from database?
                    915091
                    With getMessage do you mean the getMessageBundleClass method of the ApplicationModuleImpl class?
                    • 7. Re: Reading message texts from database?
                      915091
                      Ok, it seems you don't mean the getMessageBundleClass method, this method is not called. But i really don't know what you mean with the getMessage? Please clarify what you mean.
                      Thank in advance.
                      • 8. Re: Reading message texts from database?
                        Timo Hahn
                        Alex,
                        sorry I did not see your last post...

                        I'm using an extended JboException class to get the messages from the db.
                        public class MyException extends JboException
                        {
                         
                        protected MyException(String aNumber, Object aArgs[])
                            {
                                super(MyDbExceptionHelper.getInstance().getErrorMessage(aNumber),
                                    String.valueOf(aNumber), aArgs);
                                this.setAppendCodes(false);
                            }
                        
                        }
                        and in the MyDbExceptionHelper class I read the messages from the db into memory
                        public class MyDbExceptionHelper
                        {
                            private static MyDbExceptionHelper mDbHelper;
                            private String mErrorMessages[][];
                        
                            private MyDbExceptionHelper()
                            {
                                this.getErrorMessages();
                            }
                        
                            public static MyDbExceptionHelper getInstance()
                            {
                                if (mDbHelper == null)
                                {
                                    mDbHelper = new MyDbExceptionHelper();
                                }
                        
                                return mDbHelper;
                            }
                        
                            public String getErrorMessage(String aFehlerNummer)
                            {
                                String rMessage = aFehlerNummer;
                        
                                if (mErrorMessages == null)
                                {
                                    this.getErrorMessages();
                                }
                        
                                if (mErrorMessages != null)
                                {
                                    int i = 0;
                                    boolean hasFound = false;
                                    while (i < mErrorMessages.length && !hasFound)
                                    {
                                        if (mErrorMessages[0].equalsIgnoreCase(aFehlerNummer))
                        {
                        rMessage = mErrorMessages[i][1];
                        hasFound = true;
                        }
                        else
                        {
                        i++;
                        }
                        }
                        }
                        return rMessage;
                        }


                        public String[][] getErrorMessages()
                        {
                        ErrmessagesRoViewImpl messages = null;
                        ErrmessagesRoViewRowImpl message = null;
                        RowSetIterator rows = null;
                        int iRows = 0;
                        String rErrorMessages[][] = null;
                        if (mErrorMessages != null)
                        {
                        rErrorMessages = mErrorMessages;
                        }
                        else
                        {
                        MyExceptionHandlerImpl exceptionsDbModule = null;
                        try
                        {
                        exceptionsDbModule =
                        (MyExceptionHandlerImpl) Configuration.createRootApplicationModule("de.hahn.common.exceptions.facade.MyExceptionHandler",
                        "MyExceptionHandlerLocal");
                        }
                        catch (Exception e)
                        {
                        try
                        {
                        exceptionsDbModule =
                        (MyExceptionHandlerImpl) Configuration.createRootApplicationModule("de.hahn.common.exceptions.facade.MyExceptionHandler",
                        "MyExceptionHandlerWS");

                        }
                        catch (Exception ex)
                        {
                        ex.printStackTrace();
                        String res[][] =
                        {
                        { "ERROR9999" , "{0} {1} {2} {3}" },
                        { "WARNING9998" ,"{0} {1} {2} {3}" } };

                        return res;
                        }
                        }
                        messages = exceptionsDbModule.getErrmessagesRoView();
                        messages.executeQuery();

                        if (messages.getEstimatedRowCount() > 0)
                        {
                        rows = messages.getRowSetIterator();
                        rErrorMessages = new String[rows.getRowCount()][2];

                        while (rows.hasNext())
                        {
                        message = (ErrmessagesRoViewRowImpl) rows.next();
                        rErrorMessages[iRows][0] = message.getErrnumber();
                        rErrorMessages[iRows][1] = message.getErrmessage();
                        iRows++;
                        }
                        }

                        messages.setWhereClause(null);
                        messages.setWhereClauseParams(null);
                        mErrorMessages = rErrorMessages;
                        Configuration.releaseRootApplicationModule(exceptionsDbModule, true);
                        }
                        return rErrorMessages;
                        }


                        public String[][] refreshMessages()
                        {
                        mErrorMessages = null;
                        return getErrorMessages();
                        }
                        }
                        {code}

                        The ErrmessagesRoView is a VO which reads from a Table (errnumber varchar(10), errmessage varchar(255)). For this I use an dedicated application module just for reading the messages. Now to the ListResoureceBundle...
                        {code}
                        public class MyErrorsBundle extends ListResourceBundle
                        {
                        protected Object[][] getContents()
                        {
                        return MyDbExceptionHelper.getInstance().getErrorMessages();
                        }
                        }
                        {code}
                        This can be used e.g. as AttrValException like
                        {code}public class MyAttrValException extends AttrValException
                        {
                        public MyAttrValException (String aFehler, String aEntity, String aAttribut,
                        Object aWert)
                        {
                        super(MyErrorsBundle.class, aFehler, aEntity, aAttribut, aWert, null);
                        this.setAppendCodes(false);
                        }
                        ...
                        }
                        {code}

                        I hope you get the picture. I'll try to write a blog about this in the near future.

                        Timo
                        • 9. Re: Reading message texts from database?
                          915091
                          Timo Hahn wrote:

                          I hope you get the picture. I'll try to write a blog about this in the near future.

                          Timo
                          Thanks for your reply. Looking forward to your blog post about this topic.

                          More or less i get the picture. But i don't exactly know how to throw the "MyAttrValException". Can you tell the framework to use this class instead of the original AttrValException, like i could do with the base classes for BC?
                          Or dou you have to override the validate method in the EntityImpl and throw the extended class manually?
                          • 10. Re: Reading message texts from database?
                            915091
                            >
                            public String[][] getErrorMessages()
                            {
                            ErrmessagesRoViewImpl messages = null;
                            ErrmessagesRoViewRowImpl message = null;
                            RowSetIterator rows = null;
                            int iRows = 0;
                            String rErrorMessages[][] = null;
                            if (mErrorMessages != null)
                            {
                            rErrorMessages = mErrorMessages;
                            }
                            else
                            {
                            MyExceptionHandlerImpl exceptionsDbModule = null;
                            try
                            {
                            exceptionsDbModule =
                            (MyExceptionHandlerImpl) Configuration.createRootApplicationModule("de.hahn.common.exceptions.facade.MyExceptionHandler",
                            "MyExceptionHandlerLocal");
                            }
                            catch (Exception e)
                            {
                            try
                            {
                            exceptionsDbModule =
                            (MyExceptionHandlerImpl) Configuration.createRootApplicationModule("de.hahn.common.exceptions.facade.MyExceptionHandler",
                            "MyExceptionHandlerWS");
                            
                            }
                            catch (Exception ex)
                            {
                            ex.printStackTrace();
                            String res[][] =
                            {
                            { "ERROR9999" , "{0} {1} {2} {3}"  },
                            { "WARNING9998" ,"{0} {1} {2} {3}" } };
                            
                            return res;
                            }
                            }
                            messages = exceptionsDbModule.getErrmessagesRoView();
                            messages.executeQuery();
                            
                            if (messages.getEstimatedRowCount() > 0)
                            {
                            rows = messages.getRowSetIterator();
                            rErrorMessages = new String[rows.getRowCount()][2];
                            
                            while (rows.hasNext())
                            {
                            message = (ErrmessagesRoViewRowImpl) rows.next();
                            rErrorMessages[iRows][0] = message.getErrnumber();
                            rErrorMessages[iRows][1] = message.getErrmessage();
                            iRows++;
                            }
                            }
                            
                            messages.setWhereClause(null);
                            messages.setWhereClauseParams(null);
                            mErrorMessages = rErrorMessages;
                            Configuration.releaseRootApplicationModule(exceptionsDbModule, true);
                            }
                            return rErrorMessages;
                            }
                            Somehow i got lots of errors directly after deploying the aaplication like

                            Caused by: java.lang.StackOverflowError
                                 at java.security.AccessController.doPrivileged(Native Method)
                                 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                                 at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
                                 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
                                 at java.lang.ClassLoader.defineClass1(Native Method)
                                 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:630)
                                 at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
                                 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
                                 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
                                 at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
                                 at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
                                 at java.security.AccessController.doPrivileged(Native Method)
                                 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
                                 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
                            .
                            .
                            .

                            at the part where the application module is created via tho configuration class. Any idea what this could be?
                            • 11. Re: Reading message texts from database?
                              915091
                              Sorry for all those posts, but i've investigated further.

                              When i deploy the app with the messages from the databases like Timo has explained, i got lot of this messages:
                              <PropertyManager> <loadProperties> [6741] -----------------------------------------------------------
                              <ApplicationModuleHomeImpl> <createSession> [6742] Connected to Oracle JBO Server - Version: 11.1.1.61.92
                              <ADFLogger> <begin> Create Application Module
                              <ResourcePool> <createResource> [6743] Creating a new pool resource
                              <JboInitialContextFactory> <getInitialContext> [6744] BC4JDeployPlatform: LOCAL
                              <PropertyManager> <loadProperties> [6745] Propertymanager: skipping reload of file and system based properties
                              <PropertyManager> <loadProperties> [6746] {{ begin Loading BC4J properties 
                              <PropertyManager> <loadProperties> [6747] -----------------------------------------------------------
                              <PropertyManager> <loadProperty> [6748] BC4J Property jbo.default.language='de' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6749] BC4J Property jbo.default.country='DE' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6750] Skipping empty Property jbo.default.locale.variant from System Default
                              <PropertyManager> <loadProperty> [6751] BC4J Property DeployPlatform='LOCAL' -->(SessionImpl) from Client Environment
                              <PropertyManager> <loadProperty> [6752] Skipping empty Property ConnectionMode from System Default
                              <PropertyManager> <loadProperty> [6753] Skipping empty Property HostName from System Default
                              <PropertyManager> <loadProperty> [6754] Skipping empty Property ConnectionPort from System Default
                              <PropertyManager> <loadProperty> [6755] BC4J Property jbo.locking.mode='optimistic' -->(MetaObjectManager) from Client Environment
                              <PropertyManager> <loadProperty> [6756] BC4J Property jbo.txn.disconnect_level='0' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6757] Skipping empty Property ApplicationPath from System Default
                              <PropertyManager> <loadProperty> [6758] BC4J Property AppModuleJndiName='model.ErrorMessagesApplicationModule' -->(SessionImpl) from Client Environment
                              <PropertyManager> <loadProperty> [6759] Skipping empty Property java.naming.security.principal from System Default
                              <PropertyManager> <loadProperty> [6760] Skipping empty Property java.naming.security.credentials from System Default
                              <PropertyManager> <loadProperty> [6761] Skipping empty Property jbo.user.principal from System Default
                              <PropertyManager> <loadProperty> [6762] BC4J Property jbo.simulate.remote='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6763] BC4J Property jbo.security.context='oracle.security.jazn' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6764] Skipping empty Property jbo.object.marshaller from System Default
                              <PropertyManager> <loadProperty> [6765] BC4J Property jbo.use.pers.coll='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6766] BC4J Property jbo.pers.max.rows.per.node='70' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6767] BC4J Property jbo.pers.max.active.nodes='30' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6768] BC4J Property jbo.validation.threshold='10' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6769] BC4J Property jbo.sparse.array.threshold='20' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6770] Skipping empty Property jbo.pcoll.mgr from System Default
                              <PropertyManager> <loadProperty> [6771] BC4J Property jbo.txn_table_name='PS_TXN' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6772] BC4J Property jbo.txn_seq_name='PS_TXN_seq' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6773] BC4J Property jbo.txn_seq_inc='50' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6774] BC4J Property jbo.control_table_name='PCOLL_CONTROL' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6775] BC4J Property jbo.stringmanager.factory.class='use_default' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6776] BC4J Property jbo.domain.date.suppress_zero_time='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6777] BC4J Property jbo.domain.bind_sql_date='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6778] BC4J Property jbo.domain.string.as.bytes.for.raw='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6779] BC4J Property jbo.fetch.mode='AS.NEEDED' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6780] BC4J Property jbo.323.compatible='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6781] BC4J Property jbo.903.compatible='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6782] Skipping empty Property JBODynamicObjectsPackage from System Default
                              <PropertyManager> <loadProperty> [6783] BC4J Property MetaObjectContextFactory='oracle.jbo.mom.xml.DefaultMomContextFactory' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6784] BC4J Property jbo.load.components.lazily='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6785] BC4J Property MetaObjectContext='oracle.jbo.mom.xml.XMLContextImpl' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6786] BC4J Property java.naming.factory.initial='oracle.jbo.common.JboInitialContextFactory' -->(SessionImpl) from Client Environment
                              <PropertyManager> <loadProperty> [6787] BC4J Property IsLazyLoadingTrue='true' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
                              <PropertyManager> <loadProperty> [6788] BC4J Property oracle.jbo.usemds='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6789] BC4J Property oracle.adfm.usemds='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6790] BC4J Property ActivateSharedDataHandle='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6791] Skipping empty Property HandleName from System Default
                              <PropertyManager> <loadProperty> [6792] Skipping empty Property Factory-Substitution-List from System Default
                              <PropertyManager> <loadProperty> [6793] BC4J Property jbo.project='model.Model' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6794] BC4J Property jbo.max.cursors='50' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6795] WARNING: Property jbo.dofailoverset to null
                              <PropertyManager> <loadProperty> [6796] Skipping empty Property jbo.dofailover from null
                              <PropertyManager> <loadProperty> [6797] WARNING: Property jbo.envinfoproviderset to null
                              <PropertyManager> <loadProperty> [6798] Skipping empty Property jbo.envinfoprovider from null
                              <PropertyManager> <loadProperty> [6799] Skipping empty Property jbo.rowid_am_conn_name from System Default
                              <PropertyManager> <loadProperty> [6800] Skipping empty Property jbo.rowid_am_datasource_name from System Default
                              <PropertyManager> <loadProperty> [6801] WARNING: Property jbo.ampool.writecookietoclientset to null
                              <PropertyManager> <loadProperty> [6802] Skipping empty Property jbo.ampool.writecookietoclient from null
                              <PropertyManager> <loadProperty> [6803] WARNING: Property jbo.doconnectionpoolingset to null
                              <PropertyManager> <loadProperty> [6804] Skipping empty Property jbo.doconnectionpooling from null
                              <PropertyManager> <loadProperty> [6805] BC4J Property jbo.recyclethreshold='10' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6806] WARNING: Property jbo.ampool.dynamicjdbccredentialsset to null
                              <PropertyManager> <loadProperty> [6807] Skipping empty Property jbo.ampool.dynamicjdbccredentials from null
                              <PropertyManager> <loadProperty> [6808] BC4J Property jbo.ampool.resetnontransactionalstate='true' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6809] BC4J Property jbo.ampool.sessioncookiefactoryclass='oracle.jbo.common.ampool.DefaultSessionCookieFactory' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6810] BC4J Property jbo.ampool.connectionstrategyclass='oracle.jbo.common.ampool.DefaultConnectionStrategy' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6811] BC4J Property jbo.ampool.maxpoolsize='4096' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6812] BC4J Property jbo.ampool.initpoolsize='0' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6813] WARNING: Property jbo.ampool.monitorsleepintervalset to null
                              <PropertyManager> <loadProperty> [6814] Skipping empty Property jbo.ampool.monitorsleepinterval from null
                              <PropertyManager> <loadProperty> [6815] WARNING: Property jbo.ampool.minavailablesizeset to null
                              <PropertyManager> <loadProperty> [6816] Skipping empty Property jbo.ampool.minavailablesize from null
                              <PropertyManager> <loadProperty> [6817] WARNING: Property jbo.ampool.maxavailablesizeset to null
                              <PropertyManager> <loadProperty> [6818] Skipping empty Property jbo.ampool.maxavailablesize from null
                              <PropertyManager> <loadProperty> [6819] WARNING: Property jbo.ampool.maxinactiveageset to null
                              <PropertyManager> <loadProperty> [6820] Skipping empty Property jbo.ampool.maxinactiveage from null
                              <PropertyManager> <loadProperty> [6821] WARNING: Property jbo.ampool.timetoliveset to null
                              <PropertyManager> <loadProperty> [6822] Skipping empty Property jbo.ampool.timetolive from null
                              <PropertyManager> <loadProperty> [6823] WARNING: Property jbo.ampool.doampoolingset to null
                              <PropertyManager> <loadProperty> [6824] Skipping empty Property jbo.ampool.doampooling from null
                              <PropertyManager> <loadProperty> [6825] BC4J Property jbo.ampool.issupportspassivation='true' -->(Configuration) from Client Environment
                              <PropertyManager> <loadProperty> [6826] BC4J Property jbo.ampool.isuseexclusive='true' -->(SessionImpl) from Client Environment
                              <PropertyManager> <loadProperty> [6827] BC4J Property jbo.passivationstore='null' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6828] BC4J Property jbo.saveforlater='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6829] BC4J Property jbo.snapshotstore.undo='persistent' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6830] BC4J Property jbo.maxpassivationstacksize='10' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6831] BC4J Property jbo.txn.handleafterpostexc='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6832] BC4J Property jbo.connectfailover='true' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6833] BC4J Property jbo.datasource_naming_factory='oracle.jbo.server.DataSourceContextFactory' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6834] WARNING: Property jbo.maxpoolcookieageset to null
                              <PropertyManager> <loadProperty> [6835] Skipping empty Property jbo.maxpoolcookieage from null
                              <PropertyManager> <loadProperty> [6836] WARNING: Property PoolClassNameset to null
                              <PropertyManager> <loadProperty> [6837] Skipping empty Property PoolClassName from null
                              <PropertyManager> <loadProperty> [6838] BC4J Property jbo.maxpoolsize='4096' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6839] BC4J Property jbo.initpoolsize='0' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6840] BC4J Property jbo.poolrequesttimeout='30000' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6841] BC4J Property jbo.poolmonitorsleepinterval='600000' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6842] BC4J Property jbo.poolminavailablesize='5' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6843] BC4J Property jbo.poolmaxavailablesize='25' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6844] BC4J Property jbo.poolmaxinactiveage='600000' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6845] BC4J Property jbo.pooltimetolive='-1' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6846] BC4J Property jbo.qcpool.monitorsleepinterval='1800000' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6847] BC4J Property jbo.qcpool.maxinactiveage='900000' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6848] BC4J Property RELEASE_MODE='Stateful' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6849] BC4J Property jbo.assoc.consistent='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6850] BC4J Property jbo.viewlink.consistent='DEFAULT' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6851] BC4J Property jbo.finder.range.size='DEFAULT' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6852] BC4J Property jbo.passivation.TrackInsert='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6853] Skipping empty Property jbo.ViewCriteriaAdapter from System Default
                              <PropertyManager> <loadProperty> [6854] BC4J Property jbo.SQLBuilder='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
                              <PropertyManager> <loadProperty> [6855] BC4J Property jbo.ConnectionPoolManager='oracle.jbo.server.ConnectionPoolManagerImpl' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6856] BC4J Property jbo.TypeMapEntries='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
                              <PropertyManager> <loadProperty> [6857] Skipping empty Property jbo.sql92.JdbcDriverClass from System Default
                              <PropertyManager> <loadProperty> [6858] BC4J Property jbo.sql92.LockTrailer='FOR UPDATE' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6859] BC4J Property jbo.jdbc.trace='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6860] BC4J Property jbo.abstract.base.check='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6861] BC4J Property jbo.assoc.where.early.set='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6862] BC4J Property jbo.use.findbykey.for.assoc='true' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6863] BC4J Property jbo.sql92.DbTimeQuery='select sysdate from dual' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6864] BC4J Property oracle.jbo.defineColumnLength='skipDefines' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6865] BC4J Property jbo.jdbc_bytes_conversion='jdbc' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6866] Skipping empty Property jbo.tmpdir from System Default
                              <PropertyManager> <loadProperty> [6867] Skipping empty Property jbo.server.internal_connection from System Default
                              <PropertyManager> <loadProperty> [6868] BC4J Property SessionClass='oracle.jbo.server.SessionImpl' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6869] Skipping empty Property TransactionFactory from System Default
                              <PropertyManager> <loadProperty> [6870] Skipping empty Property jbo.def.mgr.listener from System Default
                              <PropertyManager> <loadProperty> [6871] Skipping empty Property jbo.use.global.sub.map from System Default
                              <PropertyManager> <loadProperty> [6872] BC4J Property jbo.debugoutput='console' -->(Diagnostic) from System Property
                              <PropertyManager> <loadProperty> [6873] BC4J Property jbo.debug.prefix='DBG: ' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6874] BC4J Property jbo.logging.show.timing='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6875] BC4J Property jbo.logging.show.function='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6876] BC4J Property jbo.logging.show.level='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6877] BC4J Property jbo.logging.show.linecount='true' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6878] BC4J Property jbo.logging.trace.threshold='6' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
                              <PropertyManager> <loadProperty> [6879] BC4J Property jbo.jdbc.driver.verbose='false' -->(Diagnostic) from System Default
                              <PropertyManager> <loadProperty> [6880] Skipping empty Property oracle.home from System Default
                              [Application termination requested.  Undeploying application CustomMessageTest.]
                              <PropertyManager> <loadProperty> [6881] Skipping empty Property oc4j.name from System Default
                              [09:41:52 AM] ----  Deployment started.  ----
                              [09:41:52 AM] Target platform is  (Weblogic 10.3).
                              [09:41:52 AM] Undeploying Application...
                              <PropertyManager> <loadProperty> [6882] Skipping empty Property jbo.shared.txn from System Default
                              <PropertyManager> <loadProperty> [6883] BC4J Property oracle.adfm.useSharedTransactionForFrame='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6884] BC4J Property jbo.ejb.txntimeout='1830' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6885] BC4J Property jbo.ejb.txntype='global' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6886] BC4J Property jbo.ejb.txn.disconnect_on_completion='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6887] BC4J Property jbo.ejb.useampool='false' -->(SessionImpl) from Client Environment
                              <PropertyManager> <loadProperty> [6888] Skipping empty Property oracle.jbo.schema from System Default
                              <PropertyManager> <loadProperty> [6889] BC4J Property jbo.xml.validation='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6890] BC4J Property ord.RetrievePath='ordDeliverMedia' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6891] BC4J Property ord.HttpMaxMemory='102400' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6892] Skipping empty Property ord.HttpTempDir from System Default
                              <PropertyManager> <loadProperty> [6893] BC4J Property ord.wmp.classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6894] BC4J Property ord.qp.classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6895] BC4J Property ord.rp.classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6896] BC4J Property ord.wmp.codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6897] BC4J Property ord.qp.codebase='http://www.apple.com/qtactivex/qtplugin.cab' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6898] Skipping empty Property ord.rp.codebase from System Default
                              <PropertyManager> <loadProperty> [6899] BC4J Property ord.wmp.plugins.page='http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6900] BC4J Property ord.qp.plugins.page='http://www.apple.com/quicktime/download/' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6901] BC4J Property ord.rp.plugins.page='http://www.real.com/player/' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6902] BC4J Property jbo.security.enforce='None' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6903] BC4J Property jbo.security.loginmodule='oracle.security.jazn.oc4j.JAZNUserManager' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6904] Skipping empty Property jbo.security.config from System Default
                              <PropertyManager> <loadProperty> [6905] BC4J Property jbo.server.useNullDbTransaction='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6906] BC4J Property jbo.domain.reopenblobstream='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6907] BC4J Property jbo.server.retainAssocAccessor='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6908] BC4J Property jbo.groovy.debug='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6909] BC4J Property jbo.busevent.suspendpublication='false' -->(SessionImpl) from System Default
                              <PropertyManager> <loadProperty> [6910] BC4J Property oracle.adfm.DefaultEventPolicy='NONE' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperty> [6911] BC4J Property oracle.adfm.useRootFrameOnly='false' -->(MetaObjectManager) from System Default
                              <PropertyManager> <loadProperties> [6912] Copying unknown Client property (user='USER') to session
                              <PropertyManager> <loadProperties> [6913] Copying unknown Client property (java.naming.factory.url.pkgs='weblogic.jndi.factories:weblogic.corba.j2ee.naming.url:weblogic.jndi.factories:weblogic.corba.j2ee.naming.url') to session
                              <PropertyManager> <loadProperties> [6914] Copying unknown Client property (jbo.applicationmoduleclassname='ErrorMessagesApplicationModule') to session
                              <PropertyManager> <loadProperties> [6915] Copying unknown Client property (JDBCName='MyConnection') to session
                              <PropertyManager> <loadProperties> [6916] Copying unknown Client property (name='ErrorMessagesApplicationModuleLocal') to session
                              <PropertyManager> <loadProperties> [6917] Copying unknown Client property (ApplicationName='ErrorMessagesApplicationModule') to session
                              <PropertyManager> <loadProperties> [6918] Copying unknown Client property (password='*****') to session
                              <PropertyManager> <loadProperties> [6919] Copying unknown Client property (DBconnection='jdbc:oracle:thin:@//host:1521/database') to session
                              <PropertyManager> <loadProperties> [6920] }} finished loading BC4J properties 
                              This block is repeated several times, after that the following StackOverflowExcpetions appears:
                              [19384] oracle.jbo.JboException: JBO-29115 Unable to construct the error message due to error java.lang.StackOverflowError.
                              Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-29000.
                              Error message parameters are {0=java.lang.StackOverflowError, 1=null}
                                   at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:599)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2473)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2347)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3246)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
                                   at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
                                   at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1609)
                                   at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1514)
                                   at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1485)
                                   at model.error.MyDbExceptionHelper.getErrorMessages(MyDbExceptionHelper.java:68)
                                   at model.CustomMessageBundle.getContents(CustomMessageBundle.java:18)
                                   at java.util.ListResourceBundle.loadLookup(ListResourceBundle.java:171)
                                   at java.util.ListResourceBundle.getKeys(ListResourceBundle.java:125)
                                   at oracle.javatools.resourcebundle.impl.ListResourceBundleWrapper.parseData(ListResourceBundleWrapper.java:221)
                                   at oracle.javatools.resourcebundle.impl.ListResourceBundleWrapper.getKeyValueMap(ListResourceBundleWrapper.java:40)
                                   at oracle.javatools.resourcebundle.ResourceBundleWrapperRT.getChainedKeyValueMap(ResourceBundleWrapperRT.java:252)
                                   at oracle.javatools.resourcebundle.BundleFactory.getMap(BundleFactory.java:128)
                                   at oracle.javatools.resourcebundle.BundleFactory.getMap(BundleFactory.java:94)
                                   at oracle.javatools.resourcebundle.BundleFactory.getBundle(BundleFactory.java:243)
                                   at oracle.javatools.resourcebundle.BundleFactory.getBundle(BundleFactory.java:204)
                                   at oracle.jbo.common.StringManager.getStringFromBundle(StringManager.java:580)
                                   at oracle.jbo.common.StringManager.getStringInternal(StringManager.java:521)
                                   at oracle.jbo.common.StringManager.getString(StringManager.java:475)
                                   at oracle.jbo.common.StringManager.getLocalizedString(StringManager.java:305)
                                   at oracle.jbo.common.StringManager.getLocalizedString(StringManager.java:259)
                                   at oracle.jbo.common.StringManager.getString(StringManager.java:199)
                                   at oracle.jbo.common.ObjectTypeHelper.getInstTypeNameFromId(ObjectTypeHelper.java:221)
                                   at oracle.jbo.common.ObjectTypeHelper.getTypeNameFromId(ObjectTypeHelper.java:66)
                                   at oracle.jbo.JboWarning.getTypeNameFromId(JboWarning.java:515)
                                   at oracle.jbo.NoDefException.<init>(NoDefException.java:106)
                                   at oracle.jbo.NoDefException.<init>(NoDefException.java:68)
                                   at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:618)
                                   at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:523)
                                   at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:505)
                                   at oracle.jbo.server.MetaObjectManager.findMetaObject(MetaObjectManager.java:780)
                                   at oracle.jbo.server.ApplicationModuleDefImpl.findDefObject(ApplicationModuleDefImpl.java:282)
                                   at oracle.jbo.server.ApplicationModuleImpl.createRootApplicationModule(ApplicationModuleImpl.java:470)
                                   at oracle.jbo.server.ApplicationModuleHomeImpl.create(ApplicationModuleHomeImpl.java:87)
                                   at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:158)
                                   at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:73)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2913)
                                   at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:580)
                                   at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:313)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2343)
                                   at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3246)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
                                   at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
                                   at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
                                   at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1609)
                                   at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1514)
                                   at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1485)
                                   at model.error.MyDbExceptionHelper.getErrorMessages(MyDbExceptionHelper.java:73)
                                   at model.CustomMessageBundle.getContents(CustomMessageBundle.java:18)
                              .
                              .
                              .
                              This isn't the whole stacktrace it's over 3000 lines long. It seems that some parts of the trace repeat itself, but i'm not quite sure.
                              • 12. Re: Reading message texts from database?
                                Timo Hahn
                                Alex,
                                have you created the application module (my name MyExceptionHandlerImpl) and created the EO/VO to read the data from the DB?
                                The code is from one of my projects and is reused in other different projects. That is the reason to use createRootApplicationModule. If you like you can read the messages from your own application module if you can read the tables from there.

                                Timo
                                • 13. Re: Reading message texts from database?
                                  915091
                                  Timo Hahn wrote:
                                  Alex,
                                  have you created the application module (my name MyExceptionHandlerImpl) and created the EO/VO to read the data from the DB?
                                  The code is from one of my projects and is reused in other different projects. That is the reason to use createRootApplicationModule. If you like you can read the messages from your own application module if you can read the tables from there.

                                  Timo
                                  Yes i've created the application module inclusive the implementation and EO/VO.

                                  The error happens in the getMessages method at Configuration.createRootApplicationModule(). The strange thing is, why does this already happen at deployment? Shouldn't it only be called when a validation error is fired the first time?
                                  • 14. Re: Reading message texts from database?
                                    915091
                                    Hey Timo,

                                    could you explain how to throw the exception, or how to bind the exception to the validation? (In your example the MyAttrValException)
                                    I'm struggeling to understand where to tell the framework that this is the exception i want to use for validating this attribute.

                                    Thanks in advance.
                                    1 2 Previous Next