• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hot to know whether weblogic is running or not

 
Anup Katariya
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
 
Ashish Pagare
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic