Hi,
In our webservice development procedure we create a single EAR file to provide hot deployment. There are 5 war and 1 jar files within this EAR file.
I need to specify one of the classes in the jar file as start-up class, but the server is not able to detect the class file (in the jar which in turn is in the EAR). It throws ClassNotFoundException.
Can anybody please tell me how can I have a class file in the EAR and can specify it as start-up class on WebLogic 8.1 ?
The basic requirement is to execute some code when the webservice server starts and before user hits first time.
Regards,
Vikas.
-
Using Startupclass in WebLogic 8.1 (4 messages)
- Posted by: Vikas Biyani
- Posted on: April 21 2005 04:48 EDT
Threaded Messages (4)
- Using Startupclass in WebLogic 8.1 by Sohail Sikora on April 21 2005 12:44 EDT
- Using Startupclass in WebLogic 8.1 by Roman Smatana on April 25 2005 12:49 EDT
- Using Startupclass in WebLogic 8.1 by rohit prasad on May 04 2005 00:08 EDT
- Using Startupclass in WebLogic 8.1 by rohit prasad on May 04 2005 11:13 EDT
- Using Startupclass in WebLogic 8.1 by rohit prasad on May 04 2005 00:08 EDT
-
Using Startupclass in WebLogic 8.1[ Go to top ]
- Posted by: Sohail Sikora
- Posted on: April 21 2005 12:44 EDT
- in response to Vikas Biyani
I am not sure you can do that.
The whole point of a startup class is to have code execute before your EAR is prepared for deployment. Having your startup class in the EAR defeats the above purpose.
To deploy a startup class, the jar file containing the class should be in the classpath as used in your startup script.
As far as the ClassNotfound.... goes, you should read the WebLogic Classloader documentation on how WLS loads classes for the server startup and application startup. -
Using Startupclass in WebLogic 8.1[ Go to top ]
- Posted by: Roman Smatana
- Posted on: April 25 2005 12:49 EDT
- in response to Vikas Biyani
I believe you have 2 ways how to make startup functionality :
1. via WAR, servlet ; set the <load-on-startup> = 1 tag for servlet to provide intial invocation while the WAR is deployed
2. using weblogic startup and shutdown mechanism for EAR,
In the weblogic-application.xml ; placed the following
<startup>
<startup-class>MyStartup</startup-class>
<startup-uri>MyArchive.jar</startup-uri>
</startup>
<shutdown>
<shutdown-class>MyShutdown</shutdown-class>
<shutdown-uri>MyArchive.jar</shutdown-uri>
</shutdown>
I used second approach, so everytime I re deployed the EAR application the shutdown class main method was executed and then startup class invoked.
Hope this helps
Roman -
Using Startupclass in WebLogic 8.1[ Go to top ]
- Posted by: rohit prasad
- Posted on: May 04 2005 00:08 EDT
- in response to Roman Smatana
good morning,
me had the same issue as above
and tried the
<startup>
<startup-class>MyStartup</startup-class>
<startup-uri>MyArchive.jar</startup-uri>
</startup>
approach for starting up a class on weblogic startup
however, the startup class uses some opensource third party utilities, like log4j and apache's quartz scheduler
these jars arent found by weblogic's startup procedure and the following exception occurs:
java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: org/quartz/impl/StdSchedulerFactory
how do i provide more jars into the startup class's path ?
any pointers on this will be very helpful
going, going, ... gone. -
Using Startupclass in WebLogic 8.1[ Go to top ]
- Posted by: rohit prasad
- Posted on: May 04 2005 23:13 EDT
- in response to rohit prasad
found the solution to this.
"manifest" file is the answer
using a manifest file, one can point to the necessary jars
for more information on manifest file in weblogic 8.1 :
http://e-docs.bea.com/wls/docs81/programming/classloading.html#1068864