• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Loading a file with classloader in WebSphere v5.1

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're having problems to load an XSL from and EJB using standard classloader method :
InputStream is = ClassLoader.getSystemResourceAsStream("org/xxx/myxsl.xsl");
Is there any special manner to do this in WebSphere v5.1 ?
Thanks in advance.
--
Martin
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the problem? Are you getting an exception? If so what? We can't help you if you don't give us any more information...
Kyle
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response.
Yes, of course, I can put the name of the exception, is very known.
NullPointerException. It's thrown because getSystemResource() can't find the xsl file. Also, you can be sure that the xsl file is within the .jar file. The code works without any problem outside of WebSphere Application Server.
Thanks
Martin
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using a class that is in the same package as the xsl file, e.g.
theClass.class.getResourseAsStream("a.xsl")
../Melogy
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to look at your classloader policy and make sure the app has access to the jar file where it is loaded. I would try changing your server application classloader policy through the admin console from module to application.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!