• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Loading a file with classloader in WebSphere v5.1

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3901
10
Redhat Quarkus Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic