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

how to set the classpath  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Recently i have migrated from JBoss to Websphere5.1 and i am facing some problems in running my application that worked fine with the Jboss.
Problem is that i need to add something to the WebSphere's classpath and i was unable to do so .In Jboss i used do this by adding my application specific directory path to the JBOSS_CLASSPATH in the run.bat file and even in WEBLOGIC i was succeded to do so by adding the path to Welogic classpath in the startManagedWebLogic.bat.

Following will explain the problem clearly.

*I am placing some text files in some directory say APP_DIR.
and my application reads those files place in the directory.

*So to make available this directory to the application i used to add the
path of this directory say D:\APP_DIR to the app server's classpath.

*I was unable to do so in Websphere


Any help will be greatly appreciated.


Thanks in advance
Phani
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WAS: Admin Console --> Environment --> Manage WebSphere Variables --> New
WSAD: Window --> Preferences --> Java --> Classpath Variables --> New

Once you've created the variable, you can add it to your project (Right Click --> Properties --> Java Build Path --> Add Variable). Not sure if this will help you access your text files thouugh.
 
phanidharcool kaduluri
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by emm raha:
WAS: Admin Console --> Environment --> Manage WebSphere Variables --> New
WSAD: Window --> Preferences --> Java --> Classpath Variables --> New

Once you've created the variable, you can add it to your project (Right Click --> Properties --> Java Build Path --> Add Variable). Not sure if this will help you access your text files thouugh.



Hi
i have tried adding it thru the Admin Console in the same way

Admin Console --> Environment --> Manage WebSphere Variables --> New

also restarted the server after adding the variable,but it doesn't
work

This is how am accessing the text files in my code.

this.getClass().getClassLoader().getResourceAsStream ("abc.txt");

hope this will give u a clear idea of my problem.

Note:I am not using WSAD
[ February 21, 2005: Message edited by: phanidharcool kaduluri ]
 
emm raha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using this.getClass(), how are you using a classpath variable? As long as abc.txt is available wherever your class files are, WAS should load it. e.g. If you have {project}\bin\{package>}\*.class, and you also have {project}\bin\abc.txt, your code should work (it does in WSAD).
[ February 22, 2005: Message edited by: emm raha ]
 
phanidharcool kaduluri
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Finally i was able to get rid of my problem thru shared libraries.
Thanks alot.

-Phani
 
Run away! Run away! Here, take this tiny ad with you:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!