cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

PSE and ResourceBundle issue

crosato
1-Newbie

PSE and ResourceBundle issue

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 11
jessh
5-Regular Member
(To:crosato)

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.

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.

rwelch
6-Contributor
(To:crosato)

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
jessh
5-Regular Member
(To:crosato)

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
rwelch
6-Contributor
(To:crosato)

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

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.
jessh
5-Regular Member
(To:crosato)

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

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...

jessh
5-Regular Member
(To:crosato)

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).

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).

So I don't know if this makes any difference but I just noticed that rebuilding the jars isn't affecting the PSE for me.

The jars had been built with the RB name of um_families in my helper class, but I didn't rebuild them after I updated the name (umfamilies) in the class a bit after. When I ran the PSE it threw the missing bundle exception, but instead of saying it couldn't find um_families, it said umfamilies. I've been including these files in the wtAppletCust.jar, but now it seems like it should be a different one?

Top Tags