• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hot to know whether weblogic is running or not

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
My code which would be running under oracle9ias or weblogic wants to know
whether it is running under weblogic or oracle at the particular moment.
The problem I am facing is to use weblogic specific classes when it runs
under weblogic while at other times it should be using normal java classes.
Thanks for any help
Anup
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anoop you can do it by setting a system property at the time of your app start up and read that property in your application to know whether it is running in weblogic or oracle or as simple java app.
You can also store in your config file.
I think if you can do it without using weblogic classes.
Let me know if you need help or please provide more details on what is your exact issue.
Regards,
Ashish
 
Anup Katariya
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ashish,
But look at the code now,

Above code compiles and runs perfectly in weblogic. But the same code wont
run in oracle because weblogic.jar is not in the classpath.
Now forget about my previous question about knowing whether weblogic is
running or not.
My problem is I might need to use reflection and I am not sure
how to use it. In above code I will be having "con" object which
at run time is the instance of weblogic.net.http.HttpsURLConnection.
While running under oracle it would be something different. We have an
arrangement where this code wont get executed in oracle but since weblogic
classes are present it wont get load also.
Any help?
Thanks,
Anup
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic