Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unchecked Exception

843810Mar 28 2010 — edited Mar 29 2010
How can I get all of the exceptions Thrown in a java Application?
I Was trying creating a general method called from all the try-catch statemets that can save my program Exceptions, but then I think about the unchecked exception.

Comments

Ruben Rodriguez

Hello,

I have never done this in the model, but you could try to do the same but in the DBResourceBundle.java class call AM method getResourceBundle like this:


getResourceBundle(String locale){

     String amDef = "your.fully.qualified.class.name.of.the.application.module";
     String config = "the_configuration_name_to_use";
     ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
     Map map = am.getResourceBundle(locale);
     Configuration.releaseApplicationModule(am, false);

          return map;

}

Then, in your entity.xml you should have this reference:

     <ResourceBundle>

         <JavaResourceBundle MsgBundleClass="path.to.DBResourceBundle"/>

      </ResourceBundle>

and in the attribute something like this:

     <Attribute

         Name="AttrName"

         ...>

         <Properties>

           <SchemaBasedProperties>

             <LABEL ResId="LABEL_KEY_IN_DB"/>

           </SchemaBasedProperties>

         </Properties>

      </Attribute>

regards,

Ruben

Ravi4-Oracle

Hi Ruben,

Thanks for the code. Will give it a try.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 26 2010
Added on Mar 28 2010
4 comments
230 views