RE: [JBoss-user] Startup class
If you want arbitrary code (as opposed to a servlet) to run on startup then you should be using a servlet context listener. This is part of the Servlet 2.3 spec and will be portable to all compliant servlet containers. It works fine from Tomcat and should work from Jetty. Stuart Halloway DevelopMentor http://staff.develop.com/halloway -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of David Ward Sent: Thursday, August 15, 2002 1:16 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Startup class Yes, it still exists; I use it. @web:servlet name=Foobar load-on-startup=1 David -- Kim, Yong wrote: Then, how did you make that servlet executed when startup? Did you use load-on-start attribute from xdoclet? I don't even know if that attribute still works becuase when I went to xdoclet home page, that attribute doesn't exist any more... Mitchell -Original Message- From: Michael Klem [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:37 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Startup class What I did was to create a servlet class and in its init method I added code that runs upon startup. Is there any way I can do something like startup classes? I want something nice and simple ;-) There are some classes that I want them to be loaded into memory when JBoss restarts. Thanks. Mitchell --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Is the server library URL in the classpath?
Hi Ryan, Tests and output to answer your question below. Cheers! Stuart Halloway DevelopMentor http://staff.develop.com/halloway PS. Why do you need to be at the root of the classpath? That seems like an odd (dangerous) requirement. public void testIterateClassLoaders() { ClassLoader cl = getClass().getClassLoader(); while (cl != null) { listLoaderURLS(cl); cl = cl.getParent(); } } private void listLoaderURLS(ClassLoader cl) { System.out.println(Loader + cl); if (cl instanceof URLClassLoader) { URLClassLoader loader = (URLClassLoader) cl; URL[] urls = loader.getURLs(); for (int n=0; nurls.length; n++) { System.out.println(\t + urls[n]); } } } Loader org.jboss.mx.loading.UnifiedClassLoader@40832 5{ url=file:/E:/java/jboss/jboss-3.0.0/server/default/tmp/deploy/server/default / deploy/dm-asset-mgr.jar/67.dm-asset-mgr.jar } Loader java.net.URLClassLoader@fc4bec file:/E:/java/jboss/jboss-3.0.0/lib/crimson.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-jmx.jar file:/E:/java/jboss/jboss-3.0.0/lib/concurrent.jar file:/E:/java/jboss/jboss-3.0.0/lib/jaxp.jar file:/E:/java/jboss/jboss-3.0.0/lib/log4j-boot.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-common.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-system.jar Loader sun.misc.Launcher$AppClassLoader@bac748 file:/E:/java/jboss/jboss-3.0.0/bin/ file:/E:/java/jdk1.4.0/lib/tools.jar file:/E:/java/jboss/jboss-3.0.0/bin/run.jar Loader sun.misc.Launcher$ExtClassLoader@7172ea file:/E:/java/jdk1.4.0/jre/lib/ext/dnsns.jar file:/E:/java/jdk1.4.0/jre/lib/ext/ldapsec.jar file:/E:/java/jdk1.4.0/jre/lib/ext/localedata.jar file:/E:/java/jdk1.4.0/jre/lib/ext/sunjce_provider.jar I need some files to bee in the *root* of the classpath. I'd prefer to deploy these files in server/default/conf or server/defaul/lib. Are either of these paths added to the classpath? -ryan --- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Is the server library URL in the classpath?
Hi Ryan, OJB requires it. I know, yuck. This is being solved but until then I want my stuff to work. If I'm understanding your test properly, the only directory that is in the root of the classpath is jboss/bin? This is true IF the JBOSS_CLASSPATH environment variable is not set. If you do set JBOSS_CLASSPATH then you can add any directories you want. You would probably be safer to put OJB somewhere else and specifically set JBOSS_CLASSPATH. Otherwise somebody else might set JBOSS_CLASSPATH not knowing they are messing you up. Stuart Halloway DevelopMentor http://staff.develop.com/halloway On Wed, 2002-08-14 at 15:37, Stuart Halloway wrote: Hi Ryan, Tests and output to answer your question below. Cheers! Stuart Halloway DevelopMentor http://staff.develop.com/halloway PS. Why do you need to be at the root of the classpath? That seems like an odd (dangerous) requirement. public void testIterateClassLoaders() { ClassLoader cl = getClass().getClassLoader(); while (cl != null) { listLoaderURLS(cl); cl = cl.getParent(); } } private void listLoaderURLS(ClassLoader cl) { System.out.println(Loader + cl); if (cl instanceof URLClassLoader) { URLClassLoader loader = (URLClassLoader) cl; URL[] urls = loader.getURLs(); for (int n=0; nurls.length; n++) { System.out.println(\t + urls[n]); } } } Loader org.jboss.mx.loading.UnifiedClassLoader@40832 5{ url=file:/E:/java/jboss/jboss-3.0.0/server/default/tmp/deploy/serv er/default / deploy/dm-asset-mgr.jar/67.dm-asset-mgr.jar } Loader java.net.URLClassLoader@fc4bec file:/E:/java/jboss/jboss-3.0.0/lib/crimson.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-jmx.jar file:/E:/java/jboss/jboss-3.0.0/lib/concurrent.jar file:/E:/java/jboss/jboss-3.0.0/lib/jaxp.jar file:/E:/java/jboss/jboss-3.0.0/lib/log4j-boot.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-common.jar file:/E:/java/jboss/jboss-3.0.0/lib/jboss-system.jar Loader sun.misc.Launcher$AppClassLoader@bac748 file:/E:/java/jboss/jboss-3.0.0/bin/ file:/E:/java/jdk1.4.0/lib/tools.jar file:/E:/java/jboss/jboss-3.0.0/bin/run.jar Loader sun.misc.Launcher$ExtClassLoader@7172ea file:/E:/java/jdk1.4.0/jre/lib/ext/dnsns.jar file:/E:/java/jdk1.4.0/jre/lib/ext/ldapsec.jar file:/E:/java/jdk1.4.0/jre/lib/ext/localedata.jar file:/E:/java/jdk1.4.0/jre/lib/ext/sunjce_provider.jar I need some files to bee in the *root* of the classpath. I'd prefer to deploy these files in server/default/conf or server/defaul/lib. Are either of these paths added to the classpath? -ryan --- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user