This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Mac OS and the fly likes MIssingResource Exception on OS X Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "MIssingResource Exception on OS X" Watch "MIssingResource Exception on OS X" New topic
Author

MIssingResource Exception on OS X

Tilman Bender
Greenhorn

Joined: Mar 16, 2008
Posts: 11
Hi everybody,

I have a quite strange Problem:
I built an app that makes use of PropertyResourceBundle to load some configuration data.



It works well for me on my development machine (Win XP), my Macbook Pro (Mac OS X Leopard)and Customer A's Macbook Pro (Leopard). The fun part is:

On customer B's Macbook Pro (Leopard) it fails with a missing resource exception:



Customer B has same Java-Version and locale as me and customer A.

Please help. I've been for hours now.

[ June 19, 2008: Message edited by: Tilman Bender ]
[edit]Disable smilies. CR[/edit]
[ June 19, 2008: Message edited by: Tilman Bender ]
[ June 19, 2008: Message edited by: Campbell Ritchie ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
You have a very odd package name, com.myapp...

Please confirm that "B"'s machine has the com.myapp package in the correct location.
Tilman Bender
Greenhorn

Joined: Mar 16, 2008
Posts: 11
Sorry, I made an error while preparing the post.
Somecompany is just a placeholder for project-name which I do not want to post on a public forum.

The CSVResrouce is in the same Jar as the code that loads it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Don't know, I am afraid.
Maybe more details would help? But don't know what myself.

Anybody else?
Tilman Bender
Greenhorn

Joined: Mar 16, 2008
Posts: 11
I'll write an SSCE and test it on the customer's machine.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Sounds a good idea; good luck and tell us whether it was successful.
Tilman Bender
Greenhorn

Joined: Mar 16, 2008
Posts: 11
Haven't done the SSCE yet.
But one of my colleagues got to talk to the customer again.
Apparently it has something to do with the path of jar.

When he moves the application jar to some folder higher in the directory structure (e.g. on his Desktop, which is /Users/christpoh/Desktop/) the application starts and loads the resources without complaining.

I think I'll have to delve into the topic of classloading once more
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Originally posted by Tilman Bender:

Apparently it has something to do with the path of jar.
I think I'll have to delve into the topic of classloading once more
Go carefully through wherever it is you are loading the .jar and check all the CLASSPATH variables to make sure they match.
Tilman Bender
Greenhorn

Joined: Mar 16, 2008
Posts: 11
Go carefully through wherever it is you are loading the .jar and check all the CLASSPATH variables to make sure they match.


Could you elabrate on that?

I have my complete application in one jar. The resources are located in

com/<project/>/pcclient/resource/ (where <project/> is the product-name.

My app comes in a zip that contains:
-lib/ folder containing log4j-1.2.15.jar
-PCClient.jar: the jar for my application
-startup.bat: a startup script for windows

-startup.sh: a startup script for unix/mac


Not sure how all this is related to the resource loading
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
In whihc case it wouldn't be a classpath problem. Don't know. Sorry. I shall try moving you to the Mac forum, see whether anybody can help there.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I suppose there aren't any whitespace characters in Customer B's path?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
GeeCON Prague 2014
 
subject: MIssingResource Exception on OS X