wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Hot to know whether weblogic is running or not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Hot to know whether weblogic is running or not" Watch "Hot to know whether weblogic is running or not" New topic
Author

Hot to know whether weblogic is running or not

Anup Katariya
Greenhorn

Joined: Oct 23, 2002
Posts: 29
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


SCJP
Ashish Pagare
Ranch Hand

Joined: Oct 14, 2003
Posts: 101
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

Joined: Oct 23, 2002
Posts: 29
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hot to know whether weblogic is running or not