Skip to main content
1-Visitor
January 13, 2011
Question

PSE and ResourceBundle issue

  • January 13, 2011
  • 11 replies
  • 1767 views

I originally wanted to limit the Unit's dropdown on the PSE, based on certain conditions, but after opening a call with PTC realized this is not really possible. So with some info from another ptc/user user I was able to create a custom action which will basically check to make sure that the unit selected is valid for the part.

The problem I'm running into is that I wrote a helper class, which reads in a custom .prop file, but the PSE is constantly throwing the following exception:

Caused by: java.util.MissingResourceException: Can't find bundle for base name com.blah.blah.um_families, locale en_US

The exact same code works without issue where it's being called from the edit bom jsp, and our bom loader. I know it has something to do with the PSE being an applet, but I just cannot get it to work.

I figured I would try adding the values from that um_families file into the wt.part.QuantityUnitRB file, but even that throws the same exception.

Anyone have any ideas/suggestions?

11 replies

12-Amethyst
January 13, 2011
Sounds like you possibly didn't make the classes in question available
directly in codebase but rather only in some jar in WEB-INF/lib or lib.

crosato1-VisitorAuthor
1-Visitor
January 14, 2011
All of the classes, and the um_families.properties file, are directly in codebase and haven't been put into any jar. They've been put right into codebase/com/blah/blah/.

In Reply to Jess Holle:
Sounds like you possibly didn't make the classes in question available
directly in codebase but rather only in some jar in WEB-INF/lib or lib.

10-Marble
January 14, 2011
Chris,

Since PSE is a Java app, running client side, it doesn't
load classes from the codebase on the server in the same
way as, for example, the edit bom jsp does. I think rebuilding
your jar files (MakeJar) might help...

Ron
12-Amethyst
January 14, 2011
If the class file in question isn't in any of the client jars, then PSE
(even in Java Web Start mode) should fallback to loading from codebase
(as we have special code to enable this even in Java Web Start mode).

If the class file in question *is* in one of the client jars, then that
copy will automatically take precedence over anything in codebase.

Ensuring that all resources to be loaded by Java applets and Java Web
Start applications are in jars referenced by the applet/application
rather than just in codebase will certainly provide better performance,
though.

On 1/14/2011 7:52 AM, Welch, Ronald P (US SSA) wrote:
> Chris,
>
> Since PSE is a Java app, running client side, it doesn't
> load classes from the codebase on the server in the same
> way as, for example, the edit bom jsp does. I think rebuilding
> your jar files (MakeJar) might help...
>
> Ron
10-Marble
January 14, 2011
Hi Jess,

I agree that things *should* work that way, but I have, in the
past, come across situations where it does not. I don't remember
the specifics, but I believe the problem I saw was related to the
combination of ssl, rmi and a draconian firewall configuration....

Ron
crosato1-VisitorAuthor
1-Visitor
January 14, 2011
I actually just tried rebuilding the jars, and adding my 2 classes and the prop file to the wtAppletCust.jar, but it is still throwing the same exception on my resource bundle. There shouldn't be any issue on this being a non-ptc filepath right? The path I used, had previously been created by others and, is com/lmco/PDM/ProductStructure.
12-Amethyst
January 14, 2011
At this point I guess I'm left wondering about the code you're using to
access this bundle...

crosato1-VisitorAuthor
1-Visitor
January 14, 2011

This is the piece from the helper that grabs the bundle...

public class UMHelper {

private static Hashtable UM_FAMILIES;
private static PropertyResourceBundle PROPS;
private static final String RESOURCE_BUNDLE = "com.lmco.PDM.ProductStructure.um_families";


/**
* Class initialization
*/
static {

PROPS = (PropertyResourceBundle)ResourceBundle.getBundle( RESOURCE_BUNDLE );

UM_FAMILIES = new Hashtable();

//get the family names
String unparsedfamilyNames = PROPS.getString( "FAMILY_NAMES" );

The exception is, obviously, occuring at the PROPS = (PropertyResource... line.

In Reply to Jess Holle:

At this point I guess I'm left wondering about the code you're using to
access this bundle...

12-Amethyst
January 14, 2011
Does this work for other resource bundles without _ in their base name?

I'm wondering if there's not something special about _ in base resource
names (whereas obvious _ is used in the locale name suffixes).

crosato1-VisitorAuthor
1-Visitor
January 14, 2011
Nope. I just tried to get wt.part.QuantityUnitRB instead of my .prop, rebuilt the jars and it threw the exact same exception - complaining about not finding QuantityUnitRB though.

In Reply to Jess Holle:
Does this work for other resource bundles without _ in their base name?

I'm wondering if there's not something special about _ in base resource
names (whereas obvious _ is used in the locale name suffixes).