This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Call a Java Class on Server start-up Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » BEA/Weblogic
Reply Bookmark "Call a Java Class on Server start-up" Watch "Call a Java Class on Server start-up" New topic
Author

Call a Java Class on Server start-up

abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
Hi All,

I am new to WebLogic. I am using WebLogic 10.3. I want to call a JAVA class on server startup. This class and the dependent classes are all bundeled into a JAR. How do I do this..??

Thanks


The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35438
    
    9
Does the app include a web app part? If so, then that's what ServletContextListener classes are for.


Android appsImageJ pluginsJava web charts
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
No it is not a web-app nor is it connected with any servlet or JSP page so I guess ServletContextListener would not help me.

The class is a simple java class which acts like a scheduler and which should start with server start-up and it depends on few other class files. All of these class files are packaged in a jar file. Is there a way I can tell Weblogic to read that jar and call my class (it has a main method) at startup..??
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
WebLogic Server console has a place where you can enter the fully qualified Java class name. This class gets called at the time of server startup. All you have to ensure is that the class file or the jar (which contains the class) is present in the classpath.

Both Startup and Shutdown Classes are provided for doing life cycle maintenance activities.
Krishnaa Kumar
Greenhorn

Joined: May 05, 2011
Posts: 25
Hi.,

Implement your jar as a JavaAgent and set javaagent parameters in server start up file(bat or sh)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call a Java Class on Server start-up
 
Similar Threads
[VisualAge][Weblogic] problems using weblogic with VAJ last version (4.0)
How to call a jsp from java script
Java Bean Connectivity , EJB, JSP and .NET client dilemma
HttpsURLConnection timeout setting
Debugging Help