Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

MIssingResource Exception on OS X

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Marshal
Posts: 65407
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 65407
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, I am afraid.
Maybe more details would help? But don't know what myself.

Anybody else?
 
Tilman Bender
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll write an SSCE and test it on the customer's machine.
 
Campbell Ritchie
Marshal
Posts: 65407
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds a good idea; good luck and tell us whether it was successful.
 
Tilman Bender
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 65407
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Marshal
Posts: 65407
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose there aren't any whitespace characters in Customer B's path?
 
Something about .... going for a swim. With this tiny ad ...
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!