Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-23 Thread Mike Peremsky
Well, I guess I really am starting to learn a bit more about Tomcat. It is possible to remove the singleton loader and put it back in the application code. I was just trying to do something slick with a single loader. But your answer and the previous one have shown me the error of my way. now I

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Filip Hanik - Dev Lists
that work around is probably not what you want. You've just disabled the ability to reload your app correctly. Try using another classloader, maybe the Thread.currentThread().getContextClassLoader() where are you storing the class that is trying to load the singleton? it should be in your

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Mike Peremsky
The class that is trying to load the singleton (SingletonLoader) is in a common JAR located at /common/lib/mvpservlet.jar The Singletons that I am trying to load can be from ANY app and are in the WEB-INF/classes folder of whichever application is trying to use the SingletonLoader.

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Filip Hanik - Dev Lists
well there you go, that wont work, http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html take a look at the hierarchy of the tomcat class loaders, and a class can only load up in the tree, not down. so mvpservlet is unable to load your web-inf/classes directory from your

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread David Delbecq
THAT is really *not* recommended. Short answer, you go the wrong way in your design. And adding your web-inf/classes to your common classloader will completly break the tomcat behaviour (presence of same classes at 2 levels, some instances are done at one level, some other at another level, and

Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-21 Thread Mike Peremsky
I think this may be a class loader issue, but am not sure as I have never really worked with them before. I am putting together a JAR file that contains a set of classes to be used throughout a suite of applications. I have a class called SingletonLoader that was working when it was within the

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-21 Thread Filip Hanik - Dev Lists
did you try Class singletongClassObj = this.getClass().getClassLoader().loadName(singletonClassName); Filip Mike Peremsky wrote: I think this may be a class loader issue, but am not sure as I have never really worked with them before. I am putting together a JAR file that contains a set of

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-21 Thread Mike Peremsky
I tried the modification you suggested (with the correct method name on the end) but still with the same results. I also printed out a debug message just to see what class loader was being used (not that I know what to do with it :-P ) log.debug(this class loader: +

Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-21 Thread Mike Peremsky
I have resolved this issue, but am wondering if the way I did it is the correct way to resolve this issue. I modified the catalina.properties file entry common.loader by adding the path to the applications WEB-INF/classes directory, this seems to have resolved the issue with finding the